summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2022-08-12 20:17:47 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2022-08-12 20:17:47 +0000
commit7ece349108cf6c7ac501d35bbccd324c4a0a2390 (patch)
tree733e84bed19fc451b8b75f7e5754c5c5bdda285a /sys
parentc13d56bc20fca38aa7734a583d13374e4f2dfb36 (diff)
add support for booting from RAID 1C softraid(4) volumes on amd64
Only boot-loader changes are needed. Both installboot(8) and the kernel already do what is required to make this work. ok kn@ Tested: biosboot on vmm: kn, stsp biosboot and efiboot on server hardware: stsp
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/stand/efi32/efidev.c6
-rw-r--r--sys/arch/amd64/stand/efi64/efidev.c6
-rw-r--r--sys/arch/amd64/stand/efiboot/efidev.c6
-rw-r--r--sys/arch/amd64/stand/libsa/biosdev.c6
-rw-r--r--sys/arch/amd64/stand/libsa/softraid_amd64.c5
-rw-r--r--sys/lib/libsa/softraid.c4
6 files changed, 21 insertions, 12 deletions
diff --git a/sys/arch/amd64/stand/efi32/efidev.c b/sys/arch/amd64/stand/efi32/efidev.c
index e55f6352985..a841a08fcc1 100644
--- a/sys/arch/amd64/stand/efi32/efidev.c
+++ b/sys/arch/amd64/stand/efi32/efidev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: efidev.c,v 1.2 2020/12/09 18:10:18 krw Exp $ */
+/* $OpenBSD: efidev.c,v 1.3 2022/08/12 20:17:46 stsp Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -599,9 +599,11 @@ efiopen(struct open_file *f, ...)
return EADAPT;
}
- if (bv->sbv_level == 'C' && bv->sbv_keys == NULL)
+ if ((bv->sbv_level == 'C' || bv->sbv_level == 0x1C) &&
+ bv->sbv_keys == NULL) {
if (sr_crypto_unlock_volume(bv) != 0)
return EPERM;
+ }
if (bv->sbv_diskinfo == NULL) {
dip = alloc(sizeof(struct diskinfo));
diff --git a/sys/arch/amd64/stand/efi64/efidev.c b/sys/arch/amd64/stand/efi64/efidev.c
index e55f6352985..a841a08fcc1 100644
--- a/sys/arch/amd64/stand/efi64/efidev.c
+++ b/sys/arch/amd64/stand/efi64/efidev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: efidev.c,v 1.2 2020/12/09 18:10:18 krw Exp $ */
+/* $OpenBSD: efidev.c,v 1.3 2022/08/12 20:17:46 stsp Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -599,9 +599,11 @@ efiopen(struct open_file *f, ...)
return EADAPT;
}
- if (bv->sbv_level == 'C' && bv->sbv_keys == NULL)
+ if ((bv->sbv_level == 'C' || bv->sbv_level == 0x1C) &&
+ bv->sbv_keys == NULL) {
if (sr_crypto_unlock_volume(bv) != 0)
return EPERM;
+ }
if (bv->sbv_diskinfo == NULL) {
dip = alloc(sizeof(struct diskinfo));
diff --git a/sys/arch/amd64/stand/efiboot/efidev.c b/sys/arch/amd64/stand/efiboot/efidev.c
index 8fd81511be2..07c3a515a51 100644
--- a/sys/arch/amd64/stand/efiboot/efidev.c
+++ b/sys/arch/amd64/stand/efiboot/efidev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: efidev.c,v 1.38 2021/06/10 18:05:20 krw Exp $ */
+/* $OpenBSD: efidev.c,v 1.39 2022/08/12 20:17:46 stsp Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -580,9 +580,11 @@ efiopen(struct open_file *f, ...)
return EADAPT;
}
- if (bv->sbv_level == 'C' && bv->sbv_keys == NULL)
+ if ((bv->sbv_level == 'C' || bv->sbv_level == 0x1C) &&
+ bv->sbv_keys == NULL) {
if (sr_crypto_unlock_volume(bv) != 0)
return EPERM;
+ }
if (bv->sbv_diskinfo == NULL) {
dip = alloc(sizeof(struct diskinfo));
diff --git a/sys/arch/amd64/stand/libsa/biosdev.c b/sys/arch/amd64/stand/libsa/biosdev.c
index b64714b20e0..4e56de62c43 100644
--- a/sys/arch/amd64/stand/libsa/biosdev.c
+++ b/sys/arch/amd64/stand/libsa/biosdev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: biosdev.c,v 1.34 2020/12/09 18:10:18 krw Exp $ */
+/* $OpenBSD: biosdev.c,v 1.35 2022/08/12 20:17:46 stsp Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -543,9 +543,11 @@ biosopen(struct open_file *f, ...)
return EADAPT;
}
- if (bv->sbv_level == 'C' && bv->sbv_keys == NULL)
+ if ((bv->sbv_level == 'C' || bv->sbv_level == 0x1C) &&
+ bv->sbv_keys == NULL) {
if (sr_crypto_unlock_volume(bv) != 0)
return EPERM;
+ }
if (bv->sbv_diskinfo == NULL) {
dip = alloc(sizeof(struct diskinfo));
diff --git a/sys/arch/amd64/stand/libsa/softraid_amd64.c b/sys/arch/amd64/stand/libsa/softraid_amd64.c
index 4c6099d83de..c4802372fda 100644
--- a/sys/arch/amd64/stand/libsa/softraid_amd64.c
+++ b/sys/arch/amd64/stand/libsa/softraid_amd64.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_amd64.c,v 1.7 2021/06/02 22:44:26 krw Exp $ */
+/* $OpenBSD: softraid_amd64.c,v 1.8 2022/08/12 20:17:46 stsp Exp $ */
/*
* Copyright (c) 2012 Joel Sing <jsing@openbsd.org>
@@ -291,6 +291,7 @@ srprobe(void)
break;
case 1:
+ case 0x1C:
if (bv->sbv_chunk_no == bv->sbv_chunks_found)
bv->sbv_state = BIOC_SVONLINE;
else if (bv->sbv_chunks_found > 0)
@@ -348,7 +349,7 @@ sr_strategy(struct sr_boot_volume *bv, int rw, daddr_t blk, size_t size,
/* XXX - If I/O failed we should try another chunk... */
return dip->strategy(dip, rw, blk, size, buf, rsize);
- } else if (bv->sbv_level == 'C') {
+ } else if (bv->sbv_level == 'C' || bv->sbv_level == 0x1C) {
/* Select first online chunk. */
SLIST_FOREACH(bc, &bv->sbv_chunks, sbc_link)
diff --git a/sys/lib/libsa/softraid.c b/sys/lib/libsa/softraid.c
index 41e964f879e..76f1fece3bd 100644
--- a/sys/lib/libsa/softraid.c
+++ b/sys/lib/libsa/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.4 2018/08/10 16:41:35 jsing Exp $ */
+/* $OpenBSD: softraid.c,v 1.5 2022/08/12 20:17:46 stsp Exp $ */
/*
* Copyright (c) 2012 Joel Sing <jsing@openbsd.org>
@@ -66,7 +66,7 @@ sr_clear_keys(void)
struct sr_boot_keydisk *kd;
SLIST_FOREACH(bv, &sr_volumes, sbv_link) {
- if (bv->sbv_level != 'C')
+ if (bv->sbv_level != 'C' && bv->sbv_level != 0x1C)
continue;
if (bv->sbv_keys != NULL) {
explicit_bzero(bv->sbv_keys, SR_CRYPTO_KEYBLOCK_BYTES);