Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GRUB2, no grub menu but system continues on to boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
nw_biohazard
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2008
Posts: 122

PostPosted: Sun Feb 16, 2014 3:34 am    Post subject: GRUB2, no grub menu but system continues on to boot Reply with quote

Hi,

I have upgraded to GRUB2 and managed to get my system to boot but don't see any grub menu. I assume that the system is just falling through to the default kernel after the timeout. I tried uncommenting
Code:

GRUB_TERMINAL=console


and remaking the grub.cfg:
Code:

grub2-mkconfig -o /boot/grub/grub.cfg


but no luck.
Here is grub.cfg:
http://pastebin.com/h9BZaTz8

Any clues?
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Sun Feb 16, 2014 5:04 am    Post subject: Reply with quote

If you want to see the menu for ever until you make a choice set in /etc/default/grub
Code:
GRUB_HIDDEN_TIMEOUT=-1
GRUB_TIMEOUT=-1

and then
Code:
grub2-mkconfig -o /boot/grub/grub.cfg

_________________
Paul
Back to top
View user's profile Send private message
nw_biohazard
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2008
Posts: 122

PostPosted: Sun Feb 16, 2014 5:23 am    Post subject: Reply with quote

I don't see the menu at all. Currently I have
Code:

GRUB_TIMEOUT=10
GRUB_HIDDEN_TIMEOUT=0
Back to top
View user's profile Send private message
nw_biohazard
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2008
Posts: 122

PostPosted: Sun Feb 16, 2014 9:00 pm    Post subject: Reply with quote

Here is the output of lspci if that is helpful.

Code:
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b5)
00:1c.5 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 (rev b5)
00:1c.6 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 7 (rev b5)
00:1c.7 PCI bridge: Intel Corporation 82801 PCI Bridge (rev b5)
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation H67 Express Chipset Family LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)
03:00.0 IDE interface: VIA Technologies, Inc. VT6415 PATA IDE Host Controller
04:00.0 USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)
06:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge (rev 01)
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3131

PostPosted: Sun Feb 16, 2014 9:46 pm    Post subject: Reply with quote

I've never used grub2, so it's just a guess.... timeout=0 means "show menu for 0 seconds and then boot default"
I'd be surprised if you have noticed menu shown for 0 seconds. Try what Logicien suggested and set it to -1 instead. It's a common trick to use negative value as "infinity" (sometimes 0 means infinity, but as it can be a valid value you need something else)
Back to top
View user's profile Send private message
nw_biohazard
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2008
Posts: 122

PostPosted: Sun Feb 16, 2014 10:38 pm    Post subject: Reply with quote

I'm hesitant to set the timeout to -1 since I've never actually seen the grub2 menu and wouldn't know how to navigate it blind. I did try setting everything to 60s:
Code:
GRUB_HIDDEN_TIMEOUT=60
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=60


Then rebuilt grub.cfg.

On booting I go through the BIOS screen, then the screen goes blank for approximately 60s before finally booting. I think GRUB2 seems to be handling the timeout time properly just not the video.
Back to top
View user's profile Send private message
tryn
Guru
Guru


Joined: 21 Dec 2002
Posts: 325
Location: 39.885° N. -88.913° W.

PostPosted: Mon Feb 17, 2014 2:07 am    Post subject: Reply with quote

nw_biohazard

If you want to see what is happening in the 60 seconds while it is loading do this.

In the /etc/default/grub file have this line.
Code:
GRUB_TERMINAL=console


At least I think this is what your talking about.

If you change this file be sure to run the commands.
mount /boot
grub2-mkconfig -o /boot/grub/grub.cfg
Back to top
View user's profile Send private message
nw_biohazard
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2008
Posts: 122

PostPosted: Mon Feb 17, 2014 2:16 am    Post subject: Reply with quote

Tryn,

I already have that set. It seems that should disable the graphical menu in favor of a text one but I don't even get the text menu.
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Mon Feb 17, 2014 2:37 am    Post subject: Reply with quote

