If /boot/loader.conf is not presetn check /boot/loader.conf.local.

This commit is contained in:
Luiz Souza 2017-09-14 22:04:40 -05:00
parent 59104a6ff6
commit 4ff3adec7a
3 changed files with 19 additions and 6 deletions

View File

@ -1164,7 +1164,14 @@ function setup_serial_port($when = "save", $path = "") {
system("echo \"Reading {$loader_conf_file}...\" >> /conf/upgrade_log.txt");
}
$loader_conf = file_get_contents($loader_conf_file);
if (file_exists($loader_conf_file)) {
$loader_conf = file_get_contents($loader_conf_file);
} elseif (file_exists("{$path}/boot/loader.conf.local")) {
$loader_conf_file = "{$path}/boot/loader.conf.local";
$loader_conf = file_get_contents($loader_conf_file);
} else {
$loader_conf = "";
}
$loader_conf_split = explode("\n", $loader_conf);
$data = array();

View File

@ -35,11 +35,9 @@ if [ -f /var/log/dmesg.boot ]; then
fi
# Check for different HZ
if [ -f /boot/loader.conf ]; then
HZ=`/usr/bin/grep -c kern.hz /boot/loader.conf`
if [ "$HZ" = "1" ]; then
NOTELENGTH="10"
fi
HZ=`/sbin/sysctl -n kern.hz`
if [ "$HZ" = "1" ]; then
NOTELENGTH="10"
fi
if [ -c "/dev/speaker" ]; then

View File

@ -303,6 +303,14 @@ if ($_POST) {
}
unset($loaderconf);
}
if (file_exists("/boot/loader.conf.local")) {
$loaderconf = file_get_contents("/boot/loader.conf.local");
if (strpos($loaderconf, "console=\"comconsole")) {
$config['system']['enableserial'] = true;
write_config(gettext("Restore serial console enabling in configuration."));
}
unset($loaderconf);
}
/* extract out rrd items, unset from $config when done */
if ($config['rrddata']) {
restore_rrddata();