-.\" $OpenBSD: boot_sparc64.8,v 1.16 2015/10/03 13:22:06 stsp Exp $
+.\" $OpenBSD: boot_sparc64.8,v 1.17 2022/08/04 09:16:53 kn Exp $
.\"
.\" Copyright (c) 1992, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" @(#)boot_sparc.8 8.2 (Berkeley) 4/19/94
.\"
-.Dd $Mdocdate: October 3 2015 $
+.Dd $Mdocdate: August 4 2022 $
.Dt BOOT_SPARC64 8 sparc64
.Os
.Sh NAME
.Pa bsd
by default, unless the
.Va boot-file
-variable is set, or a different filename has been specified
+variable contains a filename, or a different filename has been specified
in the boot command.
To reset this variable to its default, empty, value, type the following:
.Pp
.D1 Sy ok Li set-default boot-file
.Pp
-To boot from a
-.Xr softraid 4
-volume by default,
-.Va boot-device
-must be set to a disk device hosting a chunk of the softraid volume:
-.Pp
-.D1 Sy ok Li setenv boot-device disk0
-.Pp
-and
-.Va boot-file
-must contain the
-.Pq Pa sr
-device name of the softraid volume and optionally a partition letter
-and/or kernel:
-.Pp
-.D1 Sy ok Li setenv boot-file sr0a:/bsd
-.Pp
Autoboot is enabled by setting the
.Va auto-boot?\&
variable to
-/* $OpenBSD: boot.c,v 1.38 2021/10/26 10:45:55 patrick Exp $ */
+/* $OpenBSD: boot.c,v 1.39 2022/08/04 09:16:53 kn Exp $ */
/* $NetBSD: boot.c,v 1.3 2001/05/31 08:55:19 mrg Exp $ */
/*
* Copyright (c) 1997, 1999 Eduardo E. Horvath. All rights reserved.
}
#ifdef SOFTRAID
-/* Set bootdev_dip to the softraid boot volume, if specified. */
+/*
+ * Set bootdev_dip to the softraid boot volume, if specified.
+ * Otherwise default to the softraid volume on the boot device, if any.
+ */
static int
srbootdev(const char *bootline)
{
printf("Unknown device: sr%d\n", unit);
return ENODEV;
}
+ } else {
+ struct sr_boot_chunk *bc;
+
+ /*
+ * Check if the boot device is a member of any of the assembled
+ * softraid volumes.
+ */
+ SLIST_FOREACH(bv, &sr_volumes, sbv_link) {
+ if ((bv->sbv_flags & BIOC_SCBOOTABLE) == 0)
+ continue;
+
+ SLIST_FOREACH(bc, &bv->sbv_chunks, sbc_link) {
+ struct diskinfo *dip = bc->sbc_diskinfo;
+
+ if (!strcmp(dip->path, bootdev))
+ break;
+ }
+ if (bc != NULL)
+ break;
+ }
+ }
+ if (bv != NULL) {
if ((bv->sbv_flags & BIOC_SCBOOTABLE) == 0) {
printf("device sr%d is not bootable\n", unit);
return ENODEV;