This is very useful when /boot has the "noauto" option.
Thanks to Igor Filakhtov
[[ -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
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