From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NN3hY-0001xd-Pv for mharc-grub-devel@gnu.org; Tue, 22 Dec 2009 07:18:56 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NN3hW-0001x2-Dv for grub-devel@gnu.org; Tue, 22 Dec 2009 07:18:54 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NN3hV-0001wX-Mb for grub-devel@gnu.org; Tue, 22 Dec 2009 07:18:53 -0500 Received: from [199.232.76.173] (port=43587 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NN3hV-0001wU-Gp for grub-devel@gnu.org; Tue, 22 Dec 2009 07:18:53 -0500 Received: from fg-out-1718.google.com ([72.14.220.152]:22464) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NN3hU-00030z-VN for grub-devel@gnu.org; Tue, 22 Dec 2009 07:18:53 -0500 Received: by fg-out-1718.google.com with SMTP id 19so3533955fgg.12 for ; Tue, 22 Dec 2009 04:18:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=s418Lm4Yg75VOnYUpfa1cnKFsIPPnH0ZSFDZcFjoLyk=; b=Jv7hqlxZXd0XLq//R8gPt0rxpYPpuicQ6dvNYRb2SJ777yDo19ObhrgfLIxyQNSMOo tE4cBUngj6BIq5P4RC/+Re7soLUN1pYG4hPrRSmc3Sanghp1dVFVehGTS1fbmpAoX9pv Cu/ZGbcT5+Xdu5Ukz3QSO4Ht+uBXINPgQ0Hbc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=bJMu0KWvSIdwVjoJOV8iZ46XUY8AOrY1wEdNRKr9deoTqTZs4NunnmXLMywQk1Zpis D45nfDWW8xZ3dciKBPk61Nboo+3XfiMIcWSsOl/y6QEDzwIxM0f7bIya+hUOjFl+4qdn g/ry1jzsgDFP/PusqywaWUgEytrIaBmlki2Kw= Received: by 10.87.58.32 with SMTP id l32mr11134867fgk.23.1261484331297; Tue, 22 Dec 2009 04:18:51 -0800 (PST) Received: from debian.bg45.phnet (94-45.0-85.cust.bluewin.ch [85.0.45.94]) by mx.google.com with ESMTPS id 12sm23456621fgg.7.2009.12.22.04.18.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 22 Dec 2009 04:18:49 -0800 (PST) Message-ID: <4B30B922.2040304@gmail.com> Date: Tue, 22 Dec 2009 13:18:42 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: The development of GNU GRUB References: <4B30B34A.6030600@labri.fr> In-Reply-To: <4B30B34A.6030600@labri.fr> X-Enigmail-Version: 0.95.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig3F5BCB411C1702253EE32D1D" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: boot directory prefix in grub-install (even with --root-directory) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 12:18:54 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig3F5BCB411C1702253EE32D1D Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Gr=C3=A9goire Sutre wrote: > Hi, > > grub-install copies GRUB images into ${rootdir}/boot/grub (where > ${rootdir} is empty by default and can be changed with --root-directory= ). > > To install GRUB files on a partition that contains a /boot file, one > must specify a non-empty --root-directory, and grub files are then > copied into /DIR/boot/grub. Or one could mount the partition on a > mount point of the form DIR/boot and specify --root-directory=3DDIR to > force installation into the /grub directory of the partition. Both > solutions are not completely satisfactory. Is there a better one? > > The problem arises e.g. with NetBSD which uses /boot for its own > bootloader. The script util/grub-install.in contains lines to take > care of that situation (lines 160-172), but these lines rely on a > variable ${host_os} that is not set. This might be deprecated code > from GRUB Legacy's grub-install, where ${host_os} is set by a > configure substitution. > > An alternative solution would be to have grub-install install in > ${rootdir}/grub, with ${rootdir} equal to /boot by default. The > default behavior (with no --root-directory) would be the same. The main problem is with scripts already using --root-directory and relying on existing behaviour. I propose add a new option --grub-directory=3DDIR which defaults to ROOTDIR/boot/grub What do you think about this? > > The following patch implements this alternative. > > Thanks for your time, > > Gr=C3=A9goire > > --- util/grub-install.in.orig 2009-12-22 11:26:01.538833717 +0100 > +++ util/grub-install.in 2009-12-22 12:48:55.979476412 +0100 > @@ -39,8 +39,7 @@ > fi > grub_mkdevicemap=3D${sbindir}/`echo grub-mkdevicemap | sed ${transform= }` > grub_probe=3D${sbindir}/`echo grub-probe | sed ${transform}` > -rootdir=3D > -grub_prefix=3D`echo /boot/grub | sed ${transform}` > +rootdir=3D/boot > modules=3D > > install_device=3D > @@ -66,7 +65,7 @@ > -v, --version print the version information and exit > --modules=3DMODULES pre-load specified modules MODULES > --root-directory=3DDIR install GRUB images under the directory DI= R > - instead of the root directory > + instead of ${rootdir} > --grub-setup=3DFILE use FILE as grub-setup > --grub-mkimage=3DFILE use FILE as grub-mkimage > --grub-mkdevicemap=3DFILE use FILE as grub-mkdevicemap > @@ -84,7 +83,7 @@ > > INSTALL_DEVICE can be a GRUB device name or a system device filename. > > -grub-install copies GRUB images into the DIR/boot directory specified = by > +grub-install copies GRUB images into the DIR/`echo grub | sed > ${transform}` directory specified by > --root-directory, and uses grub-setup to install grub into the boot > sector. > > @@ -157,21 +156,7 @@ > setup_verbose=3D"--verbose" > fi > > -# Initialize these directories here, since ROOTDIR was initialized. > -case "$host_os" in > -netbsd* | openbsd*) > - # Because /boot is used for the boot block in NetBSD and OpenBSD, > use /grub > - # instead of /boot/grub. > - grub_prefix=3D`echo /grub | sed ${transform}` > - bootdir=3D${rootdir} > - ;; > -*) > - # Use /boot/grub by default. > - bootdir=3D${rootdir}/boot > - ;; > -esac > - > -grubdir=3D${bootdir}/`echo grub | sed ${transform}` > +grubdir=3D${rootdir}/`echo grub | sed ${transform}` > device_map=3D${grubdir}/device.map > > grub_probe=3D"${grub_probe} --device-map=3D${device_map}" > @@ -204,8 +189,7 @@ > fi > > # Create the GRUB directory if it is not present. > -test -d "$bootdir" || mkdir "$bootdir" || exit 1 > -test -d "$grubdir" || mkdir "$grubdir" || exit 1 > +mkdir -p "$grubdir" || exit 1 > > # If --recheck is specified, remove the device map, if present. > if test $recheck =3D yes; then > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig3F5BCB411C1702253EE32D1D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iF4EAREKAAYFAkswuScACgkQNak7dOguQgkoFQD/ZQ+ksIaP9E4oJqZb0ndOUdeY uzyOKKIgqSEViCkGQnMA/iu2Rq88w/D/O07IWP4BXZiGA6Q6zx/OlbYmH41e8ysc =YoOe -----END PGP SIGNATURE----- --------------enig3F5BCB411C1702253EE32D1D--