Bug#467169: grub-pc: [PATCH] fails to handle resume=/dev/... or more than one option - in debconf
Alban Browaeys
prahal at yahoo.com
Sat Feb 23 13:24:57 UTC 2008
Package: grub-pc
Version: 1.96+20080219-2
Severity: normal
Tags: patch
Hi thank you for the vastly improved package . I finally made the
switch.
Here is a patch for the only remaining issues I found ie :
- if there is slashes in the kopt of old menu.lst postinst fails in sed
expression. I did not replace slashes in the sed expression by other
characters as they may be also used for other needs in the boot
parameters . Instead I made pass with RET=$(printf '%s' $RET| sed
's|/|\\/|g') to escape them before feeding the kopt value to :
sed -i /etc/default/grub -e
"s/^\(GRUB_CMDLINE_LINUX\)=.*/\1=\"$RET\"/g"
- in the config file :
kopt=`sed -ne "s/^# kopt=//p" /boot/grub/menu.lst | tr -s " " "\n"
| grep -vx "\(ro\|root=[^ ]*\)"` || true
returns a set of lines which only the first one is grabbed in :
db_set grub-pc/linux_cmdline "${kopt}" || true
To fix this I added : | tr -s "\n" " "
at the end of the expression to get a single line so more than one
boot parameter is taken into account.
I am happily using grub-pc right now having learned a bit of debconf on
the way. Thanks again
Alban
-- Package-specific info:
*********************** BEGIN
/dev/root / ext3 rw,errors=remount-ro,commit=5,data=ordered 0 0
/dev/root /dev/.static/dev ext3 rw,errors=remount-ro,commit=5,data=ordered 0 0
/dev/root /scratchbox/users/prahal/scratchbox ext3 rw,errors=remount-ro,commit=5,data=ordered 0 0
/dev/root /scratchbox/users/prahal/tmp ext3 rw,errors=remount-ro,commit=5,data=ordered 0 0
*********************** END
*********************** BEGIN /boot/grub/device.map
(hd0) /dev/sda
*********************** END /boot/grub/device.map
*********************** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/update-grub using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
set default=0
set timeout=5
set root=(hd0,1)
if font (hd0,1)/usr/share/grub/unicode.pff ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
terminal gfxterm
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
insmod tga
if background_image (hd0,1)/usr/share/images/grub/Apollo_17_The_Last_Moon_Shot_Edit1.tga ; then
set color_normal=black/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_debian_theme ###
### BEGIN /etc/grub.d/10_hurd ###
### END /etc/grub.d/10_hurd ###
### BEGIN /etc/grub.d/10_linux ###
menuentry "Debian GNU/Linux, linux 2.6.25-rc2-git6" {
linux (hd0,1)/boot/vmlinuz-2.6.25-rc2-git6 root=/dev/sda1 ro resume=/dev/sda3 splash vga=0x317
}
menuentry "Debian GNU/Linux, linux 2.6.25-rc2-git6 (single-user mode)" {
linux (hd0,1)/boot/vmlinuz-2.6.25-rc2-git6 root=/dev/sda1 ro single resume=/dev/sda3 splash vga=0x317
}
menuentry "Debian GNU/Linux, linux 2.6.25-rc2-git6.old" {
linux (hd0,1)/boot/vmlinuz-2.6.25-rc2-git6.old root=/dev/sda1 ro resume=/dev/sda3 splash vga=0x317
}
menuentry "Debian GNU/Linux, linux 2.6.25-rc2-git6.old (single-user mode)" {
linux (hd0,1)/boot/vmlinuz-2.6.25-rc2-git6.old root=/dev/sda1 ro single resume=/dev/sda3 splash vga=0x317
}
menuentry "Debian GNU/Linux, linux 2.6.24-1-686" {
linux (hd0,1)/boot/vmlinuz-2.6.24-1-686 root=/dev/sda1 ro resume=/dev/sda3 splash vga=0x317
initrd (hd0,1)/boot/initrd.img-2.6.24-1-686
}
menuentry "Debian GNU/Linux, linux 2.6.24-1-686 (single-user mode)" {
linux (hd0,1)/boot/vmlinuz-2.6.24-1-686 root=/dev/sda1 ro single resume=/dev/sda3 splash vga=0x317
initrd (hd0,1)/boot/initrd.img-2.6.24-1-686
}
menuentry "Debian GNU/Linux, linux 2.6.23-1-686" {
linux (hd0,1)/boot/vmlinuz-2.6.23-1-686 root=/dev/sda1 ro resume=/dev/sda3 splash vga=0x317
initrd (hd0,1)/boot/initrd.img-2.6.23-1-686
}
menuentry "Debian GNU/Linux, linux 2.6.23-1-686 (single-user mode)" {
linux (hd0,1)/boot/vmlinuz-2.6.23-1-686 root=/dev/sda1 ro single resume=/dev/sda3 splash vga=0x317
initrd (hd0,1)/boot/initrd.img-2.6.23-1-686
}
menuentry "Debian GNU/Linux, linux 2.6.22-3-686" {
linux (hd0,1)/boot/vmlinuz-2.6.22-3-686 root=/dev/sda1 ro resume=/dev/sda3 splash vga=0x317
initrd (hd0,1)/boot/initrd.img-2.6.22-3-686
}
menuentry "Debian GNU/Linux, linux 2.6.22-3-686 (single-user mode)" {
linux (hd0,1)/boot/vmlinuz-2.6.22-3-686 root=/dev/sda1 ro single resume=/dev/sda3 splash vga=0x317
initrd (hd0,1)/boot/initrd.img-2.6.22-3-686
}
menuentry "Debian GNU/Linux, linux 2.6.22-2-686" {
linux (hd0,1)/boot/vmlinuz-2.6.22-2-686 root=/dev/sda1 ro resume=/dev/sda3 splash vga=0x317
initrd (hd0,1)/boot/initrd.img-2.6.22-2-686
}
menuentry "Debian GNU/Linux, linux 2.6.22-2-686 (single-user mode)" {
linux (hd0,1)/boot/vmlinuz-2.6.22-2-686 root=/dev/sda1 ro single resume=/dev/sda3 splash vga=0x317
initrd (hd0,1)/boot/initrd.img-2.6.22-2-686
}
menuentry "Debian GNU/Linux, linux 2.6.22-1-686" {
linux (hd0,1)/boot/vmlinuz-2.6.22-1-686 root=/dev/sda1 ro resume=/dev/sda3 splash vga=0x317
initrd (hd0,1)/boot/initrd.img-2.6.22-1-686
}
menuentry "Debian GNU/Linux, linux 2.6.22-1-686 (single-user mode)" {
linux (hd0,1)/boot/vmlinuz-2.6.22-1-686 root=/dev/sda1 ro single resume=/dev/sda3 splash vga=0x317
initrd (hd0,1)/boot/initrd.img-2.6.22-1-686
}
menuentry "Debian GNU/Linux, linux 2.6.21-2-686" {
linux (hd0,1)/boot/vmlinuz-2.6.21-2-686 root=/dev/sda1 ro resume=/dev/sda3 splash vga=0x317
initrd (hd0,1)/boot/initrd.img-2.6.21-2-686
}
menuentry "Debian GNU/Linux, linux 2.6.21-2-686 (single-user mode)" {
linux (hd0,1)/boot/vmlinuz-2.6.21-2-686 root=/dev/sda1 ro single resume=/dev/sda3 splash vga=0x317
initrd (hd0,1)/boot/initrd.img-2.6.21-2-686
}
### END /etc/grub.d/10_linux ###
*********************** END /boot/grub/grub.cfg
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.25-rc2-git6 (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages grub-pc depends on:
ii base-files 4.0.2 Debian base system miscellaneous f
ii debconf [debconf-2.0] 1.5.19 Debian configuration management sy
ii libc6 2.7-8 GNU C Library: Shared libraries
ii liblzo1 1.08-3 data compression library (old vers
ii libncurses5 5.6+20080203-1 Shared libraries for terminal hand
grub-pc recommends no packages.
-- debconf information:
grub-pc/linux_cmdline:
* grub-pc/chainload_from_menu.lst: true
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grub-pc_debconf_multiplebootparams_and_slash.diff
Type: text/x-patch
Size: 1415 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20080223/94767f1f/attachment.bin
More information about the Pkg-grub-devel
mailing list