From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aK5DW-0005Zm-T7 for mharc-grub-devel@gnu.org; Fri, 15 Jan 2016 09:19:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK5DT-0005Uf-OS for grub-devel@gnu.org; Fri, 15 Jan 2016 09:19:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aK5DP-0007Zk-MK for grub-devel@gnu.org; Fri, 15 Jan 2016 09:19:03 -0500 Received: from mout.gmx.net ([212.227.15.19]:50749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK5DP-0007ZU-DW for grub-devel@gnu.org; Fri, 15 Jan 2016 09:18:59 -0500 Received: from [192.168.1.47] ([31.34.87.55]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0Ld0fQ-1ZtVq61PY8-00i96n for ; Fri, 15 Jan 2016 15:18:58 +0100 Subject: Re: Setting config_directory to prefix at grub launch time References: <5698C704.6050102@gmx.fr> <5698D8E8.6070501@gmx.fr> To: The development of GNU GRUB From: "Arbiel (gmx)" X-Enigmail-Draft-Status: N1110 Message-ID: <5698FFCE.3040308@gmx.fr> Date: Fri, 15 Jan 2016 15:18:54 +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: <5698D8E8.6070501@gmx.fr> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Vxr8dJnVffQ1RPlNgsoXNTPr9QDs3pQuG" X-Provags-ID: V03:K0:1zsV00IZv9Q2I7bMdtsp9ukWHP+dnX25Gu0ekNXLkBFZH7wBySH mzhy1zDjcLWLEkoTgPp7b9tNB4kI9JGaYzyz1ymErIVfJwg49EBRAHC+3odT4GRSzcTYViH zZEx9o4/Ur+w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GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.19 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 14:19:05 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Vxr8dJnVffQ1RPlNgsoXNTPr9QDs3pQuG Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Le 15/01/2016 12:32, Arbiel (gmx) a =C3=A9crit : > > Le 15/01/2016 11:22, Andrei Borzenkov a =C3=83=C2=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 priva= te >>> 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 prefi= x >>> at the beginning of grub's running, as at this very moment prefix als= o >>> 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. Sorry for the disturbance. config_directory is set even when the current configuration file is the one pointed to by core.img. I run a new test echoing its value as the first line of the file. Its value is the same as the value of prefix. >> 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 reaso= n > 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. However, I confirm config_directory is not listed in the output of the set command. Here is what I got ?=3D0 cmdpath=3D(hd0) color_highlight=3Dblack/light-gray color_normal=3Dlight-gray/black defaut=3D0 feature_200_final=3Dy feature_chainloader_bpb=3Dy feature_default_font_path=3Dy feature_menuentry_id=3Dy feature_menuentry_option=3Dy feature_nativedisk_cmd=3Dy feature_ntdlr=3Dy feature_platform_search_hint=3Dy feature_timeout_style=3Dy font=3Dunicode gfxmode=3Dauto grub_cpu=3Di386 grub_platform=3Dpc lang=3Dfr_FR linux_gfx_mode=3Dkeep locale_dir=3D(hd0,msdos1)/boot/grub/locale menu_color_highlight=3Dblack/light-gray menu_color_normal=3Dwhite/black menuentry-id=3D--id pager=3D prefix=3D(hd0,msdos1)/boot/grub root=3Dhd0,msdos1 secondary_locale_dir=3D timeout_style=3Dmenu >> _______________________________________________ >> Grub-devel mailing list >> Grub-devel@gnu.org >> https://lists.gnu.org/mailman/listinfo/grub-devel >> > > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel --Vxr8dJnVffQ1RPlNgsoXNTPr9QDs3pQuG 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) iF4EAREIAAYFAlaY/9EACgkQG6j+1Sdg4Kv+eAD/QV4MKi30IZuj+yZSxq/GgZuf 6sixpwH1/c37LPpoDsUA/iGKixFOvPDNeFOWwF7+1tmaybO2XL5q/OGGWTJxG3D/ =KEJC -----END PGP SIGNATURE----- --Vxr8dJnVffQ1RPlNgsoXNTPr9QDs3pQuG--