All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] File name transformations (split into 7 diffs)
@ 2010-06-03 23:42 Grégoire Sutre
  2010-06-07 21:16 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2010-07-21  5:11 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 2 replies; 4+ messages in thread
From: Grégoire Sutre @ 2010-06-03 23:42 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 1666 bytes --]

Hi,

This is the same patch as I sent before, but this time split into 7
diffs (which must be successively applied in order) and with a cleaner
changelog.  I hope that this will facilitate the review.

This version does not include the --root-directory addition to
grub-mkconfig, as this is quite orthognal to the goal of the patch (file
name transformation).

I welcome your comments,

Grégoire

--- mostly taken from my previous message ------------------------------

The attached patch fixes problems with file name transformations, which
are partly broken in trunk.  With this patch, several installations of
grub can coexist with no conflict (at least they should), sharing
however the same configuration directory (etc/grub.d).

For instance:

./configure --program-transform-name=s,grub,aaa,

will install bin/aaa-*, sbin/aaa-*, etc. The default grub directory will
be /boot/aaa, modules will be installed there and grub-mkconfig will
look for them there.

The main changes in the patch are:

- configure defines three new variables, accounting for transformations:
   . pkgdatadir       (${datadir}/grub)
   . pkglibrootdir    (${libdir}/grub)
   . defaultbootdir   (/boot/grub, or /grub if OS is NetBSD or OpenBSD)

- these variables are used in Makefile and in util/... scripts

- output of --help and of --version in scripts uses `basename $0` and
   the same format as the one in binaries.

- in Makefile, the help2man, .info, and .mo rules also account for
   file name transformations.

- grub-mkconfig exports GRUB_DIR, which is used by grub-mkconfig_lib
   and by 00_header.

-----------------------------------------------------------------------


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: file-name-transformations_1.diff --]
[-- Type: text/x-patch; name="file-name-transformations_1.diff", Size: 13688 bytes --]

=== modified file 'ChangeLog'
--- ChangeLog	2010-06-03 08:48:23 +0000
+++ ChangeLog	2010-06-03 20:34:49 +0000
@@ -1,3 +1,22 @@
+2010-06-03  Grégoire Sutre  <gregoire.sutre@gmail.com>
+
+	Make --version uniform and avoid hard-coded program name.
+
+	* util/grub-mkimage.c (main): Use `program_name' instead of
+	hard-coded string.
+	* util/i386/pc/grub-setup.c (main): Likewise.
+	* util/sparc64/ieee1275/grub-setup.c (parse_options): Likewise.
+	* util/grub-install.in: Save the basename of $0 in $self, and use the
+	latter in informational messages.  Use the same format for --version
+	as the binary programs.
+	* util/grub-mkconfig.in: Likewise.
+	* util/grub-mkrescue.in: Likewise.
+	* util/grub-reboot.in: Likewise.
+	* util/grub-set-default.in: Likewise.
+	* util/i386/efi/grub-install.in: Likewise.
+	* util/ieee1275/grub-install.in: Likewise.
+	* util/powerpc/ieee1275/grub-mkrescue.in: Likewise.
+
 2010-06-03  Colin Watson  <cjwatson@ubuntu.com>
 
 	* INSTALL: Document several build requirements for optional features

=== modified file 'util/grub-install.in'
--- util/grub-install.in	2010-05-18 11:45:25 +0000
+++ util/grub-install.in	2010-06-03 20:34:49 +0000
@@ -34,6 +34,8 @@ font=@datadir@/@PACKAGE_TARNAME@/ascii.p
 pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
 localedir=@datadir@/locale
 
+self=`basename $0`
+
 grub_setup=${sbindir}/`echo grub-setup | sed ${transform}`
 grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
 grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
@@ -61,7 +63,7 @@ fi
 # Print the usage.
 usage () {
     cat <<EOF
-Usage: grub-install [OPTION] install_device
+Usage: $self [OPTION] install_device
 Install GRUB on your drive.
 
   -h, --help              print this message and exit
@@ -91,10 +93,10 @@ fi
 
 INSTALL_DEVICE can be a GRUB device name or a system device filename.
 
-grub-install copies GRUB images into /boot/grub (or /grub on NetBSD and
+$self copies GRUB images into /boot/grub (or /grub on NetBSD and
 OpenBSD), and uses grub-setup to install grub into the boot sector.
 
-If the --root-directory option is used, then grub-install will copy
+If the --root-directory option is used, then $self will copy
 images into the operating system installation rooted at that directory.
 
 Report bugs to <bug-grub@gnu.org>.
@@ -108,7 +110,7 @@ for option in "$@"; do
 	usage
 	exit 0 ;;
     -v | --version)
-	echo "grub-install (GNU GRUB ${PACKAGE_VERSION})"
+	echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
 	exit 0 ;;
     --modules=*)
 	modules=`echo "$option" | sed 's/--modules=//'` ;;

=== modified file 'util/grub-mkconfig.in'
--- util/grub-mkconfig.in	2010-05-23 12:11:11 +0000
+++ util/grub-mkconfig.in	2010-06-03 20:34:49 +0000
@@ -23,7 +23,8 @@ exec_prefix=@exec_prefix@
 sbindir=@sbindir@
 libdir=@libdir@
 sysconfdir=@sysconfdir@
-package_version=@PACKAGE_VERSION@
+PACKAGE_NAME=@PACKAGE_NAME@
+PACKAGE_VERSION=@PACKAGE_VERSION@
 host_os=@host_os@
 datarootdir=@datarootdir@
 datadir=@datadir@
@@ -31,6 +32,8 @@ pkgdatadir=${datadir}/`echo @PACKAGE_TAR
 grub_cfg=""
 grub_mkconfig_dir=${sysconfdir}/grub.d
 
+self=`basename $0`
+
 grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
 grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
 
@@ -38,7 +41,7 @@ grub_probe=${sbindir}/`echo grub-probe |
 # Print the usage.
 usage () {
     cat <<EOF
-Usage: $0 [OPTION]
+Usage: $self [OPTION]
 Generate a grub config file
 
   -o, --output=FILE       output generated config to FILE [default=stdout]
@@ -62,7 +65,7 @@ for option in "$@"; do
 	usage
 	exit 0 ;;
     -v | --version)
-	echo "$0 (GNU GRUB ${package_version})"
+	echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
 	exit 0 ;;
     -o)
 	next_grub_cfg=:
@@ -113,7 +116,7 @@ if [ "$EUID" != 0 ] ; then
       done ;;
   esac
   if [ $root != t ] ; then
-    echo "$0: You must run this as root" >&2
+    echo "$self: You must run this as root" >&2
     exit 1
   fi
 fi
@@ -284,7 +287,7 @@ cat << EOF
 #
 # DO NOT EDIT THIS FILE
 #
-# It is automatically generated by $0 using templates
+# It is automatically generated by $self using templates
 # from ${grub_mkconfig_dir} and settings from ${sysconfdir}/default/grub
 #
 EOF

=== modified file 'util/grub-mkimage.c'
--- util/grub-mkimage.c	2010-05-18 11:55:26 +0000
+++ util/grub-mkimage.c	2010-06-03 20:34:49 +0000
@@ -1307,7 +1307,7 @@ main (int argc, char *argv[])
 	    break;
 
 	  case 'V':
-	    printf ("grub-mkimage (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
+	    printf ("%s (%s) %s\n", program_name, PACKAGE_NAME, PACKAGE_VERSION);
 	    return 0;
 
 	  case 'v':

=== modified file 'util/grub-mkrescue.in'
--- util/grub-mkrescue.in	2010-05-27 11:43:22 +0000
+++ util/grub-mkrescue.in	2010-06-03 20:34:49 +0000
@@ -30,6 +30,8 @@ target_cpu=@target_cpu@
 native_platform=@platform@
 pkglib_DATA="@pkglib_DATA@"
 
+self=`basename $0`
+
 multiboot_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-multiboot
 coreboot_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-coreboot
 qemu_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-qemu
@@ -44,7 +46,7 @@ grub_mkimage=${bindir}/`echo grub-mkimag
 # Print the usage.
 usage () {
     cat <<EOF
-Usage: $0 [OPTION] SOURCE...
+Usage: $self [OPTION] SOURCE...
 Make GRUB rescue image.
 
   -h, --help              print this message and exit
@@ -54,7 +56,7 @@ Make GRUB rescue image.
   --rom-directory=DIR     save rom images in DIR [optional]
   --grub-mkimage=FILE     use FILE as grub-mkimage
 
-$0 generates a bootable rescue image with specified source files or directories.
+$self generates a bootable rescue image with specified source files or directories.
 
 Report bugs to <bug-grub@gnu.org>.
 EOF
@@ -67,7 +69,7 @@ for option in "$@"; do
 	usage
 	exit 0 ;;
     -v | --version)
-	echo "$0 (GNU GRUB ${PACKAGE_VERSION})"
+	echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
 	exit 0 ;;
     --modules=*)
 	modules=`echo "$option" | sed 's/--modules=//'` ;;

=== modified file 'util/grub-reboot.in'
--- util/grub-reboot.in	2010-01-05 11:16:42 +0000
+++ util/grub-reboot.in	2010-06-03 20:34:49 +0000
@@ -22,6 +22,10 @@ transform="@program_transform_name@"
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 bindir=@bindir@
+PACKAGE_NAME=@PACKAGE_NAME@
+PACKAGE_VERSION=@PACKAGE_VERSION@
+
+self=`basename $0`
 
 grub_editenv=${bindir}/`echo grub-editenv | sed ${transform}`
 rootdir=
@@ -30,7 +34,7 @@ rootdir=
 # Print the usage.
 usage () {
     cat <<EOF
-Usage: $0 [OPTION] entry
+Usage: $self [OPTION] entry
 Set the default boot entry for GRUB, for the next boot only.
 
   -h, --help              print this message and exit
@@ -51,7 +55,7 @@ for option in "$@"; do
 	usage
 	exit 0 ;;
     -v | --version)
-	echo "grub-reboot (GNU GRUB ${PACKAGE_VERSION})"
+	echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
 	exit 0 ;;
     --root-directory=*)
 	rootdir=`echo "$option" | sed 's/--root-directory=//'` ;;

=== modified file 'util/grub-set-default.in'
--- util/grub-set-default.in	2009-12-08 01:00:26 +0000
+++ util/grub-set-default.in	2010-06-03 20:34:49 +0000
@@ -22,6 +22,10 @@ transform="@program_transform_name@"
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 bindir=@bindir@
+PACKAGE_NAME=@PACKAGE_NAME@
+PACKAGE_VERSION=@PACKAGE_VERSION@
+
+self=`basename $0`
 
 grub_editenv=${bindir}/`echo grub-editenv | sed ${transform}`
 rootdir=
@@ -30,7 +34,7 @@ rootdir=
 # Print the usage.
 usage () {
     cat <<EOF
-Usage: $0 [OPTION] entry
+Usage: $self [OPTION] entry
 Set the default boot entry for GRUB.
 
   -h, --help              print this message and exit
@@ -51,7 +55,7 @@ for option in "$@"; do
 	usage
 	exit 0 ;;
     -v | --version)
-	echo "grub-set-default (GNU GRUB ${PACKAGE_VERSION})"
+	echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
 	exit 0 ;;
     --root-directory=*)
 	rootdir=`echo "$option" | sed 's/--root-directory=//'` ;;

=== modified file 'util/i386/efi/grub-install.in'
--- util/i386/efi/grub-install.in	2010-04-26 19:27:41 +0000
+++ util/i386/efi/grub-install.in	2010-06-03 20:34:49 +0000
@@ -33,6 +33,8 @@ host_os=@host_os@
 pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
 localedir=@datadir@/locale
 
+self=`basename $0`
+
 grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
 grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
 grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
@@ -50,7 +52,7 @@ debug=no
 # Print the usage.
 usage () {
     cat <<EOF
-Usage: grub-install [OPTION]
+Usage: $self [OPTION]
 Install GRUB on your EFI partition.
 
   -h, --help              print this message and exit
@@ -64,7 +66,7 @@ Install GRUB on your EFI partition.
   --no-floppy             do not probe any floppy drive
   --recheck               probe a device map even if it already exists
 
-grub-install copies GRUB images into the DIR/boot directory specified by
+$self copies GRUB images into the DIR/boot directory specified by
 --root-directory.
 
 Report bugs to <bug-grub@gnu.org>.
@@ -78,7 +80,7 @@ for option in "$@"; do
 	usage
 	exit 0 ;;
     -v | --version)
-	echo "grub-install (GNU GRUB ${PACKAGE_VERSION})"
+	echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
 	exit 0 ;;
     --modules=*)
 	modules=`echo "$option" | sed 's/--modules=//'` ;;
@@ -219,7 +221,7 @@ $grub_mkimage -O ${target_cpu}-efi --out
 echo "Installation finished. No error reported."
 echo "This is the contents of the device map $device_map."
 echo "Check if this is correct or not. If any of the lines is incorrect,"
-echo "fix it and re-run the script \`grub-install'."
+echo "fix it and re-run the script \`$self'."
 echo
 
 cat $device_map

=== modified file 'util/i386/pc/grub-setup.c'
--- util/i386/pc/grub-setup.c	2010-05-17 19:26:16 +0000
+++ util/i386/pc/grub-setup.c	2010-06-03 20:34:49 +0000
@@ -702,7 +702,7 @@ main (int argc, char *argv[])
 	    break;
 
 	  case 'V':
-	    printf ("grub-setup (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
+	    printf ("%s (%s) %s\n", program_name, PACKAGE_NAME, PACKAGE_VERSION);
 	    return 0;
 
 	  case 'v':

=== modified file 'util/ieee1275/grub-install.in'
--- util/ieee1275/grub-install.in	2010-04-26 19:27:41 +0000
+++ util/ieee1275/grub-install.in	2010-06-03 20:34:49 +0000
@@ -34,6 +34,8 @@ target_cpu=@target_cpu@
 platform=@platform@
 pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
 
+self=`basename $0`
+
 grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
 grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
 grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
@@ -53,7 +55,7 @@ nvsetenv=`which nvsetenv`
 # Print the usage.
 usage () {
     cat <<EOF
-Usage: grub-install [OPTION] [install_device]
+Usage: $self [OPTION] [install_device]
 Install GRUB on your drive.
 
   -h, --help              print this message and exit
@@ -66,7 +68,7 @@ Install GRUB on your drive.
   --grub-probe=FILE       use FILE as grub-probe
   --no-nvram              don't update the boot-device NVRAM variable
 
-grub-install copies GRUB images into the DIR/boot directory specified by
+$self copies GRUB images into the DIR/boot directory specified by
 --root-directory, and uses nvsetenv to set the Open Firmware boot-device
 variable.
 
@@ -81,7 +83,7 @@ for option in "$@"; do
 	usage
 	exit 0 ;;
     -v | --version)
-	echo "grub-install (GNU GRUB ${PACKAGE_VERSION})"
+	echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
 	exit 0 ;;
     --modules=*)
 	modules=`echo "$option" | sed 's/--modules=//'` ;;
@@ -231,7 +233,7 @@ fi
 echo "Installation finished. No error reported."
 echo "This is the contents of the device map $device_map."
 echo "Check if this is correct or not. If any of the lines is incorrect,"
-echo "fix it and re-run the script \`grub-install'."
+echo "fix it and re-run the script \`$self'."
 echo
 
 cat $device_map

=== modified file 'util/powerpc/ieee1275/grub-mkrescue.in'
--- util/powerpc/ieee1275/grub-mkrescue.in	2010-04-26 19:27:41 +0000
+++ util/powerpc/ieee1275/grub-mkrescue.in	2010-06-03 20:34:49 +0000
@@ -30,13 +30,15 @@ target_cpu=@target_cpu@
 platform=@platform@
 pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
 
+self=`basename $0`
+
 grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
 
 # Usage: usage
 # Print the usage.
 usage () {
     cat <<EOF
-Usage: grub-mkrescue [OPTION] output_image
+Usage: $self [OPTION] output_image
 Make GRUB rescue image.
 
   -h, --help              print this message and exit
@@ -46,7 +48,7 @@ Make GRUB rescue image.
                           default: ${pkglibdir}
   --grub-mkimage=FILE     use FILE as grub-mkimage
 
-grub-mkimage generates a bootable rescue CD image for PowerMac and CHRP.
+$self generates a bootable rescue CD image for PowerMac and CHRP.
 
 Report bugs to <bug-grub@gnu.org>.
 EOF
@@ -61,7 +63,7 @@ for option in "$@"; do
 	usage
 	exit 0 ;;
     -v | --version)
-	echo "grub-mkrescue (GNU GRUB ${PACKAGE_VERSION})"
+	echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
 	exit 0 ;;
     --modules=*)
 	modules=`echo "$option" | sed 's/--modules=//'` ;;