nw_biohazard, I'm not sure but, just in case it gives you an idea, below is my working /etc/default/grub file. I had to add the "GRUB_VIDEO_BACKEND=vbe" to get a background image to be displayed for the GRUB 2 menu, so perhaps you could compare the file below to yours to see if anything else is different that might be worth trying.

Code:
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-2,v 1.4 2013/09/21 18:10:55 floppym Exp $
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
#     'grub2-mkconfig -o /boot/grub/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

GRUB_DISTRIBUTOR="Gentoo"

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10

# Append parameters to the linux kernel command line
# Use GRUB_CMDLINE_LINUX="<explicit command line>" instead of the following line if you are changing kernel image
GRUB_CMDLINE_LINUX="`cat /proc/cmdline | sed -e 's#BOOT_IMAGE=.* ro ##g'`"

# Append parameters to the linux kernel command line for non-recovery entries             
#GRUB_CMDLINE_LINUX_DEFAULT=""

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

GRUB_VIDEO_BACKEND=vbe
GRUB_GFXPAYLOAD_LINUX=1024x768
GRUB_COLOR_HIGHLIGHT="magenta/black"
GRUB_COLOR_NORMAL="white/black"

# 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=1024x768

# Path to theme spec txt file.
# The starfield is by default provided with use truetype.
# NOTE: when enabling custom theme, ensure you have required font/etc.
#GRUB_THEME="/boot/grub/themes/starfield/theme.txt"

# Background image used on graphical terminal.
# Can be in various bitmap formats.
GRUB_BACKGROUND="/boot/grub/mybackground.png"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
GRUB_DISABLE_LINUX_UUID=true

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

_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
nw_biohazard
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2008
Posts: 122

PostPosted: Mon Feb 17, 2014 1:54 pm    Post subject: Reply with quote

Thanks for the suggestion. I tried "GRUB_VIDEO_BACKEND=vbe", both with and without "GRUB_TERMINAL=console" and with "GRUB_GFXPAYLOAD_LINUX=640x480" and "GRUB_GFXPAYLOAD_LINUX=1024x768". Still no luck. I'm posting the entire default file here in case that helps anyone locate the problem.

Code:
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-2,v 1.4 2013/09/21 18:10:55 floppym Exp $
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
#     'grub2-mkconfig -o /boot/grub/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

GRUB_DISTRIBUTOR="Gentoo"

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=10
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10

# Append parameters to the linux kernel command line
# GRUB_CMDLINE_LINUX=""

# Append parameters to the linux kernel command line for non-recovery entries
#GRUB_CMDLINE_LINUX_DEFAULT=""

# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=console

# Added based on Gentoo forum post. 2014-02-16.
GRUB_VIDEO_BACKEND=vbe
GRUB_GFXPAYLOAD_LINUX=640x480
GRUB_COLOR_HIGHLIGHT="magenta/black"
GRUB_COLOR_NORMAL="white/black"


# 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=640x480
#GRUB_GFXMODE=1024x768

# Path to theme spec txt file.
# The starfield is by default provided with use truetype.
# NOTE: when enabling custom theme, ensure you have required font/etc.
#GRUB_THEME="/boot/grub/themes/starfield/theme.txt"

# Background image used on graphical terminal.
# Can be in various bitmap formats.
#GRUB_BACKGROUND="/boot/grub/mybackground.png"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY=true
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Mon Feb 17, 2014 2:24 pm    Post subject: Reply with quote

Could it be something to do with your framebuffer, I wonder? I've got xf86-video-fbdev installed:

Code:
$ eix xf86-video-fbdev
[I] x11-drivers/xf86-video-fbdev
     Available versions:  0.4.3 (~)0.4.3-r1 0.4.4
     Installed versions:  0.4.4(19:19:29 31/12/13)
     Homepage:            http://xorg.freedesktop.org/
     Description:         video driver for framebuffer device

and I have the following kernel options selected:

Code:
$ cat /usr/src/linux/.config | grep -i frame
CONFIG_SCHED_OMIT_FRAME_POINTER=y
# Frame buffer hardware drivers
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
CONFIG_FRAME_WARN=2048
CONFIG_ARCH_WANT_FRAME_POINTERS=y
CONFIG_FRAME_POINTER=y

_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
nw_biohazard
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2008
Posts: 122

PostPosted: Tue Feb 18, 2014 3:37 am    Post subject: Reply with quote

Thanks for the suggestion. I did not have xf86-video-fbdev installed so I emerged it:
Code:
# emerge --search xf86-video-fbdev
Searching...
[ Results for search key : xf86-video-fbdev ]
[ Applications found : 1 ]

*  x11-drivers/xf86-video-fbdev
      Latest version available: 0.4.4
      Latest version installed: 0.4.4
      Size of files: 286 kB
      Homepage:      http://xorg.freedesktop.org/
      Description:   video driver for framebuffer device
      License:       MIT


My kernel options are nearly identical to yours:
Code:
# cat /usr/src/linux/.config | grep -i frame
CONFIG_SCHED_OMIT_FRAME_POINTER=y
# Frame buffer hardware drivers
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
CONFIG_FRAME_WARN=2048
CONFIG_ARCH_WANT_FRAME_POINTERS=y
CONFIG_FRAME_POINTER=y


Still no luck. By pressing a key at the appropriate time during the blank screen episode, I can tell that the menu is actually there as booting is delayed until I hit a RETURN. Can't see the menu though.

I must misunderstand something about how GRUB works because I don't see why kernel options would matter before the kernal has actually been chosen.
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Tue Feb 18, 2014 4:01 am    Post subject: Reply with quote

If you read the GRUB 2 documentation:

Quote:
‘GRUB_TIMEOUT’
Boot the default entry this many seconds after the menu is displayed, unless a key is pressed. The default is ‘5’. Set to ‘0’ to boot immediately without displaying the menu, or to ‘-1’ to wait indefinitely.

‘GRUB_HIDDEN_TIMEOUT’
Wait this many seconds for a key to be pressed before displaying the menu. If no key is pressed during that time, display the menu for the number of seconds specified in GRUB_TIMEOUT before booting the default entry. We expect that most people who use GRUB_HIDDEN_TIMEOUT will want to have GRUB_TIMEOUT set to ‘0’ so that the menu is not displayed at all unless a key is pressed. Unset by default.

‘GRUB_HIDDEN_TIMEOUT_QUIET’
In conjunction with ‘GRUB_HIDDEN_TIMEOUT’, set this to ‘true’ to suppress the verbose countdown while waiting for a key to be pressed before displaying the menu. Unset by default.

I think you need to have:

Code:
GRUB_HIDDEN_TIMEOUT=0

At the moment you have it set to 10 seconds, the same as GRUB_TIMEOUT. Notice that, in my /etc/default/grub file, I have GRUB_HIDDEN_TIMEOUT=0 and GRUB_TIMEOUT=10.
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
nw_biohazard
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2008
Posts: 122

PostPosted: Tue Feb 18, 2014 4:18 am    Post subject: Reply with quote

Thanks. I changed to the following:
Code:
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10

And tried with and without GRUB_TERMINAL=console commented. Same behavior.
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3131

PostPosted: Tue Feb 18, 2014 11:23 am    Post subject: Reply with quote

I know it might be considered giving up, but why won't you just mask grub2 and update to grub1?
Back to top
View user's profile Send private message
nw_biohazard
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2008
Posts: 122

PostPosted: Tue Feb 18, 2014 4:11 pm    Post subject: Reply with quote

I'm getting close to that point. I would not have upgraded but was persuaded by the dire warnings about grub1 no longer be developed/supported.

I suspect this may be a hardware-specific issue. I need to learn a bit more about how grub2 handles video.
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3131

PostPosted: Tue Feb 18, 2014 8:46 pm    Post subject: Reply with quote

