From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VvILQ-00021T-KU for mharc-grub-devel@gnu.org; Mon, 23 Dec 2013 22:07:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvILK-00021B-64 for grub-devel@gnu.org; Mon, 23 Dec 2013 22:07:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VvILE-0008V4-OP for grub-devel@gnu.org; Mon, 23 Dec 2013 22:07:38 -0500 Received: from mail-ee0-x232.google.com ([2a00:1450:4013:c00::232]:33424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvILE-0008Uv-E2 for grub-devel@gnu.org; Mon, 23 Dec 2013 22:07:32 -0500 Received: by mail-ee0-f50.google.com with SMTP id c41so2603006eek.23 for ; Mon, 23 Dec 2013 19:07:31 -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=fVYbdxlxH0EXnV8YLvPPfwsLLTtMdbyM/stQhk35jD0=; b=krB2CFSmIKKJsTwRnnh+yBsrjCujLdqLIx5Kf2Ryc6jeybAoScXgboGuvRgOP/SkrV gY1hB49waShGLBLz0t6HVplZwYRt9D5bN/Cuo0DcxQR97hHkC4534ktylyUQLvo+EfQD 4F4gqOn7GTmQGz6fJJ0sA6QXHiJSfx3uoU4vEY0Ak/T35zqOBHj+xMb83qWwT2rEKbAy ObiBSITE3xzur0+WHhKLhEFKYohgH8fRcDA5hqs4hQcpKgm3P1K/B0sYmP45V1UiY7Ll 1SJYQb4MMYQzcN8oMnErHne2TNTOnlBi0/Du+R5bzh1O9SXNLWFiKzJQLZkiH846kT1l 5yLg== X-Received: by 10.14.101.4 with SMTP id a4mr25025708eeg.28.1387854451358; Mon, 23 Dec 2013 19:07:31 -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 o1sm50960356eea.10.2013.12.23.19.07.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Dec 2013 19:07:30 -0800 (PST) Message-ID: <52B8FA71.3050204@gmail.com> Date: Tue, 24 Dec 2013 04:07:29 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: Breakage from grub-mkconfig changes for grub-file References: <20131223220141.GA25169@riva.ucam.org> <52B8B772.9040007@gmail.com> <20131224003444.GA28338@riva.ucam.org> <1387853803.918.46.camel@opensuse.site> In-Reply-To: <1387853803.918.46.camel@opensuse.site> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KDEmabuoVrK6EGDojfKmpkCDLnkasBOkX" 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: Tue, 24 Dec 2013 03:07:43 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KDEmabuoVrK6EGDojfKmpkCDLnkasBOkX Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 24.12.2013 03:56, Andrey Borzenkov wrote: > =D0=92 =D0=92=D1=82, 24/12/2013 =D0=B2 00:34 +0000, Colin Watson =D0=BF= =D0=B8=D1=88=D0=B5=D1=82: >> On Mon, Dec 23, 2013 at 11:21:38PM +0100, Vladimir '=CF=86-coder/phcod= er' Serbinenko wrote: >>> On 23.12.2013 23:01, Colin Watson wrote: >>>> This should be redesigned so that there is some way to declare in = a >>>> grub.d script that it requires multi-platform support and should b= e >>>> run multiple times. (It *must* be this way round so that upgrades= >>>> work properly.) >>> >>> The idea was that platform-independent scripts were still runnable, >>> they'll just produce the same output N times and this list is just an= >>> optimisations, specially to avoid running os-prober N times. >> >> Granted, but in some cases those scripts might not be idempotent: >> consider a user-written "42_custom" (or whatever) script that adds a >> menu entry, for instance. >> >>> The alternative will be to have something along the lines of differen= t >>> hashbang or implementing this functionality as sh functions. >> >> How about this simpler option: any script that needs to be run for eac= h >> platform could have a magic comment that we grep for in grub-mkconfig.= >> >=20 > I have a feeling that we are doing it backwards. What we actually want > is to know file type. So what about making grub-file print it instead o= f > having ever growing list of conditions? I.e. >=20 > grub-file --print {cpu|os|bits|...}=20 >=20 > and simply using it in every script to generate run-time condition like= > in (simplified) >=20 > cpu=3D$(grub-file --print cpu) >=20 > cat << EOF > if [ \$grub_platform =3D $cpu ] ; then > menuentry ... > EOF >=20 > And this could be wrapped in grub_mkconfig_platform_condition function.= >=20 The same file can have several formats and it's actually pretty common to squeeze several formats in the same image. Like EFI image and bzImage in the same file. >=20 >>>> The platform names used in grub-mkconfig (x86 i386-xen-pae x86_64-= xen >>>> mips mipsel sparc64 powerpc ia64 arm arm64) are not the same as th= e >>>> platform names used in the GRUB build system, but yet they're expo= rted >>>> across the interface to /etc/grub.d/ as GRUB_PLATFORM. This is me= ssy >>>> and confusing, and it's not clear what promises we make about futu= re >>>> changes here. >>>> >>>> We should rationalise this before issuing anything as part of a st= able >>>> release, perhaps by adopting the same target_cpu/platform terminol= ogy >>>> used in the build system. Furthermore, if we made the namespaces >>>> match up then it would be fairly straightforward to only run grub.= d >>>> scripts for platforms for which we have installed GRUB modules, wh= ich >>>> seems as though it would be sensible. >>> >>> GRUB platform names don't match with the OS compatibility. On x86 oth= er >>> than xen you can use the same kernel on all the platforms. On ARM, fo= r >>> what is arm-uboot platform for us may require different kernels for >>> different hardware. >> >> OK, but if it is a different concept then it should have a different >> name, not "platform" - otherwise it just seems confusing. >> >=20 >=20 >=20 >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 --KDEmabuoVrK6EGDojfKmpkCDLnkasBOkX 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.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlK4+nEACgkQmBXlbbo5nOtUYAEAmQ8RD3T8iNccLipCIUP8HNcS 6BMgZwAzlDuOXub4w34A/27ggXSc5SjzcXDM+6ClYHbssJsmYP7s3O3aEKifR5Gu =ZaL5 -----END PGP SIGNATURE----- --KDEmabuoVrK6EGDojfKmpkCDLnkasBOkX--