]>
Commit | Line | Data |
---|---|---|
3a6ce677 BR |
1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
2 | ||
3 | #include "secure-boot.h" | |
4 | #include "util.h" | |
5 | ||
6 | BOOLEAN secure_boot_enabled(void) { | |
7 | BOOLEAN secure; | |
8 | EFI_STATUS err; | |
9 | ||
10 | err = efivar_get_boolean_u8(EFI_GLOBAL_GUID, L"SecureBoot", &secure); | |
11 | ||
12 | return !EFI_ERROR(err) && secure; | |
13 | } | |
8b3d4ff0 MB |
14 | |
15 | #ifdef SBAT_DISTRO | |
16 | static const char sbat[] _used_ _section_ (".sbat") _align_ (512) = | |
17 | "sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md\n" | |
18 | SBAT_PROJECT ",1,The systemd Developers," SBAT_PROJECT "," PROJECT_VERSION "," PROJECT_URL "\n" | |
19 | SBAT_PROJECT "." SBAT_DISTRO "," STRINGIFY(SBAT_DISTRO_GENERATION) "," SBAT_DISTRO_SUMMARY "," SBAT_DISTRO_PKGNAME "," SBAT_DISTRO_VERSION "," SBAT_DISTRO_URL "\n"; | |
20 | #endif |