Commit 1a86a0bd authored by Franco Fichtner's avatar Franco Fichtner

rc: poperly generate /var/log/gmesg.boot

parent 66d7c5e8
#!/bin/sh #!/bin/sh
BEEP=`/usr/bin/grep -c disablebeep /conf/config.xml` BEEP=`/usr/bin/grep -c disablebeep /conf/config.xml`
if [ $BEEP -gt 0 ]; then if [ $BEEP -gt 0 ]; then
exit; exit;
...@@ -9,14 +8,6 @@ fi ...@@ -9,14 +8,6 @@ fi
# Standard note length # Standard note length
NOTELENGTH="25" NOTELENGTH="25"
# this is super annoying in VMware, exit if in VMware
if [ -f /var/log/dmesg.boot ]; then
VMWCOUNT=`/usr/bin/grep -c VMware /var/log/dmesg.boot`
if [ $VMWCOUNT -gt 0 ]; then
exit;
fi
fi
# Check for different HZ # Check for different HZ
if [ -f /boot/loader.conf ]; then if [ -f /boot/loader.conf ]; then
HZ=`/usr/bin/grep -c kern.hz /boot/loader.conf` HZ=`/usr/bin/grep -c kern.hz /boot/loader.conf`
......
...@@ -1617,36 +1617,6 @@ function system_console_configure() ...@@ -1617,36 +1617,6 @@ function system_console_configure()
setup_serial_port(); setup_serial_port();
} }
function system_dmesg_save()
{
global $g;
$dmesg = '';
$_gb = exec('/sbin/dmesg', $dmesg);
/* find last copyright line (output from previous boots may be present) */
$lastcpline = 0;
for ($i = 0; $i < count($dmesg); $i++) {
if (strstr($dmesg[$i], "Copyright (c) 1992-"))
$lastcpline = $i;
}
$fd = fopen('/var/log/dmesg.boot', 'w');
if (!$fd) {
printf(gettext("Error: cannot open dmesg.boot in system_dmesg_save().%s"), "\n");
return 1;
}
for ($i = $lastcpline; $i < count($dmesg); $i++)
fwrite($fd, $dmesg[$i] . "\n");
fclose($fd);
unset($dmesg);
return 0;
}
function system_set_harddisk_standby() function system_set_harddisk_standby()
{ {
global $g, $config; global $g, $config;
......
...@@ -64,6 +64,15 @@ else ...@@ -64,6 +64,15 @@ else
done done
fi fi
# write /var/log/dmesg.boot
/etc/rc.d/dmesg onestart
# rewrite message of the day
/etc/rc.d/motd onestart
# set keyboard map if needed
/etc/rc.d/syscons onestart
# !!! migration code for OPNsense <= 15.1.7, do not remove !!! # !!! migration code for OPNsense <= 15.1.7, do not remove !!!
if [ -d "/cf/conf" ]; then if [ -d "/cf/conf" ]; then
/bin/rm -f /conf /bin/rm -f /conf
...@@ -77,12 +86,6 @@ if [ -d /root/core ]; then ...@@ -77,12 +86,6 @@ if [ -d /root/core ]; then
/usr/bin/make -C /root/core mount /usr/bin/make -C /root/core mount
fi fi
# rewrite message of the day
/etc/rc.d/motd onestart
# set keyboard map if needed
/etc/rc.d/syscons onestart
# probe for a persistent core dump device # probe for a persistent core dump device
/usr/local/etc/rc.dumpon /usr/local/etc/rc.dumpon
......
...@@ -115,9 +115,6 @@ require_once("pfsense-utils.inc"); ...@@ -115,9 +115,6 @@ require_once("pfsense-utils.inc");
echo "."; echo ".";
echo " done.\n"; echo " done.\n";
/* save dmesg output to file */
system_dmesg_save();
/* start devd (dhclient now uses it) */ /* start devd (dhclient now uses it) */
echo "Starting device manager (devd)..."; echo "Starting device manager (devd)...";
mute_kernel_msgs(); mute_kernel_msgs();
......
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