Add the ability to transform Grub program names. For example, a user can easily launch

./configure --program-transform-name="s/grub/grub2/"

And the installed files (in this case for i386-pc) will be:

/usr/lib/grub2/i386-pc/*
/usr/local/sbin/grub2-emu
/usr/local/sbin/grub2-install
...etc

Also grub2-install place boot files in "/boot/grub2"

This allows easy integration into distributions as it allows grub2 to
sit side by side with a grub legacy install without.
This commit is contained in:
jerone 2007-04-10 21:38:26 +00:00
parent 6795c4e10b
commit 1d543c3ec0
5 changed files with 36 additions and 19 deletions

View file

@ -1,3 +1,11 @@
2007-04-10 Jerone Young <jerone@gmail.com>
* configure.ac: Add argument for autoconf to use tranformation
ability.
* Makefile.in: Add autoconf package transformation code.
* util/i386/pc/grub-install.in: Likewise.
* util/powerpc/ieee1275/grub-install.in: Likewise.
2007-03-19 Yoshinori K. Okuji <okuji@enbug.org> 2007-03-19 Yoshinori K. Okuji <okuji@enbug.org>
* fs/ext2.c (EXT2_GOOD_OLD_REVISION): New macro. * fs/ext2.c (EXT2_GOOD_OLD_REVISION): New macro.

View file

@ -17,6 +17,8 @@ SHELL = /bin/sh
@SET_MAKE@ @SET_MAKE@
transform = @program_transform_name@
srcdir = @srcdir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
@ -34,8 +36,8 @@ libdir = @libdir@
infodir = @infodir@ infodir = @infodir@
mandir = @mandir@ mandir = @mandir@
includedir = @includedir@ includedir = @includedir@
pkgdatadir = $(datadir)/@PACKAGE_TARNAME@ pkgdatadir = $(datadir)/`echo @PACKAGE_TARNAME@ | sed '$(transform)'`
pkglibdir = $(libdir)/@PACKAGE_TARNAME@/$(target_cpu)-$(platform) pkglibdir = $(libdir)/`echo @PACKAGE_TARNAME@/$(target_cpu)-$(platform) | sed '$(transform)'`
PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
@ -137,18 +139,18 @@ install-local: all
$(mkinstalldirs) $(DESTDIR)$(bindir) $(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_UTILITIES)'; for file in $$list; do \ @list='$(bin_UTILITIES)'; for file in $$list; do \
if test -f "$$file"; then dir=; else dir="$(srcdir)"; fi; \ if test -f "$$file"; then dir=; else dir="$(srcdir)"; fi; \
dest="`echo $$file | sed 's,.*/,,'`"; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
$(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \ $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \
done done
$(mkinstalldirs) $(DESTDIR)$(sbindir) $(mkinstalldirs) $(DESTDIR)$(sbindir)
@list='$(sbin_UTILITIES)'; for file in $$list; do \ @list='$(sbin_UTILITIES)'; for file in $$list; do \
if test -f "$$file"; then dir=; else dir="$(srcdir)"; fi; \ if test -f "$$file"; then dir=; else dir="$(srcdir)"; fi; \
dest="`echo $$file | sed 's,.*/,,'`"; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
$(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \ $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \
done done
@list='$(sbin_SCRIPTS)'; for file in $$list; do \ @list='$(sbin_SCRIPTS)'; for file in $$list; do \
if test -f "$$file"; then dir=; else dir="$(srcdir)"; fi; \ if test -f "$$file"; then dir=; else dir="$(srcdir)"; fi; \
dest="`echo $$file | sed 's,.*/,,'`"; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
$(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \ $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \
done done
@ -162,11 +164,11 @@ uninstall:
rm -f $(DESTDIR)$(pkglibdir)/$$dest; \ rm -f $(DESTDIR)$(pkglibdir)/$$dest; \
done done
@list='$(bin_UTILITIES)'; for file in $$list; do \ @list='$(bin_UTILITIES)'; for file in $$list; do \
dest="`echo $$file | sed 's,.*/,,'`"; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
rm -f $(DESTDIR)$(bindir)/$$dest; \ rm -f $(DESTDIR)$(bindir)/$$dest; \
done done
@list='$(sbin_UTILITIES) $(sbin_SCRIPTS)'; for file in $$list; do \ @list='$(sbin_UTILITIES) $(sbin_SCRIPTS)'; for file in $$list; do \
dest="`echo $$file | sed 's,.*/,,'`"; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
rm -f $(DESTDIR)$(sbindir)/$$dest; \ rm -f $(DESTDIR)$(sbindir)/$$dest; \
done done

View file

@ -40,6 +40,9 @@ AC_CONFIG_HEADER([config.h])
AC_CANONICAL_HOST AC_CANONICAL_HOST
AC_CANONICAL_TARGET AC_CANONICAL_TARGET
# Program name transformations
AC_ARG_PROGRAM
case "$host_cpu" in case "$host_cpu" in
powerpc64) host_m32=1 ;; powerpc64) host_m32=1 ;;
esac esac

View file

@ -18,6 +18,8 @@
# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA. # Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
# Initialize some variables. # Initialize some variables.
transform="@program_transform_name@"
prefix=@prefix@ prefix=@prefix@
exec_prefix=@exec_prefix@ exec_prefix=@exec_prefix@
sbindir=@sbindir@ sbindir=@sbindir@
@ -28,14 +30,14 @@ PACKAGE_TARNAME=@PACKAGE_TARNAME@
PACKAGE_VERSION=@PACKAGE_VERSION@ PACKAGE_VERSION=@PACKAGE_VERSION@
target_cpu=@target_cpu@ target_cpu=@target_cpu@
platform=@platform@ platform=@platform@
pkglibdir=${libdir}/${PACKAGE_TARNAME}/${target_cpu}-${platform} pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
grub_setup=${sbindir}/grub-setup grub_setup=${sbindir}/`echo grub-setup | sed ${transform}`
grub_mkimage=${bindir}/grub-mkimage grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
grub_mkdevicemap=${sbindir}/grub-mkdevicemap grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
grub_probe=${sbindir}/grub-probe grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
rootdir= rootdir=
grub_prefix=/boot/grub grub_prefix=`echo /boot/grub | sed ${transform}`
modules= modules=
install_device= install_device=
@ -132,7 +134,7 @@ case "$host_os" in
netbsd* | openbsd*) netbsd* | openbsd*)
# Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub
# instead of /boot/grub. # instead of /boot/grub.
grub_prefix=/grub grub_prefix=`echo /grub | sed ${transform}`
bootdir=${rootdir} bootdir=${rootdir}
;; ;;
*) *)
@ -141,7 +143,7 @@ netbsd* | openbsd*)
;; ;;
esac esac
grubdir=${bootdir}/grub grubdir=${bootdir}/`echo grub | sed ${transform}`
device_map=${grubdir}/device.map device_map=${grubdir}/device.map
# Check if GRUB is installed. # Check if GRUB is installed.

