* mkrelpath doesn't do what it should...
@ 2009-12-07 7:30 David Miller
2009-12-07 10:39 ` Felix Zielcke
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2009-12-07 7:30 UTC (permalink / raw)
To: fzielcke; +Cc: grub-devel
I was trying to figure out why the kernel image paths generated
automatically for me by grub-mkconfig were not correct.
I have /boot on a seperate partition, but in the generated config
files it uses paths like /boot/vmlinux-2632 etc.
The problem is grub-mkrelpath and it's usage in the scrips such as
"10_linux".
"/boot" is given to "grub-mkrelpath", and this results in
the identical "/boot" in rel_dirname.
So all the paths emitted by 10_linux end up being "/boot" based
instead of "/" based.
grub-mkrelpath seems to do the right thing if I pass it a full path,
f.e. giving it "/boot/vmlinux" emits the correct "/vmlinux"
Casually inspecting make_system_path_relative_to_its_root() shows what
appears to be another bug. It seems to immediately break from the
loop when a different device number than "/"'s is seen, but what if I
have:
/one/two/three
Where / is /dev/hda1, /one/two is /dev/hda2 and /one/two/three is yet
another mount from /dev/hda3. It seems like the premature loop exit
in this function will give us the wrong result here.
The loop needs to remember the string prefix point at which every
device number change occurs, and once the whole path has been
traversed it should unwind back to that point in order to emit
the result.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: mkrelpath doesn't do what it should...
2009-12-07 7:30 mkrelpath doesn't do what it should David Miller
@ 2009-12-07 10:39 ` Felix Zielcke
2009-12-07 11:24 ` David Miller
2009-12-08 4:35 ` David Miller
0 siblings, 2 replies; 6+ messages in thread
From: Felix Zielcke @ 2009-12-07 10:39 UTC (permalink / raw)
To: The development of GNU GRUB
Am Sonntag, den 06.12.2009, 23:30 -0800 schrieb David Miller:
> I was trying to figure out why the kernel image paths generated
> automatically for me by grub-mkconfig were not correct.
>
> I have /boot on a seperate partition, but in the generated config
> files it uses paths like /boot/vmlinux-2632 etc.
>
> The problem is grub-mkrelpath and it's usage in the scrips such as
> "10_linux".
>
> "/boot" is given to "grub-mkrelpath", and this results in
> the identical "/boot" in rel_dirname.
>
> So all the paths emitted by 10_linux end up being "/boot" based
> instead of "/" based.
>
> grub-mkrelpath seems to do the right thing if I pass it a full path,
> f.e. giving it "/boot/vmlinux" emits the correct "/vmlinux"
The one mount point case is now fixed in r1917
See Subject: `handling mount points in grub-mkrelpath' from me for the
patch.
> Casually inspecting make_system_path_relative_to_its_root() shows what
> appears to be another bug. It seems to immediately break from the
> loop when a different device number than "/"'s is seen, but what if I
> have:
>
> /one/two/three
>
> Where / is /dev/hda1, /one/two is /dev/hda2 and /one/two/three is yet
> another mount from /dev/hda3. It seems like the premature loop exit
> in this function will give us the wrong result here.
>
> The loop needs to remember the string prefix point at which every
> device number change occurs, and once the whole path has been
> traversed it should unwind back to that point in order to emit
> the result.
Multiple mount points are an interesting case. Haven't thought about
them.
But they should be now handled correctly too.
--
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: mkrelpath doesn't do what it should...
2009-12-07 10:39 ` Felix Zielcke
@ 2009-12-07 11:24 ` David Miller
2009-12-07 22:06 ` Felix Zielcke
2009-12-08 4:35 ` David Miller
1 sibling, 1 reply; 6+ messages in thread
From: David Miller @ 2009-12-07 11:24 UTC (permalink / raw)
To: grub-devel, fzielcke
From: Felix Zielcke <fzielcke@z-51.de>
Date: Mon, 07 Dec 2009 11:39:22 +0100
> Am Sonntag, den 06.12.2009, 23:30 -0800 schrieb David Miller:
>> I was trying to figure out why the kernel image paths generated
>> automatically for me by grub-mkconfig were not correct.
>>
>> I have /boot on a seperate partition, but in the generated config
>> files it uses paths like /boot/vmlinux-2632 etc.
>>
>> The problem is grub-mkrelpath and it's usage in the scrips such as
>> "10_linux".
>>
>> "/boot" is given to "grub-mkrelpath", and this results in
>> the identical "/boot" in rel_dirname.
>>
>> So all the paths emitted by 10_linux end up being "/boot" based
>> instead of "/" based.
>>
>> grub-mkrelpath seems to do the right thing if I pass it a full path,
>> f.e. giving it "/boot/vmlinux" emits the correct "/vmlinux"
>
> The one mount point case is now fixed in r1917
> See Subject: `handling mount points in grub-mkrelpath' from me for the
> patch.
Thanks I'll have a look.
Locally for testing, I changed the 10_linux script to pass the
complete image path name to the device root relative pathname
resolver. That worked just as well.
In fact I don't see why these scripts don't do that, and relatively
resolve the /boot directory whatever seperately.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: mkrelpath doesn't do what it should...
2009-12-07 11:24 ` David Miller
@ 2009-12-07 22:06 ` Felix Zielcke
2009-12-07 23:18 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Felix Zielcke @ 2009-12-07 22:06 UTC (permalink / raw)
To: The development of GNU GRUB
Am Montag, den 07.12.2009, 03:24 -0800 schrieb David Miller:
> In fact I don't see why these scripts don't do that, and relatively
> resolve the /boot directory whatever seperately.
Because it's faster to just call once for the directory
make_system_path_relative_to_its_root() instead of once for every kernel
you have.
Colin even added caching for prepare_grub_to_access_device() because it
can be slow if you have many many kernels.
--
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: mkrelpath doesn't do what it should...
2009-12-07 22:06 ` Felix Zielcke
@ 2009-12-07 23:18 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-12-07 23:18 UTC (permalink / raw)
To: grub-devel, fzielcke
From: Felix Zielcke <fzielcke@z-51.de>
Date: Mon, 07 Dec 2009 23:06:46 +0100
> Am Montag, den 07.12.2009, 03:24 -0800 schrieb David Miller:
>> In fact I don't see why these scripts don't do that, and relatively
>> resolve the /boot directory whatever seperately.
>
> Because it's faster to just call once for the directory
> make_system_path_relative_to_its_root() instead of once for every kernel
> you have.
> Colin even added caching for prepare_grub_to_access_device() because it
> can be slow if you have many many kernels.
Ok, makes sense, thanks for explaining.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: mkrelpath doesn't do what it should...
2009-12-07 10:39 ` Felix Zielcke
2009-12-07 11:24 ` David Miller
@ 2009-12-08 4:35 ` David Miller
1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2009-12-08 4:35 UTC (permalink / raw)
To: grub-devel, fzielcke
From: Felix Zielcke <fzielcke@z-51.de>
Date: Mon, 07 Dec 2009 11:39:22 +0100
> The one mount point case is now fixed in r1917
> See Subject: `handling mount points in grub-mkrelpath' from me for the
> patch.
Seems to work properly now. The paths all start with "//" but
I guess that's ok.
Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-12-08 4:35 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-07 7:30 mkrelpath doesn't do what it should David Miller
2009-12-07 10:39 ` Felix Zielcke
2009-12-07 11:24 ` David Miller
2009-12-07 22:06 ` Felix Zielcke
2009-12-07 23:18 ` David Miller
2009-12-08 4:35 ` David Miller
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.