=== modified file 'util/sparc64/ieee1275/grub-setup.c'
--- util/sparc64/ieee1275/grub-setup.c	2010-05-17 19:26:16 +0000
+++ util/sparc64/ieee1275/grub-setup.c	2010-06-03 20:34:49 +0000
@@ -503,7 +503,7 @@ parse_options (struct grub_setup_info *g
 	    break;
 
 	  case 'V':
-	    printf ("grub-setup (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
+	    printf ("%s (%s) %s\n", program_name, PACKAGE_NAME, PACKAGE_VERSION);
 	    return 0;
 
 	  case 'v':


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: file-name-transformations_2.diff --]
[-- Type: text/x-patch; name="file-name-transformations_2.diff", Size: 23734 bytes --]

=== modified file 'ChangeLog'
--- ChangeLog	2010-06-03 20:34:49 +0000
+++ ChangeLog	2010-06-03 21:36:19 +0000
@@ -1,5 +1,29 @@
 2010-06-03  Grégoire Sutre  <gregoire.sutre@gmail.com>
 
+	* configure.ac: Set and subsitute pkgdatadir, pkglibrootdir and
+	defaultbootdir.
+	* Makefile.in: Use the above autoconfigured variables.
+	* util/grub-install.in: Likewise, and simplify usage message.
+	* util/grub-mkrescue.in: Likewise.
+	* util/grub-reboot.in: Likewise.
+	* util/grub-set-default.in: Likewise.
+	* util/grub.d/10_hurd.in: Likewise.
+	* util/grub.d/10_kfreebsd.in: Likewise.
+	* util/grub.d/10_linux.in: Likewise.
+	* util/grub.d/10_netbsd.in: Likewise.
+	* util/grub.d/10_windows.in: Likewise.
+	* util/grub.d/30_os-prober.in: Likewise.
+	* util/i386/efi/grub-install.in: Likewise.
+	* util/ieee1275/grub-install.in: Likewise.
+	* util/powerpc/ieee1275/grub-mkrescue.in: Likewise.
+	* util/update-grub_lib.in: Likewise.
+	* util/grub-mkconfig.in: Likewise.
+	(GRUB_DIR): Export new variable.
+	* util/grub-mkconfig_lib.in: Likewise, and use device.map in GRUB_DIR.
+	* util/grub.d/00_header.in: Likewise, and use GRUB_DIR.
+
+2010-06-03  Grégoire Sutre  <gregoire.sutre@gmail.com>
+
 	Make --version uniform and avoid hard-coded program name.
 
 	* util/grub-mkimage.c (main): Use `program_name' instead of

=== modified file 'Makefile.in'
--- Makefile.in	2010-05-18 11:55:26 +0000
+++ Makefile.in	2010-06-03 21:36:19 +0000
@@ -39,8 +39,9 @@ localedir = @localedir@
 infodir = @infodir@
 mandir = @mandir@
 includedir = @includedir@
-pkgdatadir = $(datadir)/`echo @PACKAGE_TARNAME@ | sed '$(transform)'`
-pkglibdir =  $(libdir)/`echo @PACKAGE_TARNAME@/$(target_cpu)-$(platform) | sed '$(transform)'`
+pkgdatadir = @pkgdatadir@
+pkglibrootdir = @pkglibrootdir@
+pkglibdir = $(pkglibrootdir)/$(target_cpu)-$(platform)
 
 # Internationalization library.
 LIBINTL = @LIBINTL@
@@ -90,7 +91,7 @@ GNULIB_CFLAGS = $(GNULIB_UTIL_CFLAGS) $(
 ASFLAGS = @ASFLAGS@
 LDFLAGS = @LDFLAGS@ $(LIBS)
 CPPFLAGS = @CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/gnulib -I$(srcdir)/include -Wall -W \
-	 -DGRUB_PKGLIBROOTDIR=\"$(libdir)/`echo @PACKAGE_TARNAME@ | sed '$(transform)'`\" -DLOCALEDIR=\"$(localedir)\"
+	 -DGRUB_PKGLIBROOTDIR=\"$(pkglibrootdir)\" -DLOCALEDIR=\"$(localedir)\"
 TARGET_CC = @TARGET_CC@
 TARGET_CFLAGS = -ffreestanding @TARGET_CFLAGS@
 TARGET_ASFLAGS = -nostdinc -fno-builtin @TARGET_ASFLAGS@
@@ -355,12 +356,12 @@ install-local: all
 	  dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
 	  $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \
 	done
-	$(SHELL) $(mkinstalldirs) $(DESTDIR)$(libdir)/grub
+	$(SHELL) $(mkinstalldirs) $(DESTDIR)$(pkglibrootdir)
 	@list='$(lib_SCRIPTS)'; \
 	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)$(pkglibrootdir)/$$dest; \
 	done
 	@langs='$(LINGUAS)'; \
 	for lang in $$langs; do \
@@ -412,7 +413,7 @@ uninstall:
 	@list='$(lib_SCRIPTS)'; \
 	for file in $$list; do \
 	  dest="`echo $$file | sed 's,.*/,,'`"; \
-	  rm -f $(DESTDIR)$(libdir)/grub/$$dest; \
+	  rm -f $(DESTDIR)$(pkglibrootdir)/$$dest; \
 	done
 	@list='$(info_INFOS)'; \
 	for file in $$list; do \

=== modified file 'configure.ac'
--- configure.ac	2010-05-28 17:13:48 +0000
+++ configure.ac	2010-06-03 21:36:19 +0000
@@ -798,6 +798,27 @@ fi
 
 AC_SUBST(ASFLAGS)
 
+# Additional names and paths to be substituted in makefiles and scripts.
+pkgdatadir=${datadir}/`echo ${PACKAGE_TARNAME} | sed "${program_transform_name}"`
+pkglibrootdir=${libdir}/`echo ${PACKAGE_TARNAME} | sed "${program_transform_name}"`
+
+case "$host_os" in
+netbsd* | openbsd*)
+    # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub
+    # instead of /boot/grub.
+    defaultbootdir=
+    ;;
+*)
+    # Use /boot/grub by default.
+    defaultbootdir=/boot
+    ;;
+esac
+defaultbootdir=${defaultbootdir}/`echo ${PACKAGE_TARNAME} | sed "${program_transform_name}"`
+
+AC_SUBST([pkgdatadir])
+AC_SUBST([pkglibrootdir])
+AC_SUBST([defaultbootdir])
+
 # Output files.
 grub_CHECK_LINK_DIR
 if test x"$link_dir" = xyes ; then

=== modified file 'util/grub-install.in'
--- util/grub-install.in	2010-06-03 20:34:49 +0000
+++ util/grub-install.in	2010-06-03 21:36:19 +0000
@@ -29,10 +29,11 @@ PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
 target_cpu=@target_cpu@
 platform=@platform@
-host_os=@host_os@
 font=@datadir@/@PACKAGE_TARNAME@/ascii.pf2
-pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
+pkglibrootdir=@pkglibrootdir@
+pkglibdir=${pkglibrootdir}/${target_cpu}-${platform}
 localedir=@datadir@/locale
+defaultbootdir=@defaultbootdir@
 
 self=`basename $0`
 
@@ -42,7 +43,6 @@ grub_mkdevicemap=${sbindir}/`echo grub-m
 grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
 grub_editenv=${bindir}/`echo grub-editenv | sed ${transform}`
 rootdir=
-grub_prefix=`echo /boot/grub | sed ${transform}`
 modules=
 
 install_device=
@@ -91,13 +91,11 @@ EOF
 fi
     cat <<EOF
 
-INSTALL_DEVICE can be a GRUB device name or a system device filename.
-
-$self copies GRUB images into /boot/grub (or /grub on NetBSD and
-OpenBSD), and uses grub-setup to install grub into the boot sector.
+$self copies GRUB images into the DIR${defaultbootdir} directory specified by
+--root-directory, and uses `basename ${grub_setup}` to install GRUB into the
+boot sector of INSTALL_DEVICE.
 
-If the --root-directory option is used, then $self will copy
-images into the operating system installation rooted at that directory.
+INSTALL_DEVICE can be a GRUB device name or a system device filename.
 
 Report bugs to <bug-grub@gnu.org>.
 EOF
@@ -155,7 +153,7 @@ for option in "$@"; do
 done
 
 # for make_system_path_relative_to_its_root()
-. ${libdir}/grub/grub-mkconfig_lib
+. ${pkglibrootdir}/grub-mkconfig_lib
 
 if test "x$install_device" = x && test "${target_cpu}-${platform}" != "mips-yeeloong"; then
     echo "install_device not specified." 1>&2
@@ -171,20 +169,7 @@ if test $debug = yes; then
 fi
 
 # Initialize these directories here, since ROOTDIR was initialized.
-case "$host_os" in
-netbsd* | openbsd*)
-    # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub
-    # instead of /boot/grub.
-    grub_prefix=`echo /grub | sed ${transform}`
-    bootdir=${rootdir}
-    ;;
-*)
-    # Use /boot/grub by default.
-    bootdir=${rootdir}/boot
-    ;;
-esac
-
-grubdir=${bootdir}/`echo grub | sed ${transform}`
+grubdir=${rootdir}${defaultbootdir}
 device_map=${grubdir}/device.map
 
 grub_probe="${grub_probe} --device-map=${device_map}"
