Commit 50248132 authored by Franco Fichtner's avatar Franco Fichtner

system: fixes in previous

parent 29dcbf58
...@@ -1954,24 +1954,26 @@ function system_console_configure() ...@@ -1954,24 +1954,26 @@ function system_console_configure()
} }
} }
$new_loader_conf = ""; $new_loader_conf = '';
// construct OPNsense config for /boot/loader.conf
foreach ($new_boot_config as $param => $value) { /* reload static values from rc.loader.d */
if (!empty($value)) { mwexecf('/usr/local/etc/rc.loader');
$new_loader_conf .= "{$param}={$value}\n";
} /* copy non-matched settings already there */
}
// copy non matched settings in /boot/loader.conf
foreach (explode("\n", @file_get_contents('/boot/loader.conf')) as $line) { foreach (explode("\n", @file_get_contents('/boot/loader.conf')) as $line) {
if (!empty($line) && !array_key_exists(trim(explode('=', $line)[0]), $new_boot_config)) { if (!empty($line) && !array_key_exists(trim(explode('=', $line)[0]), $new_boot_config)) {
$new_loader_conf .= $line . "\n"; $new_loader_conf .= $line . "\n";
} }
} }
/* reload static values from rc.loader.d */ /* add our console options on top now */
mwexecf('/usr/local/etc/rc.loader'); foreach ($new_boot_config as $param => $value) {
if (!empty($value)) {
$new_loader_conf .= "{$param}={$value}\n";
}
}
/* inject dynamic values directly into loader.conf */ /* write merged file back to target location */
@file_put_contents('/boot/loader.conf', $new_loader_conf); @file_put_contents('/boot/loader.conf', $new_loader_conf);
// ** setup /etc/ttys // ** setup /etc/ttys
......
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