Configure grub with Ubuntu Core 20

Hey All,

I’m currently experimenting with Ubuntu Core and wanted to port my existing 18 image to 20. No I’m struggling with the grub configuration.

I need to add something to the kernel boot cmdline. With core18 I had the grub.cfg to do this. With core20 the grub.cfg is gone:

grub: boot configuration is shipped and managed by snapd
https://github.com/snapcore/pc-amd64-gadget/commit/12518c8bdadd12268fc535ffafe40c3d2116a6d3

Unfortunately I’m unable to find any documentation on that topic? Hope someone can give me a hint.

Thanks, and btw: is this the right place to ask about Ubuntu Core? If so, maybe add a category?

I moved your post to the devices category which is for UbuntuCore related questions…

2 Likes

Hi, unfortunately we are a bit behind implementing this feature for UC20, because the kernel command line is sealed against in the TPM for amd64, and so currently we store the kernel command line inside snapd and it is not changeable specifically for amd64 when using encryption. Snapd generates the grub.cfg that used to exist in the gadget snap to enforce that this is used.

We are aiming to soon enable the gadget snap to specify additional kernel cmdline arguments through a structured manner, but that feature is not yet implemented.

As a workaround, if you are not using encryption, you can manually edit the grub.cfg files on the ubuntu-seed and ubuntu-boot partitions after the system has finished installing (i.e. after you run console-conf). You could also do this with encryption enabled, but then the device would not be able to finish booting because it wouldn’t be able to unlock the encrypted data partition from the initramfs.

1 Like

Hi,

Thank you for the explanation. In this case, I guess I will wait for the release of this feature.