aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2022-01-25 10:59:46 -0300
committerSilvio Rhatto <rhatto@riseup.net>2022-01-25 10:59:46 -0300
commit862a32c6c1d407395c093179ecb2a6aa7c9aa482 (patch)
treec9a882e71196b4e97ecab5c95bdc9b2bebc4ea1f /share
parent1ff6a8894bbbd8c5b86c5a8b740c2d257dd00b67 (diff)
downloadhydra-862a32c6c1d407395c093179ecb2a6aa7c9aa482.tar.gz
hydra-862a32c6c1d407395c093179ecb2a6aa7c9aa482.tar.bz2
Fix: provision: attempt to migrate to new /etc/default/grub.d format
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydractl/provision30
1 files changed, 24 insertions, 6 deletions
diff --git a/share/hydractl/provision b/share/hydractl/provision
index a088d7e..39f91ac 100755
--- a/share/hydractl/provision
+++ b/share/hydractl/provision
@@ -642,6 +642,9 @@ fi
if [ "$grub" == "y" ]; then
echo "Setting up GRUB..."
+ # Ensure this folder exists
+ hydra_sudo_run mkdir $WORK/boot/grub
+
if [ "$boot_mode" == "bios" ]; then
$APT_INSTALL grub-pc -y
else
@@ -666,15 +669,30 @@ if [ "$grub" == "y" ]; then
hydra_sudo_run mount $esp_device $WORK/boot/efi
fi
- hydra_sudo_run sed -i -e 's/^GRUB_CMDLINE_LINUX_DEFAULT="quiet"$/GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor"/' \
- $WORK/etc/default/grub
+ # Old /etc/default format
+ #hydra_sudo_run sed -i -e \
+ # 's/^GRUB_CMDLINE_LINUX_DEFAULT="quiet"$/GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor"/' \
+ # $WORK/etc/default/grub
+
+ cat <<-EOF | $SUDO tee $WORK/etc/default/grub.d/cmdline.cfg > /dev/null
+GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor"
+EOF
+
hydra_sudo_run chroot $WORK/ update-grub
if [ "$encrypt" == "y" ]; then
- echo '' | $SUDO tee -a $WORK/etc/default/grub > /dev/null
- echo '# Full Disk Encryption Support' | $SUDO tee -a $WORK/etc/default/grub > /dev/null
- echo 'GRUB_ENABLE_CRYPTODISK=y' | $SUDO tee -a $WORK/etc/default/grub > /dev/null
- echo 'GRUB_PRELOAD_MODULES="lvm cryptodisk mdraid1x"' | $SUDO tee -a $WORK/etc/default/grub > /dev/null
+ # Old /etc/default format
+ #echo '' | $SUDO tee -a $WORK/etc/default/grub > /dev/null
+ #echo '# Full Disk Encryption Support' | $SUDO tee -a $WORK/etc/default/grub > /dev/null
+ #echo 'GRUB_ENABLE_CRYPTODISK=y' | $SUDO tee -a $WORK/etc/default/grub > /dev/null
+ #echo 'GRUB_PRELOAD_MODULES="lvm cryptodisk mdraid1x"' | $SUDO tee -a $WORK/etc/default/grub > /dev/null
+
+ cat <<-EOF | $SUDO tee $WORK/etc/default/grub.d/fde.cfg > /dev/null
+# Full Disk Encryption Support'
+GRUB_ENABLE_CRYPTODISK=y'
+GRUB_PRELOAD_MODULES="lvm cryptodisk mdraid1x"
+EOF
+
hydra_sudo_run chroot $WORK/ update-grub
# Fix menu entry