aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf.d/bootmisc5
-rw-r--r--init.d/bootmisc.in3
2 files changed, 8 insertions, 0 deletions
diff --git a/conf.d/bootmisc b/conf.d/bootmisc
index d79706cc..53712097 100644
--- a/conf.d/bootmisc
+++ b/conf.d/bootmisc
@@ -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
diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in
index 1a05920b..4015d8fe 100644
--- a/init.d/bootmisc.in
+++ b/init.d/bootmisc.in
@@ -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
;;