summaryrefslogtreecommitdiffstats
path: root/usr/local/www/diag_nanobsd.php
diff options
context:
space:
mode:
authorRenato Botelho <renato.botelho@bluepex.com>2009-07-28 14:26:53 -0300
committerRenato Botelho <renato.botelho@bluepex.com>2009-07-28 14:26:53 -0300
commit96099c6a291ed2d38e624f08eca708c0e1825d47 (patch)
tree89d6019965e054cab978311e949a0752314fc1a6 /usr/local/www/diag_nanobsd.php
parent58cd972469ab40dd9d2911673338fd40b2e2ab9f (diff)
downloadpfsense-96099c6a291ed2d38e624f08eca708c0e1825d47.zip
pfsense-96099c6a291ed2d38e624f08eca708c0e1825d47.tar.gz
Call conf_mount_rw() before execute boot0cfg to prevent I/O errors
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