diff --git a/live-build/auto/config b/live-build/auto/config index ce04b39a..63afda1e 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -9,9 +9,7 @@ case $ARCH:$SUBARCH in armhf:|\ i386:|\ ppc64el:|\ - riscv64:|riscv64:generic|riscv64:icicle|riscv64:jh7110|riscv64:licheerv|\ - riscv64:milkvmars|riscv64:nezha|riscv64:pic64gx|riscv64:unmatched|\ - riscv64:visionfive|riscv64:visionfive2|\ + riscv64:|riscv64:generic|\ s390x:|\ *appliance*) ;; @@ -402,15 +400,6 @@ fi # one also must request disk1-img-xz image format if [ "$IMAGEFORMAT" = "ext4" ] && [ "$PROJECT" = "ubuntu-cpc" ]; then case $ARCH:$SUBARCH in - riscv64:icicle | \ - riscv64:jh7110 | \ - riscv64:licheerv | \ - riscv64:milkvmars | \ - riscv64:nezha | \ - riscv64:pic64gx | \ - riscv64:unmatched | \ - riscv64:visionfive | \ - riscv64:visionfive2 | \ *:generic) IMAGE_HAS_HARDCODED_PASSWORD=1 if [ -z "${IMAGE_TARGETS:-}" ]; then @@ -1220,14 +1209,7 @@ case $PROJECT in ;; riscv64*) if [ -n "$SUBARCH" ]; then - case "${SUBARCH:-}" in - visionfive) - KERNEL_FLAVOURS=starfive - ;; - *) - KERNEL_FLAVOURS=generic - ;; - esac + KERNEL_FLAVOURS=generic fi ;; esac diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi-non-cloud.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi-non-cloud.binary index 2c35e13b..6519ca11 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi-non-cloud.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi-non-cloud.binary @@ -70,105 +70,12 @@ create_partitions() { fi ;; riscv64) - # same as arm64/armhf, but set bit 2 legacy bios bootable - # on the first partition for uboot - # and have two loader partitions of uboot SPL & real one - # and have CIDATA partition for preinstalled image - if [ -z "${SUBARCH:-}" ]; then - # cloud-image - sgdisk "${disk_image}" \ - --set-alignment=2 \ - --new=15::+106M \ - --typecode=15:ef00 \ - --new=1:: \ - --attributes=1:set:2 - elif [ "${SUBARCH:-}" = "nezha" ] || [ "${SUBARCH:-}" = "licheerv" ]; then - # Nezha/LicheeRV D1 boards - sgdisk "${disk_image}" \ - --set-alignment=2 \ - --new=13:256:25575 \ - --change-name=13:loader1 \ - --typecode=13:B161E8AB-7D4B-4DB4-821C-4120A0554A35 \ - --attributes=13:set:0 \ - --new=16:25576:32799 \ - --change-name=16:loader2b \ - --typecode=16:F79E76D9-AC98-418B-8F31-E17EA24FF07C \ - --attributes=16:set:0 \ - --new=14:32800:43007 \ - --change-name=14:loader2 \ - --typecode=14:F4FA3898-3478-4941-887D-FCEC4E9E3C05 \ - --attributes=14:set:0 \ - --new=15::+106M \ - --typecode=15:ef00 \ - --change-name=15:ESP \ - --new=12::+4M \ - --change-name=12:CIDATA \ - --new=1:: \ - --attributes=1:set:2 - elif [ "${SUBARCH:-}" = "icicle" ] || [ "${SUBARCH:-}" = "pic64gx" ]; then - # Microchip Icicle Kit - sgdisk "${disk_image}" \ - --set-alignment=2 \ - --new=13:256:25575 \ - --change-name=13:loader \ - --typecode=13:ef02 \ - --attributes=13:set:0 \ - --new=15::+106M \ - --typecode=15:ef00 \ - --change-name=15:ESP \ - --new=12::+4M \ - --change-name=12:CIDATA \ - --new=1:: \ - --attributes=1:set:2 - elif [ "${SUBARCH:-}" = "visionfive" ]; then - # VisionFive - sgdisk "${disk_image}" \ - --set-alignment=2 \ - --new=15::+106M \ - --typecode=15:ef00 \ - --change-name=15:ESP \ - --new=12::+4M \ - --change-name=12:CIDATA \ - --new=3::+1M \ - --change-name=3:uEnv \ - --new=1:: \ - --attributes=1:set:2 - elif [ "${SUBARCH:-}" = "visionfive2" ] || [ "${SUBARCH:-}" = "milkvmars" ] || [ "${SUBARCH:-}" = "jh7110" ]; then - # JH7110 chips: VisionFive 2, Milk-V Mars - sgdisk "${disk_image}" \ - --set-alignment=4096 \ - --new=13:4096:8191 \ - --typecode=13:2E54B353-1271-4842-806F-E436D6AF6985 \ - --change-name=13:loader1 \ - --new=2:8192:40959 \ - --typecode=2:7a097280-70d2-44bc-886c-ff5ffbb7b098 \ - --change-name=2:loader2 \ - --new=12:40960:49151 \ - --change-name=12:CIDATA \ - --new=15:49152:253951 \ - --typecode=15:ef00 \ - --change-name=15:ESP \ - --new=1:253952: \ - --attributes=1:set:2 - else - # preinstalled server, currently FU540 - # FU740 too in the future - sgdisk "${disk_image}" \ - --set-alignment=2 \ - --new=13:34:2081 \ - --change-name=13:loader1 \ - --typecode=13:5B193300-FC78-40CD-8002-E86C45580B47 \ - --attributes=13:set:0 \ - --new=14:2082:10239 \ - --change-name=14:loader2 \ - --typecode=14:2E54B353-1271-4842-806F-E436D6AF6985 \ - --attributes=14:set:0 \ - --new=15::+106M \ - --typecode=15:ef00 \ - --new=12::+4M \ - --change-name=12:CIDATA \ - --new=1:: \ - --attributes=1:set:2 + sgdisk "${disk_image}" \ + --new=15::+106M \ + --typecode=15:ef00 \ + --new=12::+4M \ + --change-name=12:CIDATA \ + --new=1:: \ fi ;; amd64) @@ -265,126 +172,30 @@ install_grub() { fi ;; riscv64) - if [ -n "${SUBARCH:-}" ]; then - # Per-device images - local my_d=$(dirname $(readlink -f ${0})) - echo "Adjusting GRUB defaults for ${ARCH}" - mkdir -p mountpoint/etc/default/grub.d/ - cp ${my_d}/riscv64/grub/10_cmdline.cfg mountpoint/etc/default/grub.d/ - echo "Installing GRUB for ${SUBARCH} board" - case "${SUBARCH}" in - "icicle") - cp ${my_d}/riscv64/grub/90_watchdog-thresh.cfg mountpoint/etc/default/grub.d/ - # The real U-Boot - chroot mountpoint apt-get install -qqy u-boot-microchip - loader="${loop_device}p13" - dd if=mountpoint/usr/lib/u-boot/microchip_icicle/u-boot.payload of=$loader - ;; - "nezha"|"licheerv") - echo "Reducing initramfs size for ${SUBARCH} board" - mkdir -p mountpoint/etc/initramfs-tools/conf.d/ - cp ${my_d}/riscv64/initramfs-tools/modules_list.conf mountpoint/etc/initramfs-tools/conf.d/ - cat ${my_d}/riscv64/initramfs-tools/allwinner >> mountpoint/etc/initramfs-tools/modules - chroot mountpoint update-initramfs -c -v -k all - echo "Installing U-Boot for ${SUBARCH} board" - if [ "$SUBARCH" = "licheerv" ]; then - # cryptsetup-initramfs is a large contributor of the initrd size: we have to - # remove it for the LicheeRV board, otherwise it fails to boot. cryptsetup-initramfs - # needs to embed plymouth (and then the drm/gpu stuff) for interacting with the user - # to decrypt the rootfs (passphrase key). - chroot mountpoint bash -c "apt remove -qqy cryptsetup-initramfs" - fi - # u-boot-nezha supports both the LicheeRV and the Nezha D1. - chroot mountpoint apt-get install -qqy u-boot-nezha - # Since version 2022.10 U-Boot SPL and U-Boot are installed onto the same partition. - # Package nezha-boot0 is not needed anymore. - loader1="${loop_device}p13" - dd if=mountpoint/usr/lib/u-boot/${SUBARCH}/u-boot-sunxi-with-spl.bin of=$loader1 - ;; - "pic64gx") - cp ${my_d}/riscv64/grub/90_watchdog-thresh.cfg mountpoint/etc/default/grub.d/ - # u-boot-pic64gx contains the vendor U-Boot - chroot mountpoint apt-get install -qqy u-boot-pic64gx - loader="${loop_device}p13" - dd if=mountpoint/usr/lib/u-boot-pic64gx/u-boot.payload of=$loader - ;; - "visionfive") - # factory u-boot requires a p3 partition with /boot/uEnv.txt file - uenv_dev="${loop_device}p3" - mkfs.ext4 "${uenv_dev}" - uenv_mnt_dir=`mktemp -d uenvXXX` - mount "${uenv_dev}" "${uenv_mnt_dir}" - mkdir -p "${uenv_mnt_dir}"/boot - - cat <<'EOF' >${uenv_mnt_dir}/boot/uEnv.txt -scriptaddr=0x88100000 -script_offset_f=0x1fff000 -script_size_f=0x1000 - -kernel_addr_r=0x84000000 -kernel_comp_addr_r=0x90000000 -kernel_comp_size=0x10000000 - -fdt_addr_r=0x88000000 -ramdisk_addr_r=0x88300000 - -bootcmd=load mmc 0:f ${kernel_addr_r} /EFI/ubuntu/grubriscv64.efi; bootefi ${kernel_addr_r} -bootcmd_mmc0=devnum=0; run mmc_boot - -ipaddr=192.168.120.200 -netmask=255.255.255.0 -EOF - - umount "${uenv_mnt_dir}" - rmdir "${uenv_mnt_dir}" - ;; - "visionfive2"|"milkvmars"|"jh7110") - cp ${my_d}/riscv64/grub/90_watchdog-thresh.cfg mountpoint/etc/default/grub.d/ - chroot mountpoint apt-get install -qqy u-boot-starfive - # U-Boot SPL - loader1="${loop_device}p13" - # Main U-Boot - loader2="${loop_device}p2" - dd if=mountpoint/usr/lib/u-boot/starfive_visionfive2/u-boot-spl.bin.normal.out of=$loader1 - dd if=mountpoint/usr/lib/u-boot/starfive_visionfive2/u-boot.itb of=$loader2 - ;; - unmatched) - cp ${my_d}/riscv64/grub/90_watchdog-thresh.cfg mountpoint/etc/default/grub.d/ - chroot mountpoint apt-get install -qqy u-boot-sifive - # U-Boot SPL - loader1="${loop_device}p13" - # Main U-Boot - loader2="${loop_device}p14" - dd if=mountpoint/usr/lib/u-boot/sifive_unmatched/u-boot-spl.bin of=$loader1 - dd if=mountpoint/usr/lib/u-boot/sifive_unmatched/u-boot.itb of=$loader2 - ;; - esac - echo "Copying device trees" - kver=$(ls mountpoint/lib/modules | sort -V | tail -n 1) - dtb_src_dirs=( - "mountpoint/usr/lib/linux-image-$kver" - "mountpoint/lib/firmware/$kver/device-tree" - ) - dtb_tgt_dir="mountpoint/boot/efi/dtb/" - mkdir -p "$dtb_tgt_dir" - for src_dir in "${dtb_src_dirs[@]}"; do - [ -d "$src_dir" ] && cp -r -v "$src_dir"/* "$dtb_tgt_dir" || echo "Skipping missing: $src_dir" - done - chroot mountpoint bash -c 'FK_FORCE=yes apt-get install -qqy grub-efi-riscv64 flash-kernel' - efi_target=riscv64-efi - # Provide end-user modifyable CIDATA - cidata_dev="${loop_device}p12" - setup_cidata "${cidata_dev}" - # Provide stock nocloud datasource - # Allow interactive login without a cloud datasource. - setup_cinocloud mountpoint - else - # Other images e.g. cloud images - chroot mountpoint apt-get install -qqy u-boot-menu grub-efi-riscv64 - efi_target=riscv64-efi - - chroot mountpoint u-boot-update - fi + # Per-device images + local my_d=$(dirname $(readlink -f ${0})) + echo "Adjusting GRUB defaults for ${ARCH}/${SUBARCH}" + mkdir -p mountpoint/etc/default/grub.d/ + cp ${my_d}/riscv64/grub/10_cmdline.cfg mountpoint/etc/default/grub.d/ + echo "Copying device trees" + kver=$(ls mountpoint/lib/modules | sort -V | tail -n 1) + dtb_src_dirs=( + "mountpoint/usr/lib/linux-image-$kver" + "mountpoint/lib/firmware/$kver/device-tree" + ) + dtb_tgt_dir="mountpoint/boot/efi/dtb/" + mkdir -p "$dtb_tgt_dir" + for src_dir in "${dtb_src_dirs[@]}"; do + [ -d "$src_dir" ] && cp -r -v "$src_dir"/* "$dtb_tgt_dir" || echo "Skipping missing: $src_dir" + done + chroot mountpoint bash -c 'FK_FORCE=yes apt-get install -qqy grub-efi-riscv64 flash-kernel' + efi_target=riscv64-efi + # Provide end-user modifyable CIDATA + cidata_dev="${loop_device}p12" + setup_cidata "${cidata_dev}" + # Provide stock nocloud datasource + # Allow interactive login without a cloud datasource. + setup_cinocloud mountpoint ;; esac diff --git a/live-build/ubuntu-cpc/hooks.d/base/riscv64/grub/90_watchdog-thresh.cfg b/live-build/ubuntu-cpc/hooks.d/base/riscv64/grub/90_watchdog-thresh.cfg deleted file mode 100644 index e9988e50..00000000 --- a/live-build/ubuntu-cpc/hooks.d/base/riscv64/grub/90_watchdog-thresh.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# When booting with Radeon GPUs a soft lockup was observed. Increase the -# watchdog threshhold. -GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT sysctl.kernel.watchdog_thresh=60" diff --git a/live-build/ubuntu-cpc/hooks.d/base/riscv64/initramfs-tools/allwinner b/live-build/ubuntu-cpc/hooks.d/base/riscv64/initramfs-tools/allwinner deleted file mode 100644 index 28ac2b70..00000000 --- a/live-build/ubuntu-cpc/hooks.d/base/riscv64/initramfs-tools/allwinner +++ /dev/null @@ -1,3 +0,0 @@ -# Required drivers to boot off MMC -mmc-block -sunxi-mmc diff --git a/live-build/ubuntu-cpc/hooks.d/base/riscv64/u-boot-menu/10_cmdline.conf b/live-build/ubuntu-cpc/hooks.d/base/riscv64/u-boot-menu/10_cmdline.conf deleted file mode 100644 index 231c2c23..00000000 --- a/live-build/ubuntu-cpc/hooks.d/base/riscv64/u-boot-menu/10_cmdline.conf +++ /dev/null @@ -1 +0,0 @@ -U_BOOT_PARAMETERS="ro efi=debug earlycon=sbi" diff --git a/live-build/ubuntu-cpc/hooks.d/base/riscv64/u-boot-menu/90_watchdog-thresh.conf b/live-build/ubuntu-cpc/hooks.d/base/riscv64/u-boot-menu/90_watchdog-thresh.conf deleted file mode 100644 index d6340d33..00000000 --- a/live-build/ubuntu-cpc/hooks.d/base/riscv64/u-boot-menu/90_watchdog-thresh.conf +++ /dev/null @@ -1,3 +0,0 @@ -# When booting with Radeon GPUs a soft lockup was observed. Increase the -# watchdog threshhold. -U_BOOT_PARAMETERS="$U_BOOT_PARAMETERS sysctl.kernel.watchdog_thresh=60"