Bug#607642: grub-pc: gurb-mkconfig failure due to incorrect probe

Paul Brook paul at nowt.org
Mon Dec 20 14:48:13 UTC 2010


Package: grub-pc
Version: 1.98+20100804-11
Severity: important
Tags: patch


grub-mkconfig fails on a system where "/" can not be accessed by grub.

The is_path_readable_by_grub function only checks that the filesystem is
known to grub.  In my case (lvm+raid) grub understands the filesystem, but
not device partition mappings. grub-mkconfig incorreclty tries to use files
(specifically unicode.pf2) under /usr, causing 00_header to fail when it calls
prepare_grub_to_access_device for this file.

Patch below fixes this by making is_path_readable_by_grub also probe the
partmap.  grub-mkconfig then correctly falls back to the files in
/boot/grub.

diff -ur clean/util/grub-mkconfig_lib.in grub2/util/grub-mkconfig_lib.in
--- clean/util/grub-mkconfig_lib.in
+++ grub2/util/grub-mkconfig_lib.in
@@ -61,6 +61,11 @@ is_path_readable_by_grub ()
     return 1
   fi
 
+  # abort if file is in a partition we don't know about
+  if ${grub_probe} -t partmap $path > /dev/null 2>&1 ; then : ; else
+    return 1
+  fi
+
   return 0
 }
 

-- Package-specific info:

*********************** BEGIN /proc/mounts
/dev/mapper/volumes-root64 / ext4 rw,noatime,barrier=1,data=ordered 0 0
/dev/mapper/volumes-scratch /scratch ext4 rw,noatime,barrier=1,data=ordered 0 0
/dev/mapper/volumes-home /home ext4 rw,noatime,barrier=1,data=ordered 0 0
/dev/md1 /boot ext3 rw,noatime,errors=continue,barrier=0,data=ordered 0 0
*********************** END /proc/mounts

*********************** BEGIN /boot/grub/device.map
(hd0)	/dev/disk/by-id/ata-WDC_WD3200SD-01KNB0_WD-WMAMR1540877
(hd1)	/dev/disk/by-id/ata-WDC_WD3200SD-01KNB0_WD-WMAMR1541006
(hd2)	/dev/disk/by-id/ata-WDC_WD5000AAKS-00YGA0_WD-WCAS81161381
(hd3)	/dev/disk/by-id/ata-WDC_WD5000AAKS-22YGA0_WD-WCAS82395254
*********************** END /boot/grub/device.map

-- System Information:
Debian Release: 6.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.36-trunk-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.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.37           Debian configuration management sy
ii  grub-common             1.98+20100804-11 GRand Unified Bootloader, version 
ii  libc6                   2.11.2-7         Embedded GNU C Library: Shared lib
ii  libdevmapper1.02.1      2:1.02.48-4      The Linux Kernel Device Mapper use
ii  ucf                     3.0025+nmu1      Update Configuration File: preserv

grub-pc recommends no packages.

Versions of packages grub-pc suggests:
ii  desktop-base                  6.0.4      common files for the Debian Deskto

-- debconf information excluded





More information about the Pkg-grub-devel mailing list