From: kn Date: Mon, 5 Sep 2022 10:03:50 +0000 (+0000) Subject: Fix file specification, zap partition bits, rectify disk naming errors X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2c39d9d4a3b43a0020832abe472f5f0eff0125de;p=openbsd Fix file specification, zap partition bits, rectify disk naming errors In boot_macppc(8), the current format a) claims to support specific disk/MBR partitions which ofwboot clearly does not parse as such and b) lacks markup to make clear which optional parts can (not) be omitted in what way. Fixing both turns promdev:partition/filename options into [[promdev:]filename] [-acds] Same goes for boot(8/macppc), which has been apparently has been copied from boot(8/amd64) without accounting for all platform specific details. On amd64, biosboot(8) sees disks as 'sd' which (accidentially?) matches the kernel driver's sd(4) name; it also supports specific disklabel(5) slices, so amd64 can do 'sd0a:/bsd'. On macppc, disks show up as 'ide', 'cd' or 'hd' which stems from OpenFirmware alone, not matching the wd(4) driver's name. Also, ofwboot always boots off the 'a' label, so macppc can only do 'hd:/bsd'. Found while installing OpenBSD/macppc from CD inside QEMU but failing to boot from disk inside QEMU and consulting our manual pages for help wrt. specifying a boot device. Turns out QEMU's OpenBIOS simply cannot boot from MSDOS filesystems (thanks gkoehler), so it wouldn't work no matter what boot file specification I'd use. tests/agreement gkoehler Feedback OK miod OK tobhe OK jmc on a previous boot_macppc.8 diff --- diff --git a/share/man/man8/man8.macppc/boot_macppc.8 b/share/man/man8/man8.macppc/boot_macppc.8 index af4fbbceedf..4a4fc699245 100644 --- a/share/man/man8/man8.macppc/boot_macppc.8 +++ b/share/man/man8/man8.macppc/boot_macppc.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: boot_macppc.8,v 1.21 2014/02/14 12:18:27 schwarze Exp $ +.\" $OpenBSD: boot_macppc.8,v 1.22 2022/09/05 10:03:50 kn Exp $ .\" .\" Copyright (c) 1992, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)boot_macppc.8 .\" -.Dd $Mdocdate: February 14 2014 $ +.Dd $Mdocdate: September 5 2022 $ .Dt BOOT_MACPPC 8 macppc .Os .Sh NAME @@ -93,16 +93,15 @@ If the special line is entered, the bootloader will attempt to restart the machine. .Pp The file specification used is of the form: -.Dl promdev:partition/filename options -where: -.Dq promdev +.Pp +.Dl Oo Oo Ar promdev : Oc Ns Ar filename Oc Op Fl acds +.Pp +where +.Ar promdev is an optional Open Firmware device name (such as .Dq hd or -.Dq ide ) -and -.Dq partition -is an optional disk partition number. +.Dq ide ) . Normal line editing characters can be used when typing the file specification. .Pp diff --git a/sys/arch/macppc/stand/boot.8 b/sys/arch/macppc/stand/boot.8 index 911bb5057d8..153a904bb00 100644 --- a/sys/arch/macppc/stand/boot.8 +++ b/sys/arch/macppc/stand/boot.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: boot.8,v 1.4 2019/12/23 12:44:34 bluhm Exp $ +.\" $OpenBSD: boot.8,v 1.5 2022/09/05 10:03:50 kn Exp $ .\" .\" Copyright (c) 1997-2001 Michael Shalayeff .\" All rights reserved. @@ -25,7 +25,7 @@ .\" THE POSSIBILITY OF SUCH DAMAGE. .\" .\" -.Dd $Mdocdate: December 23 2019 $ +.Dd $Mdocdate: September 5 2022 $ .Dt BOOT 8 macppc .Os .Sh NAME @@ -125,29 +125,26 @@ The following commands are accepted at the .Nm prompt: .Bl -tag -width shorten -.It Ic boot Op Ar image Op Fl acds -Boots the kernel image specified by +.It Ic boot Oo Oo Ar device : Oc Ns Ar image Oc Op Fl acds +Boots the specified kernel image with any options given. +If +.Ar device +or .Ar image -with any options given. -Image specification consists of a pair -.Ar device : Ns Ar filename ; -either or both can be omitted (`:' is not needed if both are omitted), -in which case values from +are omitted, values from the .Nm variables will be used. .Pp The only bootable devices, at the moment, are IDE devices connected to the internal controller; they are detected as -.Sq wd +.Sq hd devices. Therefore, to boot kernel .Pa /bsd -from slice -.Sq a on the first hard drive, specify -.Dq boot wd0a:/bsd . +.Dq boot hd:/bsd . .Bl -tag -width _a_ .It Fl a Causes the kernel to ask for the @@ -205,8 +202,10 @@ Debug flag if was compiled with DEBUG defined. .It Ic device Boot device name (e.g., -.Li wd0a , -.Li wd1a ) . +.Li ide , +.Li ide0 , +.Li hd , +.Li hd1 ) . .It Ic howto Options to pass to the loaded kernel. .It Ic image @@ -277,7 +276,7 @@ Once booted, such changes can be made permanent by using .Fl e option. .Pp -.Dl boot> boot wd1a:/bsd -c +.Dl boot> boot hd:/bsd -c .Sh SEE ALSO .Xr gzip 1 , .Xr autoconf 4 , diff --git a/sys/arch/macppc/stand/ofdev.c b/sys/arch/macppc/stand/ofdev.c index 0ce6e9a933a..066403f2a41 100644 --- a/sys/arch/macppc/stand/ofdev.c +++ b/sys/arch/macppc/stand/ofdev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofdev.c,v 1.26 2021/03/11 11:16:59 jsg Exp $ */ +/* $OpenBSD: ofdev.c,v 1.27 2022/09/05 10:03:50 kn Exp $ */ /* $NetBSD: ofdev.c,v 1.1 1997/04/16 20:29:20 thorpej Exp $ */ /* @@ -55,7 +55,6 @@ char opened_name[256]; /* * this function is passed [device specifier]:[kernel] - * however a device specifier may contain a ':' */ static int parsename(char *str, char **file)