boottool: maintain image boot prefix from default

Currently when we add an image, we check if the default image
starts with /boot, and if not we remove /boot from the new kernel
and initrd names.  This is designed to cope with the situation where
where /boot is its own partion and image names are /vmlinux.

However, this is falsly triggered where there is any device prefix as
can occur in grub:

	image (hd0,0)/boot/vmlinux

This leads us to incorrectly produce entries like:

	image /mykernel

rather than:

	image (hd0,0)/boot/mykernel

This patch changes the algorithm to remove the "filename" from the end
whatever is left then becomes the prefix if the file is in /boot, if
it is not the caller is expected to know what they are doing.  Frankly,
its not clear that we support booting files in any other directory.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@954 592f7852-d20e-0410-864c-8624ca9c26a4
1 file changed