From 75cc519f343560c09d08a34573c805e4ce7b93d6 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Tue, 28 Mar 2017 06:39:54 +0000 Subject: [PATCH] sys/boot/common: Make geli(4) support optional in MI sources This saves a negligible amount of memory for non-geli enabled bootloaders. MFC after: 1 week Sponsored by: Dell EMC Isilon --- sys/boot/common/Makefile.inc | 3 +++ sys/boot/common/module.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/sys/boot/common/Makefile.inc b/sys/boot/common/Makefile.inc index c83f00975814..7b0e81c85570 100644 --- a/sys/boot/common/Makefile.inc +++ b/sys/boot/common/Makefile.inc @@ -37,6 +37,9 @@ CFLAGS+= -DLOADER_GPT_SUPPORT CFLAGS+= -DLOADER_MBR_SUPPORT .endif .endif +.if !defined(LOADER_NO_GELI_SUPPORT) +CFLAGS+= -DLOADER_GELI_SUPPORT +.endif .if defined(HAVE_BCACHE) SRCS+= bcache.c diff --git a/sys/boot/common/module.c b/sys/boot/common/module.c index ce232b690da1..838c9d109c38 100644 --- a/sys/boot/common/module.c +++ b/sys/boot/common/module.c @@ -183,6 +183,7 @@ command_load(int argc, char *argv[]) return (error == 0 ? CMD_OK : CMD_CRIT); } +#ifdef LOADER_GELI_SUPPORT COMMAND_SET(load_geli, "load_geli", "load a geli key", command_load_geli); static int @@ -221,6 +222,7 @@ command_load_geli(int argc, char *argv[]) sprintf(typestr, "%s:geli_keyfile%d", argv[1], num); return (file_loadraw(argv[2], typestr, 1) ? CMD_OK : CMD_ERROR); } +#endif void unload(void)