dracut-initramfs-restore.sh: try to mount /boot

This is very useful when /boot has the "noauto" option.

Thanks to Igor Filakhtov
master
Harald Hoyer 2015-06-02 11:33:45 +02:00
parent c4184b5cf1
commit 4f0c7fc917
1 changed files with 3 additions and 0 deletions

View 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