@@ -358,8 +343,10 @@ if [ "${target_cpu}-${platform}" = "i386
     $grub_setup ${setup_verbose} ${setup_force} --directory=${grubdir} --device-map=${device_map} \
         ${install_device} || exit 1
 elif [ "${target_cpu}-${platform}" = "mips-yeeloong" ] ; then
+    # XXX hard-coded /boot (use ${grubdir} or ${defaultbootdir} ?)
     $grub_mkimage ${config_opt} -f ${font} -d ${pkglibdir} -O ${mkimage_target} --output=/boot/grub.elf --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
 else
+    # XXX hard-coded /boot (use ${grubdir} or ${defaultbootdir} ?)
     $grub_mkimage -O ${mkimage_target} ${config_opt} -d ${pkglibdir} --output=/boot/multiboot.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
 fi
 

=== modified file 'util/grub-mkconfig.in'
--- util/grub-mkconfig.in	2010-06-03 20:34:49 +0000
+++ util/grub-mkconfig.in	2010-06-03 21:36:19 +0000
@@ -25,10 +25,11 @@ libdir=@libdir@
 sysconfdir=@sysconfdir@
 PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
-host_os=@host_os@
 datarootdir=@datarootdir@
 datadir=@datadir@
-pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`
+pkgdatadir=@pkgdatadir@
+pkglibrootdir=@pkglibrootdir@
+defaultbootdir=@defaultbootdir@
 grub_cfg=""
 grub_mkconfig_dir=${sysconfdir}/grub.d
 
@@ -86,19 +87,33 @@ if $next_grub_cfg; then
     exit 1
 fi
 
-. ${libdir}/grub/grub-mkconfig_lib
+set $grub_mkdevicemap dummy
+if test -f "$1"; then
+    :
+else
+    echo "$1: Not found." 1>&2
+    exit 1
+fi
+
+set $grub_probe dummy
+if test -f "$1"; then
+    :
+else
+    echo "$1: Not found." 1>&2
+    exit 1
+fi
+
+GRUB_DIR=${defaultbootdir}
+
+# Create the GRUB directory if it is not present.
+mkdir -p ${GRUB_DIR} || exit 1
+
+# This must be done before sourcing grub-mkconfig_lib.
+if test -e ${GRUB_DIR}/device.map ; then : ; else
+  ${grub_mkdevicemap} --device-map=${GRUB_DIR}/device.map
+fi
 
-case "$host_os" in
-netbsd* | openbsd*)
-    # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub
-    # instead of /boot/grub.
-    grub_prefix=`echo /grub | sed ${transform}`
-    ;;
-*)
-    # Use /boot/grub by default.
-    grub_prefix=`echo /boot/grub | sed ${transform}`
-    ;;
-esac
+. ${pkglibrootdir}/grub-mkconfig_lib
 
 if [ "x$EUID" = "x" ] ; then
   EUID=`id -u`
@@ -121,28 +136,6 @@ if [ "$EUID" != 0 ] ; then
   fi
 fi
 
-set $grub_mkdevicemap dummy
-if test -f "$1"; then
-    :
-else
-    echo "$1: Not found." 1>&2
-    exit 1
-fi
-
-set $grub_probe dummy
-if test -f "$1"; then
-    :
-else
-    echo "$1: Not found." 1>&2
-    exit 1
-fi
-
-mkdir -p ${grub_prefix}
-
-if test -e ${grub_prefix}/device.map ; then : ; else
-  ${grub_mkdevicemap}
-fi
-
 # Device containing our userland.  Typically used for root= parameter.
 GRUB_DEVICE="`${grub_probe} --target=device /`"
 GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
@@ -174,7 +167,7 @@ fi
 for x in ${GRUB_TERMINAL_OUTPUT}; do
     if [ "x${x}" = "xgfxterm" ]; then
         # If this platform supports gfxterm, try to use it.
-	if ! test -e ${grub_prefix}/gfxterm.mod ; then
+	if ! test -e ${GRUB_DIR}/gfxterm.mod ; then
 	    if [ "x$termoutdefault" != "x1" ]; then
 		echo "gfxterm isn't available on your platform" >&2 ; exit 1
 	    fi
@@ -183,7 +176,7 @@ for x in ${GRUB_TERMINAL_OUTPUT}; do
 	fi
         # FIXME: this should do something smarter than just loading first
         # video backend.
-	GRUB_VIDEO_BACKEND=$(head -n 1 ${grub_prefix}/video.lst || true)
+	GRUB_VIDEO_BACKEND=$(head -n 1 ${GRUB_DIR}/video.lst || true)
 	if [ -z "${GRUB_VIDEO_BACKEND}" ] ; then
 	    if [ "x$termoutdefault" != "x1" ]; then
 		echo "No suitable backend could be found for gfxterm." >&2 ; exit 1
@@ -198,7 +191,7 @@ for x in ${GRUB_TERMINAL_OUTPUT}; do
 		exit 1
 	    fi
 	else
-	    for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do
+	    for dir in ${GRUB_DIR} ${pkgdatadir} /boot/grub /usr/share/grub ; do
 		for basename in unicode unifont ascii; do
 		    path="${dir}/${basename}.pf2"
 		    if is_path_readable_by_grub ${path} > /dev/null ; then
@@ -239,6 +232,7 @@ export GRUB_DEVICE \
   GRUB_DEVICE_UUID \
   GRUB_DEVICE_BOOT \
   GRUB_DEVICE_BOOT_UUID \
+  GRUB_DIR \
   GRUB_FS \
   GRUB_FONT_PATH \
   GRUB_PRELOAD_MODULES \
@@ -281,7 +275,7 @@ if test "x${grub_cfg}" != "x"; then
   chmod 400 ${grub_cfg}.new || grub_warn "Could not make ${grub_cfg}.new readable by only root.\
   This means that if the generated config contains a password it is readable by everyone"
 fi
-echo "Generating grub.cfg ..." >&2
+echo "Generating grub configuration ..." >&2
 
 cat << EOF
 #

=== modified file 'util/grub-mkconfig_lib.in'
--- util/grub-mkconfig_lib.in	2010-05-27 14:38:16 +0000
+++ util/grub-mkconfig_lib.in	2010-06-03 21:36:19 +0000
@@ -22,7 +22,7 @@ datarootdir=@datarootdir@
 datadir=@datadir@
 bindir=@bindir@
 sbindir=@sbindir@
-pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`
+pkgdatadir=@pkgdatadir@
 
 if test "x$grub_probe" = x; then
   grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
@@ -31,6 +31,13 @@ if test "x$grub_mkrelpath" = x; then
   grub_mkrelpath=${bindir}/`echo grub-mkrelpath | sed ${transform}`
 fi
 
+# GRUB_DIR should be set before sourcing this file, but let's be safe.
+if test "x${GRUB_DIR}" != "x"; then
+  if test -e "${GRUB_DIR}/device.map"; then
+    grub_probe="${grub_probe} --device-map=${GRUB_DIR}/device.map"
+  fi
+fi
+
 if $(which gettext >/dev/null 2>/dev/null) ; then
   gettext="gettext"
 else

=== modified file 'util/grub-mkrescue.in'
--- util/grub-mkrescue.in	2010-06-03 20:34:49 +0000
+++ util/grub-mkrescue.in	2010-06-03 21:36:19 +0000
@@ -28,16 +28,17 @@ PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
 target_cpu=@target_cpu@
 native_platform=@platform@
+pkglibrootdir=@pkglibrootdir@
 pkglib_DATA="@pkglib_DATA@"
 
 self=`basename $0`
 
-multiboot_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-multiboot
-coreboot_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-coreboot
-qemu_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-qemu
-pc_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-pc
-efi32_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-efi
-efi64_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/x86_64-efi
+multiboot_dir=${pkglibrootdir}/i386-multiboot
+coreboot_dir=${pkglibrootdir}/i386-coreboot
+qemu_dir=${pkglibrootdir}/i386-qemu
+pc_dir=${pkglibrootdir}/i386-pc
+efi32_dir=${pkglibrootdir}/i386-efi
+efi64_dir=${pkglibrootdir}/x86_64-efi
 rom_directory=
 override_dir=
 grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`

=== modified file 'util/grub-reboot.in'
--- util/grub-reboot.in	2010-06-03 20:34:49 +0000
+++ util/grub-reboot.in	2010-06-03 21:36:19 +0000
@@ -24,6 +24,7 @@ exec_prefix=@exec_prefix@
 bindir=@bindir@
 PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
+defaultbootdir=@defaultbootdir@
 
 self=`basename $0`
 
@@ -81,20 +82,7 @@ if test "x$entry" = x; then
 fi
 
 # Initialize these directories here, since ROOTDIR was initialized.
-case "$host_os" in
-netbsd* | openbsd*)
-    # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub
-    # instead of /boot/grub.
-    grub_prefix=`echo /grub | sed ${transform}`
-    bootdir=${rootdir}
-    ;;
-*)
-    # Use /boot/grub by default.
-    bootdir=${rootdir}/boot
-    ;;
-esac
-
-grubdir=${bootdir}/`echo grub | sed ${transform}`
+grubdir=${rootdir}${defaultbootdir}
 
 prev_saved_entry=`$grub_editenv ${grubdir}/grubenv list | sed -n 's/^saved_entry=//p'`
 if [ "$prev_saved_entry" ]; then

=== modified file 'util/grub-set-default.in'
--- util/grub-set-default.in	2010-06-03 20:34:49 +0000
+++ util/grub-set-default.in	2010-06-03 21:36:19 +0000
@@ -24,6 +24,7 @@ exec_prefix=@exec_prefix@
 bindir=@bindir@
 PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
+defaultbootdir=@defaultbootdir@
 
 self=`basename $0`
 
@@ -81,20 +82,7 @@ if test "x$entry" = x; then
 fi
 
 # Initialize these directories here, since ROOTDIR was initialized.
-case "$host_os" in
-netbsd* | openbsd*)
-    # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub
-    # instead of /boot/grub.
-    grub_prefix=`echo /grub | sed ${transform}`
-    bootdir=${rootdir}
-    ;;
-*)
-    # Use /boot/grub by default.
-    bootdir=${rootdir}/boot
-    ;;
-esac
-
-grubdir=${bootdir}/`echo grub | sed ${transform}`
+grubdir=${rootdir}${defaultbootdir}
 
 $grub_editenv ${grubdir}/grubenv unset prev_saved_entry
 $grub_editenv ${grubdir}/grubenv set saved_entry="$entry"

=== modified file 'util/grub.d/00_header.in'
--- util/grub.d/00_header.in	2010-06-02 12:57:13 +0000
+++ util/grub.d/00_header.in	2010-06-03 21:36:19 +0000
@@ -20,12 +20,12 @@ transform="@program_transform_name@"
 
 prefix=@prefix@
 exec_prefix=@exec_prefix@
-libdir=@libdir@
-grub_prefix=`echo /boot/grub | sed ${transform}`
-locale_dir=`echo /boot/grub/locale | sed ${transform}`
+pkglibrootdir=@pkglibrootdir@
+
+locale_dir=${GRUB_DIR}/locale
 grub_lang=`echo $LANG | cut -d _ -f 1`
 
-. ${libdir}/grub/grub-mkconfig_lib
+. ${pkglibrootdir}/grub-mkconfig_lib
 
 # Do this as early as possible, since other commands might depend on it.
 # (e.g. the `loadfont' command might need lvm or raid modules)
@@ -89,7 +89,7 @@ for x in ${GRUB_TERMINAL_INPUT} ${GRUB_T
 done
 
 if [ "x$serial" = x1 ]; then
-    if ! test -e ${grub_prefix}/serial.mod ; then
+    if ! test -e ${GRUB_DIR}/serial.mod ; then
 	echo "Serial terminal not available on this platform." >&2 ; exit 1
     fi
 

=== modified file 'util/grub.d/10_hurd.in'
--- util/grub.d/10_hurd.in	2010-05-18 18:10:37 +0000
+++ util/grub.d/10_hurd.in	2010-06-03 21:36:19 +0000
@@ -18,8 +18,9 @@
 
 prefix=@prefix@
 exec_prefix=@exec_prefix@
-libdir=@libdir@
-. ${libdir}/grub/grub-mkconfig_lib
+pkglibrootdir=@pkglibrootdir@
+
+. ${pkglibrootdir}/grub-mkconfig_lib
 
 CLASS="--class gnu --class os"
 

=== modified file 'util/grub.d/10_kfreebsd.in'
--- util/grub.d/10_kfreebsd.in	2010-04-14 12:59:58 +0000
+++ util/grub.d/10_kfreebsd.in	2010-06-03 21:36:19 +0000
@@ -19,8 +19,9 @@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 bindir=@bindir@
-libdir=@libdir@
-. ${libdir}/grub/grub-mkconfig_lib
+pkglibrootdir=@pkglibrootdir@
+
+. ${pkglibrootdir}/grub-mkconfig_lib
 
 export TEXTDOMAIN=@PACKAGE@
 export TEXTDOMAINDIR=@localedir@

=== modified file 'util/grub.d/10_linux.in'
--- util/grub.d/10_linux.in	2010-04-14 12:59:58 +0000
+++ util/grub.d/10_linux.in	2010-06-03 21:36:19 +0000
@@ -19,8 +19,9 @@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 bindir=@bindir@
-libdir=@libdir@
-. ${libdir}/grub/grub-mkconfig_lib
+pkglibrootdir=@pkglibrootdir@
+
+. ${pkglibrootdir}/grub-mkconfig_lib
 
 export TEXTDOMAIN=@PACKAGE@
 export TEXTDOMAINDIR=@localedir@

=== modified file 'util/grub.d/10_netbsd.in'
--- util/grub.d/10_netbsd.in	2010-04-19 19:25:41 +0000
+++ util/grub.d/10_netbsd.in	2010-06-03 21:36:19 +0000
@@ -19,8 +19,9 @@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 bindir=@bindir@
-libdir=@libdir@
-. ${libdir}/grub/grub-mkconfig_lib
+pkglibrootdir=@pkglibrootdir@
+
+. ${pkglibrootdir}/grub-mkconfig_lib
 
 export TEXTDOMAIN=@PACKAGE@
 export TEXTDOMAINDIR=@localedir@

=== modified file 'util/grub.d/10_windows.in'
--- util/grub.d/10_windows.in	2010-05-18 19:58:49 +0000
+++ util/grub.d/10_windows.in	2010-06-03 21:36:19 +0000
@@ -18,8 +18,9 @@
 
 prefix=@prefix@
 exec_prefix=@exec_prefix@
-libdir=@libdir@
-. ${libdir}/grub/grub-mkconfig_lib
+pkglibrootdir=@pkglibrootdir@
+
+. ${pkglibrootdir}/grub-mkconfig_lib
 
 case "`uname 2>/dev/null`" in
   CYGWIN*)  ;;

=== modified file 'util/grub.d/30_os-prober.in'
--- util/grub.d/30_os-prober.in	2010-02-03 00:24:07 +0000
+++ util/grub.d/30_os-prober.in	2010-06-03 21:36:19 +0000
@@ -18,9 +18,9 @@
 
 prefix=@prefix@
 exec_prefix=@exec_prefix@
-libdir=@libdir@
+pkglibrootdir=@pkglibrootdir@
 
-. ${libdir}/grub/grub-mkconfig_lib
+. ${pkglibrootdir}/grub-mkconfig_lib
 
 if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
   exit 0

=== modified file 'util/i386/efi/grub-install.in'
--- util/i386/efi/grub-install.in	2010-06-03 20:34:49 +0000
+++ util/i386/efi/grub-install.in	2010-06-03 21:36:19 +0000
@@ -29,9 +29,10 @@ PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
 target_cpu=@target_cpu@
 platform=@platform@
-host_os=@host_os@
-pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
+pkglibrootdir=@pkglibrootdir@
+pkglibdir=${pkglibrootdir}/${target_cpu}-${platform}
 localedir=@datadir@/locale
+defaultbootdir=@defaultbootdir@
 
 self=`basename $0`
 
@@ -40,7 +41,6 @@ grub_mkdevicemap=${sbindir}/`echo grub-m
 grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
 grub_editenv=${bindir}/`echo grub-editenv | sed ${transform}`
 rootdir=
-grub_prefix=`echo /boot/grub | sed ${transform}`
 modules=
 
 no_floppy=
@@ -66,7 +66,7 @@ Install GRUB on your EFI partition.
   --no-floppy             do not probe any floppy drive
   --recheck               probe a device map even if it already exists
 
-$self copies GRUB images into the DIR/boot directory specified by
+$self copies GRUB images into the DIR${defaultbootdir} directory specified by
 --root-directory.
 
 Report bugs to <bug-grub@gnu.org>.
@@ -113,20 +113,7 @@ if test $debug = yes; then
 fi
 
 # Initialize these directories here, since ROOTDIR was initialized.
-case "$host_os" in
-netbsd* | openbsd*)
-    # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub
-    # instead of /boot/grub.
-    grub_prefix=`echo /grub | sed ${transform}`
-    bootdir=${rootdir}
-    ;;
-*)
-    # Use /boot/grub by default.
-    bootdir=${rootdir}/boot
-    ;;
-esac
-
-grubdir=${bootdir}/`echo grub | sed ${transform}`
+grubdir=${rootdir}${defaultbootdir}
 device_map=${grubdir}/device.map
 
 # Check if GRUB is installed.

=== modified file 'util/ieee1275/grub-install.in'
--- util/ieee1275/grub-install.in	2010-06-03 20:34:49 +0000
+++ util/ieee1275/grub-install.in	2010-06-03 21:36:19 +0000
@@ -32,7 +32,9 @@ PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
 target_cpu=@target_cpu@
 platform=@platform@
-pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
+pkglibrootdir=@pkglibrootdir@
+pkglibdir=${pkglibrootdir}/${target_cpu}-${platform}
+defaultbootdir=@defaultbootdir@
 
 self=`basename $0`
 
@@ -41,7 +43,6 @@ grub_mkdevicemap=${sbindir}/`echo grub-m
 grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
 grub_editenv=${bindir}/`echo grub-editenv | sed ${transform}`
 rootdir=
-grub_prefix=`echo /boot/grub | sed ${transform}`
 modules=
 
 install_device=
@@ -68,7 +69,7 @@ Install GRUB on your drive.
   --grub-probe=FILE       use FILE as grub-probe
   --no-nvram              don't update the boot-device NVRAM variable
 
-$self copies GRUB images into the DIR/boot directory specified by
+$self copies GRUB images into the DIR${defaultbootdir} directory specified by
 --root-directory, and uses nvsetenv to set the Open Firmware boot-device
 variable.
 
@@ -121,8 +122,7 @@ if test $debug = yes; then
 fi
 
 # Initialize these directories here, since ROOTDIR was initialized.
-bootdir=${rootdir}/boot
-grubdir=${bootdir}/`echo grub | sed ${transform}`
+grubdir=${rootdir}${defaultbootdir}
 device_map=${grubdir}/device.map
 
 set $grub_mkimage dummy
@@ -136,7 +136,7 @@ fi
 # Find the partition at the right mount point.
 install_device=`$grub_mkdevicemap --device-map=/dev/stdout | $grub_probe --target=device --device-map=/dev/stdin ${grubdir}`
 
-if test "x$install_device" = "x`$grub_mkdevicemap --device-map=/dev/stdout | $grub_probe --target=device --device-map=/dev/stdin ${bootdir}`"; then
+if test "x$install_device" = "x`$grub_mkdevicemap --device-map=/dev/stdout | $grub_probe --target=device --device-map=/dev/stdin ${grubdir}/..`"; then
     echo "$grubdir must be a mount point."
     exit 1
 fi

=== modified file 'util/powerpc/ieee1275/grub-mkrescue.in'
--- util/powerpc/ieee1275/grub-mkrescue.in	2010-06-03 20:34:49 +0000
+++ util/powerpc/ieee1275/grub-mkrescue.in	2010-06-03 21:36:19 +0000
@@ -28,7 +28,8 @@ PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
 target_cpu=@target_cpu@
 platform=@platform@
-pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
+pkglibrootdir=@pkglibrootdir@
+pkglibdir=${pkglibrootdir}/${target_cpu}-${platform}
 
 self=`basename $0`
 

=== modified file 'util/update-grub_lib.in'
--- util/update-grub_lib.in	2008-11-20 19:22:20 +0000
+++ util/update-grub_lib.in	2010-06-03 21:36:19 +0000
@@ -16,8 +16,8 @@
 
 prefix=@prefix@
 exec_prefix=@exec_prefix@
-libdir=@libdir@
+pkglibrootdir=@pkglibrootdir@
 
-. ${libdir}/grub/grub-mkconfig_lib
+. ${pkglibrootdir}/grub-mkconfig_lib
 
 grub_warn "update-grub_lib is deprecated, use grub-mkconfig_lib instead"


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: file-name-transformations_3.diff --]
[-- Type: text/x-patch; name="file-name-transformations_3.diff", Size: 4716 bytes --]

