curtin-dev team mailing list archive
-
curtin-dev team
-
Mailing list archive
-
Message #01137
[Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
Ryan Harper has proposed merging ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master.
Commit message:
install_grub: Fix bootloader-id for RHEL systems, must be redhat
In 7310b4fe61465, the port from shell dropped a change where the boot-id
value for Redhat family OSes is the value 'redhat' not the os-release ID
value (which is rhel, on RHEL systems).
Add this change back to install_grub and fix unittests that fail with
'rhel' instead of 'redhat' in os-release values. Hardcode 'redhat'
paths in expected values.
LP: #1906543
Requested reviews:
curtin developers (curtin-dev)
Related bugs:
Bug #1906543 in curtin: "MAAS fails to deploy RHEL images"
https://bugs.launchpad.net/curtin/+bug/1906543
For more details, see:
https://code.launchpad.net/~raharper/curtin/+git/curtin/+merge/394766
--
Your team curtin developers is requested to review the proposed merge of ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master.
diff --git a/curtin/commands/install_grub.py b/curtin/commands/install_grub.py
index 5f8311f..4b40397 100644
--- a/curtin/commands/install_grub.py
+++ b/curtin/commands/install_grub.py
@@ -253,6 +253,8 @@ def gen_uefi_install_commands(grub_name, grub_target, grub_cmd, update_nvram,
install_cmds.append(['dpkg-reconfigure', grub_name])
install_cmds.append(['update-grub'])
elif distroinfo.family == distro.DISTROS.redhat:
+ # RHEL distros uses 'redhat' for bootid
+ bootid = 'redhat'
loader = find_efi_loader(target, bootid)
if loader and update_nvram:
grub_cmd = None # don't install just add entry
diff --git a/tests/unittests/test_commands_install_grub.py b/tests/unittests/test_commands_install_grub.py
index 8808159..6414707 100644
--- a/tests/unittests/test_commands_install_grub.py
+++ b/tests/unittests/test_commands_install_grub.py
@@ -120,7 +120,7 @@ class TestGetGrubConfigFile(CiTestCase):
@mock.patch('curtin.commands.install_grub.distro.os_release')
def test_grub_config_redhat(self, mock_os_release):
- mock_os_release.return_value = {'ID': 'redhat'}
+ mock_os_release.return_value = {'ID': 'rhel'}
distroinfo = install_grub.distro.get_distroinfo()
self.assertEqual(
'/etc/default/grub',
@@ -241,7 +241,7 @@ class TestGetCarryoverParams(CiTestCase):
install_grub.get_carryover_params(distroinfo))
def test_always_set_rh_params(self):
- self.m_os_release.return_value = {'ID': 'redhat'}
+ self.m_os_release.return_value = {'ID': 'rhel'}
distroinfo = install_grub.distro.get_distroinfo()
cmdline = "root=ZFS=rpool/ROOT/ubuntu_bo2om9 ro quiet splash"
self.m_load_file.return_value = cmdline
@@ -583,7 +583,7 @@ class TestGetGrubInstallCommand(CiTestCase):
def test_grub_install_command_redhat_no_uefi(self):
uefi = False
- self.m_os_release.return_value = {'ID': 'redhat'}
+ self.m_os_release.return_value = {'ID': 'rhel'}
distroinfo = install_grub.distro.get_distroinfo()
self.assertEqual(
'grub2-install',
@@ -700,7 +700,7 @@ class TestGenUefiInstallCommands(CiTestCase):
devices, self.target))
def test_redhat_install(self):
- self.m_os_release.return_value = {'ID': 'redhat'}
+ self.m_os_release.return_value = {'ID': 'rhel'}
distroinfo = install_grub.distro.get_distroinfo()
grub_name = 'grub2-efi-x64'
grub_target = 'x86_64-efi'
@@ -715,7 +715,7 @@ class TestGenUefiInstallCommands(CiTestCase):
['efibootmgr', '-v'],
[grub_cmd, '--target=%s' % grub_target,
'--efi-directory=/boot/efi',
- '--bootloader-id=%s' % distroinfo.variant, '--recheck'],
+ '--bootloader-id=redhat', '--recheck'],
]
expected_post = [
['grub2-mkconfig', '-o', '/boot/grub2/grub.cfg'],
@@ -743,10 +743,9 @@ class TestGenUefiInstallCommands(CiTestCase):
with open(loader, 'w+') as fh:
fh.write('\n')
- self.m_os_release.return_value = {'ID': 'redhat'}
+ self.m_os_release.return_value = {'ID': 'rhel'}
distroinfo = install_grub.distro.get_distroinfo()
- bootid = distroinfo.variant
- _enable_loaders(bootid)
+ _enable_loaders("redhat")
grub_name = 'grub2-efi-x64'
grub_target = 'x86_64-efi'
grub_cmd = 'grub2-install'
@@ -756,15 +755,15 @@ class TestGenUefiInstallCommands(CiTestCase):
part = '1'
self.m_get_disk_part.return_value = (disk, part)
- expected_loader = '/boot/efi/EFI/%s/shimx64.efi' % bootid
+ expected_loader = '/boot/efi/EFI/redhat/shimx64.efi'
expected_install = [
['efibootmgr', '-v'],
['efibootmgr', '--create', '--write-signature',
- '--label', bootid, '--disk', disk, '--part', part,
+ '--label', 'redhat', '--disk', disk, '--part', part,
'--loader', expected_loader],
]
expected_post = [
- ['grub2-mkconfig', '-o', '/boot/efi/EFI/%s/grub.cfg' % bootid],
+ ['grub2-mkconfig', '-o', '/boot/efi/EFI/redhat/grub.cfg'],
['efibootmgr', '-v']
]
Follow ups
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Paride Legovini, 2021-01-07
-
[Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Server Team CI bot, 2021-01-07
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Server Team CI bot, 2021-01-07
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Server Team CI bot, 2021-01-07
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Server Team CI bot, 2021-01-07
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Server Team CI bot, 2021-01-07
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Server Team CI bot, 2021-01-07
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Server Team CI bot, 2021-01-07
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Server Team CI bot, 2021-01-07
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Server Team CI bot, 2021-01-07
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Server Team CI bot, 2021-01-07
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Server Team CI bot, 2021-01-07
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Server Team CI bot, 2021-01-07
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Server Team CI bot, 2021-01-06
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Michael Hudson-Doyle, 2021-01-06
-
[Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Michael Hudson-Doyle, 2021-01-06
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Michael Hudson-Doyle, 2020-12-03
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Michael Hudson-Doyle, 2020-12-03
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Server Team CI bot, 2020-12-02
-
Re: [Merge] ~raharper/curtin:fix/grub-boot-id-for-rhel-images into curtin:master
From: Ryan Harper, 2020-12-02