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.
This commit is contained in:
Yves Blusseau 2010-09-21 11:42:30 +02:00
parent 4eff79d2f9
commit a4c1d277c1
5 changed files with 22 additions and 5 deletions

View file

@ -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

View file

@ -24,6 +24,10 @@
#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(). */

View 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.

View 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"

View 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