From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JlWur-0006gj-OW for mharc-grub-devel@gnu.org; Mon, 14 Apr 2008 18:12:45 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JlWup-0006g7-Up for grub-devel@gnu.org; Mon, 14 Apr 2008 18:12:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JlWun-0006dM-Vo for grub-devel@gnu.org; Mon, 14 Apr 2008 18:12:43 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JlWun-0006dA-Q6 for grub-devel@gnu.org; Mon, 14 Apr 2008 18:12:41 -0400 Received: from mx1.redhat.com ([66.187.233.31]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JlWum-00060H-MV for grub-devel@gnu.org; Mon, 14 Apr 2008 18:12:41 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m3EMCUFC012130 for ; Mon, 14 Apr 2008 18:12:30 -0400 Received: from pobox.stuttgart.redhat.com (pobox.stuttgart.redhat.com [172.16.2.10]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m3EMCTWW017425 for ; Mon, 14 Apr 2008 18:12:30 -0400 Received: from [10.34.1.17] (gopher.brq.redhat.com [10.34.1.17]) by pobox.stuttgart.redhat.com (8.13.1/8.13.1) with ESMTP id m3EMCSoW030171 for ; Mon, 14 Apr 2008 18:12:29 -0400 From: Lubomir Kundrak To: The development of GRUB 2 Content-Type: multipart/mixed; boundary="=-qSQPOyICpYQEf8PxGMtZ" Organization: Red Hat Inc. Date: Tue, 15 Apr 2008 00:12:28 +0200 Message-Id: <1208211148.3971.38.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-3.fc8) X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [PATCH] Fix file name transformations (mostly) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2008 22:12:44 -0000 --=-qSQPOyICpYQEf8PxGMtZ Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi, Attaching the patch that fixes ./configure's --program-transform-name option. Tested with --program-transform-name=s,grub,grub2, quite extensively. Only one more modification is needed to completely support this -- define DEFAULT_DIRECTORY with -D option of the preprocessor instead of hardcoding in include/grub/util/misc.h. Should be fairly trivial though. 2008-04-15 Lubomir Kundrak * Makefile.in: Honor program name transformations. * util/grub.d/00_header.in: Honor program name transformations. * util/grub.d/10_linux.in: Honor program name transformations. * util/i386/pc/grub-install.in: Honor program name transformations. * util/i386/pc/grub-mkrescue.in: Honor program name transformations. * powerpc/ieee1275/grub-mkrescue.in: Honor program name transformations. * util/update-grub.in: Honor program name transformations. * util/update-grub_lib.in: Honor program name transformations. -- Lubomir Kundrak (Red Hat Security Response Team) --=-qSQPOyICpYQEf8PxGMtZ Content-Disposition: attachment; filename=grub-1.96-transform.patch Content-Type: text/x-patch; name=grub-1.96-transform.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit diff -urp grub-1.96.orig/Makefile.in grub-1.96/Makefile.in --- grub-1.96.orig/Makefile.in 2008-01-12 01:31:54.000000000 +0100 +++ grub-1.96/Makefile.in 2008-03-16 17:53:12.000000000 +0100 @@ -189,12 +189,12 @@ install-local: all dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \ done - $(mkinstalldirs) $(DESTDIR)$(libdir)/grub + $(mkinstalldirs) $(DESTDIR)$(libdir)/`echo grub | sed '$(transform)'` @list='$(lib_DATA)'; \ for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,'`"; \ - $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(libdir)/grub/$$dest; \ + $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(libdir)/`echo grub | sed '$(transform)'`/$$dest; \ done install-strip: diff -urp grub-1.96.orig/util/grub.d/00_header.in grub-1.96/util/grub.d/00_header.in --- grub-1.96.orig/util/grub.d/00_header.in 2008-02-03 14:11:33.000000000 +0100 +++ grub-1.96/util/grub.d/00_header.in 2008-03-16 17:53:12.000000000 +0100 @@ -16,13 +16,15 @@ # You should have received a copy of the GNU General Public License # along with GRUB. If not, see . +transform="@program_transform_name@" + prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ platform=@platform@ # for convert_system_path_to_grub_path() -. ${libdir}/grub/update-grub_lib +. ${libdir}/`echo grub | sed ${transform}`/update-grub_lib # Do this as early as possible, since other commands might depend on it. # (e.g. the `font' command might need lvm or raid modules) diff -urp grub-1.96.orig/util/grub.d/10_linux.in grub-1.96/util/grub.d/10_linux.in --- grub-1.96.orig/util/grub.d/10_linux.in 2008-02-03 14:11:33.000000000 +0100 +++ grub-1.96/util/grub.d/10_linux.in 2008-03-16 17:55:39.000000000 +0100 @@ -16,10 +16,12 @@ # You should have received a copy of the GNU General Public License # along with GRUB. If not, see . +transform="@program_transform_name@" + prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ -. ${libdir}/grub/update-grub_lib +. ${libdir}/`echo grub | sed ${transform}`/update-grub_lib if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then OS=GNU/Linux diff -urp grub-1.96.orig/util/i386/pc/grub-install.in grub-1.96/util/i386/pc/grub-install.in --- grub-1.96.orig/util/i386/pc/grub-install.in 2008-02-03 14:11:33.000000000 +0100 +++ grub-1.96/util/i386/pc/grub-install.in 2008-03-16 17:56:16.000000000 +0100 @@ -36,7 +36,7 @@ grub_mkimage=${bindir}/`echo grub-mkimag grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}` grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` rootdir= -grub_prefix=`echo /boot/grub | sed ${transform}` +grub_prefix=/boot/`echo grub | sed ${transform}` modules= install_device= @@ -46,7 +46,7 @@ recheck=no debug=no # for make_system_path_relative_to_its_root() -. ${libdir}/grub/update-grub_lib +. ${libdir}/`echo grub | sed ${transform}`/update-grub_lib # Usage: usage # Print the usage. diff -urp grub-1.96.orig/util/i386/pc/grub-mkrescue.in grub-1.96/util/i386/pc/grub-mkrescue.in --- grub-1.96.orig/util/i386/pc/grub-mkrescue.in 2008-02-03 14:11:33.000000000 +0100 +++ grub-1.96/util/i386/pc/grub-mkrescue.in 2008-03-16 17:58:52.000000000 +0100 @@ -55,7 +55,6 @@ EOF image_type=cdrom input_dir=${pkglibdir} -grub_mkimage=grub-mkimage # Check the arguments. for option in "$@"; do @@ -109,10 +108,10 @@ else fi memdisk_dir=`mktemp -d` -mkdir -p ${memdisk_dir}/boot/grub +mkdir -p ${memdisk_dir}/boot/`echo grub | sed ${transform}` cp ${input_dir}/*.mod \ ${input_dir}/command.lst ${input_dir}/moddep.lst ${input_dir}/fs.lst \ - ${memdisk_dir}/boot/grub/ + ${memdisk_dir}/boot/`echo grub | sed ${transform}`/ if test "x$overlay" = x ; then : ; else cp -dpR ${overlay}/* ${memdisk_dir}/ diff -urp grub-1.96.orig/util/powerpc/ieee1275/grub-mkrescue.in grub-1.96/util/powerpc/ieee1275/grub-mkrescue.in --- grub-1.96.orig/util/powerpc/ieee1275/grub-mkrescue.in 2008-01-31 18:09:39.000000000 +0100 +++ grub-1.96/util/powerpc/ieee1275/grub-mkrescue.in 2008-03-16 17:57:31.000000000 +0100 @@ -101,7 +101,7 @@ grub.img Raw 'UNIX' 'tbxi' EOF iso_dir=`mktemp -d` -boot_dir=${iso_dir}/boot/grub +boot_dir=${iso_dir}/boot/`echo grub | sed ${transform}` mkdir ${iso_dir}/boot mkdir ${boot_dir} core_img=${boot_dir}/grub.img diff -urp grub-1.96.orig/util/update-grub.in grub-1.96/util/update-grub.in --- grub-1.96.orig/util/update-grub.in 2008-03-16 17:52:32.000000000 +0100 +++ grub-1.96/util/update-grub.in 2008-03-16 17:59:42.000000000 +0100 @@ -23,7 +23,7 @@ exec_prefix=@exec_prefix@ sbindir=@sbindir@ libdir=@libdir@ sysconfdir=@sysconfdir@ -grub_prefix=`echo /boot/grub | sed ${transform}` +grub_prefix=/boot/`echo /grub | sed ${transform}` grub_cfg=${grub_prefix}/grub.cfg update_grub_dir=${sysconfdir}/grub.d platform=@platform@ @@ -32,7 +32,7 @@ grub_mkdevicemap=${sbindir}/`echo grub-m grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` # for convert_system_path_to_grub_path(), font_path() -. ${libdir}/grub/update-grub_lib +. ${libdir}/`echo grub | sed ${transform}`/update-grub_lib if [ "x$UID" = "x" ] ; then UID=`id -u` @@ -66,24 +66,24 @@ fi mkdir -p ${grub_prefix} if test -e ${grub_prefix}/device.map ; then : ; else - grub-mkdevicemap + ${grub_mkdevicemap} fi # Device containing our userland. Typically used for root= parameter. -GRUB_DEVICE="`grub-probe --target=device /`" +GRUB_DEVICE="`${grub_probe} --target=device /`" # Filesystem for the device containing our userland. Used for stuff like # choosing Hurd filesystem module. -GRUB_FS="`grub-probe --target=fs / 2> /dev/null || echo unknown`" +GRUB_FS="`${grub_probe} --target=fs / 2> /dev/null || echo unknown`" # GRUB path to /. Only used for "set root=". Not critical. -GRUB_DRIVE="`grub-probe --target=drive /`" || true +GRUB_DRIVE="`${grub_probe} --target=drive /`" || true # GRUB path to /boot GRUB_DRIVE_BOOT="`convert_system_path_to_grub_path /boot`" # GRUB path to /boot/grub -GRUB_DRIVE_BOOT_GRUB="`convert_system_path_to_grub_path /boot/grub`" +GRUB_DRIVE_BOOT_GRUB="`convert_system_path_to_grub_path ${grub_prefix}`" defaults=`echo ${sysconfdir}/sysconfig/grub | sed ${transform}` if test -f ${defaults}; then --- grub-1.96.orig/util/update-grub_lib.in.transform 2008-03-23 11:46:14.000000000 +0100 +++ grub-1.96/util/update-grub_lib.in 2008-03-23 11:49:21.000000000 +0100 @@ -95,7 +95,8 @@ { # Prefer system path for space reasons (/boot/grub might be a very small # partition in case of OpenFirmware, etc). - for dir in ${pkgdatadir} /usr/share/grub /boot/grub ; do + for dir in ${pkgdatadir} ${pkgdatadir}/`echo grub | sed ${transform}` \ + /boot/`echo grub | sed ${transform}`; do # Prefer complete fonts over incomplete ones. for basename in unicode unifont ascii ; do path="${dir}/${basename}.pff" --=-qSQPOyICpYQEf8PxGMtZ--