* [PATCH 0/2] Add some usefull variables
@ 2010-09-01 12:25 Yves Blusseau
2010-09-01 12:25 ` [PATCH 1/2] Define " Yves Blusseau
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Yves Blusseau @ 2010-09-01 12:25 UTC (permalink / raw)
To: grub-devel
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
--
Yves Blusseau
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] Define some usefull variables
2010-09-01 12:25 [PATCH 0/2] Add some usefull variables Yves Blusseau
@ 2010-09-01 12:25 ` Yves Blusseau
2010-09-01 12:25 ` [PATCH 2/2] Use the new created variables Yves Blusseau
2010-09-02 2:24 ` [PATCH 0/2] Add some usefull variables BVK Chaitanya
2 siblings, 0 replies; 5+ messages in thread
From: Yves Blusseau @ 2010-09-01 12:25 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 230 bytes --]
* 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
[-- Attachment #2: new-variables.patch --]
[-- Type: text/plain, Size: 890 bytes --]
diff --git a/ChangeLog.new-variables b/ChangeLog.new-variables
new file mode 100644
index 0000000..c069d97
--- /dev/null
+++ b/ChangeLog.new-variables
@@ -0,0 +1,2 @@
+Define some usefull variables
+ * configure.ac: Define some usefull variables.
diff --git a/configure.ac b/configure.ac
index 9fa4606..b167408 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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.
#
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] Use the new created variables
2010-09-01 12:25 [PATCH 0/2] Add some usefull variables Yves Blusseau
2010-09-01 12:25 ` [PATCH 1/2] Define " Yves Blusseau
@ 2010-09-01 12:25 ` Yves Blusseau
2010-09-02 2:24 ` [PATCH 0/2] Add some usefull variables BVK Chaitanya
2 siblings, 0 replies; 5+ messages in thread
From: Yves Blusseau @ 2010-09-01 12:25 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 519 bytes --]
* 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
[-- Attachment #2: use-default-variables.patch --]
[-- Type: text/plain, Size: 4790 bytes --]
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"
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] Add some usefull variables
2010-09-01 12:25 [PATCH 0/2] Add some usefull variables Yves Blusseau
2010-09-01 12:25 ` [PATCH 1/2] Define " Yves Blusseau
2010-09-01 12:25 ` [PATCH 2/2] Use the new created variables Yves Blusseau
@ 2010-09-02 2:24 ` BVK Chaitanya
2010-09-02 11:33 ` Yves Blusseau
2 siblings, 1 reply; 5+ messages in thread
From: BVK Chaitanya @ 2010-09-02 2:24 UTC (permalink / raw)
To: The development of GNU GRUB
You forget to attach the patch?
bvk.chaitanya
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] Add some usefull variables
2010-09-02 2:24 ` [PATCH 0/2] Add some usefull variables BVK Chaitanya
@ 2010-09-02 11:33 ` Yves Blusseau
0 siblings, 0 replies; 5+ messages in thread
From: Yves Blusseau @ 2010-09-02 11:33 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 124 bytes --]
Le 02/09/2010 04:24, BVK Chaitanya a écrit :
> You forget to attach the patch?
No the patchs (1 and 2) are on the ML
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 3848 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-09-02 11:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-01 12:25 [PATCH 0/2] Add some usefull variables Yves Blusseau
2010-09-01 12:25 ` [PATCH 1/2] Define " Yves Blusseau
2010-09-01 12:25 ` [PATCH 2/2] Use the new created variables Yves Blusseau
2010-09-02 2:24 ` [PATCH 0/2] Add some usefull variables BVK Chaitanya
2010-09-02 11:33 ` Yves Blusseau
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.