Sunday, January 10, 2010

grub

ubuntu 9.10 default come with grub 1.97, dont know start from which version, menu.lst had done.
Now it use grub.cfg as the configuration file. It's format and syntax is not so easy to understand, and modify.

There are two place to modify with :
/etc/grub.d/ -> lots template and stage, seems allow to add extra grub menu item
/etc/default/grub -> some general setting apply to all items

My target is remove the kernel bootsplash, also make a graphic console, so below settings satisfied me :

__
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=4" # removed splash

# 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=800x600
__
Also it wont accept vga=xxx as kernel cmdline now, need to GRUB_GFXMODE=???x??? instead.

Test result :
1.
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=4 vga=791"
#GRUB_TERMINAL=console
GRUB_GFXMODE=800x600
-> grub in 800x600 mode, and linux console in 1024x768 mode

2.
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=4 vga=791"
GRUB_TERMINAL=console
GRUB_GFXMODE=800x600
-> grub in text mode, and linux console in text mode

Conclusion :
Seems both grub should be in graphic mode ( by assign GRUB_TERMINAL,GRUB_GFXMODE )
And also linux kernel ( by assign vga=791 ), otherwise linux console wont be in graphic mode.

Older grub/syslinux, only vga=791 would be enough

No comments: