Update initramfs each time the script is run

A user could have run the script previously with an old key, and then
updated their GPG key file, but since the update-initramfs script was
triggered only by crypttab changes, the initramfs wouldn't be updated.
Now we will run this each time as it's safe to run regardless.
parent 4c628eaa
......@@ -117,9 +117,10 @@ if [ "${CRYPTHOME}/cryptkey.gpg" = "$CRYPTTAB_KEY" ]; then
else
cat /etc/crypttab | sed "s|^$ROOT_LUKS .*|$ROOT_LUKS $ROOT_DEV ${CRYPTHOME}/cryptkey.gpg ${CRYPTTAB_OPTIONS},keyscript=decrypt_gnupg-sc|" > /etc/crypttab.tmp
mv /etc/crypttab.tmp /etc/crypttab
update-initramfs -u
fi
update-initramfs -u
# patch grub config files
perl -pi -e 's/^GRUB_CMDLINE_LINUX_DEFAULT=(.*) splash/GRUB_CMDLINE_LINUX_DEFAULT=\1 nosplash noresume loglevel=3/' /etc/default/grub
echo "GRUB_CMDLINE_LINUX_RECOVERY=\"cryptopts=target=$ROOT_LUKS,source=$ROOT_DEV,luks\"" >> /etc/default/grub
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment