[Merge] ~xypron/livecd-rootfs:riscv-xubuntu into livecd-rootfs:ubuntu/master
Heinrich Schuchardt
mp+494238 at code.launchpad.net
Fri Oct 17 05:28:45 UTC 2025
Diff comments:
> 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 2c35e13..bdc54bc 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
> @@ -265,126 +172,31 @@ 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/
> + rm -rf 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
This is just an indentation change due removing the superfluous
if [ -n "${SUBARCH:-}" ]; then
$SUBARCH is already checked in live-build/auto/config before
export IMAGE_TARGETS="disk-image-non-cloud"
0001-server-riscv-remove-unsupported-boards.patch-299-- setup_cidata "${cidata_dev}"
0001-server-riscv-remove-unsupported-boards.patch-300-- # Provide stock nocloud datasource
0001-server-riscv-remove-unsupported-boards.patch-301-- # Allow interactive login without a cloud datasource.
0001-server-riscv-remove-unsupported-boards.patch:302:- setup_cinocloud mountpoint
--
0001-server-riscv-remove-unsupported-boards.patch-330-+ setup_cidata "${cidata_dev}"
0001-server-riscv-remove-unsupported-boards.patch-331-+ # Provide stock nocloud datasource
0001-server-riscv-remove-unsupported-boards.patch-332-+ # Allow interactive login without a cloud datasource.
0001-server-riscv-remove-unsupported-boards.patch:333:+ setup_cinocloud mountpoint
> ;;
> esac
>
--
https://code.launchpad.net/~xypron/livecd-rootfs/+git/livecd-rootfs/+merge/494238
Your team Ubuntu Core Development Team is subscribed to branch livecd-rootfs:ubuntu/master.
More information about the Ubuntu-reviews
mailing list