Keep boot and grub directory names in sync with utils scripts
authorYves Blusseau <blusseau@zetam.org>
Tue, 21 Sep 2010 09:42:30 +0000 (11:42 +0200)
committerYves Blusseau <blusseau@zetam.org>
Tue, 21 Sep 2010 09:42:30 +0000 (11:42 +0200)
    * configure.ac: Define GRUB_BOOT_DIR_NAME and GRUB_DIR_NAME macros.
    * config.h.in: Add previous macros.
    * include/grub/emu/misc.h (DEFAULT_DIRECTORY): Use previous macros.
    * util/grub-install.in: Use $bootdir and $grubdir variables.

ChangeLog
config.h.in
configure.ac
include/grub/emu/misc.h
util/grub-install.in

index 91e6751..2061ec2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-09-21  Yves Blusseau  <blusseau@zetam.org>
+
+       Keep boot and grub directory names in sync with utils scripts
+
+       * configure.ac: Define GRUB_BOOT_DIR_NAME and GRUB_DIR_NAME macros.
+       * config.h.in: Add previous macros.
+       * include/grub/emu/misc.h (DEFAULT_DIRECTORY): Use previous macros.
+       * util/grub-install.in: Use $bootdir and $grubdir variables.
+
 2010-09-21  Colin Watson  <cjwatson@ubuntu.com>
 
        * grub-core/kern/emu/hostdisk.c (find_system_device): Only try to
index 4ac9ab5..6d7d95d 100644 (file)
 #define PACKAGE_NAME "@PACKAGE_NAME@"
 /* Define to the address where bug reports for this package should be sent. */
 #define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
+/* Default boot directory name" */
+#define GRUB_BOOT_DIR_NAME "@bootdirname@"
+/* Default grub directory name */
+#define GRUB_DIR_NAME "@grubdirname@"
 /* Define to 1 if GCC generates calls to __enable_execute_stack().  */
 #define NEED_ENABLE_EXECUTE_STACK @NEED_ENABLE_EXECUTE_STACK@
 /* Define to 1 if GCC generates calls to __register_frame_info().  */
index f9abafc..3bc2b75 100644 (file)
@@ -187,9 +187,13 @@ case "$host_os" in
 esac
 bootdirname=`echo "$bootdirname" | sed "$program_transform_name"`
 AC_SUBST(bootdirname)
+AC_DEFINE_UNQUOTED(GRUB_BOOT_DIR_NAME, "$bootdirname",
+    [Default boot directory name]")
 
 grubdirname=`echo "$PACKAGE" | sed "$program_transform_name"`
 AC_SUBST(grubdirname)
+AC_DEFINE_UNQUOTED(GRUB_DIR_NAME, "$grubdirname",
+    [Default grub directory name])
 
 #
 # Checks for build programs.
index 51cad59..47a80d3 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef GRUB_EMU_MISC_H
 #define GRUB_EMU_MISC_H 1
 
-#include <config-util.h>
+#include <config.h>
 #include <stdarg.h>
 
 #include <grub/symbol.h>
@@ -35,9 +35,9 @@
 
 #ifdef __NetBSD__
 /* NetBSD uses /boot for its boot block.  */
-# define DEFAULT_DIRECTORY     "/grub"
+# define DEFAULT_DIRECTORY     "/"GRUB_DIR_NAME
 #else
-# define DEFAULT_DIRECTORY     "/boot/grub"
+# define DEFAULT_DIRECTORY     "/"GRUB_BOOT_DIR_NAME"/"GRUB_DIR_NAME
 #endif
 
 #define DEFAULT_DEVICE_MAP     DEFAULT_DIRECTORY "/device.map"
index ebbd63c..86c6aa1 100644 (file)
@@ -561,9 +561,9 @@ $grub_mkimage ${config_opt} -d ${pkglibdir} -O ${mkimage_target} --output=${grub
 
 # Backward-compatibility kludges
 if [ "${target_cpu}-${platform}" = "mips-yeeloong" ]; then
-    cp ${grubdir}/core.${imgext} /boot/grub.elf
+    cp ${grubdir}/core.${imgext} ${bootdir}/grub.elf
 elif [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${platform}" = "powerpc-ieee1275" ]; then
-    cp ${grubdir}/core.${imgext} /boot/grub/grub
+    cp ${grubdir}/core.${imgext} ${grubdir}/grub
 elif [ "${target_cpu}-${platform}" = "i386-efi" ] || [ "${target_cpu}-${platform}" = "x86_64-efi" ]; then
     $grub_mkimage ${config_opt} -d ${pkglibdir} -O ${mkimage_target} --output=${grubdir}/grub.efi --prefix="" $modules || exit 1
 fi