How to create arm64 UC20 image with UC20 initrd

Hi guys, i’m trying create a arm64 UC image, refer to ubuntu.com/core/docs/image-building and sample gadgets on github.com/snapcore. the UC18 image create successful and bootup well, but failed for creating UC20 image. I followed the kernel-build guide ubuntu.com/core/docs/kernel-building to build the kernel snap and then create a UC20 image, but boot hang at initrd because the initrd is an UC18 type which is not used for UC20.

So how can i build the kernel snap with UC20 initrd for UC20 image? is this github.com/snapcore/core-initrd the source code for UC20 initrd? if so, how to build it and integrate with kernel snap build?

Thanks.

you can use this alternative kernel plugin:

(just create a snap/plugins/ dir in your tree and copy them in there)

here is a kernel where i make use of it:

Thanks for your reply, i got this from another topic yesterday and the output image bootup successfuly, so there is no way to build a custom uc20 initrd from the standard kernel plugin or any other source? This sample kenel plugin download a raspi uc20 initrd snap package from https://people.canonical.com/~okubik/uc-initrds/, unpack, copy modules and pack again.

i think this is currently the only way to build a proper UC20 kernel from source (note the official kernels are just re-packs of the deb binaries, which is necessary due to secure boot support in UC20)

i know that @ondra is actually working on getting this plugin officially into snapcraft as a default, not sure where that stands though.

what would you want to customize ?

okay, i suspect it was caused by what i did wrong or information i missed.

the sample raspi initrd will load raspi specific modules when initrd boot and cause error messages, i’ll try to modify the kernel plugin to fix this.

Thanks.

Hi
You can use my kernel plugin

Here is example of the plugin use:

This will automatically fetch initrrd from here https://snapcraft.io/uc-initrd from relevant track.

Plugin supports cross building, so you should be good to go
cheers
Ondra