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


diff -uNr grub2-1.96+20080219.orig/debian/grub-pc.config grub2-1.96+20080219/debian/grub-pc.config
--- grub2-1.96+20080219.orig/debian/grub-pc.config	2008-02-23 13:56:29.000000000 +0100
+++ grub2-1.96+20080219/debian/grub-pc.config	2008-02-23 02:18:49.000000000 +0100
@@ -8,7 +8,7 @@
   db_get grub-pc/linux_cmdline
   # this check ensures we only do this once
   if [ "$RET" = "fillme" ] ; then
-    kopt=`sed -ne "s/^# kopt=//p" /boot/grub/menu.lst | tr -s " " "\n" | grep -vx "\(ro\|root=[^ ]*\)"` || true
+    kopt=`sed -ne "s/^# kopt=//p" /boot/grub/menu.lst | tr -s " " "\n" | grep -vx "\(ro\|root=[^ ]*\)" | tr -s "\n" " "` || true
     db_set grub-pc/linux_cmdline "${kopt}" || true
     if [ "${kopt}" == "" ] ; then
       # something smells bad.  give user a chance to correct it.
diff -uNr grub2-1.96+20080219.orig/debian/grub-pc.postinst grub2-1.96+20080219/debian/grub-pc.postinst
--- grub2-1.96+20080219.orig/debian/grub-pc.postinst	2008-02-23 13:56:29.000000000 +0100
+++ grub2-1.96+20080219/debian/grub-pc.postinst	2008-02-23 13:58:23.000000000 +0100
@@ -19,6 +19,7 @@
         echo "Internal error in grub-pc package.  Please file a bug report." >&2
         exit 1
       elif [ "$RET" != "" ] ; then
+      	RET="$(printf '%s' "$RET" | sed 's|/|\\/|g')"
         sed -i /etc/default/grub -e "s/^\(GRUB_CMDLINE_LINUX\)=.*/\1=\"$RET\"/g"
         db_set grub-pc/linux_cmdline "" || true
       fi

Reply via email to