All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] More enhanced GNU GRUB program name transformations
@ 2007-02-11 22:58 Jerone Young
  0 siblings, 0 replies; only message in thread
From: Jerone Young @ 2007-02-11 22:58 UTC (permalink / raw)
  To: grub-devel; +Cc: lkudrak, okuji

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

This patch is derived from the patch sent earlier by Lubomir Kundrak.
What this patch adds is for library directories and directories in
/boot to be changed as well. So the 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 issue. Giving
distributions a migration path.

Attached I have changes for i386-pc & powerpc . More then happy to do
the foot work for others to get this integrated.

All patches are attached.

Signed-off-by: Jerone Young <jerone@gmail.com>

[-- Attachment #2: grub2-program-name-tranform-autoconfig.patch --]
[-- Type: text/x-patch, Size: 2666 bytes --]

diff -r cca565f3c398 -r f643e910ecf8 Makefile.in
--- a/Makefile.in	Sun Feb 11 09:48:36 2007 -0600
+++ b/Makefile.in	Sun Feb 11 09:56:07 2007 -0600
@@ -16,6 +16,8 @@ SHELL = /bin/sh
 SHELL = /bin/sh
 
 @SET_MAKE@
+
+transform = @program_transform_name@
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -34,8 +36,8 @@ infodir = @infodir@
 infodir = @infodir@
 mandir = @mandir@
 includedir = @includedir@
-pkgdatadir = $(datadir)/@PACKAGE_TARNAME@
-pkglibdir = $(libdir)/@PACKAGE_TARNAME@/$(target_cpu)-$(platform)
+pkgdatadir = `echo $(datadir)/@PACKAGE_TARNAME@ | sed '$(transform)'`
+pkglibdir = `echo $(libdir)/@PACKAGE_TARNAME@/$(target_cpu)-$(platform) | sed '$(transform)'`
 
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
@@ -134,18 +136,18 @@ install-local: all
 	$(mkinstalldirs) $(DESTDIR)$(bindir)
 	@list='$(bin_UTILITIES)'; for file in $$list; do \
 	  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; \
 	done
 	$(mkinstalldirs) $(DESTDIR)$(sbindir)
 	@list='$(sbin_UTILITIES)'; for file in $$list; do \
 	  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; \
 	done
 	@list='$(sbin_SCRIPTS)'; for file in $$list; do \
 	  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; \
 	done
 
@@ -159,11 +161,11 @@ uninstall:
 	  rm -f $(DESTDIR)$(pkglibdir)/$$dest; \
 	done
 	@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; \
 	done
 	@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; \
 	done
 
diff -r cca565f3c398 -r f643e910ecf8 configure.ac
--- a/configure.ac	Sun Feb 11 09:48:36 2007 -0600
+++ b/configure.ac	Sun Feb 11 09:56:07 2007 -0600
@@ -39,6 +39,9 @@ AC_CONFIG_HEADER([config.h])
 # Checks for host and target systems.
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
+
+# Program name transformations
+AC_ARG_PROGRAM
 
 case "$host_cpu" in
   powerpc64) host_m32=1 ;;

[-- Attachment #3: grub2-program-name-tranform-i386-pc.patch --]
[-- Type: text/x-patch, Size: 1718 bytes --]

diff -r f643e910ecf8 -r 1f2bf1b03280 util/i386/pc/grub-install.in
--- a/util/i386/pc/grub-install.in	Sun Feb 11 09:56:07 2007 -0600
+++ b/util/i386/pc/grub-install.in	Sun Feb 11 10:12:24 2007 -0600
@@ -18,6 +18,8 @@
 # Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
 
 # Initialize some variables.
+transform=@program_transform_name@
+
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 sbindir=@sbindir@
@@ -28,14 +30,14 @@ PACKAGE_VERSION=@PACKAGE_VERSION@
 PACKAGE_VERSION=@PACKAGE_VERSION@
 target_cpu=@target_cpu@
 platform=@platform@
-pkglibdir=${libdir}/${PACKAGE_TARNAME}/${target_cpu}-${platform}
-
-grub_setup=${sbindir}/grub-setup
-grub_mkimage=${bindir}/grub-mkimage
-grub_mkdevicemap=${sbindir}/grub-mkdevicemap
-grub_probe=${sbindir}/grub-probe
+pkglibdir=`echo ${libdir}/${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed '$(transform)'`
+
+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_probe=${sbindir}/`echo grub-probe | sed ${transform}`
 rootdir=
-grub_prefix=/boot/grub
+grub_prefix=`echo /boot/grub | sed ${transform}`
 modules=
 
 install_device=
@@ -132,7 +134,7 @@ netbsd* | openbsd*)
 netbsd* | openbsd*)
     # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub
     # instead of /boot/grub.
-    grub_prefix=/grub
+    grub_prefix=`echo /grub | sed ${transform}`
     bootdir=${rootdir}
     ;;
 *)
@@ -141,7 +143,7 @@ netbsd* | openbsd*)
     ;;
 esac
 
-grubdir=${bootdir}/grub
+grubdir=`echo ${bootdir}/grub | sed ${transform}`
 device_map=${grubdir}/device.map
 
 # Check if GRUB is installed.

[-- Attachment #4: grub2-program-name-tranform-powerpc.patch --]
[-- Type: text/x-patch, Size: 1166 bytes --]

diff -r 1f2bf1b03280 -r d329fc2b3f20 util/powerpc/ieee1275/grub-install.in
--- a/util/powerpc/ieee1275/grub-install.in	Sun Feb 11 10:12:24 2007 -0600
+++ b/util/powerpc/ieee1275/grub-install.in	Sun Feb 11 10:32:22 2007 -0600
@@ -21,6 +21,8 @@
 # http://ppc64-utils.ozlabs.org .
 
 # Initialize some variables.
+transform=@program_transform_name@
+
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 sbindir=@sbindir@
@@ -30,11 +32,11 @@ PACKAGE_VERSION=@PACKAGE_VERSION@
 PACKAGE_VERSION=@PACKAGE_VERSION@
 target_cpu=@target_cpu@
 platform=@platform@
-pkglibdir=${libdir}/${PACKAGE_TARNAME}/${target_cpu}-${platform}
+pkglibdir=`echo ${libdir}/${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed '$(transform)'`
 
-grub_mkimage=${bindir}/grub-mkimage
+grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
 rootdir=
-grub_prefix=/boot/grub
+grub_prefix=`echo /boot/grub | sed ${transform}`
 modules=
 
 install_device=
@@ -109,7 +111,7 @@ fi
 
 # Initialize these directories here, since ROOTDIR was initialized.
 bootdir=${rootdir}/boot
-grubdir=${bootdir}/grub
+grubdir=${bootdir}/`echo grub | sed ${transform}`
 
 set $grub_mkimage dummy
 if test -f "$1"; then

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-11 22:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-11 22:58 [PATCH] More enhanced GNU GRUB program name transformations Jerone Young

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.