[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix grub-install to use prefix for modules dir
From: |
Pavel Roskin |
Subject: |
Re: [PATCH] Fix grub-install to use prefix for modules dir |
Date: |
Tue, 17 Jun 2008 20:04:29 -0400 |
On Tue, 2008-06-17 at 13:04 -0700, Colin D Bennett wrote:
> I'm not sure. All I know is that I did
> ./configure --prefix=/home/cdb/bin/grub && make && make install,
> then I tried to do /home/cdb/bin/grub/bin/grub-install /media/sdc1 and
> grub-mkimage was getting called with /usr/local/lib/something. Since I
> specified --prefix to configure, I expect grub never ever to refer
> to /usr/local. This patch fixed my problem.
I think I know what you actually did:
./configure
make
./configure --prefix=/home/cdb/bin/grub
make
make install
"/usr/local" was hardcoded into grub-mkimage in the first run. In the
second run, grub-mkimage wasn't rebuilt because it's not a script and
because config.h didn't change.
We don't want wrong path to be hardcoded in grub-mkimage. Working it
around in scripts would keep grub-mkimage incorrect.
I think the best solution would be to add Makefile to
the grub-mkimage.o dependencies. GRUB_LIBDIR is written to Makefile
and grub-mkimage.c uses it. Here's the patch (*.mk changes are not
included):
diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk
index 87626c2..311b6ab 100644
--- a/conf/i386-efi.rmk
+++ b/conf/i386-efi.rmk
@@ -17,6 +17,7 @@ sbin_UTILITIES = grub-mkdevicemap
# For grub-mkimage.
grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \
util/resolve.c
+util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile
# For grub-setup.
#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \
diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk
index ac2f45d..e4f2a66 100644
--- a/conf/i386-ieee1275.rmk
+++ b/conf/i386-ieee1275.rmk
@@ -50,6 +50,7 @@ endif
grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \
util/resolve.c
grub_mkimage_LDFLAGS = $(LIBLZO)
+util/elf/grub-mkimage.c_DEPENDENCIES = Makefile
# For grub-mkdevicemap.
grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \
diff --git a/conf/i386-linuxbios.rmk b/conf/i386-linuxbios.rmk
index 31f03a9..d2546be 100644
--- a/conf/i386-linuxbios.rmk
+++ b/conf/i386-linuxbios.rmk
@@ -49,6 +49,7 @@ endif
grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \
util/resolve.c
grub_mkimage_LDFLAGS = $(LIBLZO)
+util/elf/grub-mkimage.c_DEPENDENCIES = Makefile
# For grub-mkdevicemap.
grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \
diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk
index a3f8467..7b7924f 100644
--- a/conf/i386-pc.rmk
+++ b/conf/i386-pc.rmk
@@ -76,6 +76,7 @@ grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c
util/misc.c \
util/resolve.c
grub_mkimage_CFLAGS =
-DGRUB_MEMORY_MACHINE_LINK_ADDR=$(GRUB_MEMORY_MACHINE_LINK_ADDR)
grub_mkimage_LDFLAGS = $(LIBLZO)
+util/i386/pc/grub-mkimage.c_DEPENDENCIES = Makefile
# For grub-setup.
util/i386/pc/grub-setup.c_DEPENDENCIES = grub_setup_init.h
diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk
index 2c16bc1..51442c6 100644
--- a/conf/powerpc-ieee1275.rmk
+++ b/conf/powerpc-ieee1275.rmk
@@ -37,6 +37,7 @@ endif
# For grub-mkimage.
grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \
util/resolve.c
+util/elf/grub-mkimage.c_DEPENDENCIES = Makefile
# For grub-mkdevicemap.
grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \
--
Regards,
Pavel Roskin