From 914997827d6cbafbe22355ad8cd61b74d5107acb Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Tue, 17 Nov 2020 23:46:19 +0000 Subject: [PATCH] disk-image-uefi.binary: build riscv64 image without a bootloader. We want GPT image with ESP, however there is no bootloader for it yet. Build without it. --- .../hooks.d/base/disk-image-uefi.binary | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) 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 4939ca97..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 \ @@ -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