Can't change tty resolution with "gfxpayload" -grub2[Solved]

Discussion in general that pertains to Sabayon Linux - Must Pertain to Sabayon Linux

Moderator: Moderators

Can't change tty resolution with "gfxpayload" -grub2[Solved]

Postby DanneStrat » Tue Oct 18, 2011 0:11

Hi.

I want to change the console resolution (in tty1, tty2 etc.) by using "GRUB_GFXPAYLOAD_LINUX=" in /etc/default/grub.

"1280x1024x32" is the highest resolution I can get from "vbeinfo"(and is also the one I want to use in tty consoles)

However, no matter what option I put under "GRUB_GFXPAYLOAD_LINUX=", the same (pretty low) resolution is being used in tty:s (and it is lower than 1280x1024).

So no matter if I use:

GRUB_GFXPAYLOAD_LINUX=1280x1024x32

or

GRUB_GFXPAYLOAD_LINUX=800x600x32

in /etc/default/grub

and then do

Code: Select all
grub-mkconfig -o /boot/grub/grub.cfg


the tty resolution remains unchanged. Why is that?

FYI, "GFXPAYLOAD=keep" is already specified in grub.cfg by default, so I've also tried to just change "GRUB_GFXMODE=" in /etc/default/grub" to the resolution I want but the console resolution remains unchanged.

Here is my grub.cfg
(As I mentioned, "gfxpayload=keep" is already specified in this file by default but seems to have no effect when used in conjunction with "GRUB_GFXMODE=")

Code: Select all
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_fonts ###
### END /etc/grub.d/00_fonts ###

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="${saved_entry}"
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 919928c8-38fc-4cfb-a481-848e6cc638e2                                                                                                       
if loadfont /usr/share/grub/unicode.pf2 ; then                                                                                                                                     
  set gfxmode=800x600x32                                                                                                                                                           
  load_video                                                                                                                                                                       
  # vga= is deprecated, grub2 handles this just fine
  # making grub2 res == linux fb res
  set gfxpayload=keep
  insmod gfxterm
  insmod part_msdos
  insmod ext2
  set root='(hd0,msdos1)'
  search --no-floppy --fs-uuid --set=root de5a9375-6ded-473d-9ec3-204becb81072
  set locale_dir=($root)/grub/locale
  set lang=sv_SE
  insmod gettext
fi
terminal_output gfxterm
if sleep --interruptible 0 ; then
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_distro_theme ###
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root de5a9375-6ded-473d-9ec3-204becb81072
insmod png
if background_image /grub/default-splash.png ; then
  set color_normal=white/black
  set color_highlight=magenta/black
else
  set menu_color_normal=cyan/blue
  set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_distro_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Sabayon GNU/Linux, med Linux x86_64-2.6.39-sabayon' --class sabayon --class gnu-linux --class gnu --class os {
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set=root de5a9375-6ded-473d-9ec3-204becb81072
        echo    'Läser in Linux x86_64-2.6.39-sabayon ...'
        linux   /kernel-genkernel-x86_64-2.6.39-sabayon ro  init=/linuxrc splash=silent,theme:sabayon vga=791 console=tty1 quiet domdadm resume=swap:UUID=bc2fe8fd-2149-4cd1-b5c3-75bd7ecf0b61 real_resume=UUID=bc2fe8fd-2149-4cd1-b5c3-75bd7ecf0b61 root=UUID=919928c8-38fc-4cfb-a481-848e6cc638e2 docrypt
        echo    'Läser in initial ramdisk ...'
        initrd  /initramfs-genkernel-x86_64-2.6.39-sabayon
}
menuentry 'Sabayon GNU/Linux, med Linux x86_64-2.6.39-sabayon (återställningsläge)' --class sabayon --class gnu-linux --class gnu --class os {
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set=root de5a9375-6ded-473d-9ec3-204becb81072
        echo    'Läser in Linux x86_64-2.6.39-sabayon ...'
        linux   /kernel-genkernel-x86_64-2.6.39-sabayon ro single init_opts=single  init=/linuxrc splash=verbose,theme:sabayon vga=791 console=tty1 quiet domdadm resume=swap:UUID=bc2fe8fd-2149-4cd1-b5c3-75bd7ecf0b61 real_resume=UUID=bc2fe8fd-2149-4cd1-b5c3-75bd7ecf0b61 root=UUID=919928c8-38fc-4cfb-a481-848e6cc638e2 docrypt
        echo    'Läser in initial ramdisk ...'
        initrd  /initramfs-genkernel-x86_64-2.6.39-sabayon
}
### 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  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###


