]> git.proxmox.com Git - grub2.git/commitdiff
* Backport from upstream, removing the need for Breaks: udev (<< 168-1):
authorColin Watson <cjwatson@debian.org>
Tue, 31 May 2011 08:17:59 +0000 (09:17 +0100)
committerColin Watson <cjwatson@debian.org>
Tue, 31 May 2011 08:17:59 +0000 (09:17 +0100)
  - Don't stat devices unless we have to.

debian/changelog
debian/control
debian/patches/lazy_stat.patch [new file with mode: 0644]
debian/patches/series
debian/rules

index 6f520ef824ab8c0e1ec750371e3261ec1f542670..3d0d884cb74d5dc2176b1c904dbc2eb0956f316f 100644 (file)
@@ -2,6 +2,8 @@ grub2 (1.99-6) UNRELEASED; urgency=low
 
   [ Colin Watson ]
   * Update Vcs-* fields for Alioth changes.
+  * Backport from upstream, removing the need for Breaks: udev (<< 168-1):
+    - Don't stat devices unless we have to.
 
   [ Debconf translations ]
   * Catalan (Jordi Mallach).
index 7daea76c89325c5bf4076b003f36b4d678168571..290121baa881f7605c4f54b977a38c2e1e476422 100644 (file)
@@ -72,7 +72,7 @@ Recommends: os-prober (>= 1.33)
 Suggests: multiboot-doc, grub-emu, xorriso (>= 0.5.6.pl00), desktop-base (>= 4.0.6)
 # See bugs #435983 and #455746
 Conflicts: mdadm (<< 2.6.7-2)
-Breaks: lupin-support (<< 0.30), ${udev-Breaks}
+Breaks: lupin-support (<< 0.30)
 Multi-Arch: foreign
 Description: GRand Unified Bootloader (common files)
  This package contains common files shared by the distinct flavours of GRUB.
diff --git a/debian/patches/lazy_stat.patch b/debian/patches/lazy_stat.patch
new file mode 100644 (file)
index 0000000..b2cdfd2
--- /dev/null
@@ -0,0 +1,73 @@
+Description: Don't stat devices unless we have to
+Author: Vladimir Serbinenko <phcoder@gmail.com>
+Author: Colin Watson <cjwatson@ubuntu.com>
+Bug-Debian: http://bugs.debian.org/627587
+Forwarded: yes
+Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3318
+Last-Update: 2011-05-31
+
+Index: b/grub-core/kern/emu/getroot.c
+===================================================================
+--- a/grub-core/kern/emu/getroot.c
++++ b/grub-core/kern/emu/getroot.c
+@@ -358,7 +358,7 @@
+       if (S_ISLNK (st.st_mode)) {
+ #ifdef __linux__
+-      if (strcmp (dir, "mapper") == 0) {
++      if (strcmp (dir, "mapper") == 0 || strcmp (dir, "/dev/mapper") == 0) {
+         /* Follow symbolic links under /dev/mapper/; the canonical name
+            may be something like /dev/dm-0, but the names under
+            /dev/mapper/ are more human-readable and so we prefer them if
+@@ -609,20 +609,27 @@
+   if (os_dev)
+     {
+-      if (stat (os_dev, &st) >= 0)
+-      dev = st.st_rdev;
+-      else
+-      grub_util_error ("cannot stat `%s'", os_dev);
+-      free (os_dev);
++      char *tmp = os_dev;
++      os_dev = canonicalize_file_name (os_dev);
++      free (tmp);
+     }
+-  else
++
++  if (os_dev)
+     {
+-      if (stat (dir, &st) >= 0)
+-      dev = st.st_dev;
+-      else
+-      grub_util_error ("cannot stat `%s'", dir);
++      if (strncmp (os_dev, "/dev/dm-", sizeof ("/dev/dm-") - 1) != 0)
++      return os_dev;
++      if (stat (os_dev, &st) < 0)
++      grub_util_error ("cannot stat `%s'", os_dev);
++      free (os_dev);
++      dev = st.st_rdev;
++      return grub_find_device ("/dev/mapper", dev);
+     }
++  if (stat (dir, &st) < 0)
++    grub_util_error ("cannot stat `%s'", dir);
++
++  dev = st.st_dev;
++  
+ #ifdef __CYGWIN__
+   /* Cygwin specific function.  */
+   os_dev = grub_find_device (dir, dev);
+Index: b/grub-core/kern/emu/hostdisk.c
+===================================================================
+--- a/grub-core/kern/emu/hostdisk.c
++++ b/grub-core/kern/emu/hostdisk.c
+@@ -1420,7 +1420,8 @@
+                 if (tree)
+                   dm_tree_free (tree);
+                 free (path);
+-                char *ret = grub_find_device (NULL, (major << 8) | minor);
++                char *ret = grub_find_device ("/dev/mapper",
++                                              (major << 8) | minor);
+                 return ret;
+               }
index 904aece2ed9d9532b9b52872d10845441222d998..d06120de74875fecbcdbcd0e0c089e5eceab5e60 100644 (file)
@@ -17,3 +17,4 @@ branch_embed-sectors.patch
 branch_fuse.patch
 mkrescue_efi_modules.patch
 mkconfig_loopback.patch
+lazy_stat.patch
index 975ae8958dacceddab70da91a90e29d606971ce5..8bc4cb39c446fe0314c3c127b38ec4347c08859c 100755 (executable)
@@ -253,14 +253,6 @@ override_dh_installdocs:
 override_dh_strip:
        dh_strip -X/usr/bin/grub-emu
 
-override_dh_gencontrol:
-ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
-       echo 'udev-Breaks=' >>debian/grub-common.substvars
-else
-       echo 'udev-Breaks=udev (<< 168-1)' >>debian/grub-common.substvars
-endif
-       dh_gencontrol
-
 override_dh_auto_clean:
        -rm -rf build
        -rm -f contrib grub-core/contrib