On Thu, 2012-02-23 at 07:34 +0100, Vladimir 'φ-coder/phcoder' Serbinenko
wrote:
> > Index: grub/util/getroot.c
> > ===================================================================
> > --- grub.orig/util/getroot.c        2012-02-03 05:22:36.227364000 -0600
> > +++ grub/util/getroot.c     2012-02-03 05:22:41.255135000 -0600
> > @@ -301,7 +301,10 @@
> >                 devices = xrealloc (devices, sizeof (devices[0])
> >                                     * devices_allocated);
> >               }
> > -           devices[ndevices++] = xasprintf ("/dev/%s", name);
> > +           if (name[0] == '/')
> > +             devices[ndevices++] = xstrdup (name);
> > +           else
> > +             devices[ndevices++] = xasprintf ("/dev/%s", name);
> >           }
> >         break;
> >       }
> >
> This one is ok other than the missing ChangeLog.

Updated zfs-devices.patch attached

> @@ -478,7 +558,8 @@
>         if (!*entries[i].device)
>       continue;
> 
> -      if (grub_strcmp (entries[i].fstype, "fuse.zfs") == 0)
> +      if (grub_strcmp (entries[i].fstype, "fuse.zfs") == 0 ||
> +          grub_strcmp (entries[i].fstype, "zfs") == 0)
>       {
>         char *slash;
>         slash = strchr (entries[i].device, '/');
> This should go as a separate patch

Attached as zfs-fstype.patch.

-- 
Richard
Index: grub/util/getroot.c
===================================================================
--- grub.orig/util/getroot.c	2012-02-27 01:09:58.142614829 -0600
+++ grub/util/getroot.c	2012-02-27 01:10:07.237344000 -0600
@@ -302,7 +302,10 @@ find_root_devices_from_poolname (char *p
 		    devices = xrealloc (devices, sizeof (devices[0])
 					* devices_allocated);
 		  }
-		devices[ndevices++] = xasprintf ("/dev/%s", name);
+		if (name[0] == '/')
+		  devices[ndevices++] = xstrdup (name);
+		else
+		  devices[ndevices++] = xasprintf ("/dev/%s", name);
 	      }
 	    break;
 	  }
Index: grub/ChangeLog.zfs-devices
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ grub/ChangeLog.zfs-devices	2012-02-27 01:20:10.839892000 -0600
@@ -0,0 +1,5 @@
+2012-02-27  Richard Laager <rlaa...@wiktel.com>
+
+	* util/getroot.c (find_root_devices_from_poolname): Handle ZFS vdevs
+	  with full paths.
+
Support native ZFS on Linux.

Index: grub/util/getroot.c
===================================================================
--- grub.orig/util/getroot.c	2012-02-27 01:10:07.237344000 -0600
+++ grub/util/getroot.c	2012-02-27 01:24:13.693145000 -0600
@@ -479,7 +479,8 @@ grub_find_root_devices_from_mountinfo (c
       if (!*entries[i].device)
 	continue;
 
-      if (grub_strcmp (entries[i].fstype, "fuse.zfs") == 0)
+      if (grub_strcmp (entries[i].fstype, "fuse.zfs") == 0 ||
+          grub_strcmp (entries[i].fstype, "zfs") == 0)
 	{
 	  char *slash;
 	  slash = strchr (entries[i].device, '/');
Index: grub/ChangeLog.zfs-fstype
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ grub/ChangeLog.zfs-fstype	2012-02-27 01:26:20.548958000 -0600
@@ -0,0 +1,5 @@
+2012-02-27  Richard Laager <rlaa...@wiktel.com>
+
+	* util/getroot.c (grub_find_root_devices_from_mountinfo): Support
+	  the native ZFS on Linux fstype ("zfs").
+

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to