=== modified file 'ChangeLog'
--- ChangeLog	2010-06-03 21:36:19 +0000
+++ ChangeLog	2010-06-03 22:02:54 +0000
@@ -1,5 +1,14 @@
 2010-06-03  Grégoire Sutre  <gregoire.sutre@gmail.com>
 
+	* util/grub-install.in: Use -x instead of -f when checking for grub
+	programs, and factorize these checks by a for loop.
+	* util/grub-mkconfig.in: Likewise.
+	* util/grub-mkrescue.in: Likewise.
+	* util/i386/efi/grub-install.in: Likewise.
+	* util/ieee1275/grub-install.in: Likewise.
+
+2010-06-03  Grégoire Sutre  <gregoire.sutre@gmail.com>
+
 	* configure.ac: Set and subsitute pkgdatadir, pkglibrootdir and
 	defaultbootdir.
 	* Makefile.in: Use the above autoconfigured variables.

=== modified file 'util/grub-install.in'
--- util/grub-install.in	2010-06-03 21:36:19 +0000
+++ util/grub-install.in	2010-06-03 22:02:54 +0000
@@ -177,7 +177,7 @@ grub_probe="${grub_probe} --device-map=$
 # Check if GRUB is installed.
 if [ "${target_cpu}-${platform}" = "i386-pc" ] || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ] ; then
     set $grub_setup dummy