Ok, I get the point. Don't worry, you won't get hacked with emac through s/sendmail/grub/. As long as it is usable for you it's perfectly fine, even if nobody tunes it to match new filesystems anymore. What has been done will work until some major changes ocure, and that change would most likely be switch to UEFI.
Back to top
View user's profile Send private message
nw_biohazard
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2008
Posts: 122

PostPosted: Thu Apr 03, 2014 12:33 am    Post subject: Reply with quote

I still don't have GRUB2 working but may have made some progress. When booting from a SystemRescueCD flash drive, I get a working (non-graphical) GRUB2 menu. I tried comparing the grub.cfg file from SystemRescueCD with my installed version but can't seem to figure out the relevant difference. Any help at what variables to set in /etc/default/grub to reproduce these settings would be appreciated.

The grub.cfg file from SystemRescueCD is very simple:
Code:
# Global options
set timeout=90
set default=0
set fallback=1
set pager=1

# Display settings
if loadfont /boot/grub/font.pf2 ; then
        set gfxmode=auto
        insmod efi_gop
        insmod efi_uga
        insmod gfxterm
        terminal_output gfxterm
fi

menuentry "SystemRescueCd (64bit, default boot options)" {
        set gfxpayload=keep
        linux   /isolinux/rescue64
        initrd  /isolinux/initram.igz
}

menuentry "SystemRescueCd (64bit, cache all files in memory)" {
        set gfxpayload=keep
        linux   /isolinux/rescue64 docache
        initrd  /isolinux/initram.igz
}

menuentry "SystemRescueCd (64bit, alternative kernel with default options)" {
        set gfxpayload=keep
        linux   /isolinux/altker64
        initrd  /isolinux/initram.igz
}

menuentry "SystemRescueCd (64bit, disable Kernel-Mode-Settings)" {
        set gfxpayload=keep
        linux   /isolinux/rescue64 nomodeset
        initrd  /isolinux/initram.igz
}

menuentry "SystemRescueCd (64bit, directly start the grahical environment)" {
        set gfxpayload=keep
        linux   /isolinux/rescue64 dostartx
        initrd  /isolinux/initram.igz
}

menuentry "Boot exising Linux OS installed on the disk (64bit kernel)" {
        set gfxpayload=keep
        linux   /isolinux/rescue64 root=auto
        initrd  /isolinux/initram.igz
}


Code:
#ls /etc/default/grub
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-2,v 1.4 2013/09/21 18:10:55 floppym Exp $
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
#     'grub2-mkconfig -o /boot/grub/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

GRUB_DISTRIBUTOR="Gentoo"

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=10

# Append parameters to the linux kernel command line
# GRUB_CMDLINE_LINUX=""

# Append parameters to the linux kernel command line for non-recovery entries
#GRUB_CMDLINE_LINUX_DEFAULT="nomodeset"

# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=console

# Added based on Gentoo forum post. 2014-02-16.
GRUB_VIDEO_BACKEND=vbe
GRUB_GFXPAYLOAD_LINUX=640x480
GRUB_COLOR_HIGHLIGHT="magenta/black"
GRUB_COLOR_NORMAL="white/black"


# 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=640x480
#GRUB_GFXMODE=1024x768

# Path to theme spec txt file.
# The starfield is by default provided with use truetype.
# NOTE: when enabling custom theme, ensure you have required font/etc.
#GRUB_THEME="/boot/grub/themes/starfield/theme.txt"

# Background image used on graphical terminal.
# Can be in various bitmap formats.
#GRUB_BACKGROUND="/boot/grub/mybackground.png"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
#GRUB_DISABLE_LINUX_UUID=true

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


Here is the grub.cfg that is currently produced:
Code:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  insmod vbe
}

