|
|
@ -132,6 +132,23 @@ create_partitions() {
|
|
|
|
--change-name=3:uEnv \
|
|
|
|
--change-name=3:uEnv \
|
|
|
|
--new=1:: \
|
|
|
|
--new=1:: \
|
|
|
|
--attributes=1:set:2
|
|
|
|
--attributes=1:set:2
|
|
|
|
|
|
|
|
elif [ "${SUBARCH:-}" = "visionfive2" ]; then
|
|
|
|
|
|
|
|
# VisionFive 2
|
|
|
|
|
|
|
|
sgdisk "${disk_image}" \
|
|
|
|
|
|
|
|
--set-alignment=4096 \
|
|
|
|
|
|
|
|
--new=13:4096:8191 \
|
|
|
|
|
|
|
|
--typecode=13:2E54B353-1271-4842-806F-E436D6AF6985 \
|
|
|
|
|
|
|
|
--change-name=13:loader1 \
|
|
|
|
|
|
|
|
--new=2:8192:16383 \
|
|
|
|
|
|
|
|
--typecode=2:7a097280-70d2-44bc-886c-ff5ffbb7b098 \
|
|
|
|
|
|
|
|
--change-name=2:loader2 \
|
|
|
|
|
|
|
|
--new=12:16384:24575 \
|
|
|
|
|
|
|
|
--change-name=12:CIDATA \
|
|
|
|
|
|
|
|
--new=15:24576:229375 \
|
|
|
|
|
|
|
|
--typecode=15:ef00 \
|
|
|
|
|
|
|
|
--change-name=15:ESP \
|
|
|
|
|
|
|
|
--new=1:229376: \
|
|
|
|
|
|
|
|
--attributes=1:set:2
|
|
|
|
else
|
|
|
|
else
|
|
|
|
# preinstalled server, currently FU540
|
|
|
|
# preinstalled server, currently FU540
|
|
|
|
# FU740 too in the future
|
|
|
|
# FU740 too in the future
|
|
|
@ -377,8 +394,32 @@ EOF
|
|
|
|
# without a cloud datasource.
|
|
|
|
# without a cloud datasource.
|
|
|
|
setup_cinocloud mountpoint
|
|
|
|
setup_cinocloud mountpoint
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
|
|
|
|
"visionfive2")
|
|
|
|
|
|
|
|
echo "Installing GRUB for ${SUBARCH} board"
|
|
|
|
|
|
|
|
cp ${my_d}/riscv64/grub/90_watchdog-thresh.cfg mountpoint/etc/default/grub.d/
|
|
|
|
|
|
|
|
# flash-kernel is needed to install the dtb for update-grub: it uses the
|
|
|
|
|
|
|
|
# /proc/device-tree/model value to pick the correct dtb and as we are in a chroot,
|
|
|
|
|
|
|
|
# the model value is wrong and we need to use /etc/flash-kernel/machine instead.
|
|
|
|
|
|
|
|
# This explains why we install flash-kernel here.
|
|
|
|
|
|
|
|
chroot mountpoint mkdir -p /etc/flash-kernel/
|
|
|
|
|
|
|
|
chroot mountpoint bash -c "echo 'StarFive VisionFive 2 v1.3B' > /etc/flash-kernel/machine"
|
|
|
|
|
|
|
|
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="/dev/mapper${loop_device///dev/}p12"
|
|
|
|
|
|
|
|
setup_cidata "${cidata_dev}"
|
|
|
|
|
|
|
|
# Provide stock nocloud datasource
|
|
|
|
|
|
|
|
# Allow interactive login on baremetal board,
|
|
|
|
|
|
|
|
# without a cloud datasource.
|
|
|
|
|
|
|
|
setup_cinocloud mountpoint
|
|
|
|
|
|
|
|
# Flash-kernel creates boot.scr if it believes we did
|
|
|
|
|
|
|
|
# not boot in UEFi mode. Remove it so that we can boot
|
|
|
|
|
|
|
|
# via GRUB.
|
|
|
|
|
|
|
|
chroot mountpoint rm -f /boot/boot.scr
|
|
|
|
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
*)
|
|
|
|
cp ${my_d}/riscv64/grub/90_watchdog-thresh.cfg mountpoint/etc/default/grub.d/
|
|
|
|
cp ${my_d}/riscv64/grub/90_watchdog-thresh.cfg mountpoint/etc/default/grub.d/
|
|
|
|
|
|
|
|
echo "Installing u-boot-menu for ${SUBARCH} board"
|
|
|
|
chroot mountpoint apt-get install -qqy u-boot-menu #grub-efi-riscv64
|
|
|
|
chroot mountpoint apt-get install -qqy u-boot-menu #grub-efi-riscv64
|
|
|
|
mkdir -p mountpoint/etc/u-boot-menu/conf.d/
|
|
|
|
mkdir -p mountpoint/etc/u-boot-menu/conf.d/
|
|
|
|
cp ${my_d}/riscv64/u-boot-menu/*.conf mountpoint/etc/u-boot-menu/conf.d/
|
|
|
|
cp ${my_d}/riscv64/u-boot-menu/*.conf mountpoint/etc/u-boot-menu/conf.d/
|
|
|
@ -412,7 +453,11 @@ EOF
|
|
|
|
chroot mountpoint u-boot-update
|
|
|
|
chroot mountpoint u-boot-update
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${SUBARCH:-}" != "visionfive" ] && [ "${SUBARCH:-}" != "nezha" ] && [ "${SUBARCH:-}" != "licheerv" ] && [ "${SUBARCH:-}" != "icicle" ]; then
|
|
|
|
if [ "${SUBARCH:-}" != "nezha" ] && \
|
|
|
|
|
|
|
|
[ "${SUBARCH:-}" != "licheerv" ] && \
|
|
|
|
|
|
|
|
[ "${SUBARCH:-}" != "icicle" ] \
|
|
|
|
|
|
|
|
[ "${SUBARCH:-}" != "visionfive" ] && \
|
|
|
|
|
|
|
|
[ "${SUBARCH:-}" != "visionfive2" ]; then
|
|
|
|
## TODO remove below once we have grub-efi-riscv64 for the platforms
|
|
|
|
## TODO remove below once we have grub-efi-riscv64 for the platforms
|
|
|
|
rm mountpoint/tmp/device.map
|
|
|
|
rm mountpoint/tmp/device.map
|
|
|
|
umount mountpoint/boot/efi
|
|
|
|
umount mountpoint/boot/efi
|
|
|
|