Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 486378

Summary: sys-boot/grub - grub2-reboot does not take into account the gentoo-specific grub2 path change
Product: Gentoo Linux Reporter: Antek Grzymała (antoszka) <antoni>
Component: [OLD] Core systemAssignee: Mike Gilbert <floppym>
Status: RESOLVED INVALID    
Severity: normal CC: base-system
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description Antek Grzymała (antoszka) 2013-09-28 21:31:20 UTC
grub2-reboot does not take into account the gentoo-specific grub2 path change, so running grub2-reboot 'some-entry' results in:

############ 

# bash -x grub2-reboot 'Windows 7 (loader) (on /dev/sda1)'
+ prefix=/usr
+ exec_prefix=/usr
+ bindir=/usr/bin
+ sysconfdir=/etc
+ PACKAGE_NAME=GRUB
+ PACKAGE_VERSION=2.00
+ datarootdir=/usr/share
+ datadir=/usr/share
+ '[' x = x ']'
+ pkgdatadir=/usr/share/grub
++ basename grub2-reboot
+ self=grub2-reboot
+ grub_editenv=/usr/bin/grub2-editenv
+ rootdir=
+ bootdir=
++ echo /boot/grub
++ sed 's,//*,/,g'
+ grubdir=/boot/grub
+ export TEXTDOMAIN=grub
+ TEXTDOMAIN=grub
+ export TEXTDOMAINDIR=/usr/share/locale
+ TEXTDOMAINDIR=/usr/share/locale
+ . /usr/share/grub/grub-mkconfig_lib
++ prefix=/usr
++ exec_prefix=/usr
++ datarootdir=/usr/share
++ datadir=/usr/share
++ bindir=/usr/bin
++ sbindir=/usr/sbin
++ pkgdatadir=/usr/share/grub
++ test x = x
++ grub_probe=/usr/sbin/grub2-probe
++ test x = x
++ grub_mkrelpath=/usr/bin/grub2-mkrelpath
++ which gettext
++ :
++ grub_tab='   '
+ test 1 -gt 0
+ option='Windows 7 (loader) (on /dev/sda1)'
+ shift
+ case "$option" in
+ test x '!=' x
+ entry='Windows 7 (loader) (on /dev/sda1)'
+ test 0 -gt 0
+ test 'xWindows 7 (loader) (on /dev/sda1)' = x
+ '[' -z '' ']'
+ bootdir=/boot
+ '[' -n '' ']'
++ echo /boot/grub
++ sed 's,//*,/,g'
+ grubdir=/boot/grub
++ /usr/bin/grub2-editenv /boot/grub/grubenv list
++ sed -n 's/^prev_saved_entry=//p'
/usr/bin/grub2-editenv: error: cannot open `/boot/grub/grubenv.new': No such file or directory.
+ prev_saved_entry=
+ '[' '' ']'
+ /usr/bin/grub2-editenv /boot/grub/grubenv set 'next_entry=Windows 7 (loader) (on /dev/sda1)'
/usr/bin/grub2-editenv: error: cannot open `/boot/grub/grubenv.new': No such file or directory.
+ exit 0

############ 

When a symlink /boot/grub2 → /boot/grub is created the script works as expected. Needs patching in the installation process.

Reproducible: Always

Steps to Reproduce:
1. run grub2-reboot 'entry'
Actual Results:  
script fails upon not being able to find /boot/grub

Expected Results:  
expect script to set a single-time default grub entry for next reboot
Comment 1 Mike Gilbert gentoo-dev 2013-09-30 14:33:11 UTC
Read your elog messages: I moved /boot/grub2 to /boot/grub with the last grub revbump (grub-2.00_p5107-r1). Sorry for the confusion, but it's better to have it there long-term.

Please re-run grub2-install and grub2-mkconfig.