Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GRUB2 and I, we don't get along very well
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Galumph
Tux's lil' helper
Tux's lil' helper


Joined: 15 Jul 2010
Posts: 122
Location: Israel

PostPosted: Thu Sep 08, 2011 6:26 pm    Post subject: GRUB2 and I, we don't get along very well Reply with quote

I just upgraded to GRUB2, and everything seems to be failing me. The mkconfig script didn't detect my drives correctly, so I had to add the entires to the grub.d files myself. Now GRUB refuses to start in a 1280x1024 resolution (I assume this replaces vga792), and it also uses some odd font.

Here's my 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
set default="0"
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
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root bea9589c-c26b-4ae2-b1a2-78fb6b01f127
if loadfont /usr/share/grub2/unicode.pf2 ; then
  set gfxmode=1280x1024
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
if sleep --interruptible 0 ; then
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
### 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.

menuentry "Gentoo Linux Lorelei" --class gnu-linux --class gnu --class os {
   set root=(hd0,msdos3)
   search --no-floppy --fs-uuid --set=root bea9589c-c26b-4ae2-b1a2-78fb6b01f127
   echo "Loading Gentoo Linux Lorelei"
   linux (hd0,msdos1)/lorelei root=/dev/sda3 ro quiet
}

menuentry "Gentoo Linux Recovery" --class gnu-linux --class gnu --class os {
        set root=(hd0,msdos3)
        search --no-floppy --fs-uuid --set=root bea9589c-c26b-4ae2-b1a2-78fb6b01f127
   echo "Loading Gentoo Linux Recovery"
        linux (hd0,msdos1)/lorelei root=/dev/sda3 ro 1
}

menuentry "Memtest86+" {
   linux16 (hd0,msdos1)/memtest86plus/memtest.bin
}
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###


and my /etc/default/grub file:
Code:

# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default,v 1.2 2011/08/30 06:45:04 scarabeus Exp $
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
#     'grub2-mkconfig -o /boot/grub2/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

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

GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""

# 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=1280x1024

# Background image used on graphical terminal.
# Can be in various bitmap formats.
#GRUB_BACKGROUND="/boot/grub2/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


The GRUB menu itself seems to start in 1280x1024, not the terminal. How do I get the terminal to start in 1280x1024?

(If anything is written wrong, it's because I didn't really read the documentation. I just messed with the console until I got something that worked and coupled it with some stuff from Slackware's grub.cfg)
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu Sep 08, 2011 7:25 pm    Post subject: Reply with quote

Before the loadfont line, I suggest adding:

Code:
insmod video

# http://forums.gentoo.org/viewtopic-t-851847.html
# http://grub.enbug.org/gfxterm
insmod vbeinfo

# http://grub.enbug.org/gfxterm
insmod font


And for the loadfont block, I use:

Code:
# This wacky script taken from http://www.mail-archive.com/grub-devel@gnu.org/msg08932.html
if loadfont /boot/grub/dejavu.pf2 ; then
    set gfxmode="1920x1080"
    insmod gfxterm
    insmod vbe
    terminal_output gfxterm
fi
insmod png
Back to top
View user's profile Send private message
Galumph
Tux's lil' helper
Tux's lil' helper


Joined: 15 Jul 2010
Posts: 122
Location: Israel

PostPosted: Fri Sep 09, 2011 2:06 pm    Post subject: Reply with quote

Adding "set gfxpayload=<resolution>" did the trick. Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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