terminal_input console
terminal_output console
if sleep --verbose --interruptible 0 ; then
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-3040ad5f-dc72-4d55-a9c5-9e70d8d2af4f' {
        load_video
        set gfxpayload=640x480
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  1827a922-6faf-49d2-b6d9-8cdbe5255347
        else
          search --no-floppy --fs-uuid --set=root 1827a922-6faf-49d2-b6d9-8cdbe5255347
        fi
        echo    'Loading Linux 3.2.1-gentoo-r2 ...'
        linux   /kernel-3.2.1-gentoo-r2 root=/dev/sda3 ro 
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-3040ad5f-dc72-4d55-a9c5-9e70d8d2af4f' {
        menuentry 'Gentoo GNU/Linux, with Linux 3.2.1-gentoo-r2' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.2.1-gentoo-r2-advanced-3040ad5f-dc72-4d55-a9c5-9e70d8d2af4f' {
                load_video
                set gfxpayload=640x480
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  1827a922-6faf-49d2-b6d9-8cdbe5255347
                else
                  search --no-floppy --fs-uuid --set=root 1827a922-6faf-49d2-b6d9-8cdbe5255347
                fi
                echo    'Loading Linux 3.2.1-gentoo-r2 ...'
                linux   /kernel-3.2.1-gentoo-r2 root=/dev/sda3 ro 
        }
        menuentry 'Gentoo GNU/Linux, with Linux 3.2.1-gentoo-r2 (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.2.1-gentoo-r2-recovery-3040ad5f-dc72-4d55-a9c5-9e70d8d2af4f' {
                load_video
                set gfxpayload=640x480
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  1827a922-6faf-49d2-b6d9-8cdbe5255347
                else
                  search --no-floppy --fs-uuid --set=root 1827a922-6faf-49d2-b6d9-8cdbe5255347
                fi
                echo    'Loading Linux 3.2.1-gentoo-r2 ...'
                linux   /kernel-3.2.1-gentoo-r2 root=/dev/sda3 ro single
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
Back to top
View user's profile Send private message
tryn
Guru
Guru


Joined: 21 Dec 2002
Posts: 325
Location: 39.885° N. -88.913° W.

PostPosted: Thu Apr 03, 2014 2:40 am    Post subject: Reply with quote

nw_biohazard

What kernel are you using? I don't even see that kernel listed in portage that shows in your grub.cfg .

The basic difference that I see between my grub.cfg file and yours is these two items

Code:
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}


Then this line.
Code:
set gfxpayload=keep


The rest of the difference that I see is just the uuid for your items which would be different.

Then the kernel which I can't find in portage.

I'm using this one. sys-kernel/gentoo-sources-3.12.13
Back to top
View user's profile Send private message
nw_biohazard
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2008
Posts: 122

PostPosted: Thu Apr 03, 2014 3:19 am    Post subject: Reply with quote

Kernel:

Code:
# uname -a
Linux wombat 3.2.1-gentoo-r2 #9 SMP Sat Feb 16 15:16:57 PST 2013 x86_64 Intel(R) Core(TM) i5-2405S CPU @ 2.50GHz GenuineIntel GNU/Linux


Why would the kernel version matter? I thought that GRUB functioned before any specific kernel was loaded?
Back to top
View user's profile Send private message
jfp
Guru
Guru


Joined: 08 Jul 2007
Posts: 326
Location: Virginia, USA

PostPosted: Thu Apr 03, 2014 12:41 pm    Post subject: Reply with quote

Here is my working /etc/default/grub file. This file is taken from a newly installed gentoo laptop and is exactly what I got after installing grub2 as shown in the installation handbook.

I am not a grub2 expert at all, but I cannot believe that the kernel configuration make any difference at all.

Just to confirm... When you run the grub2-mkconfig command, it your /boot filesystem mounted? iirc, be default the gentoo /etc/fstab does not mount /boot automatically.

After updating your /etc/default/grub file, make sure /boot is mounted, run the grub2-mkconfig and then to a full power down reboot (shutdown -h now). I read somewhere in the forums that there was the possibility of memory artifacts left in memory for a shutdown -r now reboot. That seems pretty far fetched to me, but it is worth a try.


Code:
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-2,v 1.4 2013/09/21 18:10:55 floppym Exp $
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
#     'grub2-mkconfig -o /boot/grub/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

