You are not logged in.

#1 2011-08-09 02:48:32

wilberfan
Member
From: So. Cal
Registered: 2010-12-18
Posts: 264

How to pass 'vga=794' to a chain-loaded Arch install?

I have a system with multiple distros on it:  Ubuntu, Debian Testing, Windows, Arch....  The GRUB that controls the system belongs to the Debian Testing.  All of the other distros are booted by being chainloaded from the Debian Testing GRUB...

When I select the Arch distro, the boot verbiage goes by at probably 640x480, but my monitor will handle 1280x1024.

If I manually edit the Arch entry in the GRUB, and add "vga=794" to the kernel line, everything is fine--but that requires a manual edit each time. 

Is there a way to have the GRUB2 in Debian Testing pass that vga=794 parameter to the chainloaded Arch install?


Hey, be nice...I'm new at this!

Offline

#2 2011-08-09 09:28:48

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How to pass 'vga=794' to a chain-loaded Arch install?

I don't know a thing about grub2, but in grub one /  0.91 / legacy you can edit menu.lst and add any kernel line parameters you want.

Offline

#3 2011-08-09 12:43:55

szim90
Member
Registered: 2011-08-01
Posts: 29

Re: How to pass 'vga=794' to a chain-loaded Arch install?

If the boot is chainloaded, that means that you are having Debian's grub2 call Arch's grub1, correct?

In that case, you should be able to edit grub's /boot/grub/menu.lst file from within Arch (and append the vga parameter to the end of the kernel line) to make the changes persistent. In a chainloaded setup, the first boot loader should have no effect on the second.

Offline

#4 2011-08-09 15:37:42

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: How to pass 'vga=794' to a chain-loaded Arch install?

What gfx card do you have? You might want to use kms instead.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#5 2011-08-09 15:45:26

wilberfan
Member
From: So. Cal
Registered: 2010-12-18
Posts: 264

Re: How to pass 'vga=794' to a chain-loaded Arch install?

szim90 wrote:

If the boot is chainloaded, that means that you are having Debian's grub2 call Arch's grub1, correct?

Correct.

In that case, you should be able to edit grub's /boot/grub/menu.lst file from within Arch (and append the vga parameter to the end of the kernel line) to make the changes persistent. In a chainloaded setup, the first boot loader should have no effect on the second.

That occurred to me--and I tried it yesterday--but it's not working.  This is what my Arch /boot/grub/menu.lst looks like:

# Config file for GRUB - The GNU GRand Unified Bootloader
# /boot/grub/menu.lst

# DEVICE NAME CONVERSIONS 
#
#  Linux           Grub
# -------------------------
#  /dev/fd0        (fd0)
#  /dev/sda        (hd0)
#  /dev/sdb2       (hd1,1)
#  /dev/sda3       (hd0,2)
#

#  FRAMEBUFFER RESOLUTION SETTINGS
#     +-------------------------------------------------+
#          | 640x480    800x600    1024x768   1280x1024
#      ----+--------------------------------------------
#      256 | 0x301=769  0x303=771  0x305=773   0x307=775
#      32K | 0x310=784  0x313=787  0x316=790   0x319=793
#      64K | 0x311=785  0x314=788  0x317=791   0x31A=794
#      16M | 0x312=786  0x315=789  0x318=792   0x31B=795
#     +-------------------------------------------------+
#  for more details and different resolutions see
#  [url]https://wiki.archlinux.org/index.php/GRUB#Framebuffer_resolution[/url]

# general configuration:
timeout   5
default   0
color light-blue/black light-cyan/blue

# boot sections follow
# each is implicitly numbered from 0 in the order of appearance below
#
# TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.
#
#-*

# (0) Arch Linux
title  Arch Linux  [/boot/vmlinuz-linux]
root   (hd0,0)
kernel /vmlinuz-linux root=/dev/sda3 ro vga=794
initrd /initramfs-linux.img

# (1) Windows
#title Windows
#rootnoverify (hd0,0)
#makeactive
#chainloader +1

The first thing that seems odd about it, is that my Arch install is on /dev/sda6.     I don't know--I think the Debian GRUB2 might be doing some direct calling of Arch--rather than just pointing to the Arch menu.lst?

Here's the Debian /boot/grub/grub.cfg

