Skip to contentSkip to conversation

Integrate hiddenmenu

PATCH In review Colin Watson 3 participants 7 messages Aug 10, 2009 – Aug 13, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Integrate hiddenmenu

I'd like to integrate http://grub.enbug.org/Hiddenmenu as a grub-mkconfig option so that we can use it by default in Ubuntu. How does the attached patch look? I dropped the --verbose from the wiki page since I personally prefer it to be silent, although obviously this could be patched in or out as desired. I also moved the timeout down to after the point when the graphical terminal is initialised, to decrease the period when GRUB isn't in the desired screen resolution.

2009-08-10 Colin Watson <[email protected]>

* util/grub-mkconfig.in: Export GRUB_HIDDEN_TIMEOUT.
* util/grub.d/00_header.in: Enter interruptible sleep if GRUB_HIDDEN_TIMEOUT is set.

Thanks,

Signature · 1 line
Colin Watson                                       [[email protected]]
util/grub-mkconfig.in +1 -1
diff -Nur -x '*.orig' -x '*~' grub2-1.96+20090725/util/grub-mkconfig.in grub2-1.96+20090725.new/util/grub-mkconfig.in
@@ -173,7 +173,7 @@
 export GRUB_DEVICE GRUB_DEVICE_UUID GRUB_DEVICE_BOOT GRUB_DEVICE_BOOT_UUID GRUB_FS GRUB_FONT_PATH GRUB_PRELOAD_MODULES
 
 # These are optional, user-defined variables.
-export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL_INPUT GRUB_TERMINAL_OUTPUT GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_DISABLE_LINUX_RECOVERY GRUB_GFXMODE
+export GRUB_DEFAULT GRUB_HIDDEN_TIMEOUT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL_INPUT GRUB_TERMINAL_OUTPUT GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_DISABLE_LINUX_RECOVERY GRUB_GFXMODE
 
 if test "x${grub_cfg}" != "x"; then
   rm -f ${grub_cfg}.new
util/grub.d/00_header.in +12 -1
diff -Nur -x '*.orig' -x '*~' grub2-1.96+20090725/util/grub.d/00_header.in grub2-1.96+20090725.new/util/grub.d/00_header.in
@@ -37,7 +37,6 @@
 
 cat << EOF
 set default=${GRUB_DEFAULT}
-set timeout=${GRUB_TIMEOUT}
 EOF
 
 case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in
@@ -112,3 +111,15 @@
 EOF
   ;;
 esac
+
+if [ "x${GRUB_HIDDEN_TIMEOUT}" != "x" ] ; then
+  cat << EOF
+if sleep --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
+  set timeout=${GRUB_TIMEOUT}
+fi
+EOF
+else
+  cat << EOF
+set timeout=${GRUB_TIMEOUT}
+EOF
+fi
#1 lore raw
Quoted 7 lines · Colin Watson

I'd like to integrate http://grub.enbug.org/Hiddenmenu as a grub-mkconfig option so that we can use it by default in Ubuntu. How does the attached patch look? I dropped the --verbose from the wiki page since I personally prefer it to be silent, although obviously this could be patched in or out as desired. I also moved the timeout down to after the point when the graphical terminal is initialised, to decrease the period when GRUB isn't in the desired screen resolution.

GRUB Legacy users would expect the verbose behaviour. I tend to prefer making that the default. Does anyone else prefer silent?

If we default to verbose, we could also have an option to turn it off from /etc/default/grub, if that makes life easier for you.

Other than this, the patch itself looks fine.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#2 lore raw
Quoted 11 lines · Robert Millan
Quoted 7 lines · Colin Watson

I'd like to integrate http://grub.enbug.org/Hiddenmenu as a grub-mkconfig option so that we can use it by default in Ubuntu. How does the attached patch look? I dropped the --verbose from the wiki page since I personally prefer it to be silent, although obviously this could be patched in or out as desired. I also moved the timeout down to after the point when the graphical terminal is initialised, to decrease the period when GRUB isn't in the desired screen resolution.

GRUB Legacy users would expect the verbose behaviour. I tend to prefer making that the default. Does anyone else prefer silent?

This also comes from our design people, who have told me that by default the boot loader "should not have any visible representation". That obviously doesn't necessarily mean it has to be the upstream default though! :-)

Quoted 2 lines

If we default to verbose, we could also have an option to turn it off from /etc/default/grub, if that makes life easier for you.

Slightly, I suppose. I thought there were some feelings against excessive numbers of options which is why I didn't suggest that. GRUB_HIDDEN_TIMEOUT_QUIET=1?

