Skip to contentSkip to conversation

handling mount points in grub-mkrelpath

PATCH Felix Zielcke 2 participants 3 messages Nov 29, 2009 – Dec 6, 2009

lore
Share & tools
lore
#0 lore raw

Vladimir wanted to have this discussed on ML

The old shell function make_system_path_relative_to_its_root outputed / if you gave it /boot and it was on a seperate partition. grub-mkrelpath currently outputs /boot

This breaks booting at least with the 10_linux generated entries.

Attached is my fix for that, which I'll update today to Debian.

We already broke backward compatibility with the commandline for Xen. IMO in this grub-mkrelpath case there's no need to break compatibility.

But maybe I can find a good way to handle this inside util/grub-mkconfig_lib.in just for compatibility.

Signature · 2 lines
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer

2009-11-29 Felix Zielcke <[email protected]>

* util/misc.c (make_system_path_relative_to_its_root): Correctly cope with mount points.
=== modified file 'util/misc.c'

misc.c +11 -1
@@ -500,7 +500,17 @@ make_system_path_relative_to_its_root (c
 
       /* buf is another filesystem; we found it.  */
       if (st.st_dev != num)
-	break;
+	{
+	  /* offset == 0 means path given is the mount point.  */
+	  if (offset == 0)
+	    {
+	      free (buf);
+	      free (buf2);
+	      return strdup ("/");
+	    }
+	  else
+	    break;
+	}
 
       offset = p - buf;
       /* offset == 1 means root directory.  */
#1 lore raw
Quoted 8 lines · Felix Zielcke

Vladimir wanted to have this discussed on ML

The old shell function make_system_path_relative_to_its_root outputed / if you gave it /boot and it was on a seperate partition. grub-mkrelpath currently outputs /boot

This breaks booting at least with the 10_linux generated entries.

Quoted 7 lines

Attached is my fix for that, which I'll update today to Debian.

We already broke backward compatibility with the commandline for Xen. IMO in this grub-mkrelpath case there's no need to break compatibility.

But maybe I can find a good way to handle this inside util/grub-mkconfig_lib.in just for compatibility.

Hi,

The old behaviour seems correct, so there's no need to break compatibility.

Please could you commit this in trunk?

Quoted 32 lines

2009-11-29 Felix Zielcke <[email protected]>

* util/misc.c (make_system_path_relative_to_its_root): Correctly cope with mount points.
=== modified file 'util/misc.c'

misc.c +11 -1
@@ -500,7 +500,17 @@ make_system_path_relative_to_its_root (c
 
       /* buf is another filesystem; we found it.  */
       if (st.st_dev != num)
-	break;
+	{
+	  /* offset == 0 means path given is the mount point.  */
+	  if (offset == 0)
+	    {
+	      free (buf);
+	      free (buf2);
+	      return strdup ("/");
+	    }
+	  else
+	    break;
+	}
 
       offset = p - buf;
       /* offset == 1 means root directory.  */

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 5 lines
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."
#2 lore raw

Am Freitag, den 04.12.2009, 22:23 +0100 schrieb Robert Millan:

Quoted 7 lines

Hi,

The old behaviour seems correct, so there's no need to break compatibility.

Please could you commit this in trunk?

Thanks. Commited now.

Signature · 2 lines
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer