Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1M1inG-00083p-4v for mharc-grub-devel@gnu.org; Wed, 06 May 2009 11:12:22 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M1inD-00080u-QT for grub-devel@gnu.org; Wed, 06 May 2009 11:12:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M1inB-0007z1-B3 for grub-devel@gnu.org; Wed, 06 May 2009 11:12:17 -0400 Received: from [199.232.76.173] (port=43690 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M1inB-0007yd-5F for grub-devel@gnu.org; Wed, 06 May 2009 11:12:17 -0400 Received: from ey-out-1920.google.com ([74.125.78.146]:41338) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M1inA-0007BI-GF for grub-devel@gnu.org; Wed, 06 May 2009 11:12:16 -0400 Received: by ey-out-1920.google.com with SMTP id 13so48597eye.24 for ; Wed, 06 May 2009 08:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=79q19gUFWqAVLeN/svfbGPCbcFvK42YMRToB6QNdl70=; b=K3uMjwN1cB/oFdBtLQHbCqOzWwgMiUxkyyok06Vd0JTlhc2aoeyVk/JtcIuGBGBnG0 u25+1L0tG+HU6Vbu9C80XeSqsORAdvRh+b9a8BCWoW240dwa21Lk0a0f2Ucgw4f1lVA5 Dy0KPfdUP6O4/Xo0ZM8iVgj99sFb2N4a/d9I8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=s9Mrz5+F7jNQYn2CaYA3bgGKEn4a9XtC/KOEbJJriR0lS+IWzcyFdrvdO6rWOhBvSZ e2TUbyADApDxkh2zt04rRmTbB+4VM4eHNhDkhUcsen9OWYTqy3UCMsVuCrpkJJOTKPBx 6QwXJZqWzIA+gyqw+x+nswthlI0UDcWDDLNH4= MIME-Version: 1.0 Received: by 10.210.78.16 with SMTP id a16mr1677641ebb.74.1241622734911; Wed, 06 May 2009 08:12:14 -0700 (PDT) In-Reply-To: <1241620317.3746.8.camel@fz.local> References: <1241620317.3746.8.camel@fz.local> Date: Wed, 6 May 2009 17:12:14 +0200 Message-ID: From: "Vladimir 'phcoder' Serbinenko" To: The development of GRUB 2 Content-Type: multipart/alternative; boundary=000e0cd1eb700f3a1e04693fd207 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: grub-install --root-directory=/mnt /dev/sda1 fails X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2009 15:12:20 -0000 --000e0cd1eb700f3a1e04693fd207 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Wed, May 6, 2009 at 4:31 PM, Felix Zielcke wrote: > Hello list, > > grub-install with some --root-directory option and a partition given as > setup device and not a whole disk doestn't work, i.e. blocklists are > used. > grub-setup fails that it can't find the core.img. > > The problem are these 2 lines in setup(): > core_path_dev = grub_util_get_path (dir, core_file); > ... > file = grub_file_open (core_path_dev); > > core_path_dev contains the full path given with the `-d' or > `--directory' option for example /mnt/boot/grub. > > This can't work because /mnt is a different filesystem and so GRUB only > sees /boot/grub. > Removing the /mnt part from it works fine: > (gdb) set core_path_dev="/boot/grub/core.img" > (gdb) print *file->device->disk > $13 = {name = 0x640b90 "hd1,1", dev = 0x62f520, total_sectors = 16777216, > has_partitions = 1, id = 1, partition = 0x640c10, read_hook = 0, data = 0x0} > > The only solution that comes to my mind for this problem is, to > introduce a `--root-directory' option and making the `--directory' > option relative to it. > > Does anyone have a better idea? Don't we already have a function which transforms host directory into grub directory? AFAIR we have. > > -- > Felix Zielcke > > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > -- Regards Vladimir 'phcoder' Serbinenko --000e0cd1eb700f3a1e04693fd207 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Wed, May 6, 2009 at 4:31 PM, Felix Zi= elcke <fzielcke@z-= 51.de> wrote:
Hello list,

grub-install with some --root-directory option and a partition given as
setup device and not a whole disk doestn't work, i.e. blocklists are used.
grub-setup fails that it can't find the core.img.

The problem are these 2 lines in setup():
core_path_dev =3D grub_util_get_path (dir, core_file);
...
file =3D grub_file_open (core_path_dev);

core_path_dev contains the full path given with the `-d' or
`--directory' option for example /mnt/boot/grub.

This can't work because /mnt is a different filesystem and so GRUB only=
sees /boot/grub.
Removing the /mnt part from it works fine:
(gdb) set core_path_dev=3D"/boot/grub/core.img"
(gdb) print *file->device->disk
$13 =3D {name =3D 0x640b90 "hd1,1", dev =3D 0x62f520, total_secto= rs =3D 16777216, has_partitions =3D 1, id =3D 1, partition =3D 0x640c10, re= ad_hook =3D 0, data =3D 0x0}

The only solution that comes to my mind for this problem is, to
introduce a `--root-directory' option and making the `--directory'<= br> option relative to it.

Does anyone have a better idea?
Don't we already have = a function which transforms host directory into grub directory? AFAIR we ha= ve.=A0

--
Felix Zielcke



_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel



--
Regards
Vladimir = 9;phcoder' Serbinenko
--000e0cd1eb700f3a1e04693fd207--