diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary index f997bb4e..916bc424 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary @@ -1,7 +1,7 @@ #!/bin/bash -eux case $ARCH in - amd64|arm64|armhf) + amd64|arm64|armhf|riscv64) ;; *) echo "We don't create EFI images for $ARCH." @@ -35,6 +35,15 @@ create_partitions() { --typecode=15:ef00 \ --new=1: ;; + riscv64) + # same as arm64/armhf, but set bit 2 legacy bios bootable + # on the first partition for uboot + sgdisk "${disk_image}" \ + --new=15:0:204800 \ + --typecode=15:ef00 \ + --new=1: \ + --attributes=1:set:2 + ;; amd64) sgdisk "${disk_image}" \ --new=14::+4M \ @@ -81,7 +90,7 @@ install_grub() { # please file a bug against grub2 to include the affected module. case $ARCH in arm64) - chroot mountpoint apt-get -qqy install --no-install-recommends grub-efi-arm64 grub-efi-arm64-bin + chroot mountpoint apt-get -qqy install --no-install-recommends shim-signed grub-efi-arm64-signed efi_target=arm64-efi ;; armhf) @@ -92,6 +101,22 @@ install_grub() { chroot mountpoint apt-get install -qqy grub-pc shim-signed efi_target=x86_64-efi ;; + riscv64) + # TODO does not exist yet on riscv64 + chroot mountpoint apt-get install -qqy u-boot-menu #grub-efi-riscv64 + efi_target=riscv64-efi + + chroot mountpoint u-boot-update + + ## TODO remove below once we have grub-efi-riscv64 + rm mountpoint/tmp/device.map + umount mountpoint/boot/efi + mount + umount_partition mountpoint + rmdir mountpoint + return + ## + ;; esac chroot mountpoint apt-get autoremove --purge --assume-yes diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary index 96bf83a5..ed383109 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary @@ -19,10 +19,6 @@ case $ARCH:$SUBARCH in echo "POWER disk images are handled separately" exit 0 ;; - amd64|arm64|armhf) - echo "We only create EFI images for $ARCH." - exit 0 - ;; armhf:raspi2) # matches the size of the snappy image IMAGE_SIZE=$((4*1000*1000*1000)) @@ -31,6 +27,10 @@ case $ARCH:$SUBARCH in BOOTPART_END=138M BOOT_MOUNTPOINT=/boot/firmware ;; + arm64:*|armhf:*|riscv64:*) + echo "We only create EFI images for $ARCH." + exit 0 + ;; *) ;; esac