I want to build a custom VM image that boots an Alpine Linux VM in diskless mode. This basically means I need to create a rootfs.img that just contains an EFI partition with the required files (kernel, initramfs - possibly combined into a UKI image - and a directory with .apk packages).
Can I use distrobuilder for that kind of Alpine Linux setup? And are there any existing configurations to use as the starting point?
This is an interesting question. You are looking into PXE / iPXE booting, and by default the VMs will try to perform network booting if you do not provide them with a boot device. Then, you need to setup a PXE server to server the boot image. I do not know the specifics. See this relevant post, Trying to PXE Boot Netboot.xyz from an Incus VM
No, not really. Just standard UEFI boot from an EFI partition (with the UKI image as the EFI executable). But with Alpine “diskless mode”, that image then runs entirely in RAM (from the initramfs that is part of the UKI).
And what I’m looking for is not the boot setup, but rather if I can use distrobuilder to produce a VM rootfs image that either only has an EFI partition, or at least contains an EFI partition with a UKI image (that image is generated automatically by Alpine when you configure Alpine for direct UEFI boot and install the kernel package). I can live with an additional root partition in the image (which just won’t get used in that setup).