-    if test -f "$1"; then
+    if test -x "$1"; then
         :
     else
         echo "$1: Not found." 1>&2
@@ -185,21 +185,15 @@ if [ "${target_cpu}-${platform}" = "i386
     fi
 fi
 
-set $grub_mkimage dummy
-if test -f "$1"; then
-    :
-else
-    echo "$1: Not found." 1>&2
-    exit 1
-fi
-
-set $grub_mkdevicemap dummy
-if test -f "$1"; then
-    :
-else
-    echo "$1: Not found." 1>&2
-    exit 1
-fi
+for prog in mkimage mkdevicemap probe; do
+    eval set \$grub_$prog dummy
+    if test -x "$1"; then
+        :
+    else
+        echo "$1: Not found." 1>&2
+        exit 1
+    fi
+done
 
 # Create the GRUB directory if it is not present.
 mkdir -p "$grubdir" || exit 1

=== modified file 'util/grub-mkconfig.in'
--- util/grub-mkconfig.in	2010-06-03 21:36:19 +0000
+++ util/grub-mkconfig.in	2010-06-03 22:02:54 +0000
@@ -87,21 +87,16 @@ if $next_grub_cfg; then
     exit 1
 fi
 
-set $grub_mkdevicemap dummy
-if test -f "$1"; then
-    :
-else
-    echo "$1: Not found." 1>&2
-    exit 1
-fi
-
-set $grub_probe dummy
-if test -f "$1"; then
-    :
-else
-    echo "$1: Not found." 1>&2
-    exit 1
-fi
+# Check if GRUB is installed.
+for prog in mkdevicemap probe; do
+    eval set \$grub_$prog dummy
+    if test -x "$1"; then
+        :
+    else
+        echo "$1: Not found." 1>&2
+        exit 1
+    fi
+done
 
 GRUB_DIR=${defaultbootdir}
 

=== modified file 'util/grub-mkrescue.in'
--- util/grub-mkrescue.in	2010-06-03 21:36:19 +0000
+++ util/grub-mkrescue.in	2010-06-03 22:02:54 +0000
@@ -103,7 +103,7 @@ if [ "x${output_image}" = x ] ; then
 fi
 
 set $grub_mkimage dummy
-if test -f "$1"; then
+if test -x "$1"; then
     :
 else
     echo "$1: Not found." 1>&2

=== modified file 'util/i386/efi/grub-install.in'
--- util/i386/efi/grub-install.in	2010-06-03 21:36:19 +0000
+++ util/i386/efi/grub-install.in	2010-06-03 22:02:54 +0000
@@ -117,21 +117,15 @@ grubdir=${rootdir}${defaultbootdir}
 device_map=${grubdir}/device.map
 
 # Check if GRUB is installed.
-set $grub_mkimage dummy
-if test -f "$1"; then
-    :
-else
-    echo "$1: Not found." 1>&2
-    exit 1
-fi
-
-set $grub_mkdevicemap dummy
-if test -f "$1"; then
-    :
-else
-    echo "$1: Not found." 1>&2
-    exit 1
-fi
+for prog in mkimage mkdevicemap probe; do
+    eval set \$grub_$prog dummy
+    if test -x "$1"; then
+        :
+    else
+        echo "$1: Not found." 1>&2
+        exit 1
+    fi
+done
 
 # Create the GRUB directory if it is not present.
 mkdir -p "$grubdir" || exit 1

=== modified file 'util/ieee1275/grub-install.in'
--- util/ieee1275/grub-install.in	2010-06-03 21:36:19 +0000
+++ util/ieee1275/grub-install.in	2010-06-03 22:02:54 +0000
@@ -125,13 +125,16 @@ fi
 grubdir=${rootdir}${defaultbootdir}
 device_map=${grubdir}/device.map
 
-set $grub_mkimage dummy
-if test -f "$1"; then
-    :
-else
-    echo "$1: Not found." 1>&2
-    exit 1
-fi
+# Check if GRUB is installed.
+for prog in mkimage mkdevicemap probe; do
+    eval set \$grub_$prog dummy
+    if test -x "$1"; then
+        :
+    else
+        echo "$1: Not found." 1>&2
+        exit 1
+    fi
+done
 
 # Find the partition at the right mount point.
 install_device=`$grub_mkdevicemap --device-map=/dev/stdout | $grub_probe --target=device --device-map=/dev/stdin ${grubdir}`
@@ -195,7 +198,7 @@ modules="$modules $fs_module $partmap_mo
 
 if test $update_nvram = yes; then
     set $ofpathname dummy
-    if test -f "$1"; then
+    if test -x "$1"; then
 	:
     else
 	echo "$1: Not found." 1>&2
@@ -203,7 +206,7 @@ if test $update_nvram = yes; then
     fi
 
     set $nvsetenv dummy
-    if test -f "$1"; then
+    if test -x "$1"; then
 	:
     else
 	echo "$1: Not found." 1>&2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: file-name-transformations_4.diff --]
[-- Type: text/x-patch; name="file-name-transformations_4.diff", Size: 1168 bytes --]

=== modified file 'ChangeLog'
--- ChangeLog	2010-06-03 22:02:54 +0000
+++ ChangeLog	2010-06-03 22:06:21 +0000
@@ -1,5 +1,9 @@
 2010-06-03  Grégoire Sutre  <gregoire.sutre@gmail.com>
 
+	* configure.ac: Add `.' to the directories searched for unifont.
+
+2010-06-03  Grégoire Sutre  <gregoire.sutre@gmail.com>
+
 	* util/grub-install.in: Use -x instead of -f when checking for grub
 	programs, and factorize these checks by a for loop.
 	* util/grub-mkconfig.in: Likewise.

=== modified file 'configure.ac'
--- configure.ac	2010-06-03 21:36:19 +0000
+++ configure.ac	2010-06-03 22:06:21 +0000
@@ -179,11 +179,13 @@ if test "x$YACC" = x; then
   AC_MSG_ERROR([bison is not found])
 fi
 
-for file in /usr/src/unifont.bdf /usr/share/fonts/X11/misc/unifont.pcf.gz /usr/share/fonts/unifont/unifont.pcf.gz; do
-  if test -e $file ; then
-    AC_SUBST([FONT_SOURCE], [$file])
-    break
-  fi
+for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
+  for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont; do
+    if test -f "$dir/unifont.$ext"; then
+      AC_SUBST([FONT_SOURCE], [$dir/unifont.$ext])
+      break 2
+    fi
+  done
 done
 
 AC_PROG_INSTALL


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: file-name-transformations_5.diff --]
[-- Type: text/x-patch; name="file-name-transformations_5.diff", Size: 3688 bytes --]

=== modified file 'ChangeLog'
--- ChangeLog	2010-06-03 22:06:21 +0000
+++ ChangeLog	2010-06-03 22:15:52 +0000
@@ -1,5 +1,12 @@
 2010-06-03  Grégoire Sutre  <gregoire.sutre@gmail.com>
 
+	* Makefile.in (install-local): Use installed files on help2man command
+	line to account for file name transformations.  Apply transformations
+	to generated info file.
+	(uninstall): Apply transformations to generated info file.
+
+2010-06-03  Grégoire Sutre  <gregoire.sutre@gmail.com>
+
 	* configure.ac: Add `.' to the directories searched for unifont.
 
 2010-06-03  Grégoire Sutre  <gregoire.sutre@gmail.com>

