canonical / packer-maas

Packer templates to create MAAS deployable images
Other
279 stars 169 forks source link

ubuntu: enable packing riscv64 cloud images #214

Open xypron opened 6 months ago

xypron commented 6 months ago

add riscv64 architecture to ubuntu-cloudimg

The name of the directory for the riscv64 EDK 2 firmware does not match the prefix of the firmware files. An additional variable was needed.

ubuntu: set bootindex=1 for packer-cloudimg

EDK 2 at least on riscv64 will not use the first disk as first boot option automatically. We need to assign a bootindex.

Testing

For testing the riscv64 build Ubuntu 24.04, Packer v1.10.2, qemu-system-misc 8.2.1+ds-1ubuntu1, qemu-efi-riscv64 2024.02-1 were used.

cd packer-maas/ubuntu/
packer init .
packer build -var ubuntu_series=noble -var architecture=riscv64 -only=cloudimg.* .

or

SERIES=noble ARCH=riscv64 make custom-cloudimg.tar.gz
xypron commented 6 months ago

Building on arm64 failed without if=none for the drives. I have force pushed the change.

xypron commented 6 months ago

The parameter acpi for the the RISC-V virt machine was introduced in QEMU v8.0.0. RISC-V EDK II requires QEMU >= v8.1.2.

SK1Y101 commented 6 months ago

Could you rebase this on top of main? I landed a small change to make the ARCH field in ubuntu images a makefile parameter so we can test arches with our tooling

xypron commented 6 months ago

@SK1Y101 thank you for reviewing.

I have rebased the patches. With your patch I don't have use packer directly anymore.

SERIES=noble ARCH=riscv64 make custom-cloudimg.tar.gz

works fine.

xypron commented 2 months ago

Rebased upon origin/main considering 1c81266c09ef ("Noble build fixes + More (#228)") which introduced the OVMF_SFX variable.