From a57c242287d9e8d7cd97020a0b41cc196b5ed931 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 3 May 2010 22:53:51 +0200 Subject: [PATCH 1/2] Add missing token --- util/grub-install.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub-install.in b/util/grub-install.in index 8a93ace8c..0db216fd5 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -342,7 +342,7 @@ else prefix_drive=`$grub_probe --target=drive --device ${grub_device}` || exit 1 fi -case "${target_cpu}-${platform}" +case "${target_cpu}-${platform}" in i386-pc) mkimage_target=i386-pc ;; sparc64-ieee1275) mkimage_target=sparc64-ieee1275-raw ;; mips-yeeloong) mkimage_target=mipsel-yeeloong-elf ;; From a1a5c869850fe45fe0dba4000d522045ba40e5ca Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 3 May 2010 22:54:46 +0200 Subject: [PATCH 2/2] Fix default mkimage path determination --- Makefile.in | 2 +- util/grub-mkimage.c | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile.in b/Makefile.in index 3df8b1b72..54f17f27f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -90,7 +90,7 @@ GNULIB_CFLAGS = $(GNULIB_UTIL_CFLAGS) $(POSIX_CFLAGS) ASFLAGS = @ASFLAGS@ LDFLAGS = @LDFLAGS@ $(LIBS) CPPFLAGS = @CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/gnulib -I$(srcdir)/include -Wall -W \ - -DGRUB_LIBDIR=\"$(libdir)\" -DLOCALEDIR=\"$(localedir)\" + -DGRUB_PKGLIBROOTDIR=\"$(libdir)/`echo @PACKAGE_TARNAME@ | sed '$(transform)'`\" -DLOCALEDIR=\"$(localedir)\" TARGET_CC = @TARGET_CC@ TARGET_CFLAGS = -ffreestanding @TARGET_CFLAGS@ TARGET_ASFLAGS = -nostdinc -fno-builtin @TARGET_ASFLAGS@ diff --git a/util/grub-mkimage.c b/util/grub-mkimage.c index cc4a225d4..5602b3a96 100644 --- a/util/grub-mkimage.c +++ b/util/grub-mkimage.c @@ -1182,7 +1182,7 @@ Make a bootable image of GRUB.\n\ \n\ Report bugs to <%s>.\n\ "), - program_name, GRUB_LIBDIR, DEFAULT_DIRECTORY, + program_name, GRUB_PKGLIBROOTDIR, DEFAULT_DIRECTORY, formats, PACKAGE_BUGREPORT); free (formats); @@ -1320,14 +1320,15 @@ main (int argc, char *argv[]) last = strchr (last + 1, '-'); if (!last) last = image_target->name + strlen (image_target->name); - dir = xmalloc (sizeof (GRUB_LIBDIR) + (last - image_target->name)); - memcpy (dir, GRUB_LIBDIR, sizeof (GRUB_LIBDIR) - 1); - memcpy (dir + sizeof (GRUB_LIBDIR) - 1, image_target->name, + dir = xmalloc (sizeof (GRUB_PKGLIBROOTDIR) + (last - image_target->name)); + memcpy (dir, GRUB_PKGLIBROOTDIR, sizeof (GRUB_PKGLIBROOTDIR) - 1); + *(dir + sizeof (GRUB_PKGLIBROOTDIR) - 1) = '/'; + memcpy (dir + sizeof (GRUB_PKGLIBROOTDIR), image_target->name, last - image_target->name); - *(dir + sizeof (GRUB_LIBDIR) - 1 + (last - image_target->name)) = 0; + *(dir + sizeof (GRUB_PKGLIBROOTDIR) + (last - image_target->name)) = 0; } - generate_image (dir ? : GRUB_LIBDIR, prefix ? : DEFAULT_DIRECTORY, fp, + generate_image (dir, prefix ? : DEFAULT_DIRECTORY, fp, argv + optind, memdisk, font, config, image_target, note);