Package: grub-common
Version: 1.97~beta3-1
Severity: normal
File: /usr/sbin/grub-mkconfig
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The attached patch works around the bug by allowing GRUB_DEVICE to be set in
/etc/default/grub and not probing if its set there.


- -- System Information:
Debian Release: squeeze/sid
  APT prefers oldstable
  APT policy: (500, 'oldstable'), (500, 'testing'), (130, 'unstable'), (120, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-rc5 (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-common depends on:
ii  base-files             5.0.0             Debian base system miscellaneous f
ii  libc6                  2.9-25            GNU C Library: Shared libraries
ii  libfreetype6           2.3.9-5           FreeType 2 font engine, shared lib
ii  libncurses5            5.7+20090803-2    shared libraries for terminal hand
ii  zlib1g                 1:1.2.3.3.dfsg-15 compression library - runtime

Versions of packages grub-common recommends:
pn  os-prober                     <none>     (no description available)

Versions of packages grub-common suggests:
pn  multiboot-doc                 <none>     (no description available)

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkrap/IACgkQ+z+IwlXqWf4fQgCgisuWEqxKKW7G+V6zAdog+bfm
q0MAmQFhHqy/BV06SlC4/9pj/+JWCrq8
=a29R
-----END PGP SIGNATURE-----
Index: grub2-1.97~beta4/util/grub-mkconfig.in
===================================================================
--- grub2-1.97~beta4.orig/util/grub-mkconfig.in	2009-10-18 01:01:21.000000000 -0400
+++ grub2-1.97~beta4/util/grub-mkconfig.in	2009-10-18 01:28:10.000000000 -0400
@@ -30,10 +30,13 @@
 grub_prefix=`echo /boot/grub | sed ${transform}`
 grub_cfg=""
 grub_mkconfig_dir=${sysconfdir}/grub.d
+grub_default_file=${sysconfdir}/default/grub
 
 grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
 grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
 
+. "${grub_default_file}"
+
 # Usage: usage
 # Print the usage.
 usage () {
@@ -119,8 +122,12 @@
 fi
 
 # Device containing our userland.  Typically used for root= parameter.
-GRUB_DEVICE="`${grub_probe} --target=device /`"
-GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
+if [ -z "$GRUB_DEVICE" ]; then
+	GRUB_DEVICE="`${grub_probe} --target=device /`"
+fi
+if [ -z "$GRUB_DEVICE_UUID" ]; then
+	GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
+fi
 
 # Device containing our /boot partition.  Usually the same as GRUB_DEVICE.
 GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`"
@@ -261,6 +268,10 @@
   esac
 done
 
+if [ "x${grub_cfg}" != "x" ] && ! grep -q "^password " ${grub_cfg}.new ; then
+  chmod 444 ${grub_cfg}.new || true
+fi
+
 if test "x${grub_cfg}" != "x" ; then
   # none of the children aborted with error, install the new grub.cfg
   mv -f ${grub_cfg}.new ${grub_cfg}

Reply via email to