From bdddb541e6eba8b0badf2b613a3957ec98fb75d6 Mon Sep 17 00:00:00 2001 From: sticky-note Date: Tue, 12 Nov 2024 17:04:34 +1100 Subject: [PATCH] fix(ubuntu): restablish empty default grub cmdline after cloud-init install --- builds/linux/ubuntu/20-04-lts/data/user-data.pkrtpl.hcl | 2 ++ builds/linux/ubuntu/22-04-lts/data/user-data.pkrtpl.hcl | 2 ++ builds/linux/ubuntu/24-04-lts/data/user-data.pkrtpl.hcl | 2 ++ 3 files changed, 6 insertions(+) diff --git a/builds/linux/ubuntu/20-04-lts/data/user-data.pkrtpl.hcl b/builds/linux/ubuntu/20-04-lts/data/user-data.pkrtpl.hcl index 08a56b7ac..348f55428 100644 --- a/builds/linux/ubuntu/20-04-lts/data/user-data.pkrtpl.hcl +++ b/builds/linux/ubuntu/20-04-lts/data/user-data.pkrtpl.hcl @@ -43,3 +43,5 @@ ${network} - sed -i -e 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /target/etc/ssh/sshd_config - echo '${build_username} ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/${build_username} - curtin in-target --target=/target -- chmod 440 /etc/sudoers.d/${build_username} + - curtin in-target --target=/target -- sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*$/GRUB_CMDLINE_LINUX_DEFAULT=""/' /etc/default/grub + - curtin in-target --target=/target -- update-grub diff --git a/builds/linux/ubuntu/22-04-lts/data/user-data.pkrtpl.hcl b/builds/linux/ubuntu/22-04-lts/data/user-data.pkrtpl.hcl index 419cd7315..4d51dee52 100644 --- a/builds/linux/ubuntu/22-04-lts/data/user-data.pkrtpl.hcl +++ b/builds/linux/ubuntu/22-04-lts/data/user-data.pkrtpl.hcl @@ -43,3 +43,5 @@ ${network} - sed -i -e 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /target/etc/ssh/sshd_config - echo '${build_username} ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/${build_username} - curtin in-target --target=/target -- chmod 440 /etc/sudoers.d/${build_username} + - curtin in-target --target=/target -- sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*$/GRUB_CMDLINE_LINUX_DEFAULT=""/' /etc/default/grub + - curtin in-target --target=/target -- update-grub diff --git a/builds/linux/ubuntu/24-04-lts/data/user-data.pkrtpl.hcl b/builds/linux/ubuntu/24-04-lts/data/user-data.pkrtpl.hcl index 2616f7f5e..4ed14c34a 100644 --- a/builds/linux/ubuntu/24-04-lts/data/user-data.pkrtpl.hcl +++ b/builds/linux/ubuntu/24-04-lts/data/user-data.pkrtpl.hcl @@ -43,3 +43,5 @@ ${network} - sed -i -e 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /target/etc/ssh/sshd_config - echo '${build_username} ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/${build_username} - curtin in-target --target=/target -- chmod 440 /etc/sudoers.d/${build_username} + - curtin in-target --target=/target -- sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*$/GRUB_CMDLINE_LINUX_DEFAULT=""/' /etc/default/grub + - curtin in-target --target=/target -- update-grub