Files
grub2/grub2-bls-loader-features.patch
Michael Chang b0ea2bc257 - Update to 2.14
* grub-2.14.tar.xz
- Removed tarball
  * grub-2.12.tar.xz
- Patch rediff
  * use-grub2-as-a-package-name.patch
  * grub2-secureboot-add-linuxefi.patch
  * grub2-secureboot-no-insmod-on-sb.patch
  * grub2-secureboot-chainloader.patch
  * grub2-linguas.sh-no-rsync.patch
  * grub2-s390x-01-Changes-made-and-files-added-in-order-to-allow-s390x.patch
  * grub2-s390x-03-output-7-bit-ascii.patch
  * grub2-s390x-04-grub2-install.patch
  * grub2-efi-chainload-harder.patch
  * grub2-emu-4-all.patch
  * grub2-lvm-allocate-metadata-buffer-from-raw-contents.patch
  * grub2-btrfs-01-add-ability-to-boot-from-subvolumes.patch
  * grub2-btrfs-03-follow_default.patch
  * grub2-btrfs-05-grub2-mkconfig.patch
  * grub2-btrfs-06-subvol-mount.patch
  * grub2-btrfs-10-config-directory.patch
  * grub2-efi-xen-cmdline.patch
  * grub2-Add-hidden-menu-entries.patch
  * grub2-suse-remove-linux-root-param.patch
  * 0003-bootp-New-net_bootp6-command.patch
  * 0008-efinet-Setting-DNS-server-from-UEFI-protocol.patch
  * 0001-add-support-for-UEFI-network-protocols.patch
  * 0001-kern-mm.c-Make-grub_calloc-inline.patch
  * 0002-cmdline-Provide-cmdline-functions-as-module.patch
  * 0002-ieee1275-powerpc-enables-device-mapper-discovery.patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=571
2026-01-29 02:43:06 +00:00

37 lines
1.6 KiB
Diff

Add support for LoaderFeatures EFI variable.
Index: grub-2.14~rc1/grub-core/normal/menu.c
===================================================================
--- grub-2.14~rc1.orig/grub-core/normal/menu.c
+++ grub-2.14~rc1/grub-core/normal/menu.c
@@ -46,6 +46,14 @@
{ 0x4a67b082, 0x0a4c, 0x41cf, { 0xb6, 0xc7, 0x44, 0x0b, 0x29, 0xbb, 0x8c, 0x4f } }
static grub_guid_t grub_efi_loader_guid = GRUB_EFI_LOADER_GUID;
+#define GRUB_EFI_LOADER_FEATURE_CONFIG_TIMEOUT (1 << 0)
+#define GRUB_EFI_LOADER_FEATURE_CONFIG_TIMEOUT_ONE_SHOT (1 << 1)
+#define GRUB_EFI_LOADER_FEATURE_ENTRY_DEFAULT (1 << 2)
+#define GRUB_EFI_LOADER_FEATURE_ENTRY_ONESHOT (1 << 3)
+#define GRUB_EFI_LOADER_FEATURE_BOOT_COUNTING (1 << 4)
+#define GRUB_EFI_LOADER_FEATURE_XBOOTLDR (1 << 5)
+#define GRUB_EFI_LOADER_FEATURE_MENU_DISABLE (1 << 13)
+
#endif
/* Time to delay after displaying an error message about a default/fallback
@@ -805,6 +813,15 @@ run_menu (grub_menu_t menu, int nested,
const char* val = grub_env_get ("enable_blscfg");
if (val && (val[0] == '1' || val[0] == 'y'))
{
+
+ static long loader_features =
+ GRUB_EFI_LOADER_FEATURE_ENTRY_DEFAULT |
+ GRUB_EFI_LOADER_FEATURE_ENTRY_ONESHOT |
+ GRUB_EFI_LOADER_FEATURE_BOOT_COUNTING |
+ GRUB_EFI_LOADER_FEATURE_XBOOTLDR;
+
+ grub_efi_set_variable("LoaderFeatures", &grub_efi_loader_guid, &loader_features, sizeof(long));
+
int oneshot_entry, default_entry_efi;
oneshot_entry = get_entry_from_efivar(menu, "LoaderEntryOneShot");
if (oneshot_entry != -1)