Browse Source

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 10 years ago
parent
commit
4f0c7fc917
  1. 3
      dracut-initramfs-restore.sh

3
dracut-initramfs-restore.sh

@ -14,6 +14,8 @@ SKIP="$dracutbasedir/skipcpio" @@ -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 @@ -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

Loading…
Cancel
Save