]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-initramfs-restore: make mount error nonfatal 87/head
authorAlexander Tsoy <alexander@tsoy.me>
Tue, 28 Jul 2015 11:55:59 +0000 (14:55 +0300)
committerHarald Hoyer <harald@redhat.com>
Tue, 28 Jul 2015 13:04:56 +0000 (15:04 +0200)
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

index 0e6a1a88a76499e81ad7958ad26d956cae3294ef..0c41a59ce0e64676dc30225a8fe58983bc6e482c 100644 (file)
@@ -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"