With softraid, OBP's boot-file variable aka. bootline may contain the
sofraid volume name and kernel file name delimited by a double colon, e.g.
"sr0", "sr0a", "sr0:", "sr0a:", "sr0:/bsd" or "sr0a:/bsd".
ofwboot parses this string, may fill in optional partition number ("a")
and/or optional kernel file name ("/bsd") and always prints the fully
qualified string reconstructed from parts as "Booting <bootline>":
{0} ok boot my-devalias sr0
[...]
Boot device: /virtual-devices@100/channel-devices@200/disk@0 File and args: sr0
[...]
Booting sr0:a/bsd
[...]
{0} ok boot my-devalias sr0a:/bsd
[...]
Boot device: /virtual-devices@100/channel-devices@200/disk@0 File and args: sr0a:/bsd
[...]
Booting sr0:a/bsd
[...]
Swap partition and delimiter to fix the reconstructed string, making it
suitable for copy/paste:
Booting sr0a:/bsd
This has not been an issue since the reconstructed string is only printed
and not (re)used anywhere.
OK kettenis
-/* $OpenBSD: ofdev.c,v 1.32 2021/12/01 17:25:35 kettenis Exp $ */
+/* $OpenBSD: ofdev.c,v 1.33 2022/07/27 12:32:03 kn Exp $ */
/* $NetBSD: ofdev.c,v 1.1 2000/08/20 14:58:41 mrg Exp $ */
/*
partition = 'a';
cp = &fname[0];
}
- snprintf(buf, sizeof buf, "sr%c:%c", volno, partition);
+ snprintf(buf, sizeof buf, "sr%c%c:", volno, partition);
if (strlcpy(opened_name, buf, sizeof opened_name)
>= sizeof opened_name)
return ENAMETOOLONG;