Bug#464839: grub-pc: update-grub does not export user defined variables

Martin Haaß MartinDerHaass at gmx.de
Sat Feb 9 10:04:00 UTC 2008


Package: grub-pc
Version: 1.96+20080203-1
Severity: normal
Tags: patch

User defined variables in /etc/default/grub are not exported to the scripts
run by update-grub. This is a little sed hack to export all variables used
in /etc/default/grub.

-- Package-specific info:

*********************** BEGIN /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / ext3 rw,errors=remount-ro,data=ordered 0 0
tmpfs /lib/init/rw tmpfs rw,nosuid 0 0
proc /proc proc rw,nosuid,nodev,noexec 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec 0 0
/dev/root /dev/.static/dev ext3 rw,errors=remount-ro,data=ordered 0 0
tmpfs /dev tmpfs rw 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,nosuid,noexec 0 0
fusectl /sys/fs/fuse/connections fusectl rw 0 0
/dev/sda1 /media/Vista fuseblk rw,nosuid,nodev,user_id=0,group_id=0,default_permissions,allow_other 0 0
/dev/sda5 /media/Musik fuseblk rw,nosuid,nodev,noexec,user_id=0,group_id=0,default_permissions,allow_other 0 0
*********************** END /proc/mounts

*********************** 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 ###
insmod vmwaredetect
if vmware_detect; then
  set default=1
else
  set default=0
fi
set timeout=5
set root=(hd0,6)
terminal console
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/01_windows ###
menuentry "Windows Vista" {
        
    chainloader (hd0,1)+2
}
### END /etc/grub.d/01_windows ###

### 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/10_hurd ###
### END /etc/grub.d/10_hurd ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Debian GNU/Linux, linux 2.6.24" {
	if vmware_detect; then
		linux (hd0,6)/boot/vmlinuz-2.6.24 root=/dev/sda6 ro vga=790 video=vesafb:ywrap
	else
		linux (hd0,6)/boot/vmlinuz-2.6.24 root=/dev/sda6 ro vga=0f7f
	fi
}
menuentry "Debian GNU/Linux, linux 2.6.23.14" {
	if vmware_detect; then
		linux (hd0,6)/boot/vmlinuz-2.6.23.14 root=/dev/sda6 ro vga=790 video=vesafb:ywrap
	else
		linux (hd0,6)/boot/vmlinuz-2.6.23.14 root=/dev/sda6 ro vga=0f7f
	fi
}
menuentry "Debian GNU/Linux, linux 2.6.23" {
	if vmware_detect; then
		linux (hd0,6)/boot/vmlinuz-2.6.23 root=/dev/sda6 ro vga=790 video=vesafb:ywrap
	else
		linux (hd0,6)/boot/vmlinuz-2.6.23 root=/dev/sda6 ro vga=0f7f
	fi
	initrd	(hd0,6)/boot/initrd.img-2.6.23
}
menuentry "Debian GNU/Linux, linux 2.6.21.1" {
	if vmware_detect; then
		linux (hd0,6)/boot/vmlinuz-2.6.21.1 root=/dev/sda6 ro vga=790 video=vesafb:ywrap
	else
		linux (hd0,6)/boot/vmlinuz-2.6.21.1 root=/dev/sda6 ro vga=0f7f
	fi
	initrd	(hd0,6)/boot/initrd.img-2.6.21.1
}
### END /etc/grub.d/10_linux ###
*********************** END /boot/grub/grub.cfg

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.24 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.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.18         Debian configuration management sy
ii  libc6                     2.7-6          GNU C Library: Shared libraries
ii  liblzo2-2                 2.02-3         data compression library
ii  libncurses5               5.6+20080119-1 Shared libraries for terminal hand

grub-pc recommends no packages.

-- debconf information excluded
-------------- next part --------------
--- update-grub	2008-02-03 20:28:00.000000000 +0100
+++ /usr/sbin/update-grub	2008-02-09 10:49:54.000000000 +0100
@@ -87,6 +87,9 @@
 
 if test -f ${sysconfdir}/default/grub ; then
   . ${sysconfdir}/default/grub
+  for i in `cat ${sysconfdir}/default/grub | sed -r -e '/^#/d' -e 's/(^[^=]*)(=| )(.*)/\1/'`; do
+    export $i
+  done
 fi
 
 # if ${GRUB_TERMINAL} is set, check it has a sane value.  if undefined,


More information about the Pkg-grub-devel mailing list