aboutsummaryrefslogtreecommitdiff
path: root/stand/userboot
diff options
context:
space:
mode:
authorIan Lepore <ian@FreeBSD.org>2018-07-13 17:50:25 +0000
committerIan Lepore <ian@FreeBSD.org>2018-07-13 17:50:25 +0000
commitc1418270b28edf9b99044181e9f48dfc0a7dc160 (patch)
tree7a3117380cd78465ddbc331e510018710a64f701 /stand/userboot
parent6ac05ba48600d2174b455f3773059bfbbfb9858c (diff)
downloadsrc-c1418270b28edf9b99044181e9f48dfc0a7dc160.tar.gz
src-c1418270b28edf9b99044181e9f48dfc0a7dc160.zip
Extend loader(8) geli support to all architectures and all disk-like devices.
This moves the bulk of the geli support from lib386/biosdisk.c into a new geli/gelidev.c which implements a devsw-type device whose dv_strategy() function handles geli decryption. Support for all arches comes from moving the taste-and-attach code to the devopen() function in libsa. After opening any DEVT_DISK device, devopen() calls the new function geli_probe_and_attach(), which will "attach" the geli code to the open_file struct by creating a geli_devdesc instance to replace the disk_devdesc instance in the open_file. That routes all IO for the device through the geli code. A new public geli_add_key() function is added, to allow arch/vendor-specific code to add keys obtained from custom hardware or other sources. With these changes, geli support will be compiled into all variations of loader(8) on all arches because the default is WITH_LOADER_GELI. Relnotes: yes Sponsored by: Microchip Technology Inc Differential Revision: https://reviews.freebsd.org/D15743
Notes
Notes: svn path=/head/; revision=336252
Diffstat (limited to 'stand/userboot')
-rw-r--r--stand/userboot/userboot/bootinfo32.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/stand/userboot/userboot/bootinfo32.c b/stand/userboot/userboot/bootinfo32.c
index 4f1cef61361b..ecd4ccf2edd8 100644
--- a/stand/userboot/userboot/bootinfo32.c
+++ b/stand/userboot/userboot/bootinfo32.c
@@ -36,6 +36,10 @@ __FBSDID("$FreeBSD$");
#include "bootstrap.h"
#include "libuserboot.h"
+#ifdef LOADER_GELI_SUPPORT
+#include "geliboot.h"
+#endif
+
static struct bootinfo bi;
/*
@@ -200,6 +204,9 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t
file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp);
file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend);
bios_addsmapdata(kfp);
+#ifdef LOADER_GELI_SUPPORT
+ geli_export_key_metadata(kfp);
+#endif
/* Figure out the size and location of the metadata */
*modulep = addr;