summaryrefslogtreecommitdiff
path: root/repo/openrc/0009-fix-bootmisc-mv-error.patch
blob: e87f9bb70e5cbcb67bce1de54979d8c33d185b48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: Dermot Bradley <dermot_bradley@yahoo.com>
Date: Sat, 29 Jan 2022 19:28 +0000
Subject: prevent a bootmisc trying to move a nonexistant file

During boot if the "previous_dmesg" setting is enabled in
/etc/conf.d/bootmisc then during the 1st boot of a machine the
bootmisc init.d script will attempt to move a nonexistant dmesg
file, so generating an error on the console.

Modify the script to only move an existing file.

Upstream has merged this as PR 496 so it will be in the next release.

---

diff -aur a/init.d/bootmisc.in b/init.d/bootmisc.in
--- a/init.d/bootmisc.in
+++ b/init.d/bootmisc.in
@@ -226,7 +226,7 @@
 			case "$RC_SYS" in
 				VSERVER|OPENVZ|LXC|SYSTEMD-NSPAWN) ;;
 				*)
-					if yesno ${previous_dmesg:-no}; then
+					if yesno ${previous_dmesg:-no} && [ -e /var/log/dmesg ]; then
 						mv /var/log/dmesg /var/log/dmesg.old
 					fi
 					dmesg > /var/log/dmesg