> Date: Fri, 18 Feb 2022 14:20:03 +0000
> From: Visa Hankala <[email protected]>
>
> Use installboot(8) in armv7 install.md.
>
> OK?
ok kettenis@
> Index: distrib/armv7/ramdisk/install.md
> ===================================================================
> RCS file: src/distrib/armv7/ramdisk/install.md,v
> retrieving revision 1.51
> diff -u -p -r1.51 install.md
> --- distrib/armv7/ramdisk/install.md 7 Feb 2022 20:24:30 -0000 1.51
> +++ distrib/armv7/ramdisk/install.md 18 Feb 2022 14:14:46 -0000
> @@ -31,7 +31,6 @@
> # machine dependent section of installation/upgrade script.
> #
>
> -NEWFSARGS_msdos="-F 16 -L boot"
> MOUNT_ARGS_msdos="-o-l"
>
> md_installboot() {
> @@ -47,10 +46,14 @@ md_installboot() {
> *) ;; # XXX: Handle unknown platform?
> esac
>
> - # Mount MSDOS partition, extract U-Boot and copy UEFI boot program
> + if ! installboot -r /mnt ${1}; then
> + echo "\nFailed to install bootblocks."
> + echo "You will not be able to boot OpenBSD from ${1}."
> + exit
> + fi
> +
> + # Apply some final tweaks on selected platforms
> mount ${MOUNT_ARGS_msdos} ${_disk}i /mnt/mnt
> - mkdir -p /mnt/mnt/efi/boot
> - cp /mnt/usr/mdec/BOOTARM.EFI /mnt/mnt/efi/boot/bootarm.efi
>
> _mdec=/usr/mdec/$_plat
>
> @@ -82,6 +85,8 @@ md_installboot() {
> bs=1024 seek=8 >/dev/null 2>&1
> ;;
> esac
> +
> + umount /mnt/mnt
> }
>
> md_prep_fdisk() {
> @@ -91,7 +96,6 @@ md_prep_fdisk() {
> local bootsectorstart="32768"
> local bootsectorsize="32768"
> local bootfstype="msdos"
> - local newfs_args=${NEWFSARGS_msdos}
>
> while :; do
> _d=whole
> @@ -106,8 +110,7 @@ md_prep_fdisk() {
> echo -n "Creating a ${bootfstype} partition and an
> OpenBSD partition for rest of $_disk..."
> fdisk -iy -b
> "${bootsectorsize}@${bootsectorstart}:${bootparttype}" ${_disk} >/dev/null
> echo "done."
> - disklabel $_disk 2>/dev/null | grep -q "^ i:" ||
> disklabel -w -d $_disk
> - newfs -t ${bootfstype} ${newfs_args} ${_disk}i
> + installboot -p $_disk
> return ;;
> [eE]*)
> # Manually configure the MBR.
> Index: distrib/armv7/ramdisk/list
> ===================================================================
> RCS file: src/distrib/armv7/ramdisk/list,v
> retrieving revision 1.46
> diff -u -p -r1.46 list
> --- distrib/armv7/ramdisk/list 4 Oct 2021 01:34:29 -0000 1.46
> +++ distrib/armv7/ramdisk/list 18 Feb 2022 14:14:47 -0000
> @@ -63,6 +63,7 @@ LINK instbin
> usr/bin/sed
> LINK instbin usr/bin/signify
> LINK instbin usr/bin/tee
> LINK instbin usr/sbin/chroot
> +LINK instbin usr/sbin/installboot
> LINK instbin usr/sbin/mkuboot
> LINK instbin usr/sbin/pwd_mkdb
> ARGVLINK ksh -sh
>
>