grub2 1.96+20080724-8

Robert Millan rmh at aybabtu.com
Sat Aug 23 16:46:51 UTC 2008


Hi,

Please consider approving grub2 1.96+20080724-8.  A debdiff is attached.

Thanks

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
-------------- next part --------------
diff -u grub2-1.96+20080724/debian/changelog grub2-1.96+20080724/debian/changelog
--- grub2-1.96+20080724/debian/changelog
+++ grub2-1.96+20080724/debian/changelog
@@ -1,3 +1,21 @@
+grub2 (1.96+20080724-8) unstable; urgency=high
+
+  [ Felix Zielcke ]
+  * patches/00_fix_raid0.diff: Fix a `small' incorrect calculation for raid 0.
+  * patches/09_handle_md_slash_N.diff: Add support for /dev/md/N style mdraid
+    devices. (Closes: #475585, #464215)
+  * patches/10_handle_lvm_dash_escaping.diff: LVM escapes a dash with a dash and GRUB
+    doestn't like that, so remove the double dashes. (Closes #494383)
+
+  [ Robert Millan ]
+  * Handle errors in RAID/LVM scan routine (rather than letting the upper
+    layer cope with them).  (Closes: #494501, #495049)
+    - debian/patches/00_raid_lvm_error_handling.diff: Fix the actual problem.
+    - debian/patches/00_grub_print_error.diff: Fix a bug exposed by
+      00_raid_lvm_error_handling.diff.
+
+ -- Robert Millan <rmh at aybabtu.com>  Mon, 18 Aug 2008 15:17:29 +0200
+
 grub2 (1.96+20080724-7) unstable; urgency=high
 
   * Make build-dependency on unifont-bin versioned (<< 1:5.1.20080706-1)
only in patch2:
unchanged:
--- grub2-1.96+20080724.orig/debian/patches/00_grub_print_error.diff
+++ grub2-1.96+20080724/debian/patches/00_grub_print_error.diff
@@ -0,0 +1,111 @@
+
+Prevents error handling fixes in disk/{raid,lvm}.c from breaking scripts
+that rely on grub-probe.
+
+2008-08-14  Felix Zielcke  <fzielcke at z-51.de>
+
+        * include/grub/err.h (grub_err_printf): New function prototype.
+        * util/misc.c (grub_err_printf): New function.
+        * kern/misc.c [! GRUB_UTIL] (grub_err_printf): New alias for
+        grub_printf.
+        * kern/err.c (grub_print_error): Use grub_err_printf.
+
+Index: kern/err.c
+===================================================================
+--- kern/err.c	(revision 1804)
++++ kern/err.c	(revision 1805)
+@@ -1,7 +1,7 @@
+ /* err.c - error handling routines */
+ /*
+  *  GRUB  --  GRand Unified Bootloader
+- *  Copyright (C) 2002,2005,2007  Free Software Foundation, Inc.
++ *  Copyright (C) 2002,2005,2007,2008  Free Software Foundation, Inc.
+  *
+  *  GRUB is free software: you can redistribute it and/or modify
+  *  it under the terms of the GNU General Public License as published by
+@@ -121,14 +121,14 @@
+   do
+     {
+       if (grub_errno != GRUB_ERR_NONE)
+-        grub_printf ("error: %s\n", grub_errmsg);
++        grub_err_printf ("error: %s\n", grub_errmsg);
+     } 
+   while (grub_error_pop ());
+   
+   /* If there was an assert while using error stack, report about it.  */
+   if (grub_error_stack_assert)
+     {
+-      grub_printf ("assert: error stack overflow detected!\n");
++      grub_err_printf ("assert: error stack overflow detected!\n");
+       grub_error_stack_assert = 0;
+     }
+ }
+Index: kern/misc.c
+===================================================================
+--- kern/misc.c	(revision 1804)
++++ kern/misc.c	(revision 1805)
+@@ -134,6 +134,11 @@
+   return ret;
+ }  
+ 
++#ifndef GRUB_UTIL
++int grub_err_printf (const char *fmt, ...)
++__attribute__ ((alias("grub_printf")));
++#endif
++
+ void
+ grub_real_dprintf (const char *file, const int line, const char *condition,
+ 		   const char *fmt, ...)
+Index: include/grub/err.h
+===================================================================
+--- include/grub/err.h	(revision 1804)
++++ include/grub/err.h	(revision 1805)
+@@ -1,7 +1,7 @@
+ /* err.h - error numbers and prototypes */
+ /*
+  *  GRUB  --  GRand Unified Bootloader
+- *  Copyright (C) 2002,2005,2007  Free Software Foundation, Inc.
++ *  Copyright (C) 2002,2005,2007,2008 Free Software Foundation, Inc.
+  *
+  *  GRUB is free software: you can redistribute it and/or modify
+  *  it under the terms of the GNU General Public License as published by
+@@ -64,5 +64,7 @@
+ void EXPORT_FUNC(grub_error_push) (void);
+ int EXPORT_FUNC(grub_error_pop) (void);
+ void EXPORT_FUNC(grub_print_error) (void);
++int EXPORT_FUNC(grub_err_printf) (const char *fmt, ...)
++__attribute__ ((format (printf, 1, 2)));
+ 
+ #endif /* ! GRUB_ERR_HEADER */
+Index: util/misc.c
+===================================================================
+--- util/misc.c	(revision 1804)
++++ util/misc.c	(revision 1805)
+@@ -1,6 +1,6 @@
+ /*
+  *  GRUB  --  GRand Unified Bootloader
+- *  Copyright (C) 2002,2003,2005,2006,2007  Free Software Foundation, Inc.
++ *  Copyright (C) 2002,2003,2005,2006,2007,2008  Free Software Foundation, Inc.
+  *
+  *  GRUB is free software: you can redistribute it and/or modify
+  *  it under the terms of the GNU General Public License as published by
+@@ -74,6 +74,19 @@
+   exit (1);
+ }
+ 
++int
++grub_err_printf (const char *fmt, ...)
++{
++  va_list ap;
++  int ret;
++  
++  va_start (ap, fmt);
++  ret = vfprintf (stderr, fmt, ap);
++  va_end (ap);
++
++  return ret;
++}
++
+ void *
+ xmalloc (size_t size)
+ {
only in patch2:
unchanged:
--- grub2-1.96+20080724.orig/debian/patches/10_handle_lvm_dash_escaping.diff
+++ grub2-1.96+20080724/debian/patches/10_handle_lvm_dash_escaping.diff
@@ -0,0 +1,24 @@
+--- grub2-1.96+20080724.orig/util/getroot.c	2008-08-12 15:02:14.000000000 +0200
++++ grub2-1.96+20080724/util/getroot.c	2008-08-12 15:05:22.000000000 +0200
+@@ -410,9 +410,22 @@
+   switch (grub_util_get_dev_abstraction (os_dev))
+     {
+     case GRUB_DEV_ABSTRACTION_LVM:
+-      grub_dev = xmalloc (strlen (os_dev) - 12 + 1);
++      {
++        unsigned char i, j, k, l;
+ 
+-      strcpy (grub_dev, os_dev + 12);
++        j = sizeof ("/dev/mapper/") -1;
++        l = strlen (os_dev) - j + 1;
++
++        grub_dev = xmalloc (strlen (os_dev) - strlen ("/dev/mapper/") + 1);
++
++        for (i = 0, k = 0; i < l; i++)
++          {
++             grub_dev[k] = os_dev[j + i];
++             k++;
++             if (os_dev[j + i] == '-' && os_dev[j + i + 1] == '-')
++               i++;
++          }
++       }
only in patch2:
unchanged:
--- grub2-1.96+20080724.orig/debian/patches/00_raid_lvm_error_handling.diff
+++ grub2-1.96+20080724/debian/patches/00_raid_lvm_error_handling.diff
@@ -0,0 +1,43 @@
+
+Fix for #494501
+
+2008-08-16  Robert Millan  <rmh at aybabtu.com>
+
+	* disk/raid.c (grub_raid_init): Handle/report errors set by
+	grub_device_iterate().
+	* disk/lvm.c (grub_lvm_init): Likewise.
+
+Index: disk/lvm.c
+===================================================================
+--- disk/lvm.c	(revision 1808)
++++ disk/lvm.c	(revision 1809)
+@@ -586,6 +586,12 @@
+ GRUB_MOD_INIT(lvm)
+ {
+   grub_device_iterate (&grub_lvm_scan_device);
++  if (grub_errno)
++    {
++      grub_print_error ();
++      grub_errno = GRUB_ERR_NONE;
++    }
++
+   grub_disk_dev_register (&grub_lvm_dev);
+ }
+ 
+Index: disk/raid.c
+===================================================================
+--- disk/raid.c	(revision 1808)
++++ disk/raid.c	(revision 1809)
+@@ -580,6 +580,12 @@
+ GRUB_MOD_INIT(raid)
+ {
+   grub_device_iterate (&grub_raid_scan_device);
++  if (grub_errno)
++    {
++      grub_print_error ();
++      grub_errno = GRUB_ERR_NONE;
++    }
++
+   grub_disk_dev_register (&grub_raid_dev);
+ }
+ 
only in patch2:
unchanged:
--- grub2-1.96+20080724.orig/debian/patches/00_fix_raid0.diff
+++ grub2-1.96+20080724/debian/patches/00_fix_raid0.diff
@@ -0,0 +1,15 @@
+--- grub2-1.96+20080724.orig/disk/raid.c	2008-07-04 00:56:43.000000000 +0200
++++ grub2-1.96+20080724/disk/raid.c	2008-08-12 14:09:32.000000000 +0200
+@@ -175,11 +175,11 @@
+ 	    err = grub_disk_read (array->device[disknr], read_sector, 0,
+ 				  read_size << GRUB_DISK_SECTOR_BITS, buf);
+ 	    if (err)
+ 	      break;
+ 
+-	    buf += read_size;
++	    buf += (read_size << GRUB_DISK_SECTOR_BITS);
+ 	    size -= read_size;
+ 	    if (! size)
+ 	      break;
+ 
+ 	    if (size > array->chunk_size)
only in patch2:
unchanged:
--- grub2-1.96+20080724.orig/debian/patches/09_handle_md_slash_N.diff
+++ grub2-1.96+20080724/debian/patches/09_handle_md_slash_N.diff
@@ -0,0 +1,19 @@
+--- grub2-1.96+20080724.orig/util/getroot.c	2008-05-16 23:39:52.000000000 +0200
++++ grub2-1.96+20080724/util/getroot.c	2008-08-12 14:56:14.000000000 +0200
+@@ -461,10 +461,16 @@
+       else if (os_dev[7] >= '0' && os_dev[7] <= '9')
+ 	{
+ 	  memcpy (grub_dev, os_dev + 5, 7);
+ 	  grub_dev[7] = '\0';
+ 	}
++      else if (os_dev[7] == '/' && os_dev[8] >= '0' && os_dev[8] <= '9')
++	{
++	  memcpy (grub_dev, os_dev + 5, 2);
++	  memcpy (grub_dev + 2, os_dev + 8, 5);
++	  grub_dev[7] = '\0';
++	}
+       else
+ 	grub_util_error ("Unknown kind of RAID device `%s'", os_dev);
+ 
+       break;
+ 


More information about the Pkg-grub-devel mailing list