=== modified file 'Makefile.in'
--- Makefile.in	2010-06-03 21:36:19 +0000
+++ Makefile.in	2010-06-03 22:15:52 +0000
@@ -324,26 +324,26 @@ install-local: all
 	  if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
 	  dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
 	  $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \
-	  $(HELP2MAN) --section=1 -o $(DESTDIR)$(mandir)/man1/$$dest.1 $(builddir)/$$file; \
+	  $(HELP2MAN) --section=1 -o $(DESTDIR)$(mandir)/man1/$$dest.1 $(DESTDIR)$(bindir)/$$dest; \
 	done
 	$(SHELL) $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8
 	@list='$(sbin_UTILITIES)'; for file in $$list; do \
 	  if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
 	  dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
 	  $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \
-	  $(HELP2MAN) --section=8 -o $(DESTDIR)$(mandir)/man8/$$dest.8 $(builddir)/$$file; \
+	  $(HELP2MAN) --section=8 -o $(DESTDIR)$(mandir)/man8/$$dest.8 $(DESTDIR)$(sbindir)/$$dest; \
 	done
 	@list='$(bin_SCRIPTS)'; for file in $$list; do \
 	  if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
 	  dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
 	  $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \
-	  $(HELP2MAN) --section=1 -o $(DESTDIR)$(mandir)/man1/$$dest.1 $(builddir)/$$file; \
+	  $(HELP2MAN) --section=1 -o $(DESTDIR)$(mandir)/man1/$$dest.1 $(DESTDIR)$(bindir)/$$dest; \
 	done
 	@list='$(sbin_SCRIPTS)'; for file in $$list; do \
 	  if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
 	  dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
 	  $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \
-	  $(HELP2MAN) --section=8 -o $(DESTDIR)$(mandir)/man8/$$dest.8 $(builddir)/$$file; \
+	  $(HELP2MAN) --section=8 -o $(DESTDIR)$(mandir)/man8/$$dest.8 $(DESTDIR)$(sbindir)/$$dest; \
 	done
 	$(SHELL) $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/grub.d
 	@list='$(grub-mkconfig_SCRIPTS)'; for file in $$list; do \
@@ -374,8 +374,8 @@ install-local: all
 	@list='$(info_INFOS)'; \
 	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)$(infodir); \
