mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 01:54:49 +00:00
rc: poperly generate /var/log/gmesg.boot
This commit is contained in:
parent
66d7c5e822
commit
1a86a0bd3b
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
BEEP=`/usr/bin/grep -c disablebeep /conf/config.xml`
|
||||
if [ $BEEP -gt 0 ]; then
|
||||
exit;
|
||||
@ -9,14 +8,6 @@ fi
|
||||
# Standard note length
|
||||
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
|
||||
if [ -f /boot/loader.conf ]; then
|
||||
HZ=`/usr/bin/grep -c kern.hz /boot/loader.conf`
|
||||
|
||||
@ -1617,36 +1617,6 @@ function system_console_configure()
|
||||
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()
|
||||
{
|
||||
global $g, $config;
|
||||
|
||||
15
src/etc/rc
15
src/etc/rc
@ -64,6 +64,15 @@ else
|
||||
done
|
||||
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 !!!
|
||||
if [ -d "/cf/conf" ]; then
|
||||
/bin/rm -f /conf
|
||||
@ -77,12 +86,6 @@ if [ -d /root/core ]; then
|
||||
/usr/bin/make -C /root/core mount
|
||||
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
|
||||
/usr/local/etc/rc.dumpon
|
||||
|
||||
|
||||
@ -115,9 +115,6 @@ require_once("pfsense-utils.inc");
|
||||
echo ".";
|
||||
echo " done.\n";
|
||||
|
||||
/* save dmesg output to file */
|
||||
system_dmesg_save();
|
||||
|
||||
/* start devd (dhclient now uses it) */
|
||||
echo "Starting device manager (devd)...";
|
||||
mute_kernel_msgs();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user