diff --git a/debian/changelog b/debian/changelog index 995679038..bb5ddc47a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,11 +4,15 @@ grub2 (1.96+20080418-1) unstable; urgency=low - Fixes syntax error when setting GRUB_PRELOAD_MODULES. (Closes: #476517) * Move os-prober to Suggests, to avoid trouble with #476184. (Closes: #476684) + * patches/04_run_grub_mkdevicemap_when_grub_probe_fails.diff: New patch, + does what its name says. (Closes: #467127) + - Also move grub-mkdevicemap from grub-pc to grub-common, so that GRUB + Legacy can use it. [ Updated translations ] * Basque (eu.po) by Piarres Beobide (Closes: #476708) - -- Robert Millan Fri, 18 Apr 2008 15:38:25 +0200 + -- Robert Millan Sat, 26 Apr 2008 20:06:55 +0200 grub2 (1.96+20080413-1) unstable; urgency=high diff --git a/debian/control b/debian/control index db521a321..0229dcb7a 100644 --- a/debian/control +++ b/debian/control @@ -42,9 +42,9 @@ Description: GRand Unified Bootloader, version 2 (common files) Package: grub-pc Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64 -Depends: ${shlibs:Depends}, ${misc:Depends}, grub-common, debconf +Depends: ${shlibs:Depends}, ${misc:Depends}, grub-common (>> 1.96+20080413-1), debconf Provides: grub -Replaces: pupa, grub, grub2 (<< ${Source-Version}) +Replaces: pupa, grub, grub2 (<< ${Source-Version}), grub-common (<= 1.96+20080413-1) Conflicts: pupa, grub, desktop-base (= 4.0.5) Suggests: desktop-base (>= 4.0.6), os-prober Description: GRand Unified Bootloader, version 2 (PC/BIOS version) @@ -76,9 +76,9 @@ Description: GRUB bootable rescue images, version 2 (PC/BIOS version) Package: grub-linuxbios Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64 -Depends: ${shlibs:Depends}, ${misc:Depends}, grub-common +Depends: ${shlibs:Depends}, ${misc:Depends}, grub-common (>> 1.96+20080413-1) Provides: grub -Replaces: pupa, grub, grub2 (<< ${Source-Version}) +Replaces: pupa, grub, grub2 (<< ${Source-Version}), grub-common (<= 1.96+20080413-1) Conflicts: pupa, grub Suggests: os-prober Description: GRand Unified Bootloader, version 2 (LinuxBIOS version) @@ -96,9 +96,9 @@ Description: GRand Unified Bootloader, version 2 (LinuxBIOS version) Package: grub-efi Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64 -Depends: ${shlibs:Depends}, ${misc:Depends}, grub-common +Depends: ${shlibs:Depends}, ${misc:Depends}, grub-common (>> 1.96+20080413-1) Provides: grub -Replaces: pupa, grub, grub2 (<< ${Source-Version}) +Replaces: pupa, grub, grub2 (<< ${Source-Version}), grub-common (<= 1.96+20080413-1) Conflicts: pupa, grub Suggests: os-prober Description: GRand Unified Bootloader, version 2 (EFI version) @@ -117,10 +117,10 @@ Description: GRand Unified Bootloader, version 2 (EFI version) Package: grub-ieee1275 Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64 powerpc ppc64 -Depends: ${shlibs:Depends}, ${misc:Depends}, grub-common, +Depends: ${shlibs:Depends}, ${misc:Depends}, grub-common (>> 1.96+20080413-1), powerpc-ibm-utils [powerpc ppc64], powerpc-utils [powerpc ppc64], bc [powerpc ppc64] Provides: grub -Replaces: pupa, grub, grub2 (<< ${Source-Version}) +Replaces: pupa, grub, grub2 (<< ${Source-Version}), grub-common (<= 1.96+20080413-1) Conflicts: pupa, grub Suggests: os-prober Description: GRand Unified Bootloader, version 2 (Open Firmware version) diff --git a/debian/grub-common.dirs b/debian/grub-common.dirs new file mode 100644 index 000000000..236670a2d --- /dev/null +++ b/debian/grub-common.dirs @@ -0,0 +1 @@ +usr/sbin diff --git a/debian/grub-common.install b/debian/grub-common.install new file mode 100644 index 000000000..2a8cfd0ae --- /dev/null +++ b/debian/grub-common.install @@ -0,0 +1,2 @@ +build/grub-common/grub-probe usr/sbin +build/grub-common/grub-mkdevicemap usr/sbin diff --git a/debian/patches/04_run_grub_mkdevicemap_when_grub_probe_fails.diff b/debian/patches/04_run_grub_mkdevicemap_when_grub_probe_fails.diff new file mode 100644 index 000000000..a23045f1a --- /dev/null +++ b/debian/patches/04_run_grub_mkdevicemap_when_grub_probe_fails.diff @@ -0,0 +1,62 @@ + +Author: rmh + +Upstream is discussing a long-term solution, like getting rid of device.map +altogether. In the meantime we needs something that works. + +Note: grub-common tweaked in debian/rules to provide grub-mkdevicemap; this +will probably need to change when we get rid of this patch. + +--- ../grub2/util/biosdisk.c 2008-04-07 18:45:01.000000000 +0200 ++++ ./util/biosdisk.c 2008-04-24 10:46:36.000000000 +0200 +@@ -480,6 +480,8 @@ static struct grub_disk_dev grub_util_bi + .next = 0 + }; + ++static char *dev_map; ++ + static void + read_device_map (const char *dev_map) + { +@@ -566,8 +568,9 @@ read_device_map (const char *dev_map) + } + + void +-grub_util_biosdisk_init (const char *dev_map) ++grub_util_biosdisk_init (const char *path) + { ++ dev_map = strdup (path); + read_device_map (dev_map); + grub_disk_dev_register (&grub_util_biosdisk_dev); + } +@@ -675,7 +678,7 @@ get_os_disk (const char *os_dev) + } + + static int +-find_drive (const char *os_dev) ++__find_drive (const char *os_dev) + { + int i; + char *os_disk; +@@ -695,6 +698,21 @@ find_drive (const char *os_dev) + return -1; + } + ++static int ++find_drive (const char *os_dev) ++{ ++ int ret; ++ ret = __find_drive (os_dev); ++ if (ret < 0) ++ { ++ grub_util_info ("Cannot find a GRUB drive for `%s', will regenerate device.map and try again", os_dev); ++ system ("grub-mkdevicemap"); ++ read_device_map (dev_map); ++ ret = __find_drive (os_dev); ++ } ++ return ret; ++} ++ + char * + grub_util_biosdisk_get_grub_dev (const char *os_dev) + { diff --git a/debian/rules b/debian/rules index 7d34818f0..1b23ec1d1 100644 --- a/debian/rules +++ b/debian/rules @@ -31,6 +31,10 @@ configure/grub-pc configure/grub-ieee1275 configure/grub-efi configure/grub-linu mkdir -p $(subst configure/,build/,$@) cd $(subst configure/,build/,$@) && $(CONFIGURE) --with-platform=$(subst configure/grub-,,$@) +configure/grub-common:: + mkdir -p build/grub-common + cd build/grub-common && $(CONFIGURE) + build/grub-pc build/grub-efi build/grub-ieee1275 build/grub-linuxbios:: $(MAKE) -C $@ @@ -47,14 +51,17 @@ build/grub-rescue-pc:: build/grub-pc --image-type=cdrom \ $(CURDIR)/$@/grub-rescue-cdrom.iso +build/grub-common:: + # Yes, grub-mkdevicemap shouldn't really be here. We're assuming 'pc' + # for i386 and 'ieee1275' for powerpc. Not a big deal though. See + # also debian/patches/04_run_grub_mkdevicemap_when_grub_probe_fails.diff + $(MAKE) -C $@ grub-probe grub-mkdevicemap + install/grub-pc install/grub-efi install/grub-ieee1275 install/grub-linuxbios:: $(MAKE) -C $(subst install/,build/,$@) install DESTDIR=$(CURDIR)/debian/$(subst install/,,$@)/ - # grub-probe is shipped with grub-common - mkdir -p $(CURDIR)/debian/grub-common/{usr/sbin,usr/share/man/man8} - for i in usr/sbin/grub-probe usr/share/man/man8/grub-probe.8 ; do \ - mv $(CURDIR)/debian/$(subst install/,,$@)/$$i $(CURDIR)/debian/grub-common/$$i ; \ - done + # shipped with grub-common + rm -f $(CURDIR)/debian/$(subst install/,,$@)/{usr/sbin/grub-{probe,mkdevicemap},usr/share/man/man8/grub-probe.8} for i in docs ; do \ cp debian/$$i.in debian/$(subst install/,,$@).$$i ; \