+	  dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
+	  $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(infodir)/$$dest; \
 	  if (install-info --version && \
 	       install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
 	    install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$dest" || :; \
@@ -417,7 +417,7 @@ uninstall:
 	done
 	@list='$(info_INFOS)'; \
 	for file in $$list; do \
-	  dest="`echo $$file | sed 's,.*/,,'`"; \
+	  dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
 	  if (install-info --version && \
 	       install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
 	    if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$dest"; then \


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #7: file-name-transformations_6.diff --]
[-- Type: text/x-patch; name="file-name-transformations_6.diff", Size: 3588 bytes --]

=== modified file 'ChangeLog'
--- ChangeLog	2010-06-03 22:15:52 +0000
+++ ChangeLog	2010-06-03 22:23:22 +0000
@@ -1,5 +1,12 @@
 2010-06-03  Grégoire Sutre  <gregoire.sutre@gmail.com>
 
+	* Makefile.in (install-local): Apply file name transformations to
+	generated locale (*.mo) files.
+	* util/grub-install.in: Likewise.
+	* util/i386/efi/grub-install.in: Likewise.
+
+2010-06-03  Grégoire Sutre  <gregoire.sutre@gmail.com>
+
 	* Makefile.in (install-local): Use installed files on help2man command
 	line to account for file name transformations.  Apply transformations
 	to generated info file.

=== modified file 'Makefile.in'
--- Makefile.in	2010-06-03 22:15:52 +0000
+++ Makefile.in	2010-06-03 22:23:22 +0000
@@ -365,10 +365,11 @@ install-local: all
 	done
 	@langs='$(LINGUAS)'; \
 	for lang in $$langs; do \
-	  $(SHELL) $(mkinstalldirs) $(DESTDIR)/$(datadir)/locale/$$lang/LC_MESSAGES; \
+	  $(SHELL) $(mkinstalldirs) $(DESTDIR)$(datadir)/locale/$$lang/LC_MESSAGES; \
 	  file="po/$$lang.mo"; \
 	  if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
-	  $(INSTALL_DATA) $$dir$$file $(DESTDIR)/$(datadir)/locale/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
+	  dest="`echo $(PACKAGE).mo | sed 's,.*/,,' | sed '$(transform)'`"; \
+	  $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(datadir)/locale/$$lang/LC_MESSAGES/$$dest; \
 	done
 	$(SHELL) $(mkinstalldirs) $(DESTDIR)$(infodir)
 	@list='$(info_INFOS)'; \

=== modified file 'util/grub-install.in'
--- util/grub-install.in	2010-06-03 22:02:54 +0000
+++ util/grub-install.in	2010-06-03 22:23:22 +0000
@@ -24,6 +24,7 @@ exec_prefix=@exec_prefix@
 sbindir=@sbindir@
 bindir=@bindir@
 libdir=@libdir@
+PACKAGE=@PACKAGE@
 PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
@@ -42,6 +43,7 @@ grub_mkimage=${bindir}/`echo grub-mkimag
 grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
 grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
 grub_editenv=${bindir}/`echo grub-editenv | sed ${transform}`
+grub_mofile=`echo ${PACKAGE}.mo | sed ${transform}`
 rootdir=
 modules=
 
@@ -241,8 +243,8 @@ fi
 # Copy gettext files
 mkdir -p ${grubdir}/locale/
 for dir in ${localedir}/*; do
-    if test -f "$dir/LC_MESSAGES/grub.mo"; then
-        cp -f "$dir/LC_MESSAGES/grub.mo" "${grubdir}/locale/${dir##*/}.mo"
+    if test -f "$dir/LC_MESSAGES/${grub_mofile}"; then
+        cp -f "$dir/LC_MESSAGES/${grub_mofile}" "${grubdir}/locale/${dir##*/}.mo"
     fi
 done
 

=== modified file 'util/i386/efi/grub-install.in'
--- util/i386/efi/grub-install.in	2010-06-03 22:02:54 +0000
+++ util/i386/efi/grub-install.in	2010-06-03 22:23:22 +0000
@@ -24,6 +24,7 @@ exec_prefix=@exec_prefix@
 sbindir=@sbindir@
 bindir=@bindir@
 libdir=@libdir@
+PACKAGE=@PACKAGE@
 PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
@@ -40,6 +41,7 @@ grub_mkimage=${bindir}/`echo grub-mkimag
 grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
 grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
 grub_editenv=${bindir}/`echo grub-editenv | sed ${transform}`
+grub_mofile=`echo ${PACKAGE}.mo | sed ${transform}`
 rootdir=
 modules=
 
@@ -166,8 +168,8 @@ done
 # Copy gettext files
 mkdir -p ${grubdir}/locale/
 for dir in ${localedir}/*; do
-    if test -f "$dir/LC_MESSAGES/grub.mo"; then
-        cp -f "$dir/LC_MESSAGES/grub.mo" "${grubdir}/locale/${dir##*/}.mo"
+    if test -f "$dir/LC_MESSAGES/${grub_mofile}"; then
+        cp -f "$dir/LC_MESSAGES/${grub_mofile}" "${grubdir}/locale/${dir##*/}.mo"
     fi
 done
 


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #8: file-name-transformations_7.diff --]
[-- Type: text/x-patch; name="file-name-transformations_7.diff", Size: 3645 bytes --]

=== modified file 'ChangeLog'
--- ChangeLog	2010-06-03 22:23:22 +0000
+++ ChangeLog	2010-06-03 22:35:21 +0000
@@ -1,5 +1,13 @@
 2010-06-03  Grégoire Sutre  <gregoire.sutre@gmail.com>
 
+	* util/grub-install.in: Remove the dependency on grub-mkconfig_lib.
+	* util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Fix typo
+	in partmap module loading.
+	* util/grub.d/00_header.in: Check for non-empty LANG in locale support.
+	* util/grub.d/10_netbsd.in: Added a comment.
+
+2010-06-03  Grégoire Sutre  <gregoire.sutre@gmail.com>
+
 	* Makefile.in (install-local): Apply file name transformations to
 	generated locale (*.mo) files.
 	* util/grub-install.in: Likewise.

=== modified file 'util/grub-install.in'
--- util/grub-install.in	2010-06-03 22:23:22 +0000
+++ util/grub-install.in	2010-06-03 22:35:21 +0000
@@ -41,6 +41,7 @@ self=`basename $0`
 grub_setup=${sbindir}/`echo grub-setup | sed ${transform}`
 grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
 grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
+grub_mkrelpath=${bindir}/`echo grub-mkrelpath | sed ${transform}`
 grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
 grub_editenv=${bindir}/`echo grub-editenv | sed ${transform}`
 grub_mofile=`echo ${PACKAGE}.mo | sed ${transform}`
@@ -154,9 +155,6 @@ for option in "$@"; do
     esac
 done
 
-# for make_system_path_relative_to_its_root()
-. ${pkglibrootdir}/grub-mkconfig_lib
-
 if test "x$install_device" = x && test "${target_cpu}-${platform}" != "mips-yeeloong"; then
     echo "install_device not specified." 1>&2
     usage
@@ -187,7 +185,7 @@ if [ "${target_cpu}-${platform}" = "i386
     fi
 fi
 
-for prog in mkimage mkdevicemap probe; do
+for prog in mkimage mkdevicemap mkrelpath probe; do
     eval set \$grub_$prog dummy
     if test -x "$1"; then
         :
@@ -278,7 +276,7 @@ devabstraction_module=`$grub_probe --tar
 modules="$modules $disk_module"
 modules="$modules $fs_module $partmap_module $devabstraction_module"
 
-relative_grubdir=`make_system_path_relative_to_its_root ${grubdir}` || exit 1
+relative_grubdir=`$grub_mkrelpath ${grubdir}` || exit 1
 if [ "x${relative_grubdir}" = "x" ] ; then
     relative_grubdir=/
 fi

=== modified file 'util/grub-mkconfig_lib.in'
--- util/grub-mkconfig_lib.in	2010-06-03 21:36:19 +0000
+++ util/grub-mkconfig_lib.in	2010-06-03 22:35:21 +0000
@@ -114,7 +114,7 @@ prepare_grub_to_access_device ()
 
   partmap="`${grub_probe} --device ${device} --target=partmap`"
   for module in ${partmap} ; do
-    echo "insmod ${module}"
+    echo "insmod part_${module}"
   done
 
   fs="`${grub_probe} --device ${device} --target=fs`"

=== modified file 'util/grub.d/00_header.in'
--- util/grub.d/00_header.in	2010-06-03 21:36:19 +0000
+++ util/grub.d/00_header.in	2010-06-03 22:35:21 +0000
@@ -195,7 +195,7 @@ EOF
 esac
 
 # Gettext variables and module
-if [ "x${LANG}" != "xC" ] && [ -d "${locale_dir}" ] ; then
+if [ "x${LANG}" != "x" ] && [ "x${LANG}" != "xC" ] && [ -d "${locale_dir}" ] ; then
     prepare_grub_to_access_device $(${grub_probe} --target=device ${locale_dir})
   cat << EOF
 set locale_dir=(\$root)$(make_system_path_relative_to_its_root ${locale_dir})

=== modified file 'util/grub.d/10_netbsd.in'
--- util/grub.d/10_netbsd.in	2010-06-03 21:36:19 +0000
+++ util/grub.d/10_netbsd.in	2010-06-03 22:35:21 +0000
@@ -62,6 +62,7 @@ netbsd_entry ()
   printf "}\n"
 }
 
+# Cache the sequence of commands to access / (whose device is ${GRUB_DEVICE}).
 prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e 's,^,	,')"
 
 # We look for NetBSD kernels in / but not in subdirectories.  We simply


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] File name transformations (split into 7 diffs)
  2010-06-03 23:42 [PATCH] File name transformations (split into 7 diffs) Grégoire Sutre
@ 2010-06-07 21:16 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2010-06-07 22:56   ` Grégoire Sutre
  2010-07-21  5:11 ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 1 reply; 4+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-06-07 21:16 UTC (permalink / raw)
  To: The development of GNU GRUB


[-- Attachment #1.1: Type: text/plain, Size: 2310 bytes --]

Regarding file-name-transformations_1.diff:
phcoder@debian.bg45.phnet:~$ /usr/local/bin/grub-mkfont --help
Usage: /usr/local/bin/grub-mkfont [OPTIONS] FONT_FILES

So I would prefer not to use basename for uniformity. Otherwise patch 1
is ok.

On 06/04/2010 01:42 AM, Grégoire Sutre wrote:
> Hi,
>
> This is the same patch as I sent before, but this time split into 7
> diffs (which must be successively applied in order) and with a cleaner
> changelog.  I hope that this will facilitate the review.
>
> This version does not include the --root-directory addition to
> grub-mkconfig, as this is quite orthognal to the goal of the patch (file
> name transformation).
>
> I welcome your comments,
>
> Grégoire
>
> --- mostly taken from my previous message ------------------------------
>
> The attached patch fixes problems with file name transformations, which
> are partly broken in trunk.  With this patch, several installations of
> grub can coexist with no conflict (at least they should), sharing
> however the same configuration directory (etc/grub.d).
>
> For instance:
>
> ./configure --program-transform-name=s,grub,aaa,
>
> will install bin/aaa-*, sbin/aaa-*, etc. The default grub directory will
> be /boot/aaa, modules will be installed there and grub-mkconfig will
> look for them there.
>
> The main changes in the patch are:
>
> - configure defines three new variables, accounting for transformations:
>   . pkgdatadir       (${datadir}/grub)
>   . pkglibrootdir    (${libdir}/grub)
>   . defaultbootdir   (/boot/grub, or /grub if OS is NetBSD or OpenBSD)
>
> - these variables are used in Makefile and in util/... scripts
>
> - output of --help and of --version in scripts uses `basename $0` and
>   the same format as the one in binaries.
>
> - in Makefile, the help2man, .info, and .mo rules also account for
>   file name transformations.
>
> - grub-mkconfig exports GRUB_DIR, which is used by grub-mkconfig_lib
>   and by 00_header.
>
> -----------------------------------------------------------------------
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>   


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


[-- Attachment #1.2: Type: text/html, Size: 3293 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] File name transformations (split into 7 diffs)
  2010-06-07 21:16 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-06-07 22:56   ` Grégoire Sutre
  0 siblings, 0 replies; 4+ messages in thread
From: Grégoire Sutre @ 2010-06-07 22:56 UTC (permalink / raw)
  To: The development of GNU GRUB

On 06/07/2010 11:16 PM, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> Regarding file-name-transformations_1.diff:
> phcoder@debian.bg45.phnet:~$ /usr/local/bin/grub-mkfont --help
> Usage: /usr/local/bin/grub-mkfont [OPTIONS] FONT_FILES
>
> So I would prefer not to use basename for uniformity. Otherwise patch 1
> is ok.

For the record:

As discussed on irc, we will keep the basename since otherwise we would
get, for scripts:

$ grub-reboot -h
Usage: /usr/local/sbin/grub-reboot [OPTION] entry

whereas:

$ grub-probe -h
Usage: grub-probe [OPTION]... [PATH|DEVICE]

Grégoire


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] File name transformations (split into 7 diffs)
  2010-06-03 23:42 [PATCH] File name transformations (split into 7 diffs) Grégoire Sutre
  2010-06-07 21:16 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-07-21  5:11 ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 0 replies; 4+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-07-21  5:11 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 2175 bytes --]

On 06/04/2010 01:42 AM, Grégoire Sutre wrote:
> +pkglibrootdir=${libdir}/`echo ${PACKAGE_TARNAME} | sed "${program_transform_name}"`
> +
> +case "$host_os" in
> +netbsd* | openbsd*)
> +    # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub
> +    # instead of /boot/grub.
> +    defaultbootdir=
> +    ;;
> +*)
> +    # Use /boot/grub by default.
> +    defaultbootdir=/boot
> +    ;;
> +esac
>   
/boot isn't transformed

+    # XXX hard-coded /boot (use ${grubdir} or ${defaultbootdir} ?)
     $grub_mkimage ${config_opt} -f ${font} -d ${pkglibdir} -O ${mkimage_target} --output=/boot/grub.elf --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1

Should have been ${grubdir}/grub.elf

+    # XXX hard-coded /boot (use ${grubdir} or ${defaultbootdir} ?)
     $grub_mkimage -O ${mkimage_target} ${config_opt} -d ${pkglibdir} --output=/boot/multiboot.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1

Same.

+# GRUB_DIR should be set before sourcing this file, but let's be safe.
+if test "x${GRUB_DIR}" != "x"; then
+  if test -e "${GRUB_DIR}/device.map"; then
+    grub_probe="${grub_probe} --device-map=${GRUB_DIR}/device.map"
+  fi
+fi
This would be a separate patch and the problem is that scripts assume that currently loaded kernel is the kernel which will be loaded or similar (look e.g. at uuid check). This would be a separate patch.
+


file-name-transformations_3.diff
go ahead for trunk

file-name-transformations_4.diff

go ahead for trunk

file-name-transformations_5.diff

Transforming names in manual may be cumbersome and conflicts with Colin's patch.




file-name-transformations_6.diff:

-	  $(INSTALL_DATA) $$dir$$file $(DESTDIR)/$(datadir)/locale/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
+	  dest="`echo $(PACKAGE).mo | sed 's,.*/,,' | sed '$(transform)'`"; \
+	  $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(datadir)/locale/$$lang/LC_MESSAGES/$$dest; \
Why don't you transform locale and LC_MESSAGES?



file-name-transformations_7.dif

Go ahead for trunk















-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-07-21 21:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-03 23:42 [PATCH] File name transformations (split into 7 diffs) Grégoire Sutre
2010-06-07 21:16 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-06-07 22:56   ` Grégoire Sutre
2010-07-21  5:11 ` Vladimir 'φ-coder/phcoder' Serbinenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.