sys-kernel/dracut: Add patch fixing dracut-initramfs-restore
authorAmadeusz Żołnowski <aidecoe@gentoo.org>
Sun, 16 Aug 2015 10:33:59 +0000 (11:33 +0100)
committerAmadeusz Żołnowski <aidecoe@gentoo.org>
Sun, 16 Aug 2015 10:36:10 +0000 (11:36 +0100)
Patch makes mount error nonfatal in dracut-initramfs-restore.

Commit on behalf of Alexander Tsoy <alexander@tsoy.me>.

Gentoo-Bug: 533084

Package-Manager: portage-2.2.20.1

sys-kernel/dracut/dracut-043-r2.ebuild
sys-kernel/dracut/files/043-0004-dracut-initramfs-restore-make-mount-er.patch [new file with mode: 0644]

index b713bea5b0181c0a4fe6a6e971621db23c4eb767..017bc207137eb795f527851a79e8a3f26a69157a 100644 (file)
@@ -52,6 +52,7 @@ PATCHES=(
        "${FILESDIR}/${PV}-0001-Revert-lvm-Don-t-activate-LVs-with-act.patch"
        "${FILESDIR}/${PV}-0002-Replace-echo-n-with-printf-in-code-wit.patch"
        "${FILESDIR}/${PV}-0003-syncheck-Look-for-echo-n-usage-in-modu.patch"
+       "${FILESDIR}/${PV}-0004-dracut-initramfs-restore-make-mount-er.patch"
        )
 QA_MULTILIB_PATHS="
        usr/lib/dracut/dracut-install
diff --git a/sys-kernel/dracut/files/043-0004-dracut-initramfs-restore-make-mount-er.patch b/sys-kernel/dracut/files/043-0004-dracut-initramfs-restore-make-mount-er.patch
new file mode 100644 (file)
index 0000000..23e30e1
--- /dev/null
@@ -0,0 +1,28 @@
+From a18c8fdc9cb3eb917e9a7a30466839c33131cc8a Mon Sep 17 00:00:00 2001
+From: Alexander Tsoy <alexander@tsoy.me>
+Date: Tue, 28 Jul 2015 14:55:59 +0300
+Subject: [PATCH 4/4] dracut-initramfs-restore: make mount error nonfatal
+
+Script enables errexit option (set -e). So if /boot is not a mount point
+or is already mounted, then script dies after unsuccessful mount
+command. Fix this by always returning successful result.
+---
+ dracut-initramfs-restore.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh
+index 0e6a1a8..0c41a59 100644
+--- a/dracut-initramfs-restore.sh
++++ b/dracut-initramfs-restore.sh
+@@ -14,7 +14,7 @@ SKIP="$dracutbasedir/skipcpio"
+ [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
+-mount -o ro /boot &>/dev/null
++mount -o ro /boot &>/dev/null || true
+ if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
+     IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
+-- 
+2.5.0
+