[neon/neon/livecd-rootfs/Neon/release] live-build: RISC-V: enable building for Nezha board
Alexandre Ghiti
null at kde.org
Tue Jul 26 12:23:08 BST 2022
Git commit 1527ac2b4ef88cd8224f6b2b0a770ec089c42e74 by Alexandre Ghiti.
Committed on 13/07/2022 at 14:03.
Pushed by jriddell into branch 'Neon/release'.
RISC-V: enable building for Nezha board
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
M +8 -1 live-build/auto/config
M +41 -18 live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary
https://invent.kde.org/neon/neon/livecd-rootfs/commit/1527ac2b4ef88cd8224f6b2b0a770ec089c42e74
diff --git a/live-build/auto/config b/live-build/auto/config
index 0d83ecb7..66145c95 100755
--- a/live-build/auto/config
+++ b/live-build/auto/config
@@ -938,7 +938,14 @@ case $PROJECT in
;;
riscv64*)
if [ -n "$SUBARCH" ]; then
- KERNEL_FLAVOURS=generic
+ case "${SUBARCH:-}" in
+ nezha)
+ KERNEL_FLAVOURS=allwinner
+ ;;
+ *)
+ KERNEL_FLAVOURS=generic
+ ;;
+ esac
fi
;;
esac
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 0b42d954..9ce09413 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
@@ -209,25 +209,48 @@ install_grub() {
chroot mountpoint u-boot-update
if [ -n "${SUBARCH:-}" ]; then
- u_boot_arch="${SUBARCH}"
- if [ "${u_boot_arch}" = "hifive" ]; then
- u_boot_arch=sifive_fu540
- fi
- chroot mountpoint apt-get install -qqy u-boot-sifive
- # FSBL, which gets U-Boot SPL
- loader1="/dev/mapper${loop_device///dev/}p13"
- # The real U-Boot
- loader2="/dev/mapper${loop_device///dev/}p14"
- dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot-spl.bin of=$loader1
- dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot.itb of=$loader2
- # Provide end-user modifyable CIDATA
- cidata_dev="/dev/mapper${loop_device///dev/}p12"
- setup_cidata "${cidata_dev}"
- # Provide stock nocloud datasource
- # Allow interactive login on baremetal SiFive board,
- # without a cloud datasource.
- setup_cinocloud mountpoint
+ case "${SUBARCH}" in
+ "nezha")
+ echo "Installing U-Boot for Nezha board" &1>2
+ chroot mountpoint apt-get install -qqy nezha-boot0
+ # FSBL, which gets U-Boot SPL
+ loader1="/dev/mapper${loop_device///dev/}p13"
+ dd if=mountpoint/usr/lib/u-boot/nezha/boot0_sdcard_sun20iw1p1.bin of=$loader1
+ # The real U-Boot
+ chroot mountpoint apt-get install -qqy u-boot-nezha
+ loader2="/dev/mapper${loop_device///dev/}p14"
+ dd if=mountpoint/usr/lib/u-boot/nezha/u-boot.toc1 of=$loader2
+ # Provide end-user modifyable CIDATA
+ cidata_dev="/dev/mapper${loop_device///dev/}p12"
+ setup_cidata "${cidata_dev}"
+ # Provide stock nocloud datasource
+ # Allow interactive login on baremetal SiFive board,
+ # without a cloud datasource.
+ setup_cinocloud mountpoint
+ ;;
+ *)
+ u_boot_arch="${SUBARCH}"
+ if [ "${u_boot_arch}" = "hifive" ]; then
+ u_boot_arch=sifive_fu540
+ fi
+ chroot mountpoint apt-get install -qqy u-boot-sifive
+ # FSBL, which gets U-Boot SPL
+ loader1="/dev/mapper${loop_device///dev/}p13"
+ # The real U-Boot
+ loader2="/dev/mapper${loop_device///dev/}p14"
+ dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot-spl.bin of=$loader1
+ dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot.itb of=$loader2
+ # Provide end-user modifyable CIDATA
+ cidata_dev="/dev/mapper${loop_device///dev/}p12"
+ setup_cidata "${cidata_dev}"
+ # Provide stock nocloud datasource
+ # Allow interactive login on baremetal SiFive board,
+ # without a cloud datasource.
+ setup_cinocloud mountpoint
+ ;;
+ esac
fi
+
## TODO remove below once we have grub-efi-riscv64
rm mountpoint/tmp/device.map
umount mountpoint/boot/efi
More information about the Neon-commits
mailing list