bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dangerous grub-install case


From: José Toneh
Subject: dangerous grub-install case
Date: Sat, 17 Dec 2005 04:03:47 +0000 (GMT)

Hello,

I've been looking through grub-install's code, and I've
realized that if you use the ``--root-directory'' option
passing a directory which is not a mount point, it will
perform a broken installation.

For instance, if you say:

grub-install --root-directory=/_grub_, the script will
create $grubdir (/_grub_/boot/grub) and install stage2
there. It'll also use find_device() on $rootdir, which will
return the device which is mounted on ``/''. It'll use that
device as the root device for the grub command, as line 438
says:

root_drive=`convert "$root_device"`

And line 513 says:

root $root_drive

Still, it'll use --prefix=/boot/grub (at least in most cases),
see line 514 and check the rest of the code:

setup $force_lba --stage2=$grubdir/stage2 --prefix=$grub_prefix $install_drive

I can't really test this now, but it seems like a gnarly corner
case to me. When GRUB loads, it'll look for stage2 in /boot/grub,
which won't even exist, while stage2 sits in /_grub_/boot/grub.

This is dangerous because a lot of people have trouble
understanding what exactly ``--root-directory'' does, and
so call it with unforeseen arguments.

Best regards,

José Toneh


        



        
                
_______________________________________________________ 
Yahoo! doce lar. Faça do Yahoo! sua homepage. 
http://br.yahoo.com/homepageset.html 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]