So what can I do about this?
Any help appreciated. :)
Last edited by DanneStrat on Sat Nov 05, 2011 2:31, edited 1 time in total.
DanneStrat
Young Hen
 
Posts: 27
Joined: Sun Oct 16, 2011 21:04

Re: Can't change tty resolution with "gfxpayload" - grub2

Postby joost » Wed Oct 19, 2011 6:56

afaik vga=791 (framebuffer) might overwrite the resolution setting you want.

https://wiki.ubuntu.com/FrameBuffer
joost
Sagely Hen
 
Posts: 2605
Joined: Fri Nov 17, 2006 12:11
Location: The Netherlands

Re: Can't change tty resolution with "gfxpayload" - grub2

Postby DanneStrat » Wed Oct 19, 2011 13:14

joost wrote:afaik vga=791 (framebuffer) might overwrite the resolution setting you want.

https://wiki.ubuntu.com/FrameBuffer


Thanks, I'll have a look at it.

One thing I don't fully understand though, previously when I used debian with grub2 I could set the framebuffer resolution with "GRUB_GFXPAYLOAD_LINUX=" without any problem and also in arch linux which I tested a couple of weeks ago. This make me believe that some setting elsewhere is causing "GFXPAYLOAD" to not work properly, I may be wrong though.

The vga= parameter is deprecated in grub2, but is still usable.
I would prefer to use the "new" way with "GFXPAYLOAD" instead.
Anyhow, I will continue to look around and see if I can find a solution and if I do, I will post it here for future reference.
Feel free to give suggestions on a possible fix.

BTW, as a new user of sabayon, I must say I'm really impressed. The distribution is rock-solid and the community is great. Exactly what I've been looking for. Thumbs up for the community and developers :) Keep up the good work.
/Daniel
DanneStrat
Young Hen
 
Posts: 27
Joined: Sun Oct 16, 2011 21:04

Re: Can't change tty resolution with "gfxpayload" - grub2

Postby DanneStrat » Wed Oct 19, 2011 23:10

joost wrote:afaik vga=791 (framebuffer) might overwrite the resolution setting you want.

https://wiki.ubuntu.com/FrameBuffer


OK, I think I understand it now. I misinterpreted your post.

In "/etc/default/grub" near the bottom is a script that looks like this:

Code: Select all
if [ -f "/etc/default/sabayon-grub" ]; then
        # this file is placed by the Sabayon Installer and contains
        # custom GRUB_CMDLINE_LINUX parameters created at install
        # time.
        source /etc/default/sabayon-grub
fi


It calls the file "/etc/default/sabayon-grub" with the following contents:

# this file has been added by the Anaconda Installer
# containing default installer bootloader arguments.
# DO NOT EDIT NOR REMOVE THIS FILE DIRECTLY !!!
GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} init=/linuxrc splash=silent,theme:sabayon vga=791 console=tty1 quiet domdadm resume=swap:UUID=bc2fe8fd-2149-4cd1-b5c3-75bd7ecf0b61 real_resume=UUID=bc2fe8fd-2149-4cd1-b5c3-75bd7ecf0b61 root=UUID=919928c8-38fc-4cfb-a481-848e6cc638e2 docrypt"

Among the kernel parameters specified in this file is vga=791 which overwrites the payload setting in "/etc/default/grub".

So now some questions arises:

1.Is it possible to just remove vga=791 from "/etc/default/sabayon-grub" to make the kernel use the "payload" setting in "/etc/default/grub" instead?

2. Can I change vga=791 to vga=794 in "/etc/default/sabayon-grub" to get a framebuffer in 1280x1024?

3. It says not to edit sabayon-grub directly. Any particular reason for this?

Thanks.
DanneStrat
Young Hen
 
Posts: 27
Joined: Sun Oct 16, 2011 21:04

Re: Can't change tty resolution with "gfxpayload" - grub2

Postby res0r9lm2 » Mon Oct 24, 2011 18:09

even though says not to edit it by hand you can but it will be overwritten next time you run grub2-mkconfig so its better to edit sabayon-grub or use /etc/grub.d/40_custom
res0r9lm2
Simple Hen
 
Posts: 44
Joined: Mon Oct 24, 2011 17:52

Re: Can't change tty resolution with "gfxpayload" - grub2

Postby DanneStrat » Sat Nov 05, 2011 2:30

Thanks for the help. I understand the default sabayon grub2 configuration by now so I will mark the thread as solved.
DanneStrat
Young Hen
 
Posts: 27
Joined: Sun Oct 16, 2011 21:04


Return to Sabayon Linux General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest