From: Jan Kiszka <[email protected]> No need for a separate module to hold those three global variables. Keep them in utils where they are already referenced, besides main.
Signed-off-by: Jan Kiszka <[email protected]> --- Makefile.am | 1 - bootguard.c | 20 -------------------- configure.ac | 2 +- include/utils.h | 1 + main.c | 3 +-- utils.c | 5 ++++- 6 files changed, 7 insertions(+), 25 deletions(-) delete mode 100644 bootguard.c diff --git a/Makefile.am b/Makefile.am index 9d49828..a4cf201 100644 --- a/Makefile.am +++ b/Makefile.am @@ -240,7 +240,6 @@ efi_sources = \ print.c \ utils.c \ loader_interface.c \ - bootguard.c \ main.c kernel_stub_name = kernel-stub$(MACHINE_TYPE_NAME).efi diff --git a/bootguard.c b/bootguard.c deleted file mode 100644 index 124f333..0000000 --- a/bootguard.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * EFI Boot Guard - * - * Copyright (c) Siemens AG, 2017 - * - * Authors: - * Andreas Reichel <[email protected]> - * - * This work is licensed under the terms of the GNU GPL, version 2. See - * the COPYING file in the top-level directory. - * - * SPDX-License-Identifier: GPL-2.0-only - */ - -#include "bootguard.h" -#include "utils.h" - -VOLUME_DESC *volumes = NULL; -UINTN volume_count = 128; -CHAR16 *boot_medium_path; diff --git a/configure.ac b/configure.ac index 8f78875..9f41b30 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_INIT([efibootguard], [efibootguard], []) -AC_CONFIG_SRCDIR([bootguard.c]) +AC_CONFIG_SRCDIR([main.c]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_AUX_DIR([build-aux]) diff --git a/include/utils.h b/include/utils.h index 982630f..2860258 100644 --- a/include/utils.h +++ b/include/utils.h @@ -30,6 +30,7 @@ typedef struct _VOLUME_DESC { extern VOLUME_DESC *volumes; extern UINTN volume_count; +extern CHAR16 *boot_medium_path; typedef enum { DOSFSLABEL, CUSTOMLABEL, NOLABEL } LABELMODE; diff --git a/main.c b/main.c index 3db2c91..5d28d08 100644 --- a/main.c +++ b/main.c @@ -1,7 +1,7 @@ /* * EFI Boot Guard * - * Copyright (c) Siemens AG, 2017-2025 + * Copyright (c) Siemens AG, 2017-2026 * * Authors: * Jan Kiszka <[email protected]> @@ -27,7 +27,6 @@ extern const unsigned long wdfuncs_start[]; extern const unsigned long wdfuncs_end[]; -extern CHAR16 *boot_medium_path; #define PCI_GET_VENDOR_ID(id) (UINT16)(id) #define PCI_GET_PRODUCT_ID(id) (UINT16)((id) >> 16) diff --git a/utils.c b/utils.c index c0feb61..99813be 100644 --- a/utils.c +++ b/utils.c @@ -19,9 +19,12 @@ #include "print.h" #include <utils.h> +VOLUME_DESC *volumes; +UINTN volume_count; +CHAR16 *boot_medium_path; + static BOOLEAN IsOnBootMedium(EFI_DEVICE_PATH *dp) { - extern CHAR16 *boot_medium_path; CHAR16 *device_path, *tmp; BOOLEAN result = FALSE; -- 2.47.3 -- You received this message because you are subscribed to the Google Groups "EFI Boot Guard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/efibootguard-dev/3e4bcc701e1ddfac1a25c43b5592c950ac9e1e31.1775543350.git.jan.kiszka%40siemens.com.
