From 5324c335b1b1c1cdf40753d94360ec5debd8a46f Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Fri, 27 Dec 2019 16:18:37 +0100 Subject: [PATCH] afsplitter: Move into its own module While the AFSplitter code is currently used only by the luks module, upcoming support for luks2 will add a second module that depends on it. To avoid any linker errors when adding the code to both modules because of duplicated symbols, this commit moves it into its own standalone module afsplitter as a preparatory step. Signed-off-by: Patrick Steinhardt Reviewed-by: Daniel Kiper --- grub-core/Makefile.core.def | 6 +++++- grub-core/disk/AFSplitter.c | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 037de4023..db346a9f4 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1181,10 +1181,14 @@ module = { common = lib/json/json.c; }; +module = { + name = afsplitter; + common = disk/AFSplitter.c; +}; + module = { name = luks; common = disk/luks.c; - common = disk/AFSplitter.c; }; module = { diff --git a/grub-core/disk/AFSplitter.c b/grub-core/disk/AFSplitter.c index f5a8ddc61..249163ff0 100644 --- a/grub-core/disk/AFSplitter.c +++ b/grub-core/disk/AFSplitter.c @@ -21,9 +21,12 @@ */ #include +#include #include #include +GRUB_MOD_LICENSE ("GPLv2+"); + gcry_err_code_t AF_merge (const gcry_md_spec_t * hash, grub_uint8_t * src, grub_uint8_t * dst, grub_size_t blocksize, grub_size_t blocknumbers);