From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1WnNV3-0003Z9-D8 for mharc-grub-devel@gnu.org; Thu, 22 May 2014 03:33:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnNV1-0003WD-0G for grub-devel@gnu.org; Thu, 22 May 2014 03:33:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnNUy-0001QK-Ey for grub-devel@gnu.org; Thu, 22 May 2014 03:33:10 -0400 Received: from mail-ee0-x22f.google.com ([2a00:1450:4013:c00::22f]:54351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnNUy-0001QC-6Z for grub-devel@gnu.org; Thu, 22 May 2014 03:33:08 -0400 Received: by mail-ee0-f47.google.com with SMTP id c13so2217581eek.6 for ; Thu, 22 May 2014 00:33:07 -0700 (PDT) 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=bxuz4Zw36MtYestXBB3dvbQ0jBF61pJowNSI6D8Xg4g=; b=jfU6vzkQlX2+YMSSGwIGQezPGawjuCrKogH3LLKtMU19Up9G18RLL7ECGPX+WGSan7 C4RlCW+BeEQjXkPeIw3h0gNbS7/4nd0sFPOlx7pPB+UybUaxhNcNtoMalMJmDqapyjiJ A3HzpIB9X49o+dxdP6TC25pG9ECLoeZMGFcrpMfNwQ83jLoQ8Uw9jaxaIIpzlEg+jGZ4 vkVL7E9mLJ1OwRt/fu/w18ref23YOqETEp3PcTN+OQ+t8saf7JjPf76fr/8SNgWX3Iag xytWLsHdGmpy3eUEkKO8N1pEWrx/A6X9ZGwSyzIqLRBd7hoJHDgiRlCjAeFC3+V7BT1/ heYg== X-Received: by 10.15.56.65 with SMTP id x41mr20604063eew.13.1400743987364; Thu, 22 May 2014 00:33:07 -0700 (PDT) Received: from ?IPv6:2620:0:105f:fd00:224:d7ff:fe9b:a0? ([2620:0:105f:fd00:224:d7ff:fe9b:a0]) by mx.google.com with ESMTPSA id g8sm17678642eep.0.2014.05.22.00.33.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 May 2014 00:33:06 -0700 (PDT) Message-ID: <537DA831.6030006@gmail.com> Date: Thu, 22 May 2014 09:33:05 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.4.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH 2/2] Add emdedded-config hidden option to grub-install. References: <20140519020307.2763ac7d@crass-Ideapad-Z570> In-Reply-To: <20140519020307.2763ac7d@crass-Ideapad-Z570> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WAcv837nKskTh2eXuXwvmskFufe0Pvhgg" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::22f 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: Thu, 22 May 2014 07:33:12 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --WAcv837nKskTh2eXuXwvmskFufe0Pvhgg Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 19.05.2014 09:03, Glenn Washburn wrote: > One thing to note with this patch is that the supplied embedded config = > file is appended to the normally generated one. I did this to allow=20 > the default root and prefix to be generated and subsequently overridden= =20 > if desired. >=20 embed config isn't meant to hold user-supplied command. Normal config is for this. If you want to change root/prefix, why not just install to the location where the desired prefix is? > --- > util/grub-install.c | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) >=20 > diff --git a/util/grub-install.c b/util/grub-install.c > index d66030f..85dd3a1 100644 > --- a/util/grub-install.c > +++ b/util/grub-install.c > @@ -74,6 +74,7 @@ static char *memdisk =3D NULL; > static int have_load_cfg =3D 0; > static FILE * load_cfg_f =3D NULL; > static char *load_cfg; > +static char *embed_cfg =3D NULL; > static int install_bootsector =3D 1; > static char *label_font; > static char *label_color; > @@ -100,6 +101,7 @@ enum > OPTION_BOOTLOADER_ID,=20 > OPTION_EFI_DIRECTORY, > OPTION_MEMDISK, > + OPTION_EMBED_CFG, > OPTION_FONT, > OPTION_DEBUG, > OPTION_DEBUG_IMAGE, > @@ -188,6 +190,11 @@ argp_parser (int key, char *arg, struct argp_state= *state) > memdisk =3D xstrdup (arg); > return 0; > =20 > + case OPTION_EMBED_CFG: > + free (embed_cfg); > + embed_cfg =3D xstrdup (arg); > + return 0; > + > case OPTION_DISK_MODULE: > free (disk_module); > disk_module =3D xstrdup (arg); > @@ -264,6 +271,7 @@ static struct argp_option options[] =3D { > /* TRANSLATORS: "TARGET" as in "target platform". */ > 0, N_("install GRUB for TARGET platform [default=3D%s]; available t= argets: %s"), 2}, > {"memdisk", OPTION_MEMDISK, N_("FILE"), OPTION_HIDDEN, 0, 2}, > + {"embedded-config", OPTION_EMBED_CFG, N_("FILE"), OPTION_HIDDEN, 0, = 2}, > {"grub-setup", OPTION_SETUP, "FILE", OPTION_HIDDEN, 0, 2}, > {"grub-mkrelpath", OPTION_MKRELPATH, "FILE", OPTION_HIDDEN, 0, 2}, > {"grub-mkdevicemap", OPTION_MKDEVICEMAP, "FILE", OPTION_HIDDEN, 0, 2= }, > @@ -1586,7 +1594,17 @@ main (int argc, char *argv[]) > grub_util_error ("%s", _("You've found a bug")); > =20 > if (load_cfg_f) > - fclose (load_cfg_f); > + { > + if (embed_cfg) > + { > + size_t size =3D grub_util_get_image_size(embed_cfg); > + char *embed_cfg_data =3D grub_util_read_image(embed_cfg); > + grub_util_write_image(embed_cfg_data, size, load_cfg_f, load= _cfg); > + free(embed_cfg_data); > + } > + =20 > + fclose (load_cfg_f); > + } > =20 > char *imgfile =3D grub_util_path_concat (2, platdir, > core_name); >=20 --WAcv837nKskTh2eXuXwvmskFufe0Pvhgg 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/ iF4EAREKAAYFAlN9qDEACgkQmBXlbbo5nOvaywEAmgP2RsEcVwXDR/B82TKGVz0R AINnSyd5PVTmoVq5RLsA+wcix/sTBKW6X3zKPGdlW7tBosh2N8k+NL4Vzn5KlQMC =tdhv -----END PGP SIGNATURE----- --WAcv837nKskTh2eXuXwvmskFufe0Pvhgg--