Blame SOURCES/0195-00_menu_auto_hide-Reduce-number-of-save_env-calls.patch

d9d99f
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
d9d99f
From: Hans de Goede <hdegoede@redhat.com>
d9d99f
Date: Wed, 27 Jun 2018 13:33:43 +0200
d9d99f
Subject: [PATCH] 00_menu_auto_hide: Reduce number of save_env calls
d9d99f
d9d99f
Normally boot_success will be 1 on every boot (as normally the
d9d99f
previous boot will have been successful). This means that we end
d9d99f
up in the code-path to set boot_indeterminate to 0 every boot.
d9d99f
d9d99f
So we do 2 separate save_env calls each boot, one for boot_indeterminate
d9d99f
and one for boot_success. This results in 2 writes to the disk.
d9d99f
d9d99f
This commit makes us save both boot_success and boot_indeterminate
d9d99f
in a single call, reducing the number of writes, this reducing wear
d9d99f
and tear on the underlying storage.
d9d99f
d9d99f
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
d9d99f
---
d9d99f
 util/grub.d/00_menu_auto_hide.in | 4 +---
d9d99f
 1 file changed, 1 insertion(+), 3 deletions(-)
d9d99f
d9d99f
diff --git a/util/grub.d/00_menu_auto_hide.in b/util/grub.d/00_menu_auto_hide.in
b71686
index ca95c0d1c..ad175870a 100644
d9d99f
--- a/util/grub.d/00_menu_auto_hide.in
d9d99f
+++ b/util/grub.d/00_menu_auto_hide.in
d9d99f
@@ -19,14 +19,12 @@ fi
d9d99f
 # Reset boot_indeterminate after a successful boot
d9d99f
 if [ "\${boot_success}" = "1" ] ; then
d9d99f
   set boot_indeterminate=0
d9d99f
-  save_env boot_indeterminate
d9d99f
 # Avoid boot_indeterminate causing the menu to be hidden more then once
d9d99f
 elif [ "\${boot_indeterminate}" = "1" ]; then
d9d99f
   set boot_indeterminate=2
d9d99f
-  save_env boot_indeterminate
d9d99f
 fi
d9d99f
 set boot_success=0
d9d99f
-save_env boot_success
d9d99f
+save_env boot_success boot_indeterminate
d9d99f
 
d9d99f
 if [ x\$feature_timeout_style = xy ] ; then
d9d99f
   if [ "\${menu_show_once}" ]; then