diff options
Diffstat (limited to 'packages/freenas/www')
-rw-r--r-- | packages/freenas/www/disks_manage_init.php | 180 | ||||
-rw-r--r-- | packages/freenas/www/disks_mount.php | 23 |
2 files changed, 101 insertions, 102 deletions
diff --git a/packages/freenas/www/disks_manage_init.php b/packages/freenas/www/disks_manage_init.php index be7ec5f8..3e772de3 100644 --- a/packages/freenas/www/disks_manage_init.php +++ b/packages/freenas/www/disks_manage_init.php @@ -174,100 +174,100 @@ echo $pfSenseHead->getHTML(); <tr> <td width="22%" valign="top"> </td> <td width="78%"> - <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Format disk!");?>" /> + <input id="submitt" name="Submitt" type="submit" class="formbtn" value="<?=gettext("Format disk!");?>" /> </td> </tr> <tr> <td valign="top" colspan="2"> - <? if ($do_format) - { - echo(_DISKSMANAGEINITPHP_INITTEXT); - echo('<pre>'); - ob_end_flush(); - - /* Erase MBR if not checked*/ - - if (!$notinitmbr) { - echo "Erasing MBR\n"; - system("dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . " bs=32k count=640"); - - } - else - echo "Keeping the MBR\n"; - - switch ($type) - { - case "ufs": - /* Initialize disk */ - system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk)); - echo "\"fdisk: Geom not found\"is not an error message!\n"; - /* Initialise the partition (optional) */ - system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16"); - /* Create s1 label */ - system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto"); - // Create filesystem - system("/sbin/newfs -U /dev/" . escapeshellarg($disk) . "s1"); - break; - case "ufs_no_su": - /* Initialize disk */ - system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk)); - /* Initialise the partition (optional) */ - system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16"); - /* Create s1 label */ - system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto"); - // Create filesystem - system("/sbin/newfs -m 0 /dev/" . escapeshellarg($disk) . "s1"); - break; - case "ufsgpt": - /* Create GPT partition table */ - system("/sbin/gpt destroy " . escapeshellarg($disk)); - system("/sbin/gpt create -f " . escapeshellarg($disk)); - system("/sbin/gpt add -t ufs " . escapeshellarg($disk)); - // Create filesystem - system("/sbin/newfs -U /dev/" . escapeshellarg($disk) . "p1"); - break; - case "ufsgpt_no_su": - /* Create GPT partition table */ - system("/sbin/gpt destroy " . escapeshellarg($disk)); - system("/sbin/gpt create -f " . escapeshellarg($disk)); - system("/sbin/gpt add -t ufs " . escapeshellarg($disk)); - // Create filesystem - system("/sbin/newfs -m 0 /dev/" . escapeshellarg($disk) . "p1"); - break; - case "gmirror": - /* Initialize disk */ - system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk)); - /* Initialise the partition (optional) */ - system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16"); - /* Create s1 label */ - //system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto"); - /* Delete old gmirror information */ - system("/sbin/gmirror clear /dev/" . escapeshellarg($disk)); - break; - case "raid": - /* Initialize disk */ - system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk)); - echo "\"fdisk: Geom not found\"is not an error message!\n"; - /* Initialise the partition (optional) */ - system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16"); - /* Create s1 label */ - system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto"); - break; - case "msdos": - /* Initialize disk */ - system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk)); - echo "\"fdisk: Geom not found\"is not an error message!\n"; - /* Initialise the partition (optional) */ - system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16"); - /* Create s1 label */ - system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto"); - // Create filesystem - system("/sbin/newfs_msdos -F 32 /dev/" . escapeshellarg($disk) . "s1"); - break; - } - - echo('</pre>'); - } + <? + if ($do_format) { + echo "<strong>Disk initialization details:</strong>"; + echo('<pre style="font-size: small; border: solid 1px silver; padding: 4px;">'); + ob_end_flush(); + + /* Erase MBR if not checked*/ + + if (!$notinitmbr) { + echo "Erasing MBR\n"; + system("dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . " bs=32k count=640"); + + } + else + echo "Keeping the MBR\n"; + + switch ($type) + { + case "ufs": + /* Initialize disk */ + system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk)); + echo "\"fdisk: Geom not found\" is not an error message!\n"; + /* Initialise the partition (optional) */ + system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16"); + /* Create s1 label */ + system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto"); + // Create filesystem + system("/sbin/newfs -U /dev/" . escapeshellarg($disk) . "s1"); + break; + case "ufs_no_su": + /* Initialize disk */ + system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk)); + /* Initialise the partition (optional) */ + system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16"); + /* Create s1 label */ + system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto"); + // Create filesystem + system("/sbin/newfs -m 0 /dev/" . escapeshellarg($disk) . "s1"); + break; + case "ufsgpt": + /* Create GPT partition table */ + system("/sbin/gpt destroy " . escapeshellarg($disk)); + system("/sbin/gpt create -f " . escapeshellarg($disk)); + system("/sbin/gpt add -t ufs " . escapeshellarg($disk)); + // Create filesystem + system("/sbin/newfs -U /dev/" . escapeshellarg($disk) . "p1"); + break; + case "ufsgpt_no_su": + /* Create GPT partition table */ + system("/sbin/gpt destroy " . escapeshellarg($disk)); + system("/sbin/gpt create -f " . escapeshellarg($disk)); + system("/sbin/gpt add -t ufs " . escapeshellarg($disk)); + // Create filesystem + system("/sbin/newfs -m 0 /dev/" . escapeshellarg($disk) . "p1"); + break; + case "gmirror": + /* Initialize disk */ + system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk)); + /* Initialise the partition (optional) */ + system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16"); + /* Create s1 label */ + //system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto"); + /* Delete old gmirror information */ + system("/sbin/gmirror clear /dev/" . escapeshellarg($disk)); + break; + case "raid": + /* Initialize disk */ + system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk)); + echo "\"fdisk: Geom not found\"is not an error message!\n"; + /* Initialise the partition (optional) */ + system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16"); + /* Create s1 label */ + system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto"); + break; + case "msdos": + /* Initialize disk */ + system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk)); + echo "\"fdisk: Geom not found\"is not an error message!\n"; + /* Initialise the partition (optional) */ + system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16"); + /* Create s1 label */ + system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto"); + // Create filesystem + system("/sbin/newfs_msdos -F 32 /dev/" . escapeshellarg($disk) . "s1"); + break; + } + + echo('</pre>'); + } ?> </td> </tr> diff --git a/packages/freenas/www/disks_mount.php b/packages/freenas/www/disks_mount.php index c2cf2ea4..2a68a509 100644 --- a/packages/freenas/www/disks_mount.php +++ b/packages/freenas/www/disks_mount.php @@ -122,7 +122,7 @@ echo $pfSenseHead->getHTML(); <?php if ($savemsg) print_info_box($savemsg); ?> <form id="iform" name="iform" action="disks_mount.php" method="post"> -<?php if (file_exists($d_diskdirty_path)): ?> +<?php if (file_exists($d_mountdirty_path)): ?> <?php print_info_box_np(gettext("The mount point list has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));?> <?php endif; ?> @@ -155,18 +155,17 @@ echo $pfSenseHead->getHTML(); <?=htmlspecialchars($mount['desc']);?> </td> </td> - <td valign="middle" class="listbg"> + <td valign="middle" class="listbg" style="color: #FFFFFF;"> <?php - if (file_exists($d_mountdirty_path)) - $stat=_CONFIGURING; - else { - $stat=disks_mount_status($mount); + if (file_exists($d_mountdirty_path)) { + $stat = gettext("configuring"); + } else { + $stat = disks_mount_status($mount); if ($stat == "ERROR") - echo "ERROR - <a href=\"disks_mount.php?act=ret&id=$i\">retry</a>"; - else - echo $stat; - } - ?> + $stat = "ERROR - <a href=\"disks_mount.php?act=ret&id=$i\">retry</a>"; + } + echo $stat; + ?> </td> <td valign="middle" class="list"> <a href="disks_mount_edit.php?id=<?=$i;?>"> @@ -197,7 +196,7 @@ echo $pfSenseHead->getHTML(); </span> <br /> <span class="vexpl"> - <a href="disk_manage.php">previously configured disk</a> + <a href="disks_manage.php">previously configured disk</a> </span> </td> </tr> |