|
|
@ -166,7 +166,7 @@ create_partitions() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
create_and_mount_uefi_partition() {
|
|
|
|
create_and_mount_uefi_partition() {
|
|
|
|
uefi_dev="/dev/mapper${loop_device///dev/}p15"
|
|
|
|
uefi_dev="${loop_device}p15"
|
|
|
|
mountpoint="$1"
|
|
|
|
mountpoint="$1"
|
|
|
|
mkfs.vfat -F 32 -n UEFI "${uefi_dev}"
|
|
|
|
mkfs.vfat -F 32 -n UEFI "${uefi_dev}"
|
|
|
|
|
|
|
|
|
|
|
@ -203,7 +203,7 @@ install_grub() {
|
|
|
|
# Server preinstalled image
|
|
|
|
# Server preinstalled image
|
|
|
|
# Setup cidata sample data & nocloud fallback
|
|
|
|
# Setup cidata sample data & nocloud fallback
|
|
|
|
# Allows login on first boot with or without metadata
|
|
|
|
# Allows login on first boot with or without metadata
|
|
|
|
cidata_dev="/dev/mapper${loop_device///dev/}p14"
|
|
|
|
cidata_dev="${loop_device}p14"
|
|
|
|
setup_cidata "${cidata_dev}"
|
|
|
|
setup_cidata "${cidata_dev}"
|
|
|
|
setup_cinocloud mountpoint
|
|
|
|
setup_cinocloud mountpoint
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -215,7 +215,7 @@ install_grub() {
|
|
|
|
# Server preinstalled image
|
|
|
|
# Server preinstalled image
|
|
|
|
# Setup cidata sample data & nocloud fallback
|
|
|
|
# Setup cidata sample data & nocloud fallback
|
|
|
|
# Allows login on first boot with or without metadata
|
|
|
|
# Allows login on first boot with or without metadata
|
|
|
|
cidata_dev="/dev/mapper${loop_device///dev/}p14"
|
|
|
|
cidata_dev="${loop_device}p14"
|
|
|
|
setup_cidata "${cidata_dev}"
|
|
|
|
setup_cidata "${cidata_dev}"
|
|
|
|
setup_cinocloud mountpoint
|
|
|
|
setup_cinocloud mountpoint
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -227,7 +227,7 @@ install_grub() {
|
|
|
|
# Server preinstalled image
|
|
|
|
# Server preinstalled image
|
|
|
|
# Setup cidata sample data & nocloud fallback
|
|
|
|
# Setup cidata sample data & nocloud fallback
|
|
|
|
# Allows login on first boot with or without metadata
|
|
|
|
# Allows login on first boot with or without metadata
|
|
|
|
cidata_dev="/dev/mapper${loop_device///dev/}p13"
|
|
|
|
cidata_dev="${loop_device}p13"
|
|
|
|
setup_cidata "${cidata_dev}"
|
|
|
|
setup_cidata "${cidata_dev}"
|
|
|
|
setup_cinocloud mountpoint
|
|
|
|
setup_cinocloud mountpoint
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -253,10 +253,10 @@ install_grub() {
|
|
|
|
efi_target=riscv64-efi
|
|
|
|
efi_target=riscv64-efi
|
|
|
|
# The real U-Boot
|
|
|
|
# The real U-Boot
|
|
|
|
chroot mountpoint apt-get install -qqy u-boot-microchip
|
|
|
|
chroot mountpoint apt-get install -qqy u-boot-microchip
|
|
|
|
loader="/dev/mapper${loop_device///dev/}p13"
|
|
|
|
loader="${loop_device}p13"
|
|
|
|
dd if=mountpoint/usr/lib/u-boot/microchip_icicle/u-boot.payload of=$loader
|
|
|
|
dd if=mountpoint/usr/lib/u-boot/microchip_icicle/u-boot.payload of=$loader
|
|
|
|
# Provide end-user modifyable CIDATA
|
|
|
|
# Provide end-user modifyable CIDATA
|
|
|
|
cidata_dev="/dev/mapper${loop_device///dev/}p12"
|
|
|
|
cidata_dev="${loop_device}p12"
|
|
|
|
setup_cidata "${cidata_dev}"
|
|
|
|
setup_cidata "${cidata_dev}"
|
|
|
|
# Provide stock nocloud datasource
|
|
|
|
# Provide stock nocloud datasource
|
|
|
|
# Allow interactive login on baremetal board,
|
|
|
|
# Allow interactive login on baremetal board,
|
|
|
@ -297,15 +297,15 @@ install_grub() {
|
|
|
|
# nezha-boot0 is actually compatible with the LicheeRV boards (and probably other D1-based boards)
|
|
|
|
# nezha-boot0 is actually compatible with the LicheeRV boards (and probably other D1-based boards)
|
|
|
|
chroot mountpoint apt-get install -qqy nezha-boot0
|
|
|
|
chroot mountpoint apt-get install -qqy nezha-boot0
|
|
|
|
# FSBL, which gets U-Boot SPL
|
|
|
|
# FSBL, which gets U-Boot SPL
|
|
|
|
loader1="/dev/mapper${loop_device///dev/}p13"
|
|
|
|
loader1="${loop_device}p13"
|
|
|
|
dd if=mountpoint/usr/lib/u-boot/nezha/boot0_sdcard_sun20iw1p1.bin of=$loader1
|
|
|
|
dd if=mountpoint/usr/lib/u-boot/nezha/boot0_sdcard_sun20iw1p1.bin of=$loader1
|
|
|
|
# The real U-Boot
|
|
|
|
# The real U-Boot
|
|
|
|
# u-boot-nezha actually contains both the LicheeRV and the Nezha boards support
|
|
|
|
# u-boot-nezha actually contains both the LicheeRV and the Nezha boards support
|
|
|
|
chroot mountpoint apt-get install -qqy u-boot-nezha
|
|
|
|
chroot mountpoint apt-get install -qqy u-boot-nezha
|
|
|
|
loader2="/dev/mapper${loop_device///dev/}p14"
|
|
|
|
loader2="${loop_device}p14"
|
|
|
|
dd if=mountpoint/usr/lib/u-boot/${SUBARCH}/u-boot.toc1 of=$loader2
|
|
|
|
dd if=mountpoint/usr/lib/u-boot/${SUBARCH}/u-boot.toc1 of=$loader2
|
|
|
|
# Provide end-user modifyable CIDATA
|
|
|
|
# Provide end-user modifyable CIDATA
|
|
|
|
cidata_dev="/dev/mapper${loop_device///dev/}p12"
|
|
|
|
cidata_dev="${loop_device}p12"
|
|
|
|
setup_cidata "${cidata_dev}"
|
|
|
|
setup_cidata "${cidata_dev}"
|
|
|
|
# Provide stock nocloud datasource
|
|
|
|
# Provide stock nocloud datasource
|
|
|
|
# Allow interactive login on baremetal SiFive board,
|
|
|
|
# Allow interactive login on baremetal SiFive board,
|
|
|
@ -331,7 +331,7 @@ install_grub() {
|
|
|
|
efi_target=riscv64-efi
|
|
|
|
efi_target=riscv64-efi
|
|
|
|
|
|
|
|
|
|
|
|
# factory u-boot requires a p3 partition with /boot/uEnv.txt file
|
|
|
|
# factory u-boot requires a p3 partition with /boot/uEnv.txt file
|
|
|
|
uenv_dev="/dev/mapper${loop_device///dev/}p3"
|
|
|
|
uenv_dev="${loop_device}p3"
|
|
|
|
mkfs.ext4 "${uenv_dev}"
|
|
|
|
mkfs.ext4 "${uenv_dev}"
|
|
|
|
uenv_mnt_dir=`mktemp -d uenvXXX`
|
|
|
|
uenv_mnt_dir=`mktemp -d uenvXXX`
|
|
|
|
mount "${uenv_dev}" "${uenv_mnt_dir}"
|
|
|
|
mount "${uenv_dev}" "${uenv_mnt_dir}"
|
|
|
@ -359,7 +359,7 @@ EOF
|
|
|
|
umount "${uenv_mnt_dir}"
|
|
|
|
umount "${uenv_mnt_dir}"
|
|
|
|
rmdir "${uenv_mnt_dir}"
|
|
|
|
rmdir "${uenv_mnt_dir}"
|
|
|
|
# Provide end-user modifyable CIDATA
|
|
|
|
# Provide end-user modifyable CIDATA
|
|
|
|
cidata_dev="/dev/mapper${loop_device///dev/}p12"
|
|
|
|
cidata_dev="${loop_device}p12"
|
|
|
|
setup_cidata "${cidata_dev}"
|
|
|
|
setup_cidata "${cidata_dev}"
|
|
|
|
# Provide stock nocloud datasource
|
|
|
|
# Provide stock nocloud datasource
|
|
|
|
# Allow interactive login on baremetal SiFive board,
|
|
|
|
# Allow interactive login on baremetal SiFive board,
|
|
|
@ -376,13 +376,13 @@ EOF
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
chroot mountpoint apt-get install -qqy u-boot-sifive
|
|
|
|
chroot mountpoint apt-get install -qqy u-boot-sifive
|
|
|
|
# FSBL, which gets U-Boot SPL
|
|
|
|
# FSBL, which gets U-Boot SPL
|
|
|
|
loader1="/dev/mapper${loop_device///dev/}p13"
|
|
|
|
loader1="${loop_device}p13"
|
|
|
|
# The real U-Boot
|
|
|
|
# The real U-Boot
|
|
|
|
loader2="/dev/mapper${loop_device///dev/}p14"
|
|
|
|
loader2="${loop_device}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-spl.bin of=$loader1
|
|
|
|
dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot.itb of=$loader2
|
|
|
|
dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot.itb of=$loader2
|
|
|
|
# Provide end-user modifyable CIDATA
|
|
|
|
# Provide end-user modifyable CIDATA
|
|
|
|
cidata_dev="/dev/mapper${loop_device///dev/}p12"
|
|
|
|
cidata_dev="${loop_device}p12"
|
|
|
|
setup_cidata "${cidata_dev}"
|
|
|
|
setup_cidata "${cidata_dev}"
|
|
|
|
# Provide stock nocloud datasource
|
|
|
|
# Provide stock nocloud datasource
|
|
|
|
# Allow interactive login on baremetal SiFive board,
|
|
|
|
# Allow interactive login on baremetal SiFive board,
|
|
|
|