From 569a6ec6477e66a2b92aa3f04695abbcf2cb6a8b Mon Sep 17 00:00:00 2001 From: Nikolai Kostrigin Date: Tue, 26 Feb 2019 10:05:55 +0300 Subject: [PATCH] 0.12-alt3 - 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(-) diff --git a/alterator-grub.spec b/alterator-grub.spec index 83322bb..48c0dff 100644 --- a/alterator-grub.spec +++ b/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 diff --git a/alterator-grub/backend3/grub b/alterator-grub/backend3/grub index aec2f00..520ecc5 100755 --- a/alterator-grub/backend3/grub +++ b/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 -- 2.19.2