summaryrefslogtreecommitdiffstats
path: root/usr/local/www/diag_nanobsd.php
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www/diag_nanobsd.php')
-rwxr-xr-xusr/local/www/diag_nanobsd.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr/local/www/diag_nanobsd.php b/usr/local/www/diag_nanobsd.php
index 6715902..0733994 100755
--- a/usr/local/www/diag_nanobsd.php
+++ b/usr/local/www/diag_nanobsd.php
@@ -38,6 +38,7 @@ ini_set('implicit_flush', 1);
ini_set('max_input_time', '9999');
require_once("guiconfig.inc");
+require_once("config.inc");
$pgtitle = array("Diagnostics","NanoBSD");
include("head.inc");
@@ -108,13 +109,13 @@ EOF;
$AOLD_UFS_ID="1";
$ABOOTFLASH="{$BOOT_DRIVE}s{$AOLDSLICE}";
}
+ conf_mount_rw();
exec("sysctl kern.geom.debugflags=16");
exec("gpart set -a active -i {$ASLICE} {$BOOT_DRIVE}");
exec("/usr/sbin/boot0cfg -s {$ASLICE} -v /dev/{$BOOT_DRIVE}");
exec("/bin/mkdir /tmp/{$AGLABEL_SLICE}");
exec("/sbin/fsck_ufs -y /dev/{$ACOMPLETE_PATH}");
exec("/sbin/mount /dev/ufs/{$AGLABEL_SLICE} /tmp/{$AGLABEL_SLICE}");
- exec("/bin/cp /etc/fstab /tmp/{$AGLABEL_SLICE}/etc/fstab");
$fstab = <<<EOF
/dev/ufs/{$AGLABEL_SLICE} / ufs ro 1 1
/dev/ufs/cf /cf ufs ro 1 1
@@ -122,6 +123,7 @@ EOF;
file_put_contents("/tmp/{$AGLABEL_SLICE}/etc/fstab", $fstab);
exec("/sbin/umount /tmp/{$AGLABEL_SLICE}");
exec("sysctl kern.geom.debugflags=0");
+ conf_mount_ro();
$savemsg = "The boot slice has been set to {$BOOT_DRIVE} {$AGLABEL_SLICE}";
}
OpenPOWER on IntegriCloud