summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2020-07-05 21:03:49 +0000
committerkettenis <kettenis@openbsd.org>2020-07-05 21:03:49 +0000
commitd73c33752e1abec32d79081bbc41c7e543a932f8 (patch)
tree31f5ff049c851d0502bb93ca7709c1cf0b037230
parentuse the intended operator in cpu_rnd_messybits(); ok kettenis@ (diff)
downloadwireguard-openbsd-d73c33752e1abec32d79081bbc41c7e543a932f8.tar.xz
wireguard-openbsd-d73c33752e1abec32d79081bbc41c7e543a932f8.zip
Create a grub.cfg file such that petitboot can load the kernel.
For this purpose we copy the kernel to the msdos filesystem. That kernel is named "boot" as we anticipate replacing it with a proper OpenBSD bootloader in the future. Based in a diff from deraadt@ ok deraadt@
-rw-r--r--distrib/powerpc64/ramdisk/install.md15
1 files changed, 14 insertions, 1 deletions
diff --git a/distrib/powerpc64/ramdisk/install.md b/distrib/powerpc64/ramdisk/install.md
index c308c9f0b4c..280869a186b 100644
--- a/distrib/powerpc64/ramdisk/install.md
+++ b/distrib/powerpc64/ramdisk/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.1 2020/07/04 21:11:04 kettenis Exp $
+# $OpenBSD: install.md,v 1.2 2020/07/05 21:03:49 kettenis Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -34,8 +34,21 @@
NCPU=$(sysctl -n hw.ncpufound)
NEWFSARGS_msdos="-F 16 -L boot"
+MOUNT_ARGS_msdos="-o-l"
md_installboot() {
+ local _disk=/dev/$1
+
+ # Mount MSDOS partition, copy boot kernel and create menu entry
+ mount ${MOUNT_ARGS_msdos} ${_disk}i /mnt/mnt
+ cp /mnt/bsd /mnt/mnt/boot
+ cat > /mnt/mnt/grub.cfg <<-__EOT
+ menuentry "OpenBSD" {
+ linux /boot
+ initrd /boot
+ }
+ __EOT
+ umount /mnt/mnt
}
md_prep_fdisk() {