1
0

in rc.init copy log from previous boot to place of safety

This commit is contained in:
Daniel Barlow 2025-01-01 18:20:03 +00:00
parent fd28f0ce04
commit cc94ef57fa
2 changed files with 7 additions and 11 deletions

View File

@ -145,17 +145,8 @@ to :file:`/dev/pmsg0` as well as to the regular log. This is a
circular buffer, so when it fills up newer messages will overwrite the circular buffer, so when it fills up newer messages will overwrite the
oldest messages. oldest messages.
To check the previous messages after a (planned or forced) reboot, Logs found in pstore after a reboot will be moved at startup to
you need to mooun the pstore filesystem. :file:`/run/log/previous-boot`
.. code-block:: console
# mount -t pstore pstore /sys/fs/pstore/
# ls -l /sys/fs/pstore/
-r--r--r-- 1 43071 pmsg-ramoops-0
# cat /sys/fs/pstore/pmsg-ramoops-0
@40000000000000282c997d29 mydevice klogd <6>[ 30.793756] int: port 2(wlan0) entered blocking state
[log messages from before the reboot follow]

View File

@ -22,6 +22,11 @@ mount -t tmpfs none /tmp
mkdir /dev/pts mkdir /dev/pts
mount -t devpts none /dev/pts mount -t devpts none /dev/pts
if test -c /dev/pmsg0 ; then
mount -t pstore none /sys/fs/pstore
(cat /sys/fs/pstore/* && rm /sys/fs/pstore/*) > /run/log/previous-boot
fi
mkdir -m 0751 -p /run/services/outputs mkdir -m 0751 -p /run/services/outputs
chgrp system /run/services/outputs chgrp system /run/services/outputs