@@ -, +, @@ - prevent an error message during bootloader installation if a LUKS encryption is chosen for root partition --- alterator-grub.spec | 6 +++++- alterator-grub/backend3/grub | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) --- a/alterator-grub.spec +++ a/alterator-grub.spec @@ -2,7 +2,7 @@ Name: alterator-grub Version: 0.12 -Release: alt2 +Release: alt3 Summary: alterator module to setup grub bootloader License: GPL @@ -49,6 +49,10 @@ alterator module to setup grub bootloader %_bindir/* %changelog +* Sun Feb 24 2019 Nikolai Kostrigin 0.12-alt3 +- prevent an error message during bootloader installation if a LUKS + encryption is chosen for root partition + * Mon May 21 2018 Sergey Bolshakov 0.12-alt2 - do not require grub-pc on non-pc --- a/alterator-grub/backend3/grub +++ a/alterator-grub/backend3/grub @@ -132,6 +132,16 @@ write_device() { GRUB_DEV= for dev in $bootdev; do GRUB_DEV="$(blockdev_get_symlink "$dev") $GRUB_DEV" + + # try to overcome an error occuring when a root partition is chosen to be encrypted with LUKS + if [ -L /dev/mapper/*_luks ]; then + if ! grep "^GRUB_ENABLE_CRYPTODISK=" /etc/default/grub > /dev/null 2>&1; then + echo "GRUB_ENABLE_CRYPTODISK=y" >> /etc/default/grub + else + sed -i "s|GRUB_ENABLE_CRYPTODISK=.*|GRUB_ENABLE_CRYPTODISK=y|" /etc/default/grub + fi + fi + grub-install $target "$dev" >> $gruboutput 2>&1 if [ $? -ne 0 ]; then if grep blocklists $gruboutput; then --