Signature · 1 line
Colin Watson                                       [[email protected]]
#3 lore raw
Quoted 6 lines · Colin Watson
Quoted 2 lines

If we default to verbose, we could also have an option to turn it off from /etc/default/grub, if that makes life easier for you.

Slightly, I suppose. I thought there were some feelings against excessive numbers of options which is why I didn't suggest that. GRUB_HIDDEN_TIMEOUT_QUIET=1?

For this one I don't mind. But would you please make it "(true|false)" ?

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#4 lore raw
Quoted 9 lines · Robert Millan
Quoted 6 lines · Colin Watson
Quoted 2 lines

If we default to verbose, we could also have an option to turn it off from /etc/default/grub, if that makes life easier for you.

Slightly, I suppose. I thought there were some feelings against excessive numbers of options which is why I didn't suggest that. GRUB_HIDDEN_TIMEOUT_QUIET=1?

For this one I don't mind. But would you please make it "(true|false)" ?

OK. How's this?

Thanks,

Signature · 1 line
Colin Watson                                       [[email protected]]
util/grub-mkconfig.in +1 -1
diff -Nur -x '*.orig' -x '*~' grub2-1.96+20090725/util/grub-mkconfig.in grub2-1.96+20090725.new/util/grub-mkconfig.in
@@ -173,7 +173,7 @@
 export GRUB_DEVICE GRUB_DEVICE_UUID GRUB_DEVICE_BOOT GRUB_DEVICE_BOOT_UUID GRUB_FS GRUB_FONT_PATH GRUB_PRELOAD_MODULES
 
 # These are optional, user-defined variables.
-export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL_INPUT GRUB_TERMINAL_OUTPUT GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_DISABLE_LINUX_RECOVERY GRUB_GFXMODE
+export GRUB_DEFAULT GRUB_HIDDEN_TIMEOUT GRUB_HIDDEN_TIMEOUT_QUIET GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL_INPUT GRUB_TERMINAL_OUTPUT GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_DISABLE_LINUX_RECOVERY GRUB_GFXMODE
 
 if test "x${grub_cfg}" != "x"; then
   rm -f ${grub_cfg}.new
util/grub.d/00_header.in +17 -1
diff -Nur -x '*.orig' -x '*~' grub2-1.96+20090725/util/grub.d/00_header.in grub2-1.96+20090725.new/util/grub.d/00_header.in
@@ -37,7 +37,6 @@
 
 cat << EOF
 set default=${GRUB_DEFAULT}
-set timeout=${GRUB_TIMEOUT}
 EOF
 
 case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in
@@ -112,3 +111,20 @@
 EOF
   ;;
 esac
+
+if [ "x${GRUB_HIDDEN_TIMEOUT}" != "x" ] ; then
+  if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then 
+    verbose=
+  else
+    verbose=" --verbose"
+  fi
+  cat << EOF
+if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
+  set timeout=${GRUB_TIMEOUT}
+fi
+EOF
+else
+  cat << EOF
+set timeout=${GRUB_TIMEOUT}
+EOF
+fi
#5 lore raw
Quoted 5 lines · Colin Watson
Quoted 4 lines · Robert Millan
Quoted 3 lines · Colin Watson
Quoted 2 lines

If we default to verbose, we could also have an option to turn it off from /etc/default/grub, if that makes life easier for you.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Slightly, I suppose. I thought there were some feelings against excessive numbers of options which is why I didn't suggest that. GRUB_HIDDEN_TIMEOUT_QUIET=1?

For this one I don't mind. But would you please make it "(true|false)" ?

OK. How's this?

Committed (with a small adjustment), thanks.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#6 lore raw
In reply to Robert Millan
Quoted 11 lines · Robert Millan
Quoted 7 lines · Colin Watson

I'd like to integrate http://grub.enbug.org/Hiddenmenu as a grub-mkconfig option so that we can use it by default in Ubuntu. How does the attached patch look? I dropped the --verbose from the wiki page since I personally prefer it to be silent, although obviously this could be patched in or out as desired. I also moved the timeout down to after the point when the graphical terminal is initialised, to decrease the period when GRUB isn't in the desired screen resolution.

GRUB Legacy users would expect the verbose behaviour.  I tend to prefer making that the default.  Does anyone else prefer silent?

A timeout with a black screen gives a very bad impression. For a distro it can be ok since you'll probably provide a nice splash image but since upstream provides none I prefer it to be verbose by default

Quoted 19 lines

If we default to verbose, we could also have an option to turn it off from /etc/default/grub, if that makes life easier for you.

Other than this, the patch itself looks fine.

--
Robert Millan

 The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 4 lines
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git