You are not logged in.

#1 2013-06-27 19:54:32

hobarrera
Member
From: The Netherlands
Registered: 2011-04-12
Posts: 355
Website

Skip GRUB menu unless shift is pressed

I've made a small script (mostly canibalizing bits of Ubuntu's os_prober) that hides GRUB's menu if shift is not being held down.

This allows setting GRUB's timeouts to 0, without loosing access to GRUB if I break stuff.

I've packages this as a nice AUR package. Just install grub-holdshift

And modify these variables (and add the latter) to /etc/defaults/grub:

GRUB_TIMEOUT="0"
GRUB_HIDDEN_TIMEOUT="0"
GRUB_FORCE_HIDDEN_MENU="true"

This is probably very useful to those (like me) that are obsessed with boot time, but don't want to loose access to GRUB's menu when things break (and I do break my setup! big_smile)

Remember to re-run grub-mkconfig after installing!

Offline

#2 2013-06-27 23:26:34

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Skip GRUB menu unless shift is pressed

You need to change the last line of the PKGBUILD.  When it unzips the source, the 31_hold_shift file is contained in the directory grub-holdshift-1.0.

-   install -Dm 755 31_hold_shift "$pkgdir/etc/grub.d/31_hold_shift"
+   install -Dm 755 grub-holdshift-1.0/31_hold_shift "$pkgdir/etc/grub.d/31_hold_shift"

Offline

#3 2013-06-28 00:37:37

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: Skip GRUB menu unless shift is pressed

Nice.
By the way, why is the cat-block repeatet beginning in line 87? I think it should not be there, the file should end at line 86.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2013-06-28 06:44:46

hobarrera
Member
From: The Netherlands
Registered: 2011-04-12
Posts: 355
Website

Re: Skip GRUB menu unless shift is pressed

WonderWoofy wrote:

You need to change the last line of the PKGBUILD.  When it unzips the source, the 31_hold_shift file is contained in the directory grub-holdshift-1.0.

-   install -Dm 755 31_hold_shift "$pkgdir/etc/grub.d/31_hold_shift"
+   install -Dm 755 grub-holdshift-1.0/31_hold_shift "$pkgdir/etc/grub.d/31_hold_shift"

Looks like I didn't clean my $srcdir between builds and didn't notice this during my final tests. Thanks for pointing this out.

progandy wrote:

Nice.
By the way, why is the cat-block repeatet beginning in line 87? I think it should not be there, the file should end at line 86.

Yup, well spoted. I did some additional tiny cleanups there as well.



I've pushed an updated package!

Offline

#5 2013-10-19 01:39:33

greenmanspirit
Member
Registered: 2012-10-17
Posts: 13

Re: Skip GRUB menu unless shift is pressed

I installed this package but am unable to get my menu to show up while holding shift. I tried holding it down from boot and when I saw the "Welcome to GRUB" message.

/etc/default/grub:

GRUB_DEFAULT=0
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable Hidden Menu, and optionally hide the timeout count
GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"


#GRUB_SAVEDEFAULT="true"

GRUB_FORCE_HIDDEN_MENU="true"

Thank you!

Offline

#6 2013-10-19 02:42:39

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Skip GRUB menu unless shift is pressed

Did you regernate your grub.cfg after installing?

Offline

#7 2014-01-22 04:30:08

tuusjr
Member
Registered: 2013-07-17
Posts: 8

Re: Skip GRUB menu unless shift is pressed

I have the same problem as greenmanspirit. After installing the package and updating the /etc/default/grub as described, I did a grub-mkconfig -o /boot/grub/grub.cfg. I think I saw an error under the "Welcome to Grub" message, but I don't know where I can find (if it exists) an error log for grub.

Offline

#8 2014-01-30 06:16:36

bittermint
Member
Registered: 2013-07-07
Posts: 6

Re: Skip GRUB menu unless shift is pressed

hello! first of all congratulations I find your script precious because it smooths the boot process... now here's the deal: every time I've been in the need to do a fresh installation of any distribution, I make use of this script as it is described on this page https://wiki.archlinux.org/index.php/GR … _held_down
BUT, now that I'm running elementary OS, and I've already created the file (/etc/grub.d/31_hold_shift) and given it the 755 permissions,  plus I've updated the grub.cfg with grub-mkconfig -o /boot/grub/grub.cfg and I got a message like this : /etc/grub.d/31_hold_shift error 26 /etc/grub.d/31_hold_shift source not found 
(or something like that smile ) then i looked at line 26 and it points out to: ${datarootdir}/grub/grub-mkconfig_lib, and I thought that maybe the file wasn't in the right location but in fact the file is in the right location, so... what can I be doing wrong?

Offline

#9 2014-01-30 11:14:24

th3voic3
Member
Registered: 2012-03-20
Posts: 92

Re: Skip GRUB menu unless shift is pressed

The script is also not working for me.
When I look at the grub.cfg file I have only the two comment lines for the script, but nothing is inbetween those lines.

Offline

#10 2014-01-30 17:14:44

bittermint
Member
Registered: 2013-07-07
Posts: 6

Re: Skip GRUB menu unless shift is pressed

th3voic3 wrote:

The script is also not working for me.
When I look at the grub.cfg file I have only the two comment lines for the script, but nothing is inbetween those lines.

the same happens when copy the content of the script inside the zip file from the AUR package, 2 lines commented but nothing between them and still not working

Offline

Board footer

Powered by FluxBB