]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-initramfs-restore.sh: try to mount /boot
authorHarald Hoyer <harald@redhat.com>
Tue, 2 Jun 2015 09:33:45 +0000 (11:33 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 2 Jun 2015 09:47:04 +0000 (11:47 +0200)
This is very useful when /boot has the "noauto" option.

Thanks to Igor Filakhtov

dracut-initramfs-restore.sh

index 8b9b80f9cf2c2cbee259072c89a4b6084b691e73..0e6a1a88a76499e81ad7958ad26d956cae3294ef 100644 (file)
@@ -14,6 +14,8 @@ SKIP="$dracutbasedir/skipcpio"
 
 [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
 
+mount -o ro /boot &>/dev/null
+
 if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
     IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
 fi
@@ -22,6 +24,7 @@ fi
 cd /run/initramfs
 
 [ -f .need_shutdown -a -f "$IMG" ] || exit 1
+
 if $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
     rm -f -- .need_shutdown
 elif $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then