View file

@ -21,6 +21,8 @@
# http://ppc64-utils.ozlabs.org . # http://ppc64-utils.ozlabs.org .
# Initialize some variables. # Initialize some variables.
transform="@program_transform_name@"
prefix=@prefix@ prefix=@prefix@
exec_prefix=@exec_prefix@ exec_prefix=@exec_prefix@
sbindir=@sbindir@ sbindir=@sbindir@
@ -30,11 +32,11 @@ PACKAGE_TARNAME=@PACKAGE_TARNAME@
PACKAGE_VERSION=@PACKAGE_VERSION@ PACKAGE_VERSION=@PACKAGE_VERSION@
target_cpu=@target_cpu@ target_cpu=@target_cpu@
platform=@platform@ platform=@platform@
pkglibdir=${libdir}/${PACKAGE_TARNAME}/${target_cpu}-${platform} pkglibdir= ${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
grub_mkimage=${bindir}/grub-mkimage grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
rootdir= rootdir=
grub_prefix=/boot/grub grub_prefix=`echo /boot/grub | sed ${transform}`
modules= modules=
install_device= install_device=
@ -109,7 +111,7 @@ fi
# Initialize these directories here, since ROOTDIR was initialized. # Initialize these directories here, since ROOTDIR was initialized.
bootdir=${rootdir}/boot bootdir=${rootdir}/boot
grubdir=${bootdir}/grub grubdir=${bootdir}/`echo grub | sed ${transform}`
set $grub_mkimage dummy set $grub_mkimage dummy
if test -f "$1"; then if test -f "$1"; then