Setting Up VESAFB Under GRUB2

In This Earlier Posting, I had written, that I switched to the proprietary nVidia graphics-drivers on the computer I name ‘Plato’, but that for the purposes of managing several console-sessions using

  • <Ctrl>+<Alt>+F1 ,
  • <Ctrl>+<Alt>+F7

My customary solution, to set up ‘uvesafb‘, no longer works. What happens is that everything runs fine, until the command is given to switch back to the X-server session, at which point the system crashes. Thus, as I had left it at first, console-sessions were available, but at some horribly-low default resolution (without ‘uvesafb’). This had to be remedied, and the way I chose to solve this was actually to use the older ‘vesafb’, which is not a 3rd-party frame-buffer ‘device’, but rather a set of kernel-instructions / kernel-settings, which can be specified in the file ‘/etc/default/grub’.

Because my computers use ‘GRUB2′, the most-elegant way to solve this problem would be, to put the following two lines / uncomment and adapt, like so:

 


GRUB_GFXMODE=1920x1080
GRUB_GFXPAYLOAD_LINUX="keep"


 

But, on ‘Plato’, this solution was not available, because 1920×1080 was not an available frame-buffer resolution. On this machine, I’d need to have set the highest-possible VESA resolution first, and then have been in the position of having to state next, whether to use “keep” or some other, available resolution, actually to start Linux.

This might have resulted in a ‘lightdm’ log-in screen, set to an unsuitable resolution, all the way until the user logs in, and the Plasma 5 desktop manager re-establishes his or her personal, desktop-resolution – just because, 1920×1080 was not available from the GRUB.

Instead, the following first command reveals which frame-buffer resolutions are available on any one machine, and then it’s still possible today, to give the option ” vga=#” , using the exact code which was provided by the first command:

 


root@Plato:/home/dirk# hwinfo --framebuffer
02: None 00.0: 11001 VESA Framebuffer                           
  [Created at bios.459]
  Unique ID: rdCR.BfO5bYYtG87
  Hardware Class: framebuffer
  Model: "NVIDIA GF104 Board - 10410001"
  Vendor: "NVIDIA Corporation"
  Device: "GF104 Board - 10410001"
  SubVendor: "NVIDIA"
  SubDevice: 
  Revision: "Chip Rev"
  Memory Size: 14 MB
  Memory Range: 0xd5000000-0xd5dfffff (rw)
  Mode 0x0300: 640x400 (+640), 8 bits
  Mode 0x0301: 640x480 (+640), 8 bits
  Mode 0x0303: 800x600 (+800), 8 bits
  Mode 0x0305: 1024x768 (+1024), 8 bits
  Mode 0x0307: 1280x1024 (+1280), 8 bits
  Mode 0x030e: 320x200 (+640), 16 bits
  Mode 0x030f: 320x200 (+1280), 24 bits
  Mode 0x0311: 640x480 (+1280), 16 bits
  Mode 0x0312: 640x480 (+2560), 24 bits
  Mode 0x0314: 800x600 (+1600), 16 bits
  Mode 0x0315: 800x600 (+3200), 24 bits
  Mode 0x0317: 1024x768 (+2048), 16 bits
  Mode 0x0318: 1024x768 (+4096), 24 bits
  Mode 0x031a: 1280x1024 (+2560), 16 bits
  Mode 0x031b: 1280x1024 (+5120), 24 bits
  Mode 0x0330: 320x200 (+320), 8 bits
  Mode 0x0331: 320x400 (+320), 8 bits
  Mode 0x0332: 320x400 (+640), 16 bits
  Mode 0x0333: 320x400 (+1280), 24 bits
  Mode 0x0334: 320x240 (+320), 8 bits
  Mode 0x0335: 320x240 (+640), 16 bits
  Mode 0x0336: 320x240 (+1280), 24 bits
  Mode 0x033d: 640x400 (+1280), 16 bits
  Mode 0x033e: 640x400 (+2560), 24 bits
  Mode 0x0360: 1280x800 (+1280), 8 bits
  Mode 0x0361: 1280x800 (+5120), 24 bits                                        
  Config Status: cfg=new, avail=yes, need=no, active=unknown                    
root@Plato:/home/dirk# cd /etc/default
root@Plato:/etc/default# cat grub                                               
# If you change this file, run 'update-grub' afterwards to update               
# /boot/grub/grub.cfg.                                                          
# For full documentation of the options in this file, see:                      
#   info -f grub -n 'Simple configuration'                                      
                                                                                
GRUB_DEFAULT=0                                                                  
GRUB_TIMEOUT=5                                                                  
GRUB_DISTRIBUTOR=`[ "$(uname -m)" = "x86_64" ] && echo Kanotix64 || echo Kanotix`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vga=0x31a"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# 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

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

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

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

root@Plato:/etc/default# 


 

I repeat, the Mode ‘0x31a’ will only be available on a given machine, if the preceding command showed it as being available. We don’t want hung, unbootable machines! And the prefix ‘0x’ needs to be put in this case, to define a hexadecimal number, not a base-10 number. Leading zeroes should actually be omitted.

But then what I did find, was that this method, dating back to GRUB v1, gave me what I wanted, which was, the highest-available text-resolution, but afterward, an X-server resolution, chosen by the X-server, and chosen by the actual graphics driver, and then, chosen by one user’s desktop preferences… Because my monitor is a modern, 16:9 monitor, this results in distorted but easily-legible text. But the distortion would be another reason, never to put ‘1280×1024′ for ‘GRUB_GFXPAYLOAD_LINUX= ‘ .

Furthermore, ‘the splashy’ also known as ‘plymouth’, works fine as well.

After this file has been edited, the command

update-grub2

Must be given, to make the changes actual.

Dirk

 

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>