From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aK2cy-0005X4-2f for mharc-grub-devel@gnu.org; Fri, 15 Jan 2016 06:33:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK2cw-0005W9-3W for grub-devel@gnu.org; Fri, 15 Jan 2016 06:33:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aK2cr-0005Xn-1c for grub-devel@gnu.org; Fri, 15 Jan 2016 06:33:10 -0500 Received: from mout.gmx.net ([212.227.17.22]:54477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK2cq-0005Xj-OC for grub-devel@gnu.org; Fri, 15 Jan 2016 06:33:04 -0500 Received: from [192.168.1.47] ([31.34.87.55]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0Lyj4F-1a8aJE1Z5z-016AJe for ; Fri, 15 Jan 2016 12:33:03 +0100 Subject: Re: Setting config_directory to prefix at grub launch time To: The development of GNU GRUB References: <5698C704.6050102@gmx.fr> From: "Arbiel (gmx)" X-Enigmail-Draft-Status: N1110 Message-ID: <5698D8E8.6070501@gmx.fr> Date: Fri, 15 Jan 2016 12:32:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BGPu0i2tN6aXHccP0uKcHd3qVQBulcglm" X-Provags-ID: V03:K0:5+qEkSsqivz3Y1OGpH484Tv4CjgXXRK1fbfXN0ELCRS0TULxdJN YfE++/2cK8gpU2reIQIYiHLXdY6uyVzRoQZ/6yB0vymiMX9el8Eolimys3MY0KzzJWsnc7a e1DzwlgJz9hqx40YnlcyExth8Ht/ZM+FoscLpb1qo90QZzQxPSyX38TcPdi3QXZ868SsM1Z gUuI4aNfKaEDNs33gA8dQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:vPfSxBEmh6M=:SKtGEqIbl69Ggbprga9ehN muoMvLI+ZrEO3Yu8FSnWtz2zjzNeLqRwoXRNuLeHdVeyvcCzFjhApjfz4dFSqmbeIg0qjg7Cf 1EtoI+LHIDXTyJBNiaWxaEE+ZhJbziN8h+4UzgOS+gxjP9U8scSKINJKmsCpr7H+Xu3etG0SW vUtTv+bXwaUteyotcxAYTcFaR2HonF+3uI2M/IYNHE3jTUzZp2zpNN/sCAcfvmd/cYmIQMD9r P9tisdLWKb01/Yq4EWHbCpClW5Ta7ueNSjOS5nj3ZariD4yWO3EmxdCuiiLQEMCHZZkSGuqu6 HyUJEgSacDOcb0BoTJRrgKU1nlBG8F+jrK1YWos2TCdiOnlNS4riagxLqvO4+OpPnckvpxKhw MBkC0AtLtPngFzGGfis8aHrLLhgxWUlNoGnViksVHAGOv7zrCnMEkdfNN41QVKRtGeGN/6jt7 FqW1AdrZheSThxsWq+g/dpyt7NZNVlBxqpEgQtEx1c1IJQt55K2321+vRuuIAbw3EY6x9fjzF FZYE4INfSR76ozYOndA6KAKwmWYLR5yF1+6l2K75qDqAGn2y8IokOUhpJMQ1p0EnbaCtrUQaB xAUr9hWxOaZOUIaUQPLhBVcYH2sD45r8gpd1szkCFE4AowByvDdJDSdDuARKAp1FiFmWrLPNC b9+cQrn0yS1T00XYy/kS3w+NJgy7cI/11C/ojPQ6uaNYN9IMN7z96zGbPc/uJqO6cLIPrhL+b C41GIxMjletvHorNNRiwaZ6uJ/Dsv/27ZUyeNjLCPIDwNGBILIIjf6mX7I8hVCwZ59kxqBfdH PhZSpJSGOLfp5ZNUr0l0GMqGiclnxk+J436rvJckgwoVW7vYHzknYW4IIqF2AVskyh0Nonv0H K8PuZzTtgqU3YLOtsXvw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.22 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: Fri, 15 Jan 2016 11:33:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BGPu0i2tN6aXHccP0uKcHd3qVQBulcglm Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Le 15/01/2016 11:22, Andrei Borzenkov a =C3=A9crit : > On Fri, Jan 15, 2016 at 1:16 PM, Arbiel (gmx) wrote: >> In the Ubuntu distributions, there is a /etc/grub.d/41_custom which >> creates the following lines in the grub configuration file >> >> ### BEGIN /etc/grub.d/41_custom ### >> if [ -f ${config_directory}/custom.cfg ]; then >> source ${config_directory}/custom.cfg >> elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then >> source $prefix/custom.cfg; >> fi >> ### END /etc/grub.d/41_custom ### >> >> In the custom.cfg file, I use the source command to insert some privat= e >> scripts stored in a ${prefix}/greffons/ directory. However, when the >> configuration file has been the target of a configfile command, the >> source of my private scripts becomes ${config_file}/greffons/. To be >> compatible to all situations, I need to have config_file set to prefix= >> at the beginning of grub's running, as at this very moment prefix also= >> is the directory of the configuration file. >> > config_directory is managed by grub to point to current source of > configuration.=20 No, config_directory is unset when grub executes the configuration file pointed to by core.img. There is no config_directory listed by the "set" command (using|grub-mkconfig (GRUB) 2.02~beta2-9ubuntu1.4|). It seems to only be set by the configfile command. > If you always need to use prefix, just always use > prefix. I'm afraid I do not understand the problem. I cannot always use prefix as I want to access the scripts located in the same directory as the current configuration file. This is the reason why I would be glad to always use config_directory, which is unfortunately unset when the current configuration file is the one core.img points to. > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel > --BGPu0i2tN6aXHccP0uKcHd3qVQBulcglm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iF4EAREIAAYFAlaY2OwACgkQG6j+1Sdg4Kt2dAD9GszyH8K+yzS38sEE0y2a0BGB gfAi2p7bg9HkuNZ1qOIA/2m6ysIsyLzc7uQRg3yu2/NUDaXiKg/4UztLKJ7QDGdn =IrUa -----END PGP SIGNATURE----- --BGPu0i2tN6aXHccP0uKcHd3qVQBulcglm--