Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RHEL 9.x family OS custom image deployments #169

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

alanbach
Copy link
Contributor

I received reports where RHEL 9.3 deployments are failing to boot, and after performing some troubleshooting, it turned out the sed command in the kickstart file was not working properly.

I applied a small fix and build RHEL 8.8 and RHEL 9.3 images and deployed using my MAAS 3.3.5. The deployments are now working properly, hence I'm proposing this PR.

diff --git a/centos7/http/centos7.ks.in b/centos7/http/centos7.ks.in
index 8c61879..47083a3 100644
--- a/centos7/http/centos7.ks.in
+++ b/centos7/http/centos7.ks.in
@@ -40,7 +40,7 @@ rm -f /etc/sysconfig/network-scripts/ifcfg-[^lo]*
 sed -i 's/^GRUB_TERMINAL=.*/GRUB_TERMINAL_OUTPUT="console"/g' /etc/default/grub
 sed -i '/GRUB_SERIAL_COMMAND="serial"/d' /etc/default/grub
 sed -ri 's/(GRUB_CMDLINE_LINUX=".*)\s+console=ttyS0(.*")/\1\2/' /etc/default/grub
-sed -i 's/"GRUB_ENABLE_BLSCFG=.*"/"GRUB_ENABLE_BLSCFG=false"/g' /etc/default/grub 
+sed -i 's/GRUB_ENABLE_BLSCFG=.*/GRUB_ENABLE_BLSCFG=false/g' /etc/default/grub
 
 yum clean all
 %end
diff --git a/centos8-stream/http/centos8-stream.ks.in b/centos8-stream/http/centos8-stream.ks.in
index 42990f6..823e78b 100644
--- a/centos8-stream/http/centos8-stream.ks.in
+++ b/centos8-stream/http/centos8-stream.ks.in
@@ -40,7 +40,7 @@ rm -f /etc/sysconfig/network-scripts/ifcfg-[^lo]*
 sed -i 's/^GRUB_TERMINAL=.*/GRUB_TERMINAL_OUTPUT="console"/g' /etc/default/grub
 sed -i '/GRUB_SERIAL_COMMAND="serial"/d' /etc/default/grub
 sed -ri 's/(GRUB_CMDLINE_LINUX=".*)\s+console=ttyS0(.*")/\1\2/' /etc/default/grub
-sed -i 's/"GRUB_ENABLE_BLSCFG=.*"/"GRUB_ENABLE_BLSCFG=false"/g' /etc/default/grub 
+sed -i 's/GRUB_ENABLE_BLSCFG=.*/GRUB_ENABLE_BLSCFG=false/g' /etc/default/grub
 
 dnf clean all
 %end
diff --git a/centos8/http/centos8.ks.in b/centos8/http/centos8.ks.in
index f7d2c82..8080061 100644
--- a/centos8/http/centos8.ks.in
+++ b/centos8/http/centos8.ks.in
@@ -40,7 +40,7 @@ rm -f /etc/sysconfig/network-scripts/ifcfg-[^lo]*
 sed -i 's/^GRUB_TERMINAL=.*/GRUB_TERMINAL_OUTPUT="console"/g' /etc/default/grub
 sed -i '/GRUB_SERIAL_COMMAND="serial"/d' /etc/default/grub
 sed -ri 's/(GRUB_CMDLINE_LINUX=".*)\s+console=ttyS0(.*")/\1\2/' /etc/default/grub
-sed -i 's/"GRUB_ENABLE_BLSCFG=.*"/"GRUB_ENABLE_BLSCFG=false"/g' /etc/default/grub 
+sed -i 's/GRUB_ENABLE_BLSCFG=.*/GRUB_ENABLE_BLSCFG=false/g' /etc/default/grub
 
 dnf clean all
 %end
diff --git a/rhel7/http/rhel7.ks.in b/rhel7/http/rhel7.ks.in
index 695fe26..f011496 100644
--- a/rhel7/http/rhel7.ks.in
+++ b/rhel7/http/rhel7.ks.in
@@ -40,7 +40,7 @@ rm -f /etc/sysconfig/network-scripts/ifcfg-[^lo]*
 sed -i 's/^GRUB_TERMINAL=.*/GRUB_TERMINAL_OUTPUT="console"/g' /etc/default/grub
 sed -i '/GRUB_SERIAL_COMMAND="serial"/d' /etc/default/grub
 sed -ri 's/(GRUB_CMDLINE_LINUX=".*)\s+console=ttyS0(.*")/\1\2/' /etc/default/grub
-sed -i 's/"GRUB_ENABLE_BLSCFG=.*"/"GRUB_ENABLE_BLSCFG=false"/g' /etc/default/grub 
+sed -i 's/GRUB_ENABLE_BLSCFG=.*/GRUB_ENABLE_BLSCFG=false/g' /etc/default/grub
 
 yum clean all
 %end
diff --git a/rhel8/http/rhel8.ks.in b/rhel8/http/rhel8.ks.in
index 9ee3846..caa543d 100644
--- a/rhel8/http/rhel8.ks.in
+++ b/rhel8/http/rhel8.ks.in
@@ -39,7 +39,7 @@ rm -f /etc/sysconfig/network-scripts/ifcfg-[^lo]*
 sed -i 's/^GRUB_TERMINAL=.*/GRUB_TERMINAL_OUTPUT="console"/g' /etc/default/grub
 sed -i '/GRUB_SERIAL_COMMAND="serial"/d' /etc/default/grub
 sed -ri 's/(GRUB_CMDLINE_LINUX=".*)\s+console=ttyS0(.*")/\1\2/' /etc/default/grub
-sed -i 's/"GRUB_ENABLE_BLSCFG=.*"/"GRUB_ENABLE_BLSCFG=false"/g' /etc/default/grub 
+sed -i 's/GRUB_ENABLE_BLSCFG=.*/GRUB_ENABLE_BLSCFG=false/g' /etc/default/grub
 
 dnf clean all
 %end
diff --git a/rhel9/http/rhel9.ks.in b/rhel9/http/rhel9.ks.in
index 9ee3846..5fddeed 100644
--- a/rhel9/http/rhel9.ks.in
+++ b/rhel9/http/rhel9.ks.in
@@ -39,7 +39,7 @@ rm -f /etc/sysconfig/network-scripts/ifcfg-[^lo]*
 sed -i 's/^GRUB_TERMINAL=.*/GRUB_TERMINAL_OUTPUT="console"/g' /etc/default/grub
 sed -i '/GRUB_SERIAL_COMMAND="serial"/d' /etc/default/grub
 sed -ri 's/(GRUB_CMDLINE_LINUX=".*)\s+console=ttyS0(.*")/\1\2/' /etc/default/grub
-sed -i 's/"GRUB_ENABLE_BLSCFG=.*"/"GRUB_ENABLE_BLSCFG=false"/g' /etc/default/grub 
+sed -i 's/GRUB_ENABLE_BLSCFG=.*/GRUB_ENABLE_BLSCFG=false/g' /etc/default/grub
 
 dnf clean all
 %end

work properly with RHEL9 and related operating systems.
@alexsander-souza alexsander-souza merged commit 37b6046 into canonical:main Nov 29, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants