Skip to content

Commit

Permalink
Add grubby to handle latest grub2 changes
Browse files Browse the repository at this point in the history
With latest grub2 installer, one should set the
kernel to be booted explicitly after update or
install of latest kernel

Signed-off-by: Abdul Haleem <[email protected]>
  • Loading branch information
abdhaleegit committed Nov 22, 2023
1 parent 051b5e8 commit a142cf4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions testcases/InstallUpstreamKernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def is_url(path):
con.run_command("make %s" % self.config)
# Capture kernel version & release
res = con.run_command("make kernelrelease")
print(res)
sha = con.run_command("git rev-parse HEAD")
tcommit = con.run_command("export 'TERM=xterm-256color';git show -s --format=%ci")
tcommit = re.sub(r"\x1b\[[0-9;]*[mGKHF]", "", tcommit[1])
Expand All @@ -128,8 +129,9 @@ def is_url(path):
time.sleep(10)
if not self.use_kexec:
# FIXME: Handle distributions which do not support grub
con.run_command(
"grub2-mkconfig --output=/boot/grub2/grub.cfg")
#con.run_command(
# "grub2-mkconfig --output=/boot/grub2/grub.cfg")
con.run_command("grubby --set-default /boot/vmlinuz-%s" % res[-1])
log.debug("Rebooting after kernel install...")
self.console_thread.console_terminate()
con.close()
Expand Down

0 comments on commit a142cf4

Please sign in to comment.