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