GRUB_DISTRIBUTOR="Gentoo"

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10

# Append parameters to the linux kernel command line
# GRUB_CMDLINE_LINUX=""

# Append parameters to the linux kernel command line for non-recovery entries
#GRUB_CMDLINE_LINUX_DEFAULT=""

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=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=640x480

# Path to theme spec txt file.
# The starfield is by default provided with use truetype.
# NOTE: when enabling custom theme, ensure you have required font/etc.
#GRUB_THEME="/boot/grub/themes/starfield/theme.txt"

# Background image used on graphical terminal.
# Can be in various bitmap formats.
#GRUB_BACKGROUND="/boot/grub/mybackground.png"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
#GRUB_DISABLE_LINUX_UUID=true

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

_________________
jfp
Back to top
View user's profile Send private message
nw_biohazard
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2008
Posts: 122

PostPosted: Fri Apr 04, 2014 2:35 pm    Post subject: Reply with quote

Thanks for the advice. I have verified that /boot is mounted and that a new grub.cfg file is created each time. I tried the shutdown -h now followed by a reboot with the same result.

I strongly suspect this is some sort of video mode issue. I'm trying to understand whether, in the working grub.cfg file, the following lines are executed:
Code:
# Display settings
if loadfont /boot/grub/font.pf2 ; then
        set gfxmode=auto
        insmod efi_gop
        insmod efi_uga
        insmod gfxterm
        terminal_output gfxterm
fi


Not sure how I can tell if the "loadfont" variable is set.

If not, then it seems that everything is being determined by
Code:
set gfxpayload=keep
Back to top
View user's profile Send private message
nw_biohazard
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2008
Posts: 122

PostPosted: Thu Apr 10, 2014 1:47 am    Post subject: Reply with quote

Update after another read of the GRUB manual, more hacking with numerous combinations of parameters in /etc/default/grub, and testing a couple of different keyboards. No combination of parameters I have tried so far has caused the grub menu to appear.

As far as I can tell, grub is responding correctly to the setting of
Code:
GRUB_TIMEOUT

Setting it to some positive number causes the system to wait that long unless a carriage return is entered to launch the default entry. Setting it to 0 causes immediate boot of the default. Setting it to -1 causes grub to wait for a carriage return.

Setting
Code:
GRUB_HIDDEN_TIMEOUT

to a negative number does not seem to have any effect.

Setting
Code:
GRUB_TERMINAL=console

also has no effect.

I also tried commenting everything out of /etc/default/grub and running
Code:
grub2-mkconfig -o /boot/grub/grub.cfg

with no effect.

I suspect this might be a hardware issue. I'm running an ASUS P8H67-M motherboard with integrated Intel Integrated Graphics Processor. If anyone has a working grub2 configuration for a similar system, it would be great to see it.

Here is my current /etc/grub/default
Code:
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-2,v 1.4 2013/09/21 18:10:55 floppym Exp $
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
#     'grub2-mkconfig -o /boot/grub/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

#GRUB_DISTRIBUTOR="Gentoo"

#GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10

# Append parameters to the linux kernel command line
# GRUB_CMDLINE_LINUX=""

# Append parameters to the linux kernel command line for non-recovery entries
#GRUB_CMDLINE_LINUX_DEFAULT=""

# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=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=640x480

# Path to theme spec txt file.
# The starfield is by default provided with use truetype.
# NOTE: when enabling custom theme, ensure you have required font/etc.
#GRUB_THEME="/boot/grub/themes/starfield/theme.txt"

# Background image used on graphical terminal.
# Can be in various bitmap formats.
#GRUB_BACKGROUND="/boot/grub/mybackground.png"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
#GRUB_DISABLE_LINUX_UUID=true

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


And the resulting /boot/grub/grub.cfg
Code:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

