Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package grub2 for openSUSE:Factory checked 
in at 2026-03-14 22:20:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/grub2 (Old)
 and      /work/SRC/openSUSE:Factory/.grub2.new.8177 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "grub2"

Sat Mar 14 22:20:23 2026 rev:385 rq:1338584 version:2.14

Changes:
--------
--- /work/SRC/openSUSE:Factory/grub2/grub2.changes      2026-03-03 
15:30:14.143323632 +0100
+++ /work/SRC/openSUSE:Factory/.grub2.new.8177/grub2.changes    2026-03-14 
22:20:38.736784474 +0100
@@ -1,0 +2,6 @@
+Fri Mar  6 14:37:52 UTC 2026 - Danilo Spinella <[email protected]>
+
+- Fix LoaderConfigTimeout and LoaderConfigTimeoutOneshot (bsc#1259477)
+  * grub2-bls-loader-config-timeout-fix.patch
+
+-------------------------------------------------------------------

New:
----
  grub2-bls-loader-config-timeout-fix.patch

----------(New B)----------
  New:- Fix LoaderConfigTimeout and LoaderConfigTimeoutOneshot (bsc#1259477)
  * grub2-bls-loader-config-timeout-fix.patch
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ grub2.spec ++++++
--- /var/tmp/diff_new_pack.otmvEH/_old  2026-03-14 22:20:42.032920921 +0100
+++ /var/tmp/diff_new_pack.otmvEH/_new  2026-03-14 22:20:42.032920921 +0100
@@ -398,6 +398,7 @@
 Patch409:       0001-bls-Allow-configuration-of-active-console-type.patch
 Patch410:       0002-grubbls-Add-automatic-fwsetup-menu-entry.patch
 Patch411:       0001-ieee1275-support-dm-multipath-bootlist.patch
+Patch412:       grub2-bls-loader-config-timeout-fix.patch
 
 %if 0%{?suse_version} < 1600
 Requires:       gettext-runtime


++++++ grub2-bls-loader-config-timeout-fix.patch ++++++
Index: grub-2.14/grub-core/normal/menu.c
===================================================================
--- grub-2.14.orig/grub-core/normal/menu.c
+++ grub-2.14/grub-core/normal/menu.c
@@ -46,6 +46,8 @@
         { 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_UINT_MAX 4294967295U
+
 #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)
@@ -68,7 +70,8 @@ grub_err_t (*grub_gfxmenu_try_hook) (int
 enum timeout_style {
   TIMEOUT_STYLE_MENU,
   TIMEOUT_STYLE_COUNTDOWN,
-  TIMEOUT_STYLE_HIDDEN
+  TIMEOUT_STYLE_HIDDEN,
+  TIMEOUT_STYLE_DISABLED,
 };
 
 struct timeout_style_name {
@@ -78,6 +81,7 @@ struct timeout_style_name {
   {"menu", TIMEOUT_STYLE_MENU},
   {"countdown", TIMEOUT_STYLE_COUNTDOWN},
   {"hidden", TIMEOUT_STYLE_HIDDEN},
+  {"disabled", TIMEOUT_STYLE_DISABLED},
   {NULL, 0}
 };
 
@@ -858,59 +862,60 @@ run_menu (grub_menu_t menu, int nested,
 #ifdef GRUB_MACHINE_EFI
   if (val && (val[0] == '1' || val[0] == 'y'))
     {
-      int timeout_oneshot = -1;
+      unsigned long timeout_oneshot;
+      bool has_timeout_oneshot = false;
       /* https://systemd.io/BOOT_LOADER_INTERFACE/ */
       char* loader_config_timeout_oneshot = 
get_efivar("LoaderConfigTimeoutOneShot");
-      grub_dprintf("bls", "%s\n", loader_config_timeout_oneshot);
       if (loader_config_timeout_oneshot)
       {
+        /* Remove any value */
         grub_efi_set_variable_to_string("LoaderConfigTimeoutOneShot",
                 &grub_efi_loader_guid, "", 0);
-        timeout_oneshot = (int) grub_strtoul (loader_config_timeout_oneshot, 
0, 0);
+        timeout_oneshot = grub_strtoul (loader_config_timeout_oneshot, 0, 0);
         if (grub_errno != GRUB_ERR_NONE)
-          {
-            grub_errno = GRUB_ERR_NONE;
-            timeout_oneshot = -1;
-          }
+          grub_errno = GRUB_ERR_NONE;
         /* We have a valid value */
-        if (timeout_oneshot != -1)
+        else
           {
             if (timeout_oneshot == 0)
-              {
-                /* Wait indefinitely. In this case we want to set the timeout 
value to -1.
-                   In this case unsetting timeout will have the same effect. */
-                grub_env_unset ("timeout");
-              } else {
-                grub_menu_set_timeout (timeout_oneshot);
-              }
-              grub_env_set("timeout_style", "menu");
+              /* Wait indefinitely. */
+              grub_env_unset ("timeout");
+            else {
+              grub_menu_set_timeout (timeout_oneshot);
+              has_timeout_oneshot = true;
+            }
+            grub_env_set("timeout_style", "menu");
           }
         grub_free(loader_config_timeout_oneshot);
       }
-    /* If there was no LoaderConfigTimeoutOneShot value or it was invalid
+    /* If there was no LoaderConfigTimeoutOneShot value or it was invalid,
        read LoaderConfigTimeout */
-    if (timeout_oneshot == -1)
+    if (!has_timeout_oneshot)
       {
         char* loader_config_timeout = get_efivar("LoaderConfigTimeout");
         if (loader_config_timeout)
           {
             if (grub_strcmp(loader_config_timeout, "menu-force") == 0)
               {
-                grub_env_unset ("timeout");
+                grub_env_unset("timeout");
+                grub_env_set("timeout_style", "menu");
               } else if (grub_strcmp(loader_config_timeout, "0") == 0 ||
                       grub_strcmp(loader_config_timeout, "menu-hidden") == 0)
               {
-                grub_menu_set_timeout (1);
+                grub_menu_set_timeout (3);
                 grub_env_set("timeout_style", "hidden");
               } else if (grub_strcmp(loader_config_timeout, "menu-disabled") 
== 0)
               {
-                grub_menu_set_timeout (0);
-                grub_env_unset ("timeout");
+                grub_env_set ("timeout", "0");
+                grub_env_set("timeout_style", "disabled");
               } else {
-                int loader_timeout = (int) grub_strtoul 
(loader_config_timeout, 0, 0);
+                unsigned long loader_timeout = grub_strtoul 
(loader_config_timeout, 0, 0);
                 if (grub_errno == GRUB_ERR_NONE)
                   {
-                    grub_menu_set_timeout (loader_timeout);
+                    if (loader_timeout == GRUB_EFI_UINT_MAX)
+                      grub_env_unset("timeout");
+                    else
+                      grub_menu_set_timeout (loader_timeout);
                     grub_env_set("timeout_style", "menu");
                   } else {
                     grub_errno = GRUB_ERR_NONE;
@@ -986,10 +991,11 @@ run_menu (grub_menu_t menu, int nested,
     }
 
   /* If timeout is 0, drawing is pointless (and ugly).  */
-  if (timeout == 0)
+  if (timeout == 0 || timeout_style == TIMEOUT_STYLE_DISABLED)
     {
       *auto_boot = 1;
-      *notify_boot = timeout_style != TIMEOUT_STYLE_HIDDEN;
+      *notify_boot = timeout_style != TIMEOUT_STYLE_HIDDEN &&
+          timeout_style != TIMEOUT_STYLE_DISABLED;
       return default_entry;
     }
 

Reply via email to