# 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_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="10"
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='(/dev/sda,msdos4)'
search --no-floppy --fs-uuid --set c2796e79-ac4c-475a-af88-1c443ccd8c8c
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=1280x1024
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos4)'
search --no-floppy --fs-uuid --set c2796e79-ac4c-475a-af88-1c443ccd8c8c
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos4)'
search --no-floppy --fs-uuid --set c2796e79-ac4c-475a-af88-1c443ccd8c8c
insmod png
if background_image /usr/share/images/desktop-base/spacefun-grub.png ; then
  set color_normal=light-gray/black
  set color_highlight=white/black
else
  set menu_color_normal=cyan/blue
  set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Debian GNU/Linux, with Linux 2.6.31-11.dmz.1-liquorix-686' --class debian --class gnu-linux --class gnu --class os {
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos4)'
    search --no-floppy --fs-uuid --set c2796e79-ac4c-475a-af88-1c443ccd8c8c
    echo    'Loading Linux 2.6.31-11.dmz.1-liquorix-686 ...'
    linux    /boot/vmlinuz-2.6.31-11.dmz.1-liquorix-686 root=UUID=c2796e79-ac4c-475a-af88-1c443ccd8c8c ro vga=794 quiet nomodeset
    echo    'Loading initial ramdisk ...'
    initrd    /boot/initrd.img-2.6.31-11.dmz.1-liquorix-686
}
menuentry 'Debian GNU/Linux, with Linux 2.6.31-11.dmz.1-liquorix-686 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos4)'
    search --no-floppy --fs-uuid --set c2796e79-ac4c-475a-af88-1c443ccd8c8c
    echo    'Loading Linux 2.6.31-11.dmz.1-liquorix-686 ...'
    linux    /boot/vmlinuz-2.6.31-11.dmz.1-liquorix-686 root=UUID=c2796e79-ac4c-475a-af88-1c443ccd8c8c ro single vga=794
    echo    'Loading initial ramdisk ...'
    initrd    /boot/initrd.img-2.6.31-11.dmz.1-liquorix-686
}
menuentry 'Debian GNU/Linux, with Linux 2.6.31-9.dmz.2-liquorix-686' --class debian --class gnu-linux --class gnu --class os {
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos4)'
    search --no-floppy --fs-uuid --set c2796e79-ac4c-475a-af88-1c443ccd8c8c
    echo    'Loading Linux 2.6.31-9.dmz.2-liquorix-686 ...'
    linux    /boot/vmlinuz-2.6.31-9.dmz.2-liquorix-686 root=UUID=c2796e79-ac4c-475a-af88-1c443ccd8c8c ro vga=794 quiet nomodeset
    echo    'Loading initial ramdisk ...'
    initrd    /boot/initrd.img-2.6.31-9.dmz.2-liquorix-686
}
menuentry 'Debian GNU/Linux, with Linux 2.6.31-9.dmz.2-liquorix-686 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos4)'
    search --no-floppy --fs-uuid --set c2796e79-ac4c-475a-af88-1c443ccd8c8c
    echo    'Loading Linux 2.6.31-9.dmz.2-liquorix-686 ...'
    linux    /boot/vmlinuz-2.6.31-9.dmz.2-liquorix-686 root=UUID=c2796e79-ac4c-475a-af88-1c443ccd8c8c ro single vga=794
    echo    'Loading initial ramdisk ...'
    initrd    /boot/initrd.img-2.6.31-9.dmz.2-liquorix-686
}
### 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 ###
menuentry "Ubuntu, Linux 2.6.31-17-generic (on /dev/sda1)" {
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos1)'
    search --no-floppy --fs-uuid --set 01a46bd1-11b1-432c-9e3e-c17630b9c13d
    linux /boot/vmlinuz-2.6.31-17-generic root=UUID=01a46bd1-11b1-432c-9e3e-c17630b9c13d ro
    initrd /boot/initrd.img-2.6.31-17-generic
}
menuentry "Ubuntu, Linux 2.6.31-17-generic (recovery mode) (on /dev/sda1)" {
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos1)'
    search --no-floppy --fs-uuid --set 01a46bd1-11b1-432c-9e3e-c17630b9c13d
    linux /boot/vmlinuz-2.6.31-17-generic root=UUID=01a46bd1-11b1-432c-9e3e-c17630b9c13d ro single
    initrd /boot/initrd.img-2.6.31-17-generic
}
menuentry "Ubuntu, Linux 2.6.31-16-generic (on /dev/sda1)" {
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos1)'
    search --no-floppy --fs-uuid --set 01a46bd1-11b1-432c-9e3e-c17630b9c13d
    linux /boot/vmlinuz-2.6.31-16-generic root=UUID=01a46bd1-11b1-432c-9e3e-c17630b9c13d ro
    initrd /boot/initrd.img-2.6.31-16-generic
}
menuentry "Ubuntu, Linux 2.6.31-16-generic (recovery mode) (on /dev/sda1)" {
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos1)'
    search --no-floppy --fs-uuid --set 01a46bd1-11b1-432c-9e3e-c17630b9c13d
    linux /boot/vmlinuz-2.6.31-16-generic root=UUID=01a46bd1-11b1-432c-9e3e-c17630b9c13d ro single
    initrd /boot/initrd.img-2.6.31-16-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (on /dev/sda1)" {
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos1)'
    search --no-floppy --fs-uuid --set 01a46bd1-11b1-432c-9e3e-c17630b9c13d
    linux /boot/vmlinuz-2.6.31-14-generic root=UUID=01a46bd1-11b1-432c-9e3e-c17630b9c13d ro
    initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode) (on /dev/sda1)" {
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos1)'
    search --no-floppy --fs-uuid --set 01a46bd1-11b1-432c-9e3e-c17630b9c13d
    linux /boot/vmlinuz-2.6.31-14-generic root=UUID=01a46bd1-11b1-432c-9e3e-c17630b9c13d ro single
    initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Arch (on /dev/sda6)" {
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos6)'
    search --no-floppy --fs-uuid --set 65e0a45a-1257-408b-a5a4-5253088d330d
    linux /boot/vmlinuz-linux root=/dev/sda6
    initrd /boot/initramfs-linux.img
}
menuentry "Windows 7 (loader) (on /dev/sdb1)" {
    insmod part_msdos
    insmod ntfs
    set root='(hd1,msdos1)'
    search --no-floppy --fs-uuid --set 62f0ef4ef0ef26cf
    chainloader +1
}
### 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 ###

Based on this line:

# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub

I'm beginning to think I need to run 'grub-mkconfig'--because I've already edited /etc/default/grub to include the vga=794 option:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

GRUB_DEFAULT=10
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet nomodeset"
GRUB_CMDLINE_LINUX="vga=794"

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

# 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_LINUX_RECOVERY="true"

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

That's just a guess.  I don't know GRUB2 well enough to know for sure.     Any GRUB2'ers out there?  ;-)


Hey, be nice...I'm new at this!

Offline

#6 2011-08-09 15:49:37

wilberfan
Member
From: So. Cal
Registered: 2010-12-18
Posts: 264

Re: How to pass 'vga=794' to a chain-loaded Arch install?

Mr.Elendig wrote:

What gfx card do you have? You might want to use kms instead.

It's an nVidia...something.  I've forgotten how to check!  And, sorry, I'm not familiar with 'kms'?

Last edited by wilberfan (2011-08-09 15:55:59)


Hey, be nice...I'm new at this!

Offline

#7 2011-08-09 15:53:33

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: How to pass 'vga=794' to a chain-loaded Arch install?

The debian GRUB2 is not chainloading any GRUB.


This silver ladybug at line 28...

Offline

#8 2011-08-09 15:57:06

wilberfan
Member
From: So. Cal
Registered: 2010-12-18
Posts: 264

Re: How to pass 'vga=794' to a chain-loaded Arch install?

lolilolicon wrote:

The debian GRUB2 is not chainloading any GRUB.

So you're confirming that GRUB2 is calling Arch directly?  That's something that GRUB2 is capable and/or designed to do...?

Last edited by wilberfan (2011-08-09 15:59:05)


Hey, be nice...I'm new at this!

Offline

#9 2011-08-09 16:06:56

szim90
Member
Registered: 2011-08-01
Posts: 29

Re: How to pass 'vga=794' to a chain-loaded Arch install?

As lolilolicon said, you're not chainloading. Grub2 is calling the arch kernel directly.

A chainloaded entry would look something like this:

menuentry "Grub 1 Bootloader" {
set root=(hd0,8)
chainloader +1
}

As is stands now, grub2's os_prober is seeing there is another os, and directly running it. You have a number of options here. Personally, for my multi-distro machine, I disable the os_prober completely (you can add GRUB_DISABLE_OS_PROBER=true to /etc/default/grub (or at least you can in ubuntu, you can alternatively just remove execute permission on /boot/grub.d/30_os-prober). You can then chainload all of your other distros by adding the appropriate menu entries to /boot/grub.d/40_custom - assuming they all have their own bootloaders installed in their partition). You will have to run update-grub after this for the change to take effect.

The advantage of this is that, if another distro has a kernel upgrade, then you won't have to update the main bootloader with the new kernel config.

You might want to take a look at the ubuntu and arch pages on grub2 for more info:
https://help.ubuntu.com/community/Grub2
https://wiki.archlinux.org/index.php/Gr … figuration

Hope this helps.

Offline

#10 2011-08-09 16:21:36

wilberfan
Member
From: So. Cal
Registered: 2010-12-18
Posts: 264

Re: How to pass 'vga=794' to a chain-loaded Arch install?

szim90 wrote:

The advantage of this is that, if another distro has a kernel upgrade, then you won't have to update the main bootloader with the new kernel config.

Good info--thanks!  I'll look into your suggestions...

But I've noticed that with this current setup, that I've never had to update the main bootloader whenever Arch upgrades the kernel!  (I've had to do that in other, non-Arch scenarios).   I've never completely understood why--but I thought it was pretty cool.


Hey, be nice...I'm new at this!

Offline

#11 2011-08-09 18:59:45

szim90
Member
Registered: 2011-08-01
Posts: 29

Re: How to pass 'vga=794' to a chain-loaded Arch install?

That's probably because arch's kernel doesn't have a version attached to the file name. If you look at your current arch entry:

menuentry "Arch (on /dev/sda6)" {
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos6)'
    search --no-floppy --fs-uuid --set 65e0a45a-1257-408b-a5a4-5253088d330d
    linux /boot/vmlinuz-linux root=/dev/sda6
    initrd /boot/initramfs-linux.img
}

The kernel points to /boot/vmlinuz-linux. I would guess that, when arch updates the kernel, it simply replaces this file with one of the same name. As a result, the grub2 entry is still valid.

That kernel update problem can become a problem with distros like Ubuntu, which place versions in their kernel filename. For example, if you look at your ubuntu kernel line:

linux /boot/vmlinuz-2.6.31-17-generic

It calls out a specific kernel version. That's where the problem occurs. If Ubuntu got a new kernel, unless you ran update-grub in debian, the grub entry would always point to the old version.

Offline

#12 2011-08-09 20:37:30

wilberfan
Member
From: So. Cal
Registered: 2010-12-18
Posts: 264

Re: How to pass 'vga=794' to a chain-loaded Arch install?

Well, I ran a grub-mkconfig within the Debian, and then a grub-update (with the settings as in post #5, above)--but I'm still getting the lower resolution when I boot into Arch...  I thought that might work... ) "Noob's Prayer" ;-)


Hey, be nice...I'm new at this!

Offline

#13 2011-08-10 19:20:13

szim90
Member
Registered: 2011-08-01
Posts: 29

Re: How to pass 'vga=794' to a chain-loaded Arch install?

If you don't want to chainload, and instead use the auto-generated entries, may need to add this to your /etc/default/grub:

GRUB_GFXPAYLOAD_LINUX=keep

If that fails, you should add the vga option to the "GRUB_CMDLINE_LINUX_DEFAULT=" line
(ref: https://wiki.archlinux.org/index.php/GR … esolution)

Regardless of what method you use, you will need to regenerate grub.

If both of those methods fail, you can manually append the vga flag to the "linux" line in Arch's menu entry in grub.cfg. However, if you do this, then the changes will be lost whenever grub is regenerated.

Offline

#14 2011-08-10 20:11:07

wilberfan
Member
From: So. Cal
Registered: 2010-12-18
Posts: 264

Re: How to pass 'vga=794' to a chain-loaded Arch install?

szim90 wrote:

If you don't want to chainload, and instead use the auto-generated entries, may need to add this to your /etc/default/grub:

GRUB_GFXPAYLOAD_LINUX=keep

If that fails, you should add the vga option to the "GRUB_CMDLINE_LINUX_DEFAULT=" line
(ref: https://wiki.archlinux.org/index.php/GR … esolution)

Regardless of what method you use, you will need to regenerate grub.

If both of those methods fail, you can manually append the vga flag to the "linux" line in Arch's menu entry in grub.cfg. However, if you do this, then the changes will be lost whenever grub is regenerated.

Well, your first two suggestions failed.  I manually applied the vga flag in the Debian grub.cfg, and that DID work.  It's better than having to enter the flag at every boot (like I've been doing), but it's obviously not a perfect solution.


Hey, be nice...I'm new at this!

Offline

Board footer

Powered by FluxBB