summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2012-10-09 12:58:08 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2012-10-09 12:58:08 +0000
commitc0a2bd79b51ad862778e94ac08e51d2b86a0352b (patch)
tree4e7556e20239e437ea446f0c21a116104a7eb89f /sys/arch/i386
parent9dd2347c33110f38758fee95a09b63b85c8251ec (diff)
Allow boot(8) to pass information to the kernel, regarding the softraid
volume that it booted off.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/bios.c19
-rw-r--r--sys/arch/i386/include/biosvar.h10
2 files changed, 27 insertions, 2 deletions
diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c
index d3fd9ce4f5d..4fea285a9e9 100644
--- a/sys/arch/i386/i386/bios.c
+++ b/sys/arch/i386/i386/bios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bios.c,v 1.96 2012/08/10 18:50:04 krw Exp $ */
+/* $OpenBSD: bios.c,v 1.97 2012/10/09 12:58:07 jsing Exp $ */
/*
* Copyright (c) 1997-2001 Michael Shalayeff
@@ -76,6 +76,11 @@
#include <dev/ic/comreg.h>
#endif
+#include "softraid.h"
+#if NSOFTRAID > 0
+#include <dev/softraidvar.h>
+#endif
+
struct bios_softc {
struct device sc_dev;
};
@@ -456,6 +461,7 @@ bios_getopt()
bootarg_t *q;
bios_ddb_t *bios_ddb;
bios_bootduid_t *bios_bootduid;
+ bios_bootsr_t *bios_bootsr;
#ifdef BIOS_DEBUG
printf("bootargv:");
@@ -554,6 +560,17 @@ bios_getopt()
bcopy(bios_bootduid, bootduid, sizeof(bootduid));
break;
+ case BOOTARG_BOOTSR:
+ bios_bootsr = (bios_bootsr_t *)q->ba_arg;
+#if NSOFTRAID > 0
+ bcopy(&bios_bootsr->uuid, &sr_bootuuid,
+ sizeof(sr_bootuuid));
+ bcopy(&bios_bootsr->maskkey, &sr_bootkey,
+ sizeof(sr_bootkey));
+#endif
+ explicit_bzero(bios_bootsr, sizeof(bios_bootsr_t));
+ break;
+
default:
#ifdef BIOS_DEBUG
printf(" unsupported arg (%d) %p", q->ba_type,
diff --git a/sys/arch/i386/include/biosvar.h b/sys/arch/i386/include/biosvar.h
index 54e64129af9..40f640b67d4 100644
--- a/sys/arch/i386/include/biosvar.h
+++ b/sys/arch/i386/include/biosvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: biosvar.h,v 1.58 2012/06/03 13:17:47 kettenis Exp $ */
+/* $OpenBSD: biosvar.h,v 1.59 2012/10/09 12:58:07 jsing Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -223,6 +223,14 @@ typedef struct _bios_bootduid {
u_char duid[8];
} __packed bios_bootduid_t;
+#define BOOTARG_BOOTSR 10
+#define BOOTSR_UUID_MAX 16
+#define BOOTSR_CRYPTO_MAXKEYBYTES 32
+typedef struct _bios_bootsr {
+ u_int8_t uuid[BOOTSR_UUID_MAX];
+ u_int8_t maskkey[BOOTSR_CRYPTO_MAXKEYBYTES];
+} __packed bios_bootsr_t;
+
#if defined(_KERNEL) || defined (_STANDALONE)
#ifdef _LOCORE