terminal_input console
terminal_output console
set timeout=10
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'GNU/Linux' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-3040ad5f-dc72-4d55-a9c5-9e70d8d2af4f' {
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  1827a922-6faf-49d2-b6d9-8cdbe5255347
        else
          search --no-floppy --fs-uuid --set=root 1827a922-6faf-49d2-b6d9-8cdbe5255347
        fi
        echo    'Loading Linux 3.2.1-gentoo-r2 ...'
        linux   /kernel-3.2.1-gentoo-r2 root=/dev/sda3 ro 
}
submenu 'Advanced options for GNU/Linux' $menuentry_id_option 'gnulinux-advanced-3040ad5f-dc72-4d55-a9c5-9e70d8d2af4f' {
        menuentry 'GNU/Linux, with Linux 3.2.1-gentoo-r2' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.2.1-gentoo-r2-advanced-3040ad5f-dc72-4d55-a9c5-9e70d8d2af4f' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  1827a922-6faf-49d2-b6d9-8cdbe5255347
                else
                  search --no-floppy --fs-uuid --set=root 1827a922-6faf-49d2-b6d9-8cdbe5255347
                fi
                echo    'Loading Linux 3.2.1-gentoo-r2 ...'
                linux   /kernel-3.2.1-gentoo-r2 root=/dev/sda3 ro 
        }
        menuentry 'GNU/Linux, with Linux 3.2.1-gentoo-r2 (recovery mode)' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.2.1-gentoo-r2-recovery-3040ad5f-dc72-4d55-a9c5-9e70d8d2af4f' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  1827a922-6faf-49d2-b6d9-8cdbe5255347
                else
                  search --no-floppy --fs-uuid --set=root 1827a922-6faf-49d2-b6d9-8cdbe5255347
                fi
                echo    'Loading Linux 3.2.1-gentoo-r2 ...'
                linux   /kernel-3.2.1-gentoo-r2 root=/dev/sda3 ro single
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
Back to top
View user's profile Send private message
nw_biohazard
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2008
Posts: 122

PostPosted: Sat Apr 12, 2014 9:11 pm    Post subject: Reply with quote

I've examined the grub2 setup on a version of SystemRescueCD which displays the menu when I bood from a USB flash drive and tried to transfer that grub.cfg to the my Gentoo system. Here is the SystemRescueCD grub.cfg file, modified for my system:
Code:
# Global options
set timeout=90
set default=0
set fallback=1
set pager=1

# Display settings
if loadfont /boot/grub/font.pf2 ; then
        set gfxmode=auto
        insmod efi_gop
        insmod efi_uga
        insmod gfxterm
        terminal_output gfxterm
fi

menuentry "Gentoo GNU/Linux" {
        set gfxpayload=keep
        linux   /kernel-3.2.1-gentoo-r2 root=/dev/sda3 ro
}


I also copied /boot/grub/font.pf2 from the SystemRescueCD installation to /boot/grub on my machine.

Unfortunately, this grub.cfg behaves exactly as all of the ones I have generated on my system: no menu is ever displayed regardless of whether <SHIFT> (have tried both left and right) or <ESC> is pressed, or any other variable setting in /etc/default/grub that I have tried.

It seems that there must be some difference in the environment on boot between the SystemRescueCD installation and what I have that is causing something not to get picked up by grub but I have no clue what that might be.

One thing that does seem somewhat different is the presence of "efi.img" and "x86_64-efi" in /boot/grub. Not sure what the significance of that is but any help would be appreciated as I am rather hamstrung at the moment in terms of rebuilding or upgrading kernels if I can't choose them in the grub menu. Thanks in advance!

Code:

drwx------ 3 root root    4096 Nov 28 21:18 .
drwx------ 3 root root    4096 Nov 28 21:18 ..
-rw-r--r-- 1 root root 1474560 Oct 27 09:47 efi.img
-rw-r--r-- 1 root root    4987 Jan 26  2013 font.pf2
-rw-r--r-- 1 root root    1163 Jan 26  2013 grub-381.cfg
drwx------ 2 root root   12288 Nov 28 21:18 x86_64-efi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum