From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1W5zP6-000584-2p for mharc-grub-devel@gnu.org; Wed, 22 Jan 2014 10:07:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5zOy-00057D-3A for grub-devel@gnu.org; Wed, 22 Jan 2014 10:07:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5zOs-0005KY-Nb for grub-devel@gnu.org; Wed, 22 Jan 2014 10:07:36 -0500 Received: from mail-ee0-x232.google.com ([2a00:1450:4013:c00::232]:60759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5zOs-0005KA-DA for grub-devel@gnu.org; Wed, 22 Jan 2014 10:07:30 -0500 Received: by mail-ee0-f50.google.com with SMTP id d17so4929481eek.23 for ; Wed, 22 Jan 2014 07:07:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=rxvnFnQyuSSmpFaDRTA7J63ndl0vk7WA4UoLzo3CsDo=; b=euBGeqONbfR9Wb6bEsg/z3uwXuwRJn2PGZW8e3Qfs5UCF9NX20vXMJ7lun8Y20NiRk +7XacDI3uLEpEBrUCpmfvw/WBIHh+6vwHjsp5DB3mU1y7SBmb6ME0/lQAgl52btwviNK qNIIoY36Gaw+WDK4fnSh8NHrvlv1v3+/VXoCjiieRP3Uxgh4d9lgXi6X+VCEtVyPlZU3 /bfsc5lisYHwi68Rv/uS1gPteQenPkX9nwkQV6E2SCbcaGTHcIp66lL5+ydOgt8MBj7I kqZu61T/nT2hzJYJILQkn79wvju0e9/EBw9w4mjaXe+9LYIcuzTVbAXTiH9ZiEFHb1Sx anNg== X-Received: by 10.15.43.206 with SMTP id x54mr454932eev.95.1390403249633; Wed, 22 Jan 2014 07:07:29 -0800 (PST) Received: from [192.168.1.16] (85-188.196-178.cust.bluewin.ch. [178.196.188.85]) by mx.google.com with ESMTPSA id j46sm28118765eew.18.2014.01.22.07.07.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 Jan 2014 07:07:28 -0800 (PST) Message-ID: <52DFDEAF.7000308@gmail.com> Date: Wed, 22 Jan 2014 16:07:27 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.2.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH] normalize default prefix in grub-mkimage References: <1388166076-10718-1-git-send-email-arvidjaar@gmail.com> <52DE1F7C.3080809@gmail.com> <20140121204841.0c0ae8af@opensuse.site> In-Reply-To: <20140121204841.0c0ae8af@opensuse.site> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="K0KR9s2oB1dURTkcW19Bwp664od9PE6e5" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::232 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 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: Wed, 22 Jan 2014 15:07:42 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --K0KR9s2oB1dURTkcW19Bwp664od9PE6e5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 21.01.2014 17:48, Andrey Borzenkov wrote: > =D0=92 Tue, 21 Jan 2014 08:19:24 +0100 > Vladimir '=CF=86-coder/phcoder' Serbinenko =D0=BF=D0= =B8=D1=88=D0=B5=D1=82: >=20 >> On 27.12.2013 18:41, Andrey Borzenkov wrote: >>> This fixes bogus "C:\boot\grub" at runtime for Windows build as well = as >>> the case when /boot is on separate mount point for other systems. >>> >> grub-mkimage shouldn't perform any FS-based resolving, that's job of t= he >> caller. This default should either be hardwired to >> "/"GRUB_BOOT_DIR_NAME"/"GRUB_DIR_NAME >> or perhaps even to "/boot/grub" or default should be killed altogether= =2E >=20 > I prefer the latter. Any default will most likely be wrong, so it is > better to be explicit about it. >=20 If you call grub-mkimage directly you're either dev or doing sth wrong. The default allows quicker creation of test images for new systems where you don't expect it to get to normal mode yet anyway. This being said, I agree with restraining possibilities of direct-tool-usage screwup. Go ahead. > From: Andrey Borzenkov > Subject: [PATCH] do not set default prefix in grub-mkimage >=20 > Default prefix is likely wrong on Unix and completely wrong on Windows.= > Let caller set it explicitly to avoid any ambiguity. >=20 > --- > util/grub-mkimage.c | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) >=20 > diff --git a/util/grub-mkimage.c b/util/grub-mkimage.c > index a2bd4c1..1e0bcf1 100644 > --- a/util/grub-mkimage.c > +++ b/util/grub-mkimage.c > @@ -64,7 +64,7 @@ static struct argp_option options[] =3D { > {"directory", 'd', N_("DIR"), 0, > /* TRANSLATORS: platform here isn't identifier. It can be translate= d. */ > N_("use images and modules under DIR [default=3D%s/]"), 0= }, > - {"prefix", 'p', N_("DIR"), 0, N_("set prefix directory [default=3D%= s]"), 0}, > + {"prefix", 'p', N_("DIR"), 0, N_("set prefix directory"), 0}, > {"memdisk", 'm', N_("FILE"), 0, > /* TRANSLATORS: "memdisk" here isn't an identifier, it can be trans= lated. > "embed" is a verb (command description). "*/ > @@ -93,8 +93,6 @@ help_filter (int key, const char *text, void *input _= _attribute__ ((unused))) > { > case 'd': > return xasprintf (text, grub_util_get_pkglibdir ()); > - case 'p': > - return xasprintf (text, DEFAULT_DIRECTORY); > case 'O': > { > char *formats =3D grub_install_get_image_targets_string (), *ret; > @@ -268,6 +266,15 @@ main (int argc, char *argv[]) > exit(1); > } > =20 > + if (!arguments.prefix) > + { > + char *program =3D xstrdup(program_name); > + printf ("%s\n", _("Prefix not specified (use the -p option)."));= > + argp_help (&argp, stderr, ARGP_HELP_STD_USAGE, program); > + free (program); > + exit(1); > + } > + > if (arguments.output) > { > fp =3D grub_util_fopen (arguments.output, "wb"); > @@ -287,8 +294,7 @@ main (int argc, char *argv[]) > strcpy (ptr, dn); > } > =20 > - grub_install_generate_image (arguments.dir, > - arguments.prefix ? : DEFAULT_DIRECTORY, fp, > + grub_install_generate_image (arguments.dir, arguments.prefix, fp, > arguments.output, arguments.modules, > arguments.memdisk, arguments.pubkeys, > arguments.npubkeys, arguments.config, >=20 >=20 >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 --K0KR9s2oB1dURTkcW19Bwp664od9PE6e5 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 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlLf3q8ACgkQmBXlbbo5nOu6dQD+Invcgzfe5N23Ap8xeeQD/ic8 yOqBlrKsfROs7p8LUtsBAIZd3LRcwDvQXBaut6g6kFvytgDCmGIs6X6PelPamqrI =7NE9 -----END PGP SIGNATURE----- --K0KR9s2oB1dURTkcW19Bwp664od9PE6e5--