Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1OqmTD-00084p-Aj for mharc-grub-devel@gnu.org; Wed, 01 Sep 2010 08:31:15 -0400 Received: from [140.186.70.92] (port=58135 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OqmT7-0007wd-DC for grub-devel@gnu.org; Wed, 01 Sep 2010 08:31:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OqmT3-00072S-Jd for grub-devel@gnu.org; Wed, 01 Sep 2010 08:31:09 -0400 Received: from smtpout01s1.x-echo.com ([193.252.149.37]:35390) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OqmT3-00071X-Bk for grub-devel@gnu.org; Wed, 01 Sep 2010 08:31:05 -0400 Received: from colinux.localdomain (localhost.localdomain [127.0.0.1]) by colinux.localdomain (SMTP Server) with ESMTP id A69401000E for ; Wed, 1 Sep 2010 14:25:50 +0200 (CEST) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=MIMEBOUNDARY To: grub-devel@gnu.org From: Yves Blusseau Date: Wed, 01 Sep 2010 14:25:50 +0200 Message-ID: <20100901122550.7615.86533.stgit@colinux.localdomain> In-Reply-To: <20100901122511.7615.48954.stgit@colinux.localdomain> References: <20100901122511.7615.48954.stgit@colinux.localdomain> User-Agent: StGit/0.15-97-g9680 X-AV-Checked: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [PATCH 2/2] Use the new created variables X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2010 12:31:14 -0000 This is a MIME message. --MIMEBOUNDARY Content-Disposition: inline MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit * 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 --MIMEBOUNDARY Content-Disposition: attachment; filename=use-default-variables.patch MIME-Version: 1.0 Content-Type: text/plain; name=use-default-variables.patch; charset="utf-8" Content-Transfer-Encoding: 7bit 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" --MIMEBOUNDARY--