summaryrefslogtreecommitdiff
path: root/distrib/riscv64
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2022-02-03 10:27:34 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2022-02-03 10:27:34 +0000
commit9c298fe7fbd6345b77d14f6f96e1b8f4904b70b3 (patch)
treec4434ce72144ee9a0210968c1419c199e293b773 /distrib/riscv64
parentbbbd2ad05cddc1b19b7cd6a462a3ac722950ec76 (diff)
Use installboot(8) in install.md of riscv64.
OK kettenis@ deraadt@
Diffstat (limited to 'distrib/riscv64')
-rw-r--r--distrib/riscv64/ramdisk/install.md19
-rw-r--r--distrib/riscv64/ramdisk/list3
2 files changed, 9 insertions, 13 deletions
diff --git a/distrib/riscv64/ramdisk/install.md b/distrib/riscv64/ramdisk/install.md
index 426f91e332d..5c83395f2f4 100644
--- a/distrib/riscv64/ramdisk/install.md
+++ b/distrib/riscv64/ramdisk/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.3 2021/08/02 21:46:39 kettenis Exp $
+# $OpenBSD: install.md,v 1.4 2022/02/03 10:27:33 visa Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -33,16 +33,13 @@
#
NCPU=$(sysctl -n hw.ncpufound)
-NEWFSARGS_msdos="-F 16 -L boot"
-MOUNT_ARGS_msdos="-o-l"
md_installboot() {
- local _disk=/dev/$1
-
- mount ${MOUNT_ARGS_msdos} ${_disk}i /mnt/mnt
- mkdir -p /mnt/mnt/efi/boot
- cp /mnt/usr/mdec/BOOTRISCV64.EFI /mnt/mnt/efi/boot/bootriscv64.efi
- echo bootriscv64.efi > /mnt/mnt/efi/boot/startup.nsh
+ if ! installboot -r /mnt ${1}; then
+ echo "\nFailed to install bootblocks."
+ echo "You will not be able to boot OpenBSD from ${1}."
+ exit
+ fi
}
md_prep_fdisk() {
@@ -53,7 +50,6 @@ md_prep_fdisk() {
local bootsectorsize="32768"
local bootsectorend=$(($bootsectorstart + $bootsectorsize))
local bootfstype="msdos"
- local newfs_args=${NEWFSARGS_msdos}
while :; do
_d=whole
@@ -83,8 +79,7 @@ write
quit
__EOT
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.
diff --git a/distrib/riscv64/ramdisk/list b/distrib/riscv64/ramdisk/list
index 23a2fb5c1f4..b765f96d74d 100644
--- a/distrib/riscv64/ramdisk/list
+++ b/distrib/riscv64/ramdisk/list
@@ -1,4 +1,4 @@
-# $OpenBSD: list,v 1.5 2021/10/04 01:34:29 kevlo Exp $
+# $OpenBSD: list,v 1.6 2022/02/03 10:27:33 visa Exp $
SRCDIRS distrib/special
@@ -62,6 +62,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/pwd_mkdb
ARGVLINK ksh -sh
SPECIAL rm bin/md5