From: Lubomir Kundrak <lkundrak@redhat.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: [PATCH] GNU GRUB program name transformations
Date: Thu, 25 Jan 2007 11:27:32 +0100 [thread overview]
Message-ID: <1169720852.3386.38.camel@pluto> (raw)
[-- Attachment #1: Type: text/plain, Size: 1305 bytes --]
Hi all,
I am maintaining a work-in-progress package [1] for the NetBSD package
system, pkgsrc. I was wondering how to avoid conflict between GRUB
Legacy and GRUB 2, letting them (their userspace utilities) coexist
side-by-side. IIRC, one single utility that was conflicting was
grub-install.
[1] http://pkgsrc-wip.cvs.sourceforge.net/pkgsrc-wip/wip/grub2/
[2] http://www.pkgsrc.org/
From my point of view, the best solution was to use the autoconf macro
AC_ARG_PROGRAM adding program name transformation options,
--program-transform-name, --program-prefix and --program-suffix. Side
effect of this is that it allows you to have multiple instances of GRUB
2 installed more comfortably.
The question is whether it is a good thing to transform program names by
default in vendor specific packages (as is done with current version of
pkgsrc package). Alternative solution would be to transform GRUB Legacy
filenames, which, though it might cause some confusion to Legacy users,
seems to be more appropropriate. Does GRUB Legacy support such
transformations in its most recent version?
Anone has other/better suggestions how to avoid GRUB Legacy/GRUB 2
conflict? I attach the patch which applies against current CVS snapshot
to this message.
Regards,
--
Lubomir Kundrak (Red Hat Security Response Team)
[-- Attachment #2: grub2-program-name-transform.patch --]
[-- Type: text/x-patch, Size: 3822 bytes --]
diff -urp grub2.orig/Makefile.in grub2/Makefile.in
--- grub2.orig/Makefile.in 2007-01-25 05:03:31.000000000 +0100
+++ grub2/Makefile.in 2007-01-25 05:09:07.000000000 +0100
@@ -52,6 +52,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+transform = @program_transform_name@
mkinstalldirs = $(srcdir)/mkinstalldirs
CC = @CC@
@@ -139,18 +140,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
@@ -164,11 +165,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 -urp grub2.orig/configure.ac grub2/configure.ac
--- grub2.orig/configure.ac 2007-01-25 05:03:31.000000000 +0100
+++ grub2/configure.ac 2007-01-25 05:03:48.000000000 +0100
@@ -40,6 +40,9 @@ AC_CONFIG_HEADER([config.h])
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
+# Program name transformations
+AC_ARG_PROGRAM
+
case "$host_cpu" in
powerpc64) host_m32=1 ;;
esac
diff -urp grub2.orig/util/i386/pc/grub-install.in grub2/util/i386/pc/grub-install.in
--- grub2.orig/util/i386/pc/grub-install.in 2007-01-25 05:03:31.000000000 +0100
+++ grub2/util/i386/pc/grub-install.in 2007-01-25 05:19:55.000000000 +0100
@@ -29,11 +29,12 @@ PACKAGE_VERSION=@PACKAGE_VERSION@
target_cpu=@target_cpu@
platform=@platform@
pkglibdir=${libdir}/${PACKAGE_TARNAME}/${target_cpu}-${platform}
+transform=@program_transform_name@
-grub_setup=${sbindir}/grub-setup
-grub_mkimage=${bindir}/grub-mkimage
-grub_mkdevicemap=${sbindir}/grub-mkdevicemap
-grub_probe=${sbindir}/grub-probe
+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
modules=
diff -urp grub2.orig/util/powerpc/ieee1275/grub-install.in grub2/util/powerpc/ieee1275/grub-install.in
--- grub2.orig/util/powerpc/ieee1275/grub-install.in 2007-01-25 05:03:31.000000000 +0100
+++ grub2/util/powerpc/ieee1275/grub-install.in 2007-01-25 05:20:23.000000000 +0100
@@ -31,8 +31,9 @@ PACKAGE_VERSION=@PACKAGE_VERSION@
target_cpu=@target_cpu@
platform=@platform@
pkglibdir=${libdir}/${PACKAGE_TARNAME}/${target_cpu}-${platform}
+transform=@program_transform_name@
-grub_mkimage=${bindir}/grub-mkimage
+grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
rootdir=
grub_prefix=/boot/grub
modules=
next reply other threads:[~2007-01-25 10:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-25 10:27 Lubomir Kundrak [this message]
2007-01-26 11:52 ` [PATCH] GNU GRUB program name transformations Yoshinori K. Okuji
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1169720852.3386.38.camel@pluto \
--to=lkundrak@redhat.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.