Bug#676609: grub2: diff for NMU version 1.99-22.1

Samuel Thibault sthibault at debian.org
Fri Jun 8 08:17:40 UTC 2012


Package: grub2
Version: 1.99-22
Severity: normal
Tags: patch pending

Dear maintainer,

I've prepared an NMU for grub2 (versioned as 1.99-22.1) and
uploaded it to DELAYED/7. Please feel free to tell me if I
should delay it longer.

Regards.
-------------- next part --------------
diff -u grub2-1.99/debian/changelog grub2-1.99/debian/changelog
--- grub2-1.99/debian/changelog
+++ grub2-1.99/debian/changelog
@@ -1,3 +1,14 @@
+grub2 (1.99-22.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Apply upstream patches for hurd-i386:
+    - Test inode number (Closes: #634799).
+    - Disable zfs code on GNU/Hurd (Closes: #670069).
+    - Add userland partition support (Closes: #670186).
+  * Fix packages build without libfuse (Closes: #670189).
+
+ -- Samuel Thibault <sthibault at debian.org>  Fri, 08 Jun 2012 01:19:00 +0200
+
 grub2 (1.99-22) unstable; urgency=low
 
   [ Debconf translations ]
diff -u grub2-1.99/debian/patches/series grub2-1.99/debian/patches/series
--- grub2-1.99/debian/patches/series
+++ grub2-1.99/debian/patches/series
@@ -42,0 +43,3 @@
+dirlen.patch
+hurd.patch
+userland-part.patch
only in patch2:
unchanged:
--- grub2-1.99.orig/debian/grub-mount-udeb.install.hurd-i386
+++ grub2-1.99/debian/grub-mount-udeb.install.hurd-i386
@@ -0,0 +1 @@
+usr/sbin/grub-probe
only in patch2:
unchanged:
--- grub2-1.99.orig/debian/grub-common.install.hurd-i386
+++ grub2-1.99/debian/grub-common.install.hurd-i386
@@ -0,0 +1,37 @@
+../../debian/presubj			usr/share/bug/grub-common
+../../debian/apport/source_grub2.py	usr/share/apport/package-hooks/
+../../debian/grub.d			etc
+
+etc/bash_completion.d
+etc/grub.d
+usr/bin/grub-bin2h
+usr/bin/grub-editenv
+usr/bin/grub-fstest
+usr/bin/grub-kbdcomp
+usr/bin/grub-menulst2cfg
+usr/bin/grub-mkfont
+usr/bin/grub-mkimage
+usr/bin/grub-mklayout
+usr/bin/grub-mkpasswd-pbkdf2
+usr/bin/grub-mkrelpath
+usr/bin/grub-script-check
+usr/sbin/grub-mkconfig
+usr/sbin/grub-mkdevicemap
+usr/sbin/grub-probe
+usr/share/grub
+usr/share/locale
+usr/share/man/man1/grub-bin2h.1
+usr/share/man/man1/grub-editenv.1
+usr/share/man/man1/grub-fstest.1
+usr/share/man/man1/grub-menulst2cfg.1
+usr/share/man/man1/grub-mkfont.1
+usr/share/man/man1/grub-mkimage.1
+usr/share/man/man1/grub-mklayout.1
+usr/share/man/man1/grub-mkpasswd-pbkdf2.1
+usr/share/man/man1/grub-mkrelpath.1
+usr/share/man/man1/grub-script-check.1
+usr/share/man/man8/grub-mkconfig.8
+usr/share/man/man8/grub-mkdevicemap.8
+usr/share/man/man8/grub-probe.8
+usr/bin/grub-mkrescue
+usr/share/man/man1/grub-mkrescue.1
only in patch2:
unchanged:
--- grub2-1.99.orig/debian/patches/userland-part.patch
+++ grub2-1.99/debian/patches/userland-part.patch
@@ -0,0 +1,149 @@
+Description: Handle hurd userspace partitions.
+Author: Samuel Thibault <samuel.thibault at ens-lyon.org>
+Origin: upstream, http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/4290
+Forwarded: not-needed
+Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/4290
+Last-Update: 2012-06-08
+
+--- a/grub-core/kern/emu/getroot.c	2012-05-03 20:59:16 +0000
++++ b/grub-core/kern/emu/getroot.c	2012-05-03 21:41:46 +0000
+@@ -337,6 +337,75 @@
+ 
+ #elif defined (__GNU__)
+ 
++static char *
++find_hurd_root_device (const char *path)
++{
++  file_t file;
++  error_t err;
++  char *argz = NULL, *name = NULL, *ret;
++  size_t argz_len = 0;
++  int i;
++
++  file = file_name_lookup (path, 0, 0);
++  if (file == MACH_PORT_NULL)
++    grub_util_error ("cannot open `%s': %s", path, strerror (errno));
++
++  /* This returns catenated 0-terminated strings.  */
++  err = file_get_fs_options (file, &argz, &argz_len);
++  if (err)
++    grub_util_error ("cannot get filesystem options "
++                       "for path `%s': %s", path, strerror(err));
++  if (argz_len == 0)
++    /* TRANSLATORS: a "translator" is similar to a filesystem, but handled by a
++     * userland daemon.  */
++    grub_util_error ("translator is empty for path `%s'", path);
++
++  /* Make sure the string is terminated.  */
++  argz[argz_len-1] = 0;
++
++  /* Skip first word (translator path) and options.  */
++  for (i = strlen (argz) + 1; i < argz_len; i += strlen (argz + i) + 1)
++    {
++      if (argz[i] != '-')
++        {
++          /* Non-option.  Only accept one, assumed to be the FS path.  */
++          /* XXX: this should be replaced by an RPC to the translator.  */
++          if (name)
++            /* TRANSLATORS: we expect to get something like
++               /hurd/foobar --option1 --option2=baz /dev/something
++             */
++            grub_util_error ("translator `%s' for path `%s' has several "
++                               "non-option words, at least `%s' and `%s'",
++                               argz, path, name, argz + i);
++          name = argz + i;
++        }
++    }
++
++  if (!name)
++    /* TRANSLATORS: we expect to get something like
++       /hurd/foobar --option1 --option2=baz /dev/something
++     */
++    grub_util_error ("translator `%s' for path `%s' is given only options, "
++                       "cannot find device part", argz, path);
++
++  if (strncmp (name, "device:", sizeof ("device:") - 1) == 0)
++    {
++      char *dev_name = name + sizeof ("device:") - 1;
++      size_t size = sizeof ("/dev/") - 1 + strlen (dev_name) + 1;
++      char *next;
++      ret = malloc (size);
++      next = stpncpy (ret, "/dev/", size);
++      stpncpy (next, dev_name, size - (next - ret));
++    }
++  else if (!strncmp (name, "file:", sizeof ("file:") - 1))
++    ret = strdup (name + sizeof ("file:") - 1);
++  else
++    ret = strdup (name);
++
++  munmap (argz, argz_len);
++  return ret;
++}
++
+ #elif ! defined(__CYGWIN__)
+ 
+ char *
+@@ -565,61 +634,8 @@
+ {
+   char *os_dev = NULL;
+ #ifdef __GNU__
+-  file_t file;
+-  mach_port_t *ports;
+-  int *ints;
+-  loff_t *offsets;
+-  char *data;
+-  error_t err;
+-  mach_msg_type_number_t num_ports = 0, num_ints = 0, num_offsets = 0, data_len = 0;
+-  size_t name_len;
+-
+-  file = file_name_lookup (dir, 0, 0);
+-  if (file == MACH_PORT_NULL)
+-    return 0;
+-
+-  err = file_get_storage_info (file,
+-			       &ports, &num_ports,
+-			       &ints, &num_ints,
+-			       &offsets, &num_offsets,
+-			       &data, &data_len);
+-
+-  if (num_ints < 1)
+-    grub_util_error ("Storage info for `%s' does not include type", dir);
+-  if (ints[0] != STORAGE_DEVICE)
+-    grub_util_error ("Filesystem of `%s' is not stored on local disk", dir);
+-
+-  if (num_ints < 5)
+-    grub_util_error ("Storage info for `%s' does not include name", dir);
+-  name_len = ints[4];
+-  if (name_len < data_len)
+-    grub_util_error ("Bogus name length for storage info for `%s'", dir);
+-  if (data[name_len - 1] != '\0')
+-    grub_util_error ("Storage name for `%s' not NUL-terminated", dir);
+-
+-  os_dev = xmalloc (strlen ("/dev/") + data_len);
+-  memcpy (os_dev, "/dev/", strlen ("/dev/"));
+-  memcpy (os_dev + strlen ("/dev/"), data, data_len);
+-
+-  if (ports && num_ports > 0)
+-    {
+-      mach_msg_type_number_t i;
+-      for (i = 0; i < num_ports; i++)
+-        {
+-	  mach_port_t port = ports[i];
+-	  if (port != MACH_PORT_NULL)
+-	    mach_port_deallocate (mach_task_self(), port);
+-        }
+-      munmap ((caddr_t) ports, num_ports * sizeof (*ports));
+-    }
+-
+-  if (ints && num_ints > 0)
+-    munmap ((caddr_t) ints, num_ints * sizeof (*ints));
+-  if (offsets && num_offsets > 0)
+-    munmap ((caddr_t) offsets, num_offsets * sizeof (*offsets));
+-  if (data && data_len > 0)
+-    munmap (data, data_len);
+-  mach_port_deallocate (mach_task_self (), file);
++  /* GNU/Hurd specific function.  */
++  os_dev = find_hurd_root_device (dir);
+ #else /* !__GNU__ */
+   struct stat st;
+   dev_t dev;
only in patch2:
unchanged:
--- grub2-1.99.orig/debian/patches/hurd.patch
+++ grub2-1.99/debian/patches/hurd.patch
@@ -0,0 +1,37 @@
+Description: Fix hurd build by disabling zfs code.
+Author: Samuel Thibault <samuel.thibault at ens-lyon.org>
+Origin: upstream, http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/4237
+Forwarded: not-needed
+Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/4237
+Last-Update: 2012-06-08
+
+--- a/grub-core/kern/emu/getroot.c	2012-04-21 14:49:56 +0000
++++ b/grub-core/kern/emu/getroot.c	2012-04-22 19:02:55 +0000
+@@ -241,6 +241,8 @@ 
+ 
+ #endif /* __linux__ */
+ 
++#if !defined (__GNU__)
++
+ static char *
+ find_device_from_pool (const char *poolname)
+ {
+@@ -322,6 +323,8 @@ 
+   return device;
+ }
+ 
++#endif
++
+ #ifdef __MINGW32__
+ 
+ char *
+@@ -331,6 +331,8 @@ 
+   return 0;
+ }
+ 
++#elif defined (__GNU__)
++
+ #elif ! defined(__CYGWIN__)
+ 
+ char *
+
only in patch2:
unchanged:
--- grub2-1.99.orig/debian/patches/dirlen.patch
+++ grub2-1.99/debian/patches/dirlen.patch
@@ -0,0 +1,19 @@
+Description: Ignore?entries?with direct.inode?=?0.
+Author: Samuel Thibault <samuel.thibault at ens-lyon.org>
+Origin: upstream, http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3749
+Forwarded: not-needed
+Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3749
+Last-Update: 2012-06-08
+
+--- a/grub-core/fs/ext2.c	2012-01-14 10:30:43 +0000
++++ b/grub-core/fs/ext2.c	2012-01-14 10:55:20 +0000
+@@ -685,7 +685,7 @@ grub_ext2_iterate_dir (grub_fshelp_node_
+       if (dirent.direntlen == 0)
+         return 0;
+ 
+-      if (dirent.namelen != 0)
++      if (dirent.inode != 0 && dirent.namelen != 0)
+ 	{
+ 	  char filename[dirent.namelen + 1];
+ 	  struct grub_fshelp_node *fdiro;
+


More information about the Pkg-grub-devel mailing list