Commit e9b5d28c authored by Franco Fichtner's avatar Franco Fichtner

inc/config: exterminate cf_path softcoding

parent 08e6c7d7
......@@ -107,7 +107,7 @@ else if (file_exists("/var/run/booting") && !file_exists('/conf/config.xml')) {
/* skip mfs mounted filesystems */
if (strstr($mountdisk, "md"))
continue;
if (mwexec("/sbin/mount -r /dev/{$mountdisk}a {$g['cf_path']}") == 0) {
if (mwexec("/sbin/mount -r /dev/{$mountdisk}a /cf") == 0) {
if (file_exists('/conf/config.xml')) {
/* found it */
$cfgdevice = $mountdisk;
......@@ -116,12 +116,12 @@ else if (file_exists("/var/run/booting") && !file_exists('/conf/config.xml')) {
printf(gettext("Found configuration on %s.%s"), $cfgdevice, "\n");
}
mwexec("/sbin/umount -f {$g['cf_path']}");
mwexec("/sbin/umount -f /cf");
if ($cfgdevice)
break;
}
if (mwexec("/sbin/mount -r /dev/{$mountdisk}d {$g['cf_path']}") == 0) {
if (mwexec("/sbin/mount -r /dev/{$mountdisk}d /cf") == 0) {
if (file_exists('/conf/config.xml')) {
/* found it */
$cfgdevice = $mountdisk;
......@@ -130,7 +130,7 @@ else if (file_exists("/var/run/booting") && !file_exists('/conf/config.xml')) {
printf(gettext("Found configuration on %s.%s"), $cfgdevice, "\n");
}
mwexec("/sbin/umount -f {$g['cf_path']}");
mwexec("/sbin/umount -f /cf");
if ($cfgdevice)
break;
......@@ -157,7 +157,7 @@ else if (file_exists("/var/run/booting") && !file_exists('/conf/config.xml')) {
/* write out an fstab */
$fd = fopen('/etc/fstab', 'w');
$fstab = "/dev/{$cfgpartition} {$g['cf_path']} {$cfgfstype} ro,noatime 1 1\n";
$fstab = "/dev/{$cfgpartition} /cf {$cfgfstype} ro,noatime 1 1\n";
$fstab .= "proc /proc procfs rw 0 0\n";
fwrite($fd, $fstab);
......
......@@ -290,12 +290,12 @@ function conf_mount_rw() {
if ((refcount_reference(1000) > 1) && is_writable("/"))
return;
$status = mwexec("/sbin/mount -u -w -o sync,noatime {$g['cf_path']}");
$status = mwexec("/sbin/mount -u -w -o sync,noatime /cf");
if($status <> 0) {
if(file_exists("/var/run/booting"))
echo gettext("Disk is dirty. Running fsck -y") . "\n";
mwexec("/sbin/fsck -y {$g['cf_path']}");
$status = mwexec("/sbin/mount -u -w -o sync,noatime {$g['cf_path']}");
mwexec("/sbin/fsck -y /cf");
$status = mwexec("/sbin/mount -u -w -o sync,noatime /cf");
}
/* if the platform is soekris or wrap or pfSense, lets mount the
......@@ -339,7 +339,7 @@ function conf_mount_ro() {
clear_subsystem_dirty('mount');
/* sync data, then force a remount of /cf */
pfSense_sync();
mwexec("/sbin/mount -u -r -f -o sync,noatime {$g['cf_path']}");
mwexec("/sbin/mount -u -r -f -o sync,noatime /cf");
mwexec("/sbin/mount -u -r -f -o sync,noatime /");
}
......
......@@ -44,7 +44,6 @@ $g = array(
"vardb_path" => "/var/db",
"varlog_path" => "/var/log",
"tmp_path" => "/tmp",
"cf_path" => "/cf",
"xml_rootobj" => "pfsense",
"admin_group" => "admins",
"product_name" => "OPNsense",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment