Bug#505517: grub-pc: Patch Update on Lenny with 1.97~beta3-1 binaries
Ian MacDonald
imac at netstatz.com
Wed Oct 21 19:24:12 UTC 2009
Package: grub-pc
Version: 1.97~beta3-1
Followup-For: Bug #505517
Using the patches (second set) above was a bit non-trivial. In the end our system now adds Xen entries correctly.
Below is the output,
-- BEGIN OUTPUT --
endor:/usr/src# cat grub-pc_00_allow_xen.patch | patch -p0
patching file /etc/grub.d/10_linux
Hunk #1 succeeded at 21 with fuzz 2.
Hunk #2 FAILED at 31.
1 out of 2 hunks FAILED -- saving rejects to file /etc/grub.d/10_linux.rej
patching file /etc/grub.d/common
endor:/usr/src# cat grub-pc_01_allow_xen.patch | patch -p0
patching file /etc/grub.d/09_xen
patch: **** malformed patch at line 127:
endor:/usr/src# cat grub-pc_02_allow_xen.patch | patch -p0
patching file /etc/default/grub
Hunk #1 FAILED at 10.
1 out of 1 hunk FAILED -- saving rejects to file /etc/default/grub.rej
patching file /usr/sbin/update-grub
Hunk #1 FAILED at 152.
1 out of 1 hunk FAILED -- saving rejects to file /usr/sbin/update-grub.rej
-- END OUTPUT --
Here is what we did following the attempted patching above,
On 00 we kept the original 10_linux, let it create /etc/grub.d/common from the patch.
On 01 we created 09_xen by hand, making it executable (not sure why the patch failed)
On 02 we manually edited /default/grub after inspecting the diff and skipped fixing update-grub as it seemed legacy
In the end, it seems to work, the output looks a bit buggy, shown below using a legacy lib:
cheers,
iMac
endor:~# update-grub
Generating grub.cfg ...
Warning: update-grub_lib is deprecated, use grub-mkconfig_lib instead
Found Xen hypervisor image: /boot/xen-3.2-1-amd64.gz
\tFound linux image: /boot/vmlinuz-2.6.26-2-xen-amd64
\tFound initrd image: /boot/initrd.img-2.6.26-2-xen-amd64
Found linux image: /boot/vmlinuz-2.6.26-2-xen-amd64
Found initrd image: /boot/initrd.img-2.6.26-2-xen-amd64
Found linux image: /boot/vmlinuz-2.6.26-2-amd64
Found initrd image: /boot/initrd.img-2.6.26-2-amd64
done
endor:~#
In our grub.cfg we now have the desired section for xen as shown below.
We pulled our binaries from squeeze as we stumbled on some other grub2 issues related to our GPT+RAID+Crypto+LVM setup described in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=548156
-- Package-specific info:
*********************** BEGIN /proc/mounts
/dev/mapper/vg2-endor_root / ext3 rw,errors=remount-ro,data=ordered 0 0
/dev/md0 /boot ext3 rw,errors=continue,data=ordered 0 0
*********************** END /proc/mounts
*********************** BEGIN /boot/grub/device.map
(hd0) /dev/sda
(hd1) /dev/sdb
*********************** END /boot/grub/device.map
*********************** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
set default=0
insmod raid
insmod mdraid
insmod ext2
set root=(md0)
search --no-floppy --fs-uuid --set c84af6a1-1079-4ff7-9760-61c619549df1
if loadfont /grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
set timeout=5
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/09_xen ###
insmod raid
insmod mdraid
insmod ext2
set root=(md0)
search --no-floppy --fs-uuid --set c84af6a1-1079-4ff7-9760-61c619549df1
menuentry "Debian Xen hypervisor 3.2-1-amd64, linux 2.6.26-2-xen-amd64" {
multiboot /xen-3.2-1-amd64.gz
module /vmlinuz-2.6.26-2-xen-amd64 root=/dev/mapper/vg2-endor_root ro
module /initrd.img-2.6.26-2-xen-amd64
}
menuentry "Debian Xen hypervisor 3.2-1-amd64, linux 2.6.26-2-xen-amd64 (single-user mode)" {
multiboot /xen-3.2-1-amd64.gz
module /vmlinuz-2.6.26-2-xen-amd64 root=/dev/mapper/vg2-endor_root ro single
module /initrd.img-2.6.26-2-xen-amd64
}
### END /etc/grub.d/09_xen ###
### BEGIN /etc/grub.d/10_linux ###
menuentry "Debian GNU/Linux, Linux 2.6.26-2-xen-amd64" {
insmod raid
insmod mdraid
insmod ext2
set root=(md0)
search --no-floppy --fs-uuid --set c84af6a1-1079-4ff7-9760-61c619549df1
linux /vmlinuz-2.6.26-2-xen-amd64 root=/dev/mapper/vg2-endor_root ro
initrd /initrd.img-2.6.26-2-xen-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.26-2-xen-amd64 (recovery mode)" {
insmod raid
insmod mdraid
insmod ext2
set root=(md0)
search --no-floppy --fs-uuid --set c84af6a1-1079-4ff7-9760-61c619549df1
linux /vmlinuz-2.6.26-2-xen-amd64 root=/dev/mapper/vg2-endor_root ro single
initrd /initrd.img-2.6.26-2-xen-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.26-2-amd64" {
insmod raid
insmod mdraid
insmod ext2
set root=(md0)
search --no-floppy --fs-uuid --set c84af6a1-1079-4ff7-9760-61c619549df1
linux /vmlinuz-2.6.26-2-amd64 root=/dev/mapper/vg2-endor_root ro
initrd /initrd.img-2.6.26-2-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.26-2-amd64 (recovery mode)" {
insmod raid
insmod mdraid
insmod ext2
set root=(md0)
search --no-floppy --fs-uuid --set c84af6a1-1079-4ff7-9760-61c619549df1
linux /vmlinuz-2.6.26-2-amd64 root=/dev/mapper/vg2-endor_root ro single
initrd /initrd.img-2.6.26-2-amd64
}
### END /etc/grub.d/10_linux ###
### 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 ###
*********************** END /boot/grub/grub.cfg
-- System Information:
Debian Release: 5.0.3
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.26-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages grub-pc depends on:
ii debconf [debconf-2.0] 1.5.24 Debian configuration management sy
ii grub-common 1.97~beta3-1 GRand Unified Bootloader, version
ii libc6 2.7-18 GNU C Library: Shared libraries
ii ucf 3.0016 Update Configuration File: preserv
grub-pc recommends no packages.
Versions of packages grub-pc suggests:
pn desktop-base <none> (no description available)
pn genisoimage <none> (no description available)
-- debconf information:
grub-pc/kopt_extracted: false
grub2/kfreebsd_cmdline:
* grub-pc/install_devices: /dev/sda, /dev/sdb
grub-pc/postrm_purge_boot_grub: false
* grub2/linux_cmdline:
grub2/kfreebsd_cmdline_default: quiet
* grub2/linux_cmdline_default:
grub-pc/chainload_from_menu.lst: true
More information about the Pkg-grub-devel
mailing list