rancher / elemental-toolkit

:snowflake: The toolkit to build, ship and maintain cloud-init driven Linux derivatives based on container images
https://rancher.github.io/elemental-toolkit/docs/
Apache License 2.0
288 stars 49 forks source link

add symlink for missing binary on ubuntu 22.04+ #2048

Closed furlongm closed 4 months ago

furlongm commented 4 months ago

grub2-editenv does not exist on ubuntu 22.04+ - it is just called grub-editenv

Currently it fails like so:

ERRO[2024-04-17T22:54:28-04:00] sh: 1: grub2-editenv: not found
 : failed to run grub2-editenv /oem/grubenv set boot_assessment_check=yes: exit status 127
ERRO[2024-04-17T22:54:28-04:00] sh: 1: grub2-editenv: not found
 : failed to run grub2-editenv /oem/grubenv unset last_boot_attempt: exit status 127
ERRO[2024-04-17T22:54:28-04:00] 2 errors occurred:
        * failed to run grub2-editenv /oem/grubenv set boot_assessment_check=yes: exit status 127
        * failed to run grub2-editenv /oem/grubenv unset last_boot_attempt: exit status 127

The symlink fixes the issue

davidcassany commented 4 months ago

Very nice! I think we could also check which editenv command exists and use that like we do in the bootloader code, but I will merge this in the meantime! 👍

Interesting I guess the problem here is for the cloud-config of boot assessment, in the golang client we already check if grub2-editenv or grub-editenv should be used. I guess there is no other simple way than adding some logic in the cloud-config file to actually fallback to one or the other when a miss is detected.

@frelon this is also reminding us we should make sure all distros tests are functional. Proabably it is bit drastic but we could consider enabling them all by default, now they don't last that much and using linux we can run many concurrent jobs.