support for rocky linux UEFI

Bug #1955671 reported by Francesco Santagata
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Unassigned
3.2
Fix Released
Medium
Unassigned
curtin
Fix Committed
Undecided
Unassigned
curtin (Ubuntu)
In Progress
Undecided
Unassigned

Bug Description

Hi,

with curtin 21.3 I'm able to install Rocky 8.4 on vms, but not on UEFI (BIOS maybe ???) bare metal:

finish: cmd-install/stage-curthooks/builtin/cmd-curthooks: FAIL: curtin command curthooks
        Traceback (most recent call last):
          File "/curtin/curtin/commands/main.py", line 202, in main
            ret = args.func(args)
          File "/curtin/curtin/commands/curthooks.py", line 1886, in curthooks
            builtin_curthooks(cfg, target, state)
          File "/curtin/curtin/commands/curthooks.py", line 1851, in builtin_curthooks
            setup_grub(cfg, target, osfamily=osfamily,
          File "/curtin/curtin/commands/curthooks.py", line 804, in setup_grub
            install_grub(instdevs, target, uefi=uefi_bootable, grubcfg=grubcfg)
          File "/curtin/curtin/commands/install_grub.py", line 398, in install_grub
            in_chroot.subp(cmd, env=env, capture=True)
          File "/curtin/curtin/util.py", line 780, in subp
            return subp(*args, **kwargs)
          File "/curtin/curtin/util.py", line 275, in subp
            return _subp(*args, **kwargs)
          File "/curtin/curtin/util.py", line 139, in _subp
            raise ProcessExecutionError(stdout=out, stderr=err,
        curtin.util.ProcessExecutionError: Unexpected error while running command.
        Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpqkhzgamy/target', 'grub2-mkconfig', '-o', '/boot/efi/EFI/redhat/grub.cfg']
        Exit code: 1
        Reason: -
        Stdout: ''
        Stderr: /usr/sbin/grub2-mkconfig: line 274: /boot/efi/EFI/redhat/grub.cfg.new: No such file or directory

        Unexpected error while running command.
        Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpqkhzgamy/target', 'grub2-mkconfig', '-o', '/boot/efi/EFI/redhat/grub.cfg']
        Exit code: 1
        Reason: -
        Stdout: ''
        Stderr: /usr/sbin/grub2-mkconfig: line 274: /boot/efi/EFI/redhat/grub.cfg.new: No such file or directory

Stderr: ''

It's pretty clear that /boot/efi/EFI/redhat/ is missing and it should be /boot/efi/EFI/rockylinux/

BR
Francesco

Related branches

Revision history for this message
Dan Bungert (dbungert) wrote :

@Francesco - Thanks for testing the work so far. I'm still not really setup for meaningful rockylinux test but I think the fix for this one is straightforward.

I've got a test build out at https://launchpad.net/~dbungert/+archive/ubuntu/curtin-lp-1955671 - would you be able to confirm that this helps?

It's entirely possible that when testing this you get past the current problem and find another, feel free to list that here.

Revision history for this message
Francesco Santagata (phrancesco) wrote :

Hi,

just tested right now.

It seems it doesn't work...

curtin: Installation started. (21.3-5-g5ae173be-0ubuntu1)
start: cmd-install/stage-partitioning/builtin/cmd-block-meta: curtin command block-meta

[...]

finish: cmd-install/stage-curthooks/builtin/cmd-curthooks/install-grub: FAIL: installing grub to target devices
        finish: cmd-install/stage-curthooks/builtin/cmd-curthooks/configuring-bootloader: FAIL: configuring target system bootloader
        finish: cmd-install/stage-curthooks/builtin/cmd-curthooks: FAIL: curtin command curthooks
        Traceback (most recent call last):
          File "/curtin/curtin/commands/main.py", line 202, in main
            ret = args.func(args)
          File "/curtin/curtin/commands/curthooks.py", line 1886, in curthooks
            builtin_curthooks(cfg, target, state)
          File "/curtin/curtin/commands/curthooks.py", line 1851, in builtin_curthooks
            setup_grub(cfg, target, osfamily=osfamily,
          File "/curtin/curtin/commands/curthooks.py", line 804, in setup_grub
            install_grub(instdevs, target, uefi=uefi_bootable, grubcfg=grubcfg)
          File "/curtin/curtin/commands/install_grub.py", line 398, in install_grub
            in_chroot.subp(cmd, env=env, capture=True)
          File "/curtin/curtin/util.py", line 780, in subp
            return subp(*args, **kwargs)
          File "/curtin/curtin/util.py", line 275, in subp
            return _subp(*args, **kwargs)
          File "/curtin/curtin/util.py", line 139, in _subp
            raise ProcessExecutionError(stdout=out, stderr=err,
        curtin.util.ProcessExecutionError: Unexpected error while running command.
        Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmps9fpka1f/target', 'grub2-mkconfig', '-o', '/boot/efi/EFI/redhat/grub.cfg']
        Exit code: 1
        Reason: -
        Stdout: ''
        Stderr: /usr/sbin/grub2-mkconfig: line 274: /boot/efi/EFI/redhat/grub.cfg.new: No such file or directory

        Unexpected error while running command.
        Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmps9fpka1f/target', 'grub2-mkconfig', '-o', '/boot/efi/EFI/redhat/grub.cfg']
        Exit code: 1
        Reason: -
        Stdout: ''
        Stderr: /usr/sbin/grub2-mkconfig: line 274: /boot/efi/EFI/redhat/grub.cfg.new: No such file or directory

Stderr: ''

It seems like it's still recognise the OS as redhat...

BR
Francesco

Revision history for this message
Francesco Santagata (phrancesco) wrote :

PS,

I've been on holidays, this test takes 20 minutes to me, not a week.

Cheers

Revision history for this message
Francesco Santagata (phrancesco) wrote :

Full curtin log

Revision history for this message
Francesco Santagata (phrancesco) wrote :

@Dan, any news on this ?
I'm, starting with a load of bare metal and still have to go with centos 8.4 ...

BR
Francesco

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpqkhzgamy/target', 'grub2-mkconfig', '-o', '/boot/efi/EFI/redhat/grub.cfg']

does not look correct, given that rocky edition of grub2 ships:

/boot/efi/EFI/rocky/grub.cfg
/boot/efi/EFI/rocky/grubenv
/boot/efi/EFI/rocky/grubx64.efi
/boot/grub2/grubenv
/boot/loader/entries
/etc/grub2-efi.cfg

and so on.

So i think when rocky is detected /rocky/ should be used instead of /redhat/.

Or maybe even a /*/ glob, or a set of allowed patterns? Given how many different operating systems there are that use the same installation methods in curtin. I.e. rhel, centos, fedora, rocky, etc.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Made an untested merge-proposal linked, please test.

Revision history for this message
Dan Bungert (dbungert) wrote :

@Francesco -

I've got a new test build out at https://launchpad.net/~dbungert/+archive/ubuntu/curtin-lp-1955671 - are you able to retry?

Revision history for this message
Francesco Santagata (phrancesco) wrote :

Hi,

I patched distro.py inside this one curtin package:

https://launchpad.net/~dbungert/+archive/ubuntu/curtin-lp-1955671

It's working.

I tested on two VMs (1 Bios + 1 UEFI).

With this "https://launchpad.net/~dbungert/+archive/ubuntu/curtin-lp-1955671"
BIOS Centos 8.4 OK, Rocky 8.4 OK
UEFI Centos 8.4 OK, Rocky 8.4 KO

With your latest patch of distro.py Rocky 8.4 on UEFI is working.

Minor Issue, at boot time it tests a lot of efi files before finding the right one...
The first time is really slow, then the "scan" goes much faster.

I have a screen capture of it.

BR
Francesco

PS
please let me know if you need a more clean test... got some problems with "git+ssh" a lost a little bit of focus.

Revision history for this message
Francesco Santagata (phrancesco) wrote :

@Dan I already tested a rough patch in you package 21.3-5.

It seems to work, only minor issued during boot, I attach a screencapture.

Tomorrow I'll test the 21.3-14.

BR
Francesco

Revision history for this message
Dan Bungert (dbungert) wrote :

@Francesco Just so you know, the build I provided should just be the same as Dimitri provided, but already patched.

Changed in curtin (Ubuntu):
status: New → Incomplete
status: Incomplete → In Progress
Changed in curtin:
status: New → In Progress
status: In Progress → Fix Committed
Revision history for this message
Francesco Santagata (phrancesco) wrote :

@Dan, Sorry for being so late... Just noticed that the package is available only for Jammy, will it be possible to have available for Focal too ? Still using Focal...

BR
Francesco

Revision history for this message
Dan Bungert (dbungert) wrote :

Sure thing Francesco, I have uploaded a Focal build to the PPA.

Revision history for this message
Francesco Santagata (phrancesco) wrote :

Thanks @Dan,

21.3-14 tested:

Bios VM with rocky 8.4 OK
UEFI VM with rocky 8.4 OK
UEFI Dell R6525 with rocky 8.4 OK.

Minor Issue, at boot time it tests a lot of efi files before finding the right one...
The first time is really slow, then the "scan" goes much faster.

I have a screen capture of it.

Thanks.

BR
Francesco

Revision history for this message
Camille Rodriguez (camille.rodriguez) wrote :

hi all,

any timeline for the fix to be "released" ? I see it's only committed so far.

Cheers,
Camille

Revision history for this message
Camille Rodriguez (camille.rodriguez) wrote :

Added MAAS as impacted project, since it needs to pull in the new curtin ppa to avoid this issue in the deployment of custom images. Raised Field-High since it is now actively impacting a customer deployment.

Changed in maas:
status: New → Confirmed
Revision history for this message
Camille Rodriguez (camille.rodriguez) wrote :

Removed Field-High. MAAS 3.2/edge contains the new curtain stable ppa that includes this fix

Revision history for this message
Narinder Gupta (narindergupta) wrote :

I can confirm in my testing that installation gets successful after we move to 3.2/edge MAAS

Changed in maas:
status: Confirmed → Fix Committed
milestone: none → 3.3.0
importance: Undecided → Medium
Revision history for this message
Camille Rodriguez (camille.rodriguez) wrote :

patch for maas is currently available under channel 3.2/stable/curtin-stable

Changed in maas:
milestone: 3.3.0 → 3.3.0-beta1
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.