All of lore.kernel.org
 help / color / mirror / Atom feed
* handling mount points in grub-mkrelpath
@ 2009-11-29 20:52 Felix Zielcke
  2009-12-04 21:23 ` Robert Millan
  0 siblings, 1 reply; 3+ messages in thread
From: Felix Zielcke @ 2009-11-29 20:52 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 659 bytes --]

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.
-- 
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer

[-- Attachment #2: 02_fix_mountpoints_in_mkrelpath.diff --]
[-- Type: text/x-patch, Size: 681 bytes --]

2009-11-29 Felix Zielcke <fzielcke@z-51.de>

	* util/misc.c (make_system_path_relative_to_its_root): Correctly cope with
	mount points.
=== modified file 'util/misc.c'
--- util/misc.c	2009-11-25 23:10:02 +0000
+++ util/misc.c	2009-11-29 19:19:28 +0000
@@ -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.  */


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-06  9:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-29 20:52 handling mount points in grub-mkrelpath Felix Zielcke
2009-12-04 21:23 ` Robert Millan
2009-12-06  9:22   ` Felix Zielcke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.