Add some usefull variables
cover Add some usefull variables
Hi, i have defined some usefull variables in configure.ac, so they can be used in the script or source files.
---
ChangeLog.new-variables | 2 ++ ChangeLog.use-new-variables | 6 ++++++ configure.ac | 15 +++++++++++++++ util/grub-install.in | 19 +++---------------- util/grub-mkconfig.in | 16 +++------------- util/grub-reboot.in | 16 ++-------------- util/grub-set-default.in | 16 ++-------------- 7 files changed, 33 insertions(+), 57 deletions(-) create mode 100644 ChangeLog.new-variables create mode 100644 ChangeLog.use-new-variables
Signature · 1 line
Yves Blusseau
PATCH 1/2 Define some usefull variables
* configure.ac: Define some usefull variables.
--- ChangeLog.new-variables | 2 ++ configure.ac | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 0 deletions(-) create mode 100644 ChangeLog.new-variables
ChangeLog.new-variables new file +2 -0
@@ -0,0 +1,2 @@ +Define some usefull variables + * configure.ac: Define some usefull variables.
configure.ac +15 -0
@@ -176,6 +176,21 @@ AC_SUBST(host_kernel) AC_SUBST(target_cpu) AC_SUBST(platform) +# Define default variables +grubname=`echo $PACKAGE | sed "$program_transform_name"` +AC_SUBST(grubname) + +case "$host_os" in + netbsd* | openbsd*) + # Because /boot is used for the boot block in NetBSD and OpenBSD, + default_bootdirname='' ;; + *) default_bootdirname='boot' ;; +esac +AC_SUBST(default_bootdirname) + +default_grubdirname="$grubname" +AC_SUBST(default_grubdirname) + # # Checks for build programs. #
PATCH 2/2 Use the new created variables
In reply to Yves Blusseau * util/grub-install.in: Use default variables.
* util/grub-mkconfig.in: Likewise.
* util/grub-reboot.in: Likewise.
* util/grub-set-default.in: Likewise.
--- ChangeLog.use-new-variables | 6 ++++++ util/grub-install.in | 19 +++---------------- util/grub-mkconfig.in | 16 +++------------- util/grub-reboot.in | 16 ++-------------- util/grub-set-default.in | 16 ++-------------- 5 files changed, 16 insertions(+), 57 deletions(-) create mode 100644 ChangeLog.use-new-variables
ChangeLog.use-new-variables new file +6 -0
@@ -0,0 +1,6 @@ +Use the new created variables + + * util/grub-install.in: Use default variables. + * util/grub-mkconfig.in: Likewise. + * util/grub-reboot.in: Likewise. + * util/grub-set-default.in: Likewise.
util/grub-install.in +3 -16
@@ -41,7 +41,6 @@ grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}` grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` grub_editenv=${bindir}/`echo grub-editenv | sed ${transform}` rootdir= -grub_prefix=`echo /boot/grub | sed ${transform}` modules= install_device=
@@ -88,7 +87,7 @@ fi INSTALL_DEVICE can be a GRUB device name or a system device filename. -$self copies GRUB images into /boot/grub (or /grub on NetBSD and +$self copies GRUB images into /@default_bootdirname@/@default_grubdirname@ (or /@default_grubdirname@ on NetBSD and OpenBSD), and uses grub-setup to install grub into the boot sector. If the --root-directory option is used, then $self will copy
@@ -216,20 +215,8 @@ if test $debug = yes; then fi # Initialize these directories here, since ROOTDIR was initialized. -case "$host_os" in -netbsd* | openbsd*) - # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub - # instead of /boot/grub. - grub_prefix=`echo /grub | sed ${transform}` - bootdir=${rootdir} - ;; -*) - # Use /boot/grub by default. - bootdir=${rootdir}/boot - ;; -esac - -grubdir=${bootdir}/`echo grub | sed ${transform}` +bootdir=${rootdir}/@default_bootdirname@ +grubdir=${bootdir}/@default_grubdirname@ device_map=${grubdir}/device.map grub_probe="${grub_probe} --device-map=${device_map}"
util/grub-mkconfig.in +3 -13
@@ -38,6 +38,8 @@ self=`basename $0` grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}` grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` +GRUB_PREFIX=/@default_bootdirname@/@default_grubdirname@ + # Usage: usage # Print the usage. usage () {
@@ -93,18 +95,6 @@ done . ${libdir}/grub/grub-mkconfig_lib -case "$host_os" in -netbsd* | openbsd*) - # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub - # instead of /boot/grub. - GRUB_PREFIX=`echo /grub | sed ${transform}` - ;; -*) - # Use /boot/grub by default. - GRUB_PREFIX=`echo /boot/grub | sed ${transform}` - ;; -esac - if [ "x$EUID" = "x" ] ; then EUID=`id -u` fi
@@ -200,7 +190,7 @@ for x in ${GRUB_TERMINAL_OUTPUT}; do exit 1 fi else - for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do + for dir in ${pkgdatadir} ${GRUB_PREFIX} /usr/share/grub ; do for basename in unicode unifont ascii; do path="${dir}/${basename}.pf2" if is_path_readable_by_grub ${path} > /dev/null ; then
util/grub-reboot.in +2 -14
@@ -100,20 +100,8 @@ if test "x$entry" = x; then fi # Initialize these directories here, since ROOTDIR was initialized. -case "$host_os" in -netbsd* | openbsd*) - # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub - # instead of /boot/grub. - grub_prefix=`echo /grub | sed ${transform}` - bootdir=${rootdir} - ;; -*) - # Use /boot/grub by default. - bootdir=${rootdir}/boot - ;; -esac - -grubdir=${bootdir}/`echo grub | sed ${transform}` +bootdir=${rootdir}/@default_bootdirname@ +grubdir=${bootdir}/@default_grubdirname@ prev_saved_entry=`$grub_editenv ${grubdir}/grubenv list | sed -n 's/^saved_entry=//p'` if [ "$prev_saved_entry" ]; then
util/grub-set-default.in +2 -14
@@ -100,20 +100,8 @@ if test "x$entry" = x; then fi # Initialize these directories here, since ROOTDIR was initialized. -case "$host_os" in -netbsd* | openbsd*) - # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub - # instead of /boot/grub. - grub_prefix=`echo /grub | sed ${transform}` - bootdir=${rootdir} - ;; -*) - # Use /boot/grub by default. - bootdir=${rootdir}/boot - ;; -esac - -grubdir=${bootdir}/`echo grub | sed ${transform}` +bootdir=${rootdir}/@default_bootdirname@ +grubdir=${bootdir}/@default_grubdirname@ $grub_editenv ${grubdir}/grubenv unset prev_saved_entry $grub_editenv ${grubdir}/grubenv set saved_entry="$entry"
You forget to attach the patch?
bvk.chaitanya
Quoted 1 line · BVK Chaitanya
You forget to attach the patch?
No the patchs (1 and 2) are on the ML