bootmisc: optionally save the previous dmesg log

X-Gentoo-Bug: 561204
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=561204
This commit is contained in:
William Hubbs 2015-10-21 14:01:57 -05:00
parent 6cae41a4e6
commit ee944553a9
2 changed files with 8 additions and 0 deletions

View File

@ -8,3 +8,8 @@ wipe_tmp="YES"
# Write the initial dmesg log into /var/log/dmesg after boot
# This may be useful if you need the kernel boot log afterwards
log_dmesg="YES"
# Save the previous dmesg log to dmesc.old
# This may be useful if you need to compare the current boot to the
# previous one.
#previous_dmesg=no

View File

@ -216,6 +216,9 @@ start()
case "$RC_SYS" in
VSERVER|OPENVZ|LXC|SYSTEMD-NSPAWN) ;;
*)
if yesno ${previous_dmesg:-no}; then
mv /var/log/dmesg /var/log/dmesg.old
fi
dmesg > /var/log/dmesg
chmod 640 /var/log/dmesg
;;