diff --git a/ChangeLog.use-new-variables b/ChangeLog.use-new-variables new file mode 100644 index 0000000..a3f811f --- /dev/null +++ b/ChangeLog.use-new-variables @@ -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. diff --git a/util/grub-install.in b/util/grub-install.in index e6521f0..b90ef60 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -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}" diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 828b54b..d9c75c1 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -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 diff --git a/util/grub-reboot.in b/util/grub-reboot.in index e7a41f6..3195237 100644 --- a/util/grub-reboot.in +++ b/util/grub-reboot.in @@ -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 diff --git a/util/grub-set-default.in b/util/grub-set-default.in index 389c504..fc50a20 100644 --- a/util/grub-set-default.in +++ b/util/grub-set-default.in @@ -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"