* update-grub2
@ 2006-10-15 10:18 Robert Millan
2006-10-15 10:40 ` update-grub2 Declan Naughton
` (2 more replies)
0 siblings, 3 replies; 20+ messages in thread
From: Robert Millan @ 2006-10-15 10:18 UTC (permalink / raw)
To: grub-devel; +Cc: jason, otavio, pkg-grub-devel
[-- Attachment #1: Type: text/plain, Size: 1145 bytes --]
Hi there,
This is my proposal for a new dessign in update-grub. As you might know,
update-grub is a script used in Debian to generate GRUB config file. Over time,
we've found that the monolithic dessign of that script made it difficult to
maintain and extend, and it ultimately has become bloated. I'm redessigning it
to be simple, modular and easily extensible.
With this work, we solve another problem: the copyright for original update-grub
was held by several people and it was too difficult to attain the paperwork FSF
projects require for submitting the script to you.
The script I'm attaching is mostly meant as proof of concept to show the
proposed framework for generating the config file and allowing third-party apps
(memtest86, etc) to hook their stuff in.
Please send me your feedback and tell wether you like it. I think it'd be very
good if a unified solution for this were provided from GRUB upstream, instead of
each distributor cooking up their own.
--
Robert Millan
My spam trap is honeypot@aybabtu.com. Note: this address is only intended for
spam harvesters. Writing to it will get you added to my black list.
[-- Attachment #2: ug.diff --]
[-- Type: text/plain, Size: 7953 bytes --]
diff -Nur empty/update-grub update-grub/update-grub
--- empty/update-grub 1970-01-01 01:00:00.000000000 +0100
+++ update-grub/update-grub 2006-10-15 00:49:37.000000000 +0200
@@ -0,0 +1,77 @@
+#! /bin/bash -e
+
+# Generate grub.cfg by inspecting /boot contents.
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
+
+grub_prefix=/boot/grub
+grub_cfg=${grub_prefix}/grub.cfg
+update_grub_dir=/etc/update-grub.d
+test_mode=false
+
+if [ "$UID" != 0 ] ; then
+ echo "$0: You must run this as root"
+ exit 1
+fi
+
+if [ "$1" == "-y" ] ; then
+ echo "$0: warning: Ignoring -y option (no longer needed)."
+fi
+
+if ! test -d ${update_grub_dir} && test -d ./update-grub.d ; then
+ update_grub_dir=./update-grub.d
+ test_mode=true
+fi
+
+if ! which grub-probe > /dev/null ; then
+ echo "$0: grub-probe not found in PATH."
+ exit 1
+fi
+
+if ! ${test_mode} ; then
+ exec > ${grub_cfg}.new
+fi
+
+cat << EOF
+#
+# DO NOT EDIT THIS FILE
+#
+# It is automaticaly generated by $0 using templates from ${update_grub_dir}
+#
+EOF
+
+export GRUB_DEVICE="`grub-probe --target=device ${grub_prefix}`"
+export GRUB_DRIVE="`grub-probe --target=drive ${grub_prefix}`"
+export GRUB_FS="`grub-probe --target=fs ${grub_prefix}`"
+
+shopt -s nullglob ; for i in ${update_grub_dir}/* ; do
+ case $i in
+ # emacsen backup files. FIXME: support other editors
+ *~) ;;
+ *)
+ if test -x $i ; then
+ echo -e "\n### BEGIN $i ###"
+ $i
+ echo "### END $i ###"
+ fi
+ ;;
+ esac
+done
+
+# none of the children aborted with error, install the new grub.cfg
+if ! ${test_mode} ; then
+ exec mv ${grub_cfg}{.new,}
+fi
diff -Nur empty/update-grub.d/00_header update-grub/update-grub.d/00_header
--- empty/update-grub.d/00_header 1970-01-01 01:00:00.000000000 +0100
+++ update-grub/update-grub.d/00_header 2006-10-15 11:42:32.000000000 +0200
@@ -0,0 +1,28 @@
+#! /bin/bash -e
+
+# update-grub helper script.
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
+
+
+if [ -z "${GRUB_DEFAULT}" ] ; then GRUB_DEFAULT=0 ; fi
+if [ -z "${GRUB_TIMEOUT}" ] ; then GRUB_TIMEOUT=5 ; fi
+
+cat << EOF
+set default=${GRUB_DEFAULT}
+set timeout=${GRUB_TIMEOUT}
+set root=${GRUB_DRIVE}
+EOF
diff -Nur empty/update-grub.d/10_hurd update-grub/update-grub.d/10_hurd
--- empty/update-grub.d/10_hurd 1970-01-01 01:00:00.000000000 +0100
+++ update-grub/update-grub.d/10_hurd 2006-10-15 11:42:21.000000000 +0200
@@ -0,0 +1,65 @@
+#! /bin/bash -e
+
+# update-grub helper script.
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
+
+# FIXME: add l4 here?
+kernel=
+for i in /boot/gnumach{.gz,} ; do
+ if test -e $i ; then
+ kernel=$i
+ fi
+done
+
+# FIXME: This works for ext2. For other filesystems we might need special-casing
+case "${GRUB_FS}" in
+ *fs) hurd_fs="${GRUB_FS}" ;;
+ *) hurd_fs="${GRUB_FS}fs" ;;
+esac
+
+at_least_one=false
+all_of_them=true
+for i in "${kernel}" /hurd/${hurd_fs}.static /hurd/exec ; do
+ if test -e "$i" ; then
+ at_least_one=true
+ else
+ all_of_them=false
+ fi
+done
+
+if ! ${at_least_one} ; then
+ # no hurd here, aborting
+ exit 0
+fi
+
+if ! ${all_of_them} || ! test -e /lib/ld.so.1 ; then
+ echo "Some Hurd stuff found, but not enough to boot."
+ exit 1
+fi
+
+cat << EOF
+menuentry "GNU" {
+ multiboot ${kernel} root=device:${GRUB_DEVICE}
+ module /hurd/${hurd_fs}.static --readonly \\
+ --multiboot-command-line='\${kernel-command-line}' \\
+ --host-priv-port='\${host-port}' \\
+ --device-master-port='\${device-port}' \\
+ --exec-server-task='\${exec-task}' -T typed '\${root}' \\
+ '\$(task-create)' '\$(task-resume)'
+ module /lib/ld.so.1 /hurd/exec '\$(exec-task=task-create)'
+}
+EOF
diff -Nur empty/update-grub.d/10_linux update-grub/update-grub.d/10_linux
--- empty/update-grub.d/10_linux 1970-01-01 01:00:00.000000000 +0100
+++ update-grub/update-grub.d/10_linux 2006-10-15 11:42:25.000000000 +0200
@@ -0,0 +1,36 @@
+#! /bin/bash -e
+
+# update-grub helper script.
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
+
+shopt -s nullglob
+
+for linux in /{boot/,}vmlinuz-* ; do
+ version=`echo $linux | sed -e "s,.*/[^0-9]*-,,g"`
+ basedir=`echo $linux | sed -e "s,/[^/]*$,,g"`
+ cat << EOF
+menuentry "GNU/Linux, linux ${version}" {
+ linux ${linux} root=${GRUB_DEVICE} ro
+EOF
+ if test -e /boot/initrd.img-${version} ; then cat << EOF
+ initrd ${dir}/initrd.img-${version}
+EOF
+ fi
+ cat << EOF
+}
+EOF
+done
diff -Nur empty/update-grub.d/README update-grub/update-grub.d/README
--- empty/update-grub.d/README 1970-01-01 01:00:00.000000000 +0100
+++ update-grub/update-grub.d/README 2006-10-15 01:09:12.000000000 +0200
@@ -0,0 +1,11 @@
+
+All executable files in this directory are processed in shell expansion order.
+
+ 00_*: Reserved for 00_header.
+ 10_*: Native boot entries.
+ 20_*: Third party apps (e.g. memtest86).
+
+The number namespace in-between is configurable by system installer and/or
+administrator. For example, you can add an entry to boot another OS as
+01_otheros, 11_otheros, etc, depending on the position you want it to occupy in
+the menu; and then adjust the default setting by editting 00_header.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: update-grub2
2006-10-15 10:18 update-grub2 Robert Millan
@ 2006-10-15 10:40 ` Declan Naughton
2006-10-15 11:16 ` update-grub2 Robert Millan
[not found] ` <8764elkryd.fsf@neumann.lab.ossystems.com.br>
2006-11-27 17:00 ` ping (update-grub2) Robert Millan
2 siblings, 1 reply; 20+ messages in thread
From: Declan Naughton @ 2006-10-15 10:40 UTC (permalink / raw)
To: The development of GRUB 2; +Cc: jason, otavio, pkg-grub-devel
Maybe this isn't the right place, but..
I've been pissed off a couple of times by my grub config being
overwritten after installing a new kernel on Ubuntu (presumably the
same happens on Debian) - I don't get why it doesn't simply add the
new kernel rather than regenerate the entire file?
If you think this is too off-topic then ignore if you will or email me
privately :)
On 10/15/06, Robert Millan <rmh@aybabtu.com> wrote:
>
> Hi there,
>
> This is my proposal for a new dessign in update-grub. As you might know,
> update-grub is a script used in Debian to generate GRUB config file. Over time,
> we've found that the monolithic dessign of that script made it difficult to
> maintain and extend, and it ultimately has become bloated. I'm redessigning it
> to be simple, modular and easily extensible.
>
> With this work, we solve another problem: the copyright for original update-grub
> was held by several people and it was too difficult to attain the paperwork FSF
> projects require for submitting the script to you.
>
> The script I'm attaching is mostly meant as proof of concept to show the
> proposed framework for generating the config file and allowing third-party apps
> (memtest86, etc) to hook their stuff in.
>
> Please send me your feedback and tell wether you like it. I think it'd be very
> good if a unified solution for this were provided from GRUB upstream, instead of
> each distributor cooking up their own.
>
> --
> Robert Millan
>
> My spam trap is honeypot@aybabtu.com. Note: this address is only intended for
> spam harvesters. Writing to it will get you added to my black list.
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>
>
>
--
Declan Naughton
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: update-grub2
2006-10-15 10:40 ` update-grub2 Declan Naughton
@ 2006-10-15 11:16 ` Robert Millan
0 siblings, 0 replies; 20+ messages in thread
From: Robert Millan @ 2006-10-15 11:16 UTC (permalink / raw)
To: The development of GRUB 2; +Cc: jason, otavio, pkg-grub-devel
On Sun, Oct 15, 2006 at 11:40:02AM +0100, Declan Naughton wrote:
> Maybe this isn't the right place, but..
>
> I've been pissed off a couple of times by my grub config being
> overwritten after installing a new kernel on Ubuntu (presumably the
> same happens on Debian) - I don't get why it doesn't simply add the
> new kernel rather than regenerate the entire file?
>
> If you think this is too off-topic then ignore if you will or email me
> privately :)
Yes, it is :)
I'm not the person (nor this is the place) to answer about that, but note that
my proposal for update-grub2 doesn't keep state from former config files.
That's a very awkward (and as you already found out, very error-prone) that I
wouldn't recommend having at all.
In my proposed framework, if you want to customise the configuration you have to
do it at the source (in /etc/update-grub.d or whatever it'll be called).
--
Robert Millan
My spam trap is honeypot@aybabtu.com. Note: this address is only intended for
spam harvesters. Writing to it will get you added to my black list.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: update-grub2
[not found] ` <8764elkryd.fsf@neumann.lab.ossystems.com.br>
@ 2006-10-16 13:48 ` Robert Millan
0 siblings, 0 replies; 20+ messages in thread
From: Robert Millan @ 2006-10-16 13:48 UTC (permalink / raw)
To: Otavio Salvador; +Cc: grub-devel, jason, pkg-grub-devel
On Sun, Oct 15, 2006 at 10:46:50PM -0200, Otavio Salvador wrote:
> Robert Millan <rmh@aybabtu.com> writes:
>
> > Hi there,
> >
> > This is my proposal for a new dessign in update-grub. As you might know,
> > update-grub is a script used in Debian to generate GRUB config file. Over time,
> > we've found that the monolithic dessign of that script made it difficult to
> > maintain and extend, and it ultimately has become bloated. I'm redessigning it
> > to be simple, modular and easily extensible.
>
> It looks great! It's simple and flexible.
>
> Robert, we could start to implement it on Debian side to start to grab
> "plugins" for other uses. We should also check what's the current
> feature set of update-grub and start a campain inside of Debian to
> grab the need "plugins" to don't have regressions for end user.
I think we should wait to see what upstream (CCed) says. If upstream GRUB
includes this feature, then it's an upstream issue for the other projects as
well.
--
Robert Millan
My spam trap is honeypot@aybabtu.com. Note: this address is only intended for
spam harvesters. Writing to it will get you added to my black list.
^ permalink raw reply [flat|nested] 20+ messages in thread
* ping (update-grub2)
2006-10-15 10:18 update-grub2 Robert Millan
2006-10-15 10:40 ` update-grub2 Declan Naughton
[not found] ` <8764elkryd.fsf@neumann.lab.ossystems.com.br>
@ 2006-11-27 17:00 ` Robert Millan
2006-11-27 22:20 ` Vincent Pelletier
` (2 more replies)
2 siblings, 3 replies; 20+ messages in thread
From: Robert Millan @ 2006-11-27 17:00 UTC (permalink / raw)
To: grub-devel; +Cc: jason, otavio, pkg-grub-devel
No comments? Are you interested in getting this into the main grub tree? In my
opinion, since update-grub needs a rewrite it's a good oportunity to merge this
now and unify grub.cfg generation across distributions (something that wasn't
possible with the old update-grub because of copyright issues).
That said, if you don't like the idea then we could proceed adding it in debian,
but that might close the door to merging in the future (maintaining the script
in debian ourselves implies accepting contributions from many people without any
paperwork arrangements).
On Sun, Oct 15, 2006 at 12:18:42PM +0200, Robert Millan wrote:
>
> Hi there,
>
> This is my proposal for a new dessign in update-grub. As you might know,
> update-grub is a script used in Debian to generate GRUB config file. Over time,
> we've found that the monolithic dessign of that script made it difficult to
> maintain and extend, and it ultimately has become bloated. I'm redessigning it
> to be simple, modular and easily extensible.
>
> With this work, we solve another problem: the copyright for original update-grub
> was held by several people and it was too difficult to attain the paperwork FSF
> projects require for submitting the script to you.
>
> The script I'm attaching is mostly meant as proof of concept to show the
> proposed framework for generating the config file and allowing third-party apps
> (memtest86, etc) to hook their stuff in.
>
> Please send me your feedback and tell wether you like it. I think it'd be very
> good if a unified solution for this were provided from GRUB upstream, instead of
> each distributor cooking up their own.
>
> --
> Robert Millan
>
> My spam trap is honeypot@aybabtu.com. Note: this address is only intended for
> spam harvesters. Writing to it will get you added to my black list.
> diff -Nur empty/update-grub update-grub/update-grub
> --- empty/update-grub 1970-01-01 01:00:00.000000000 +0100
> +++ update-grub/update-grub 2006-10-15 00:49:37.000000000 +0200
> @@ -0,0 +1,77 @@
> +#! /bin/bash -e
> +
> +# Generate grub.cfg by inspecting /boot contents.
> +# Copyright (C) 2006 Free Software Foundation, Inc.
> +#
> +# This file is free software; you can redistribute it and/or modify it
> +# under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful, but
> +# WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> +# General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
> +
> +grub_prefix=/boot/grub
> +grub_cfg=${grub_prefix}/grub.cfg
> +update_grub_dir=/etc/update-grub.d
> +test_mode=false
> +
> +if [ "$UID" != 0 ] ; then
> + echo "$0: You must run this as root"
> + exit 1
> +fi
> +
> +if [ "$1" == "-y" ] ; then
> + echo "$0: warning: Ignoring -y option (no longer needed)."
> +fi
> +
> +if ! test -d ${update_grub_dir} && test -d ./update-grub.d ; then
> + update_grub_dir=./update-grub.d
> + test_mode=true
> +fi
> +
> +if ! which grub-probe > /dev/null ; then
> + echo "$0: grub-probe not found in PATH."
> + exit 1
> +fi
> +
> +if ! ${test_mode} ; then
> + exec > ${grub_cfg}.new
> +fi
> +
> +cat << EOF
> +#
> +# DO NOT EDIT THIS FILE
> +#
> +# It is automaticaly generated by $0 using templates from ${update_grub_dir}
> +#
> +EOF
> +
> +export GRUB_DEVICE="`grub-probe --target=device ${grub_prefix}`"
> +export GRUB_DRIVE="`grub-probe --target=drive ${grub_prefix}`"
> +export GRUB_FS="`grub-probe --target=fs ${grub_prefix}`"
> +
> +shopt -s nullglob ; for i in ${update_grub_dir}/* ; do
> + case $i in
> + # emacsen backup files. FIXME: support other editors
> + *~) ;;
> + *)
> + if test -x $i ; then
> + echo -e "\n### BEGIN $i ###"
> + $i
> + echo "### END $i ###"
> + fi
> + ;;
> + esac
> +done
> +
> +# none of the children aborted with error, install the new grub.cfg
> +if ! ${test_mode} ; then
> + exec mv ${grub_cfg}{.new,}
> +fi
> diff -Nur empty/update-grub.d/00_header update-grub/update-grub.d/00_header
> --- empty/update-grub.d/00_header 1970-01-01 01:00:00.000000000 +0100
> +++ update-grub/update-grub.d/00_header 2006-10-15 11:42:32.000000000 +0200
> @@ -0,0 +1,28 @@
> +#! /bin/bash -e
> +
> +# update-grub helper script.
> +# Copyright (C) 2006 Free Software Foundation, Inc.
> +#
> +# This file is free software; you can redistribute it and/or modify it
> +# under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful, but
> +# WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> +# General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
> +
> +
> +if [ -z "${GRUB_DEFAULT}" ] ; then GRUB_DEFAULT=0 ; fi
> +if [ -z "${GRUB_TIMEOUT}" ] ; then GRUB_TIMEOUT=5 ; fi
> +
> +cat << EOF
> +set default=${GRUB_DEFAULT}
> +set timeout=${GRUB_TIMEOUT}
> +set root=${GRUB_DRIVE}
> +EOF
> diff -Nur empty/update-grub.d/10_hurd update-grub/update-grub.d/10_hurd
> --- empty/update-grub.d/10_hurd 1970-01-01 01:00:00.000000000 +0100
> +++ update-grub/update-grub.d/10_hurd 2006-10-15 11:42:21.000000000 +0200
> @@ -0,0 +1,65 @@
> +#! /bin/bash -e
> +
> +# update-grub helper script.
> +# Copyright (C) 2006 Free Software Foundation, Inc.
> +#
> +# This file is free software; you can redistribute it and/or modify it
> +# under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful, but
> +# WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> +# General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
> +
> +# FIXME: add l4 here?
> +kernel=
> +for i in /boot/gnumach{.gz,} ; do
> + if test -e $i ; then
> + kernel=$i
> + fi
> +done
> +
> +# FIXME: This works for ext2. For other filesystems we might need special-casing
> +case "${GRUB_FS}" in
> + *fs) hurd_fs="${GRUB_FS}" ;;
> + *) hurd_fs="${GRUB_FS}fs" ;;
> +esac
> +
> +at_least_one=false
> +all_of_them=true
> +for i in "${kernel}" /hurd/${hurd_fs}.static /hurd/exec ; do
> + if test -e "$i" ; then
> + at_least_one=true
> + else
> + all_of_them=false
> + fi
> +done
> +
> +if ! ${at_least_one} ; then
> + # no hurd here, aborting
> + exit 0
> +fi
> +
> +if ! ${all_of_them} || ! test -e /lib/ld.so.1 ; then
> + echo "Some Hurd stuff found, but not enough to boot."
> + exit 1
> +fi
> +
> +cat << EOF
> +menuentry "GNU" {
> + multiboot ${kernel} root=device:${GRUB_DEVICE}
> + module /hurd/${hurd_fs}.static --readonly \\
> + --multiboot-command-line='\${kernel-command-line}' \\
> + --host-priv-port='\${host-port}' \\
> + --device-master-port='\${device-port}' \\
> + --exec-server-task='\${exec-task}' -T typed '\${root}' \\
> + '\$(task-create)' '\$(task-resume)'
> + module /lib/ld.so.1 /hurd/exec '\$(exec-task=task-create)'
> +}
> +EOF
> diff -Nur empty/update-grub.d/10_linux update-grub/update-grub.d/10_linux
> --- empty/update-grub.d/10_linux 1970-01-01 01:00:00.000000000 +0100
> +++ update-grub/update-grub.d/10_linux 2006-10-15 11:42:25.000000000 +0200
> @@ -0,0 +1,36 @@
> +#! /bin/bash -e
> +
> +# update-grub helper script.
> +# Copyright (C) 2006 Free Software Foundation, Inc.
> +#
> +# This file is free software; you can redistribute it and/or modify it
> +# under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful, but
> +# WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> +# General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
> +
> +shopt -s nullglob
> +
> +for linux in /{boot/,}vmlinuz-* ; do
> + version=`echo $linux | sed -e "s,.*/[^0-9]*-,,g"`
> + basedir=`echo $linux | sed -e "s,/[^/]*$,,g"`
> + cat << EOF
> +menuentry "GNU/Linux, linux ${version}" {
> + linux ${linux} root=${GRUB_DEVICE} ro
> +EOF
> + if test -e /boot/initrd.img-${version} ; then cat << EOF
> + initrd ${dir}/initrd.img-${version}
> +EOF
> + fi
> + cat << EOF
> +}
> +EOF
> +done
> diff -Nur empty/update-grub.d/README update-grub/update-grub.d/README
> --- empty/update-grub.d/README 1970-01-01 01:00:00.000000000 +0100
> +++ update-grub/update-grub.d/README 2006-10-15 01:09:12.000000000 +0200
> @@ -0,0 +1,11 @@
> +
> +All executable files in this directory are processed in shell expansion order.
> +
> + 00_*: Reserved for 00_header.
> + 10_*: Native boot entries.
> + 20_*: Third party apps (e.g. memtest86).
> +
> +The number namespace in-between is configurable by system installer and/or
> +administrator. For example, you can add an entry to boot another OS as
> +01_otheros, 11_otheros, etc, depending on the position you want it to occupy in
> +the menu; and then adjust the default setting by editting 00_header.
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
--
Robert Millan
My spam trap is honeypot@aybabtu.com. Note: this address is only intended for
spam harvesters. Writing to it will get you added to my black list.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: ping (update-grub2)
2006-11-27 17:00 ` ping (update-grub2) Robert Millan
@ 2006-11-27 22:20 ` Vincent Pelletier
2007-04-11 15:57 ` update-grub again (Re: ping (update-grub2)) Robert Millan
[not found] ` <20061127214807.GA23613@linkinnovations.com>
2006-11-28 7:26 ` Yoshinori K. Okuji
2 siblings, 1 reply; 20+ messages in thread
From: Vincent Pelletier @ 2006-11-27 22:20 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 1939 bytes --]
Le lundi 27 novembre 2006 18:00, Robert Millan a écrit :
> No comments? Are you interested in getting this into the main grub tree?
> In my opinion, since update-grub needs a rewrite it's a good oportunity to
> merge this now and unify grub.cfg generation across distributions
> (something that wasn't possible with the old update-grub because of
> copyright issues).
>
> That said, if you don't like the idea then we could proceed adding it in
> debian, but that might close the door to merging in the future (maintaining
> the script in debian ourselves implies accepting contributions from many
> people without any paperwork arrangements).
Personally, the way update-grub works on all my applicable debian installs
suits me perfectly.
But as Declan said, it's bad to overwrite the file...
I wonder if it could become just a generation of a file which would be
included (or not) by the "main" config file.
If that main config file does not exist at all, it could be generated - unless
we consider that a user might want not to have a config file at all.
I don't know if the current scripting allows this, I haven't put an eye on it
for a looong time.
Another idea, which I just had while writing this mail :
What about putting the .d directory in /boot(/grub) and implementing a
mechanism in grub to be able to handle such configuration directory ?
My idea is about multi-OS (multi-distro, whatever) users, which have to
privilege one among and merge the boot possibilities - by hand most probably.
If this offers a common way of storing boot entries, it can solve that
problem.
In my idea, I would go even further by suggesting a non grub-specific way of
doing so, allowing to switch bootloaders which would support such
configuration layouts. But I guess few people are ready to spend much effort
in making boot loaders compatible one with the other...
--
Vincent Pelletier
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: ping (update-grub2)
[not found] ` <20061127214807.GA23613@linkinnovations.com>
@ 2006-11-28 6:32 ` Robert Millan
0 siblings, 0 replies; 20+ messages in thread
From: Robert Millan @ 2006-11-28 6:32 UTC (permalink / raw)
To: Jason Thomas; +Cc: grub-devel, otavio, pkg-grub-devel
On Tue, Nov 28, 2006 at 08:48:08AM +1100, Jason Thomas wrote:
> I think now is the time. Lets do it.
You mean in Debian? If upstream is not interested, I'd really prefer an
explicit answer, just to be sure.
> On Mon, Nov 27, 2006 at 06:00:16PM +0100, Robert Millan wrote:
> >
> > No comments? Are you interested in getting this into the main grub tree? In my
> > opinion, since update-grub needs a rewrite it's a good oportunity to merge this
> > now and unify grub.cfg generation across distributions (something that wasn't
> > possible with the old update-grub because of copyright issues).
> >
> > That said, if you don't like the idea then we could proceed adding it in debian,
> > but that might close the door to merging in the future (maintaining the script
> > in debian ourselves implies accepting contributions from many people without any
> > paperwork arrangements).
> >
> > On Sun, Oct 15, 2006 at 12:18:42PM +0200, Robert Millan wrote:
> > >
> > > Hi there,
> > >
> > > This is my proposal for a new dessign in update-grub. As you might know,
> > > update-grub is a script used in Debian to generate GRUB config file. Over time,
> > > we've found that the monolithic dessign of that script made it difficult to
> > > maintain and extend, and it ultimately has become bloated. I'm redessigning it
> > > to be simple, modular and easily extensible.
> > >
> > > With this work, we solve another problem: the copyright for original update-grub
> > > was held by several people and it was too difficult to attain the paperwork FSF
> > > projects require for submitting the script to you.
> > >
> > > The script I'm attaching is mostly meant as proof of concept to show the
> > > proposed framework for generating the config file and allowing third-party apps
> > > (memtest86, etc) to hook their stuff in.
> > >
> > > Please send me your feedback and tell wether you like it. I think it'd be very
> > > good if a unified solution for this were provided from GRUB upstream, instead of
> > > each distributor cooking up their own.
--
Robert Millan
My spam trap is honeypot@aybabtu.com. Note: this address is only intended for
spam harvesters. Writing to it will get you added to my black list.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: ping (update-grub2)
2006-11-27 17:00 ` ping (update-grub2) Robert Millan
2006-11-27 22:20 ` Vincent Pelletier
[not found] ` <20061127214807.GA23613@linkinnovations.com>
@ 2006-11-28 7:26 ` Yoshinori K. Okuji
2007-04-11 15:50 ` update-grub again (Re: ping (update-grub2)) Robert Millan
2 siblings, 1 reply; 20+ messages in thread
From: Yoshinori K. Okuji @ 2006-11-28 7:26 UTC (permalink / raw)
To: The development of GRUB 2
On Monday 27 November 2006 18:00, Robert Millan wrote:
> No comments? Are you interested in getting this into the main grub tree?
> In my opinion, since update-grub needs a rewrite it's a good oportunity to
> merge this now and unify grub.cfg generation across distributions
> (something that wasn't possible with the old update-grub because of
> copyright issues).
>
> That said, if you don't like the idea then we could proceed adding it in
> debian, but that might close the door to merging in the future (maintaining
> the script in debian ourselves implies accepting contributions from many
> people without any paperwork arrangements).
I describe my own opinion. If others do not agree, let me know.
If the script is generic enough, and other projects are willing to use it, it
is convenient to put it in official versions ("official" means "upstream" in
Debian, but I don't like the term "upstream" very much, BTW). So, in this
case, I accept it. But if it is used only for Debian, I don't think it is
worth doing.
I know it is not so nice to put distribution-specific scripts in official
versions with my past experience, because official versions are not always
synchronized with distribution versions, so when a script in an official
version is "outdated" for a distribution, it is necessary to locally patch
the script, and this effort can be quite painful, if you always need to make
patches for every version.
That's why we don't have the directory "debian" any longer. We had it in GRUB
legacy in version 0.5.92 or something when Gordon was the maintainer of the
GRUB package in Debian. But this became really annoying after Gordon got
inactive, because I had no idea on how to maintain it, as I was not a Debian
user then. And, someone (I think he was Jason Thomas) complained, and I
decided to drop it from the official version.
Okuji
^ permalink raw reply [flat|nested] 20+ messages in thread
* update-grub again (Re: ping (update-grub2))
2006-11-28 7:26 ` Yoshinori K. Okuji
@ 2007-04-11 15:50 ` Robert Millan
2007-04-17 12:49 ` update-grub2 patch Robert Millan
0 siblings, 1 reply; 20+ messages in thread
From: Robert Millan @ 2007-04-11 15:50 UTC (permalink / raw)
To: The development of GRUB 2
On Tue, Nov 28, 2006 at 08:26:48AM +0100, Yoshinori K. Okuji wrote:
I'm terribly late at repliing here :-) - sorry about that. It's about lack of
time, not lack of interest.
> On Monday 27 November 2006 18:00, Robert Millan wrote:
> > No comments? Are you interested in getting this into the main grub tree?
> > In my opinion, since update-grub needs a rewrite it's a good oportunity to
> > merge this now and unify grub.cfg generation across distributions
> > (something that wasn't possible with the old update-grub because of
> > copyright issues).
> >
> > That said, if you don't like the idea then we could proceed adding it in
> > debian, but that might close the door to merging in the future (maintaining
> > the script in debian ourselves implies accepting contributions from many
> > people without any paperwork arrangements).
>
> I describe my own opinion. If others do not agree, let me know.
>
> If the script is generic enough, and other projects are willing to use it, it
> is convenient to put it in official versions ("official" means "upstream" in
> Debian, but I don't like the term "upstream" very much, BTW). So, in this
> case, I accept it. But if it is used only for Debian, I don't think it is
> worth doing.
The script is not Debian-specific in nature, and it can be used by other
distributors. Of course, since I wrote it in Debian it's not known to work
elsewhere, but there's nothing inherently unportable about it.
> I know it is not so nice to put distribution-specific scripts in official
> versions with my past experience, because official versions are not always
> synchronized with distribution versions, so when a script in an official
> version is "outdated" for a distribution, it is necessary to locally patch
> the script, and this effort can be quite painful, if you always need to make
> patches for every version.
>
> That's why we don't have the directory "debian" any longer. We had it in GRUB
> legacy in version 0.5.92 or something when Gordon was the maintainer of the
> GRUB package in Debian. But this became really annoying after Gordon got
> inactive, because I had no idea on how to maintain it, as I was not a Debian
> user then. And, someone (I think he was Jason Thomas) complained, and I
> decided to drop it from the official version.
I understand your concern. Shouldn't be a problem with update-grub IMHO.
If you're ok with it, I'll refurbish it into a patch against CVS so that you
can confirm the changes.
--
Robert Millan
My spam trap is honeypot@aybabtu.com. Note: this address is only intended
for spam harvesters. Writing to it will get you added to my black list.
^ permalink raw reply [flat|nested] 20+ messages in thread
* update-grub again (Re: ping (update-grub2))
2006-11-27 22:20 ` Vincent Pelletier
@ 2007-04-11 15:57 ` Robert Millan
0 siblings, 0 replies; 20+ messages in thread
From: Robert Millan @ 2007-04-11 15:57 UTC (permalink / raw)
To: The development of GRUB 2
On Mon, Nov 27, 2006 at 11:20:06PM +0100, Vincent Pelletier wrote:
> > That said, if you don't like the idea then we could proceed adding it in
> > debian, but that might close the door to merging in the future (maintaining
> > the script in debian ourselves implies accepting contributions from many
> > people without any paperwork arrangements).
>
> Personally, the way update-grub works on all my applicable debian installs
> suits me perfectly.
When you just run it and see it works, everything seems wonderful. But have
a look at the code; everyone has been adding their cruft for ages, and it's
completely unmanageable now. By taking a modular approach, we can have a
simple core that is easily maintainable, and unload the responsability for
modules to the applications they're associated with.
> But as Declan said, it's bad to overwrite the file...
> I wonder if it could become just a generation of a file which would be
> included (or not) by the "main" config file.
> If that main config file does not exist at all, it could be generated - unless
> we consider that a user might want not to have a config file at all.
>
> I don't know if the current scripting allows this, I haven't put an eye on it
> for a looong time.
I'm not particularly interested about that, but it's trivial to implement it
later provided that grub scripting supports it.
> Another idea, which I just had while writing this mail :
>
> What about putting the .d directory in /boot(/grub) and implementing a
> mechanism in grub to be able to handle such configuration directory ?
That's not feasible. The script modules do complex stuff that couldn't
be done comfortably if we were in kernel-mode C instead of shell scripting
(check out what my scripts do and you'll see what I mean).
--
Robert Millan
My spam trap is honeypot@aybabtu.com. Note: this address is only intended
for spam harvesters. Writing to it will get you added to my black list.
^ permalink raw reply [flat|nested] 20+ messages in thread
* update-grub2 patch
2007-04-11 15:50 ` update-grub again (Re: ping (update-grub2)) Robert Millan
@ 2007-04-17 12:49 ` Robert Millan
2007-04-17 13:26 ` Otavio Salvador
2007-04-21 13:38 ` Yoshinori K. Okuji
0 siblings, 2 replies; 20+ messages in thread
From: Robert Millan @ 2007-04-17 12:49 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 222 bytes --]
Here's my patch. Let me know if it's ok for commit.
--
Robert Millan
My spam trap is honeypot@aybabtu.com. Note: this address is only intended
for spam harvesters. Writing to it will get you added to my black list.
[-- Attachment #2: update-grub2.diff --]
[-- Type: text/x-diff, Size: 14092 bytes --]
2007-04-17 Robert Millan <rmh@aybabtu.com>
* DISTLIST: Add util/update-grub.in, util/grub.d/00_header.in,
util/grub.d/10_hurd.in, util/grub.d/10_linux.in and util/grub.d/README.
* Makefile.in: Declare enable_update_grub. Install update-grub_SCRIPTS
and update-grub_DATA.
* configure.ac: Add --enable-update-grub option to enable update-grub.
* configure: Regenerate.
* conf/common.rmk: Install update-grub components when
enable_update_grub is set.
* conf/common.mk: Regenerate.
* util/update-grub.in: New. Core of update-grub.
* util/grub.d/00_header.in: New. Generates grub.cfg header.
* util/grub.d/10_hurd.in: New. Generates boot entries for the Hurd.
* util/grub.d/10_linux.in: New. Generates boot entries for Linux.
* util/grub.d/README: New. Document grub.d directory layout.
Index: DISTLIST
===================================================================
RCS file: /sources/grub/grub2/DISTLIST,v
retrieving revision 1.38
diff -u -r1.38 DISTLIST
--- DISTLIST 14 Oct 2006 18:59:34 -0000 1.38
+++ DISTLIST 17 Apr 2007 12:06:37 -0000
@@ -258,6 +258,11 @@
util/raid.c
util/resolve.c
util/unifont2pff.rb
+util/update-grub.in
+util/grub.d/00_header.in
+util/grub.d/10_hurd.in
+util/grub.d/10_linux.in
+util/grub.d/README
util/i386/efi/grub-mkimage.c
util/i386/pc/biosdisk.c
util/i386/pc/getroot.c
Index: Makefile.in
===================================================================
RCS file: /sources/grub/grub2/Makefile.in,v
retrieving revision 1.24
diff -u -r1.24 Makefile.in
--- Makefile.in 10 Apr 2007 21:38:26 -0000 1.24
+++ Makefile.in 17 Apr 2007 12:06:37 -0000
@@ -77,6 +78,7 @@
# Options.
enable_grub_emu = @enable_grub_emu@
+enable_update_grub = @enable_update_grub@
### General variables.
@@ -153,6 +155,17 @@
dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
$(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \
done
+ $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/grub.d
+ @list='$(update-grub_SCRIPTS)'; for file in $$list; do \
+ if test -f "$$file"; then dir=; else dir="$(srcdir)"; fi; \
+ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
+ $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \
+ done
+ @list='$(update-grub_DATA)'; for file in $$list; do \
+ if test -f "$$file"; then dir=; else dir="$(srcdir)"; fi; \
+ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
+ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \
+ done
install-strip:
$(MAKE) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" install
Index: configure.ac
===================================================================
RCS file: /sources/grub/grub2/configure.ac,v
retrieving revision 1.37
diff -u -r1.37 configure.ac
--- configure.ac 10 Apr 2007 21:38:26 -0000 1.37
+++ configure.ac 17 Apr 2007 12:06:37 -0000
@@ -314,6 +314,19 @@
[fi]
AC_SUBST([enable_grub_emu])
+AC_ARG_ENABLE([update-grub],
+ [AS_HELP_STRING([--enable-update-grub],
+ [build and install the `update-grub' grub.cfg generation utility])])
+[if [ x"$enable_update_grub" = xyes ]; then
+ # Check for bash.]
+ AC_PATH_PROG(_BASH, bash) # BASH is a reserved variable, use _BASH instead
+ if test "x$_BASH" = x; then
+ AC_MSG_ERROR([bash is required for `update-grub'])
+ fi
+ AC_CONFIG_FILES([util/update-grub util/grub.d/00_header util/grub.d/10_hurd util/grub.d/10_linux])
+[fi]
+AC_SUBST([enable_update_grub])
+
# Output files.
AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu
include/grub/machine:include/grub/$target_cpu/$platform])
Index: conf/common.mk
===================================================================
RCS file: /sources/grub/grub2/conf/common.mk,v
retrieving revision 1.20
diff -u -r1.20 common.mk
--- conf/common.mk 3 Nov 2006 20:28:04 -0000 1.20
+++ conf/common.mk 17 Apr 2007 12:06:38 -0000
@@ -18,6 +18,11 @@
rm -f $@; sh $(srcdir)/geninit.sh $(filter %.c,$^) > $@
DISTCLEANFILES += grub_emu_init.c
+ifeq ($(enable_update_grub), yes)
+sbin_UTILITIES += util/update-grub
+update-grub_SCRIPTS += util/grub.d/00_header util/grub.d/10_linux util/grub.d/10_hurd
+update-grub_DATA += util/grub.d/README
+endif
# Filing systems.
pkgdata_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod \
Index: conf/common.rmk
===================================================================
RCS file: /sources/grub/grub2/conf/common.rmk,v
retrieving revision 1.12
diff -u -r1.12 common.rmk
--- conf/common.rmk 3 Nov 2006 20:28:04 -0000 1.12
+++ conf/common.rmk 17 Apr 2007 12:06:38 -0000
@@ -18,6 +18,11 @@
rm -f $@; sh $(srcdir)/geninit.sh $(filter %.c,$^) > $@
DISTCLEANFILES += grub_emu_init.c
+ifeq ($(enable_update_grub), yes)
+sbin_UTILITIES += util/update-grub
+update-grub_SCRIPTS += util/grub.d/00_header util/grub.d/10_linux util/grub.d/10_hurd
+update-grub_DATA += util/grub.d/README
+endif
# Filing systems.
pkgdata_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod \
Index: util/update-grub.in
===================================================================
RCS file: util/update-grub.in
diff -N util/update-grub.in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ util/update-grub.in 17 Apr 2007 12:06:38 -0000
@@ -0,0 +1,89 @@
+#! @_BASH@ -e
+
+# Generate grub.cfg by inspecting /boot contents.
+# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
+
+transform="@program_transform_name@"
+
+sysconfdir=@sysconfdir@
+grub_prefix=`echo /boot/grub | sed ${transform}`
+grub_cfg=${grub_prefix}/grub.cfg
+update_grub_dir=${sysconfdir}/grub.d
+test_mode=false
+
+if [ "$UID" != 0 ] ; then
+ echo "$0: You must run this as root" >&2
+ exit 1
+fi
+
+if [ "$1" == "-y" ] ; then
+ echo "$0: warning: Ignoring -y option (no longer needed)." >&2
+fi
+
+if ! test -d ${update_grub_dir} && test -d ./grub.d ; then
+ update_grub_dir=./grub.d
+ test_mode=true
+fi
+
+if ! which grub-probe > /dev/null ; then
+ echo "$0: grub-probe not found in PATH." >&2
+ exit 1
+fi
+
+if ! ${test_mode} ; then
+ exec > ${grub_cfg}.new
+ chmod 444 ${grub_cfg}.new
+fi
+
+if test -f ${sysconfdir}/default/grub ; then
+ . ${sysconfdir}/default/grub
+fi
+
+echo "Updating ${grub_cfg} ..." >&2
+
+cat << EOF
+#
+# DO NOT EDIT THIS FILE
+#
+# It is automaticaly generated by $0 using templates from ${update_grub_dir}
+#
+EOF
+
+export GRUB_DEVICE="`grub-probe --target=device ${grub_prefix}`"
+export GRUB_DRIVE="`grub-probe --target=drive ${grub_prefix}`"
+export GRUB_FS="`grub-probe --target=fs ${grub_prefix}`"
+
+shopt -s nullglob ; for i in ${update_grub_dir}/* ; do
+ case $i in
+ # emacsen backup files. FIXME: support other editors
+ *~) ;;
+ *)
+ if test -x $i ; then
+ echo -e "\n### BEGIN $i ###"
+ $i
+ echo "### END $i ###"
+ fi
+ ;;
+ esac
+done
+
+# none of the children aborted with error, install the new grub.cfg
+if ! ${test_mode} ; then
+ mv ${grub_cfg}{.new,}
+fi
+
+echo "done" >&2
Index: util/grub.d/00_header.in
===================================================================
RCS file: util/grub.d/00_header.in
diff -N util/grub.d/00_header.in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ util/grub.d/00_header.in 17 Apr 2007 12:06:38 -0000
@@ -0,0 +1,28 @@
+#! @_BASH@ -e
+
+# update-grub helper script.
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
+
+
+if [ -z "${GRUB_DEFAULT}" ] ; then GRUB_DEFAULT=0 ; fi
+if [ -z "${GRUB_TIMEOUT}" ] ; then GRUB_TIMEOUT=5 ; fi
+
+cat << EOF
+set default=${GRUB_DEFAULT}
+set timeout=${GRUB_TIMEOUT}
+set root=${GRUB_DRIVE}
+EOF
Index: util/grub.d/10_hurd.in
===================================================================
RCS file: util/grub.d/10_hurd.in
diff -N util/grub.d/10_hurd.in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ util/grub.d/10_hurd.in 17 Apr 2007 12:06:38 -0000
@@ -0,0 +1,72 @@
+#! @_BASH@ -e
+
+# update-grub helper script.
+# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
+
+if [ -z "${GRUB_DISTRIBUTOR}" ] ; then
+ OS=GNU
+else
+ OS="${GRUB_DISTRIBUTOR} GNU/Hurd"
+fi
+
+# FIXME: add l4 here?
+kernel=
+for i in /boot/gnumach{.gz,} ; do
+ if test -e $i ; then
+ kernel=$i
+ fi
+done
+
+# FIXME: This works for ext2. For other filesystems we might need special-casing
+case "${GRUB_FS}" in
+ *fs) hurd_fs="${GRUB_FS}" ;;
+ *) hurd_fs="${GRUB_FS}fs" ;;
+esac
+
+at_least_one=false
+all_of_them=true
+for i in "${kernel}" /hurd/${hurd_fs}.static /hurd/exec ; do
+ if test -e "$i" ; then
+ echo "Found Hurd module: $i" >&2
+ at_least_one=true
+ else
+ all_of_them=false
+ fi
+done
+
+if ! ${at_least_one} ; then
+ # no hurd here, aborting silently
+ exit 0
+fi
+
+if ! ${all_of_them} || ! test -e /lib/ld.so.1 ; then
+ echo "Some Hurd stuff found, but not enough to boot." >&2
+ exit 1
+fi
+
+cat << EOF
+menuentry "${OS}" {
+ multiboot ${kernel} root=device:${GRUB_DEVICE}
+ module /hurd/${hurd_fs}.static --readonly \\
+ --multiboot-command-line='\${kernel-command-line}' \\
+ --host-priv-port='\${host-port}' \\
+ --device-master-port='\${device-port}' \\
+ --exec-server-task='\${exec-task}' -T typed '\${root}' \\
+ '\$(task-create)' '\$(task-resume)'
+ module /lib/ld.so.1 /hurd/exec '\$(exec-task=task-create)'
+}
+EOF
Index: util/grub.d/10_linux.in
===================================================================
RCS file: util/grub.d/10_linux.in
diff -N util/grub.d/10_linux.in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ util/grub.d/10_linux.in 17 Apr 2007 12:06:38 -0000
@@ -0,0 +1,53 @@
+#! @_BASH@ -e
+
+# update-grub helper script.
+# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
+
+if [ -n "${GRUB_DISTRIBUTOR}" ] ; then GRUB_DISTRIBUTOR="${GRUB_DISTRIBUTOR} " ; fi
+
+shopt -s nullglob
+
+for linux in /{boot/,}vmlinu[xz]-* ; do
+ echo "Found linux image: $linux" >&2
+ version=`echo $linux | sed -e "s,.*/[^0-9]*-,,g"`
+ basedir=`echo $linux | sed -e "s,/[^/]*$,,g"`
+ cat << EOF
+menuentry "${GRUB_DISTRIBUTOR}GNU/Linux, linux ${version}" {
+ linux ${linux} root=${GRUB_DEVICE} ro
+EOF
+ if test -e ${basedir}/initrd.img-${version} ; then
+ echo "Found initrd image: ${basedir}/initrd.img-${version}" >&2
+ cat << EOF
+ initrd ${basedir}/initrd.img-${version}
+EOF
+ fi
+ cat << EOF
+}
+EOF
+ cat << EOF
+menuentry "${GRUB_DISTRIBUTOR}GNU/Linux, linux ${version} (single-user mode)" {
+ linux ${linux} root=${GRUB_DEVICE} ro single
+EOF
+ if test -e ${basedir}/initrd.img-${version} ; then
+ cat << EOF
+ initrd ${basedir}/initrd.img-${version}
+EOF
+ fi
+ cat << EOF
+}
+EOF
+done
Index: util/grub.d/README
===================================================================
RCS file: util/grub.d/README
diff -N util/grub.d/README
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ util/grub.d/README 17 Apr 2007 12:06:38 -0000
@@ -0,0 +1,11 @@
+
+All executable files in this directory are processed in shell expansion order.
+
+ 00_*: Reserved for 00_header.
+ 10_*: Native boot entries.
+ 20_*: Third party apps (e.g. memtest86+).
+
+The number namespace in-between is configurable by system installer and/or
+administrator. For example, you can add an entry to boot another OS as
+01_otheros, 11_otheros, etc, depending on the position you want it to occupy in
+the menu; and then adjust the default setting via /etc/default/grub.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: update-grub2 patch
2007-04-17 12:49 ` update-grub2 patch Robert Millan
@ 2007-04-17 13:26 ` Otavio Salvador
2007-04-21 13:38 ` Yoshinori K. Okuji
1 sibling, 0 replies; 20+ messages in thread
From: Otavio Salvador @ 2007-04-17 13:26 UTC (permalink / raw)
To: The development of GRUB 2
Robert Millan <rmh@aybabtu.com> writes:
> Here's my patch. Let me know if it's ok for commit.
It looks OK. After commiting it we can start to try to push "plugins"
for others like Xen.
--
O T A V I O S A L V A D O R
---------------------------------------------
E-mail: otavio@debian.org UIN: 5906116
GNU/Linux User: 239058 GPG ID: 49A5F855
Home Page: http://otavio.ossystems.com.br
---------------------------------------------
"Microsoft sells you Windows ... Linux gives
you the whole house."
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: update-grub2 patch
2007-04-17 12:49 ` update-grub2 patch Robert Millan
2007-04-17 13:26 ` Otavio Salvador
@ 2007-04-21 13:38 ` Yoshinori K. Okuji
2007-04-29 23:22 ` Robert Millan
1 sibling, 1 reply; 20+ messages in thread
From: Yoshinori K. Okuji @ 2007-04-21 13:38 UTC (permalink / raw)
To: The development of GRUB 2
On Tuesday 17 April 2007 14:49, Robert Millan wrote:
> Here's my patch. Let me know if it's ok for commit.
To include this in the official repository, you need to take care about the
portability. You should not rely on the existence of some programs.
For instance, you use bash. This is not good. Use /bin/sh instead. You use
shopt. This is not good, because this is specific to bash. The way in which
you write test expressions is not very portable.
Also, don't use negations (i.e. `!'), because they don't behave correctly on
some platforms. Use "if ... then else ..." instead.
For more information, please look at the chapter "Portable Shell Programming"
in the Autoconf manual.
Regards,
Okuji
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: update-grub2 patch
2007-04-21 13:38 ` Yoshinori K. Okuji
@ 2007-04-29 23:22 ` Robert Millan
2007-05-01 20:45 ` Yoshinori K. Okuji
0 siblings, 1 reply; 20+ messages in thread
From: Robert Millan @ 2007-04-29 23:22 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 709 bytes --]
On Sat, Apr 21, 2007 at 03:38:38PM +0200, Yoshinori K. Okuji wrote:
> On Tuesday 17 April 2007 14:49, Robert Millan wrote:
> > Here's my patch. Let me know if it's ok for commit.
>
> To include this in the official repository, you need to take care about the
> portability. [...]
I ported it to bourne shell. It's tested and known to work with dash as
/bin/sh. I think this should address your concern.
My new patch also arranges the logic for generating update-grub components
to make it more similar to how grub-install is handled.
--
Robert Millan
My spam trap is honeypot@aybabtu.com. Note: this address is only intended
for spam harvesters. Writing to it will get you added to my black list.
[-- Attachment #2: update-grub2.diff --]
[-- Type: text/x-diff, Size: 12986 bytes --]
2007-04-30 Robert Millan <rmh@aybabtu.com>
* DISTLIST: Add util/update-grub.in, util/grub.d/00_header.in,
util/grub.d/10_hurd.in, util/grub.d/10_linux.in and util/grub.d/README.
* Makefile.in: Build update-grub_SCRIPTS. Install update-grub_SCRIPTS
and update-grub_DATA.
* conf/common.rmk: Build and install update-grub components.
* conf/common.mk: Regenerate.
* util/update-grub.in: New. Core of update-grub.
* util/grub.d/00_header.in: New. Generates grub.cfg header.
* util/grub.d/10_hurd.in: New. Generates boot entries for the Hurd.
* util/grub.d/10_linux.in: New. Generates boot entries for Linux.
* util/grub.d/README: New. Document grub.d directory layout.
Index: DISTLIST
===================================================================
RCS file: /sources/grub/grub2/DISTLIST,v
retrieving revision 1.38
diff -u -r1.38 DISTLIST
--- DISTLIST 14 Oct 2006 18:59:34 -0000 1.38
+++ DISTLIST 29 Apr 2007 23:00:30 -0000
@@ -258,6 +258,11 @@
util/raid.c
util/resolve.c
util/unifont2pff.rb
+util/update-grub.in
+util/grub.d/00_header.in
+util/grub.d/10_hurd.in
+util/grub.d/10_linux.in
+util/grub.d/README
util/i386/efi/grub-mkimage.c
util/i386/pc/biosdisk.c
util/i386/pc/getroot.c
Index: Makefile.in
===================================================================
RCS file: /sources/grub/grub2/Makefile.in,v
retrieving revision 1.24
diff -u -r1.24 Makefile.in
--- Makefile.in 10 Apr 2007 21:38:26 -0000 1.24
+++ Makefile.in 29 Apr 2007 23:00:30 -0000
@@ -87,7 +87,7 @@
DATA = $(pkgdata_IMAGES) $(pkgdata_MODULES) $(pkgdata_PROGRAMS) \
$(pkgdata_DATA)
PROGRAMS = $(bin_UTILITIES) $(sbin_UTILITIES)
-SCRIPTS = $(sbin_SCRIPTS)
+SCRIPTS = $(sbin_SCRIPTS) $(update-grub_SCRIPTS)
CLEANFILES =
MOSTLYCLEANFILES =
@@ -153,6 +153,17 @@
dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
$(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \
done
+ $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/grub.d
+ @list='$(update-grub_SCRIPTS)'; for file in $$list; do \
+ if test -f "$$file"; then dir=; else dir="$(srcdir)"; fi; \
+ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
+ $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \
+ done
+ @list='$(update-grub_DATA)'; for file in $$list; do \
+ if test -f "$$file"; then dir=; else dir="$(srcdir)"; fi; \
+ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
+ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \
+ done
install-strip:
$(MAKE) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" install
Index: conf/common.rmk
===================================================================
RCS file: /sources/grub/grub2/conf/common.rmk,v
retrieving revision 1.12
diff -u -r1.12 common.rmk
--- conf/common.rmk 3 Nov 2006 20:28:04 -0000 1.12
+++ conf/common.rmk 29 Apr 2007 23:00:32 -0000
@@ -18,6 +18,33 @@
rm -f $@; sh $(srcdir)/geninit.sh $(filter %.c,$^) > $@
DISTCLEANFILES += grub_emu_init.c
+# For update-grub
+update-grub: util/update-grub.in config.status
+ ./config.status --file=$@:$<
+ chmod +x $@
+sbin_SCRIPTS += update-grub
+CLEANFILES += update-grub
+
+00_header: util/grub.d/00_header.in config.status
+ ./config.status --file=$@:$<
+ chmod +x $@
+update-grub_SCRIPTS += 00_header
+CLEANFILES += 00_header
+
+10_linux: util/grub.d/10_linux.in config.status
+ ./config.status --file=$@:$<
+ chmod +x $@
+update-grub_SCRIPTS += 10_linux
+CLEANFILES += 10_linux
+
+10_hurd: util/grub.d/10_hurd.in config.status
+ ./config.status --file=$@:$<
+ chmod +x $@
+update-grub_SCRIPTS += 10_hurd
+CLEANFILES += 10_hurd
+
+update-grub_DATA += util/grub.d/README
+
# Filing systems.
pkgdata_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod \
Index: util/update-grub.in
===================================================================
RCS file: util/update-grub.in
diff -N util/update-grub.in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ util/update-grub.in 29 Apr 2007 23:00:32 -0000
@@ -0,0 +1,94 @@
+#! /bin/sh -e
+
+# Generate grub.cfg by inspecting /boot contents.
+# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
+
+transform="@program_transform_name@"
+
+sysconfdir=@sysconfdir@
+grub_prefix=`echo /boot/grub | sed ${transform}`
+grub_cfg=${grub_prefix}/grub.cfg
+update_grub_dir=${sysconfdir}/grub.d
+test_mode=false
+
+if test -z "$UID" ; then
+ UID=`id -u`
+fi
+
+if [ "$UID" != 0 ] ; then
+ echo "$0: You must run this as root" >&2
+ exit 1
+fi
+
+if [ "$1" = "-y" ] ; then
+ echo "$0: warning: Ignoring -y option (no longer needed)." >&2
+fi
+
+if test ! -d ${update_grub_dir} && test -d ./grub.d ; then
+ update_grub_dir=./grub.d
+ test_mode=true
+fi
+
+if which grub-probe > /dev/null ; then : ; else
+ echo "$0: grub-probe not found in PATH." >&2
+ exit 1
+fi
+
+if ${test_mode} ; then : ; else
+ exec > ${grub_cfg}.new
+ chmod 444 ${grub_cfg}.new
+fi
+
+if test -f ${sysconfdir}/default/grub ; then
+ . ${sysconfdir}/default/grub
+fi
+
+echo "Updating ${grub_cfg} ..." >&2
+
+cat << EOF
+#
+# DO NOT EDIT THIS FILE
+#
+# It is automaticaly generated by $0 using templates from ${update_grub_dir}
+#
+EOF
+
+export GRUB_DEVICE="`grub-probe --target=device ${grub_prefix}`"
+export GRUB_DRIVE="`grub-probe --target=drive ${grub_prefix}`"
+export GRUB_FS="`grub-probe --target=fs ${grub_prefix}`"
+
+for i in ${update_grub_dir}/* ; do
+ case $i in
+ # emacsen backup files. FIXME: support other editors
+ *~) ;;
+ *)
+ if test -x $i ; then
+ echo
+ echo "### BEGIN $i ###"
+ $i
+ echo "### END $i ###"
+ fi
+ ;;
+ esac
+done
+
+# none of the children aborted with error, install the new grub.cfg
+if ${test_mode} ; then : ; else
+ mv ${grub_cfg}.new ${grub_cfg}
+fi
+
+echo "done" >&2
Index: util/grub.d/00_header.in
===================================================================
RCS file: util/grub.d/00_header.in
diff -N util/grub.d/00_header.in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ util/grub.d/00_header.in 29 Apr 2007 23:00:32 -0000
@@ -0,0 +1,28 @@
+#! /bin/sh -e
+
+# update-grub helper script.
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
+
+
+if [ -z "${GRUB_DEFAULT}" ] ; then GRUB_DEFAULT=0 ; fi
+if [ -z "${GRUB_TIMEOUT}" ] ; then GRUB_TIMEOUT=5 ; fi
+
+cat << EOF
+set default=${GRUB_DEFAULT}
+set timeout=${GRUB_TIMEOUT}
+set root=${GRUB_DRIVE}
+EOF
Index: util/grub.d/10_hurd.in
===================================================================
RCS file: util/grub.d/10_hurd.in
diff -N util/grub.d/10_hurd.in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ util/grub.d/10_hurd.in 29 Apr 2007 23:00:32 -0000
@@ -0,0 +1,72 @@
+#! /bin/sh -e
+
+# update-grub helper script.
+# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
+
+if test -z "${GRUB_DISTRIBUTOR}" ; then
+ OS=GNU
+else
+ OS="${GRUB_DISTRIBUTOR} GNU/Hurd"
+fi
+
+# FIXME: add l4 here?
+kernel=
+for i in /boot/gnumach.gz /boot/gnumach ; do
+ if test -e $i ; then
+ kernel=$i
+ fi
+done
+
+# FIXME: This works for ext2. For other filesystems we might need special-casing
+case "${GRUB_FS}" in
+ *fs) hurd_fs="${GRUB_FS}" ;;
+ *) hurd_fs="${GRUB_FS}fs" ;;
+esac
+
+at_least_one=false
+all_of_them=true
+for i in "${kernel}" /hurd/${hurd_fs}.static /hurd/exec ; do
+ if test -e "$i" ; then
+ echo "Found Hurd module: $i" >&2
+ at_least_one=true
+ else
+ all_of_them=false
+ fi
+done
+
+if ${at_least_one} ; then : ; else
+ # no hurd here, aborting silently
+ exit 0
+fi
+
+if ${all_of_them} && test -e /lib/ld.so.1 ; then : ; else
+ echo "Some Hurd stuff found, but not enough to boot." >&2
+ exit 1
+fi
+
+cat << EOF
+menuentry "${OS}" {
+ multiboot ${kernel} root=device:${GRUB_DEVICE}
+ module /hurd/${hurd_fs}.static --readonly \\
+ --multiboot-command-line='\${kernel-command-line}' \\
+ --host-priv-port='\${host-port}' \\
+ --device-master-port='\${device-port}' \\
+ --exec-server-task='\${exec-task}' -T typed '\${root}' \\
+ '\$(task-create)' '\$(task-resume)'
+ module /lib/ld.so.1 /hurd/exec '\$(exec-task=task-create)'
+}
+EOF
Index: util/grub.d/10_linux.in
===================================================================
RCS file: util/grub.d/10_linux.in
diff -N util/grub.d/10_linux.in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ util/grub.d/10_linux.in 29 Apr 2007 23:00:32 -0000
@@ -0,0 +1,54 @@
+#! /bin/sh -e
+
+# update-grub helper script.
+# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
+
+if [ -n "${GRUB_DISTRIBUTOR}" ] ; then GRUB_DISTRIBUTOR="${GRUB_DISTRIBUTOR} " ; fi
+
+for linux in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
+ if test -e ${linux} ; then : ; else
+ continue
+ fi
+ echo "Found linux image: $linux" >&2
+ version=`echo $linux | sed -e "s,.*/[^0-9]*-,,g"`
+ basedir=`echo $linux | sed -e "s,/[^/]*$,,g"`
+ cat << EOF
+menuentry "${GRUB_DISTRIBUTOR}GNU/Linux, linux ${version}" {
+ linux ${linux} root=${GRUB_DEVICE} ro
+EOF
+ if test -e ${basedir}/initrd.img-${version} ; then
+ echo "Found initrd image: ${basedir}/initrd.img-${version}" >&2
+ cat << EOF
+ initrd ${basedir}/initrd.img-${version}
+EOF
+ fi
+ cat << EOF
+}
+EOF
+ cat << EOF
+menuentry "${GRUB_DISTRIBUTOR}GNU/Linux, linux ${version} (single-user mode)" {
+ linux ${linux} root=${GRUB_DEVICE} ro single
+EOF
+ if test -e ${basedir}/initrd.img-${version} ; then
+ cat << EOF
+ initrd ${basedir}/initrd.img-${version}
+EOF
+ fi
+ cat << EOF
+}
+EOF
+done
Index: util/grub.d/README
===================================================================
RCS file: util/grub.d/README
diff -N util/grub.d/README
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ util/grub.d/README 29 Apr 2007 23:00:32 -0000
@@ -0,0 +1,11 @@
+
+All executable files in this directory are processed in shell expansion order.
+
+ 00_*: Reserved for 00_header.
+ 10_*: Native boot entries.
+ 20_*: Third party apps (e.g. memtest86+).
+
+The number namespace in-between is configurable by system installer and/or
+administrator. For example, you can add an entry to boot another OS as
+01_otheros, 11_otheros, etc, depending on the position you want it to occupy in
+the menu; and then adjust the default setting via /etc/default/grub.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: update-grub2 patch
2007-04-29 23:22 ` Robert Millan
@ 2007-05-01 20:45 ` Yoshinori K. Okuji
2007-05-02 13:31 ` Robert Millan
0 siblings, 1 reply; 20+ messages in thread
From: Yoshinori K. Okuji @ 2007-05-01 20:45 UTC (permalink / raw)
To: The development of GRUB 2
On Monday 30 April 2007 01:22, Robert Millan wrote:
> On Sat, Apr 21, 2007 at 03:38:38PM +0200, Yoshinori K. Okuji wrote:
> > On Tuesday 17 April 2007 14:49, Robert Millan wrote:
> > > Here's my patch. Let me know if it's ok for commit.
> >
> > To include this in the official repository, you need to take care about
> > the portability. [...]
>
> I ported it to bourne shell. It's tested and known to work with dash as
> /bin/sh. I think this should address your concern.
>
> My new patch also arranges the logic for generating update-grub components
> to make it more similar to how grub-install is handled.
Some issues are still there. You should avoid test -z. Instead, use test x$foo
= x. You should avoid ! in test. Use else instead. You should avoid using
which. Travese $PATH instead.
Okuji
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: update-grub2 patch
2007-05-01 20:45 ` Yoshinori K. Okuji
@ 2007-05-02 13:31 ` Robert Millan
2007-05-02 15:35 ` Amin Azez
2007-05-03 15:48 ` Robert Millan
0 siblings, 2 replies; 20+ messages in thread
From: Robert Millan @ 2007-05-02 13:31 UTC (permalink / raw)
To: The development of GRUB 2
On Tue, May 01, 2007 at 10:45:39PM +0200, Yoshinori K. Okuji wrote:
> On Monday 30 April 2007 01:22, Robert Millan wrote:
> > On Sat, Apr 21, 2007 at 03:38:38PM +0200, Yoshinori K. Okuji wrote:
> > > On Tuesday 17 April 2007 14:49, Robert Millan wrote:
> > > > Here's my patch. Let me know if it's ok for commit.
> > >
> > > To include this in the official repository, you need to take care about
> > > the portability. [...]
> >
> > I ported it to bourne shell. It's tested and known to work with dash as
> > /bin/sh. I think this should address your concern.
> >
> > My new patch also arranges the logic for generating update-grub components
> > to make it more similar to how grub-install is handled.
>
> Some issues are still there. You should avoid test -z. Instead, use test x$foo
> = x.
Ok
> You should avoid ! in test. Use else instead.
Earlier when I read the portability document I was pointed to, I found:
"You may use `!' with `test', but not with `if'"
Are you sure this change is required?
> You should avoid using
> which. Travese $PATH instead.
Do you mean something like:
IFS=:
for i in $PATH ; do
grub-probe="$i/grub-probe"
if test -x $grub-probe ; then break ; fi
done
?
--
Robert Millan
My spam trap is honeypot@aybabtu.com. Note: this address is only intended
for spam harvesters. Writing to it will get you added to my black list.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: update-grub2 patch
2007-05-02 13:31 ` Robert Millan
@ 2007-05-02 15:35 ` Amin Azez
2007-05-03 15:48 ` Robert Millan
1 sibling, 0 replies; 20+ messages in thread
From: Amin Azez @ 2007-05-02 15:35 UTC (permalink / raw)
To: The development of GRUB 2
* Robert Millan wrote, On 02/05/07 14:31:
> Do you mean something like:
> IFS=:
> for i in $PATH ; do
> grub-probe="$i/grub-probe"
> if test -x $grub-probe ; then break ; fi
> done
>
>
You may as well define your own which:
which() {
IFS=:
for i in $PATH ; do
if test -x "$i/$1"
then echo "$i/$1"
return
fi
done
return 1
}
then you can keep on using which
Sam
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: update-grub2 patch
2007-05-02 13:31 ` Robert Millan
2007-05-02 15:35 ` Amin Azez
@ 2007-05-03 15:48 ` Robert Millan
2007-05-03 21:44 ` Yoshinori K. Okuji
1 sibling, 1 reply; 20+ messages in thread
From: Robert Millan @ 2007-05-03 15:48 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 725 bytes --]
On Wed, May 02, 2007 at 03:31:16PM +0200, Robert Millan wrote:
> > You should avoid ! in test. Use else instead.
>
> Earlier when I read the portability document I was pointed to, I found:
>
> "You may use `!' with `test', but not with `if'"
>
> Are you sure this change is required?
Well, since this is just one line, I fixed it.
Attached new patch fixes all three problems ('which', 'test !' and 'test -z|-n')
and also adds code in 00_header.in to enable gfxterm when the unicode font is
found in /boot/grub.
Let me know if everything is ok now..
--
Robert Millan
My spam trap is honeypot@aybabtu.com. Note: this address is only intended
for spam harvesters. Writing to it will get you added to my black list.
[-- Attachment #2: update-grub2.diff --]
[-- Type: text/x-diff, Size: 12917 bytes --]
2007-05-03 Robert Millan <rmh@aybabtu.com>
* DISTLIST: Add util/update-grub.in, util/grub.d/00_header.in,
util/grub.d/10_hurd.in, util/grub.d/10_linux.in and util/grub.d/README.
* Makefile.in: Build update-grub_SCRIPTS. Install update-grub_SCRIPTS
and update-grub_DATA.
* conf/common.rmk: Build and install update-grub components.
* conf/common.mk: Regenerate.
* util/update-grub.in: New. Core of update-grub.
* util/grub.d/00_header.in: New. Generates grub.cfg header.
* util/grub.d/10_hurd.in: New. Generates boot entries for the Hurd.
* util/grub.d/10_linux.in: New. Generates boot entries for Linux.
* util/grub.d/README: New. Document grub.d directory layout.
diff -Nur grub2/conf/common.rmk grub2.update-grub/conf/common.rmk
--- grub2/conf/common.rmk 2007-05-03 17:44:05.000000000 +0200
+++ grub2.update-grub/conf/common.rmk 2007-05-03 16:53:34.000000000 +0200
@@ -18,6 +18,33 @@
rm -f $@; sh $(srcdir)/geninit.sh $(filter %.c,$^) > $@
DISTCLEANFILES += grub_emu_init.c
+# For update-grub
+update-grub: util/update-grub.in config.status
+ ./config.status --file=$@:$<
+ chmod +x $@
+sbin_SCRIPTS += update-grub
+CLEANFILES += update-grub
+
+00_header: util/grub.d/00_header.in config.status
+ ./config.status --file=$@:$<
+ chmod +x $@
+update-grub_SCRIPTS += 00_header
+CLEANFILES += 00_header
+
+10_linux: util/grub.d/10_linux.in config.status
+ ./config.status --file=$@:$<
+ chmod +x $@
+update-grub_SCRIPTS += 10_linux
+CLEANFILES += 10_linux
+
+10_hurd: util/grub.d/10_hurd.in config.status
+ ./config.status --file=$@:$<
+ chmod +x $@
+update-grub_SCRIPTS += 10_hurd
+CLEANFILES += 10_hurd
+
+update-grub_DATA += util/grub.d/README
+
# Filing systems.
pkgdata_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod \
diff -Nur grub2/DISTLIST grub2.update-grub/DISTLIST
--- grub2/DISTLIST 2007-05-03 17:44:05.000000000 +0200
+++ grub2.update-grub/DISTLIST 2007-05-03 16:53:34.000000000 +0200
@@ -258,6 +258,11 @@
util/raid.c
util/resolve.c
util/unifont2pff.rb
+util/update-grub.in
+util/grub.d/00_header.in
+util/grub.d/10_hurd.in
+util/grub.d/10_linux.in
+util/grub.d/README
util/i386/efi/grub-mkimage.c
util/i386/pc/biosdisk.c
util/i386/pc/getroot.c
diff -Nur grub2/Makefile.in grub2.update-grub/Makefile.in
--- grub2/Makefile.in 2007-05-03 17:44:05.000000000 +0200
+++ grub2.update-grub/Makefile.in 2007-05-03 16:53:34.000000000 +0200
@@ -87,7 +87,7 @@
DATA = $(pkgdata_IMAGES) $(pkgdata_MODULES) $(pkgdata_PROGRAMS) \
$(pkgdata_DATA)
PROGRAMS = $(bin_UTILITIES) $(sbin_UTILITIES)
-SCRIPTS = $(sbin_SCRIPTS)
+SCRIPTS = $(sbin_SCRIPTS) $(update-grub_SCRIPTS)
CLEANFILES =
MOSTLYCLEANFILES =
@@ -153,6 +153,17 @@
dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
$(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \
done
+ $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/grub.d
+ @list='$(update-grub_SCRIPTS)'; for file in $$list; do \
+ if test -f "$$file"; then dir=; else dir="$(srcdir)"; fi; \
+ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
+ $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \
+ done
+ @list='$(update-grub_DATA)'; for file in $$list; do \
+ if test -f "$$file"; then dir=; else dir="$(srcdir)"; fi; \
+ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
+ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \
+ done
install-strip:
$(MAKE) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" install
diff -Nur grub2/util/grub.d/00_header.in grub2.update-grub/util/grub.d/00_header.in
--- grub2/util/grub.d/00_header.in 1970-01-01 01:00:00.000000000 +0100
+++ grub2.update-grub/util/grub.d/00_header.in 2007-05-03 17:40:42.000000000 +0200
@@ -0,0 +1,38 @@
+#! /bin/sh -e
+
+# update-grub helper script.
+# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
+
+
+if [ "x${GRUB_DEFAULT}" = "x" ] ; then GRUB_DEFAULT=0 ; fi
+if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi
+
+cat << EOF
+set default=${GRUB_DEFAULT}
+set timeout=${GRUB_TIMEOUT}
+set root=${GRUB_DRIVE}
+EOF
+
+if test -e /boot/grub/unifont.pff ; then
+ cat << EOF
+font /boot/grub/unifont.pff
+set gfxmode=640x480x32
+insmod gfxterm
+insmod vbe
+terminal gfxterm
+EOF
+fi
diff -Nur grub2/util/grub.d/10_hurd.in grub2.update-grub/util/grub.d/10_hurd.in
--- grub2/util/grub.d/10_hurd.in 1970-01-01 01:00:00.000000000 +0100
+++ grub2.update-grub/util/grub.d/10_hurd.in 2007-05-03 17:38:19.000000000 +0200
@@ -0,0 +1,72 @@
+#! /bin/sh -e
+
+# update-grub helper script.
+# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
+
+if [ "x${GRUB_DISTRIBUTOR}" = "" ] ; then
+ OS=GNU
+else
+ OS="${GRUB_DISTRIBUTOR} GNU/Hurd"
+fi
+
+# FIXME: add l4 here?
+kernel=
+for i in /boot/gnumach.gz /boot/gnumach ; do
+ if test -e $i ; then
+ kernel=$i
+ fi
+done
+
+# FIXME: This works for ext2. For other filesystems we might need special-casing
+case "${GRUB_FS}" in
+ *fs) hurd_fs="${GRUB_FS}" ;;
+ *) hurd_fs="${GRUB_FS}fs" ;;
+esac
+
+at_least_one=false
+all_of_them=true
+for i in "${kernel}" /hurd/${hurd_fs}.static /hurd/exec ; do
+ if test -e "$i" ; then
+ echo "Found Hurd module: $i" >&2
+ at_least_one=true
+ else
+ all_of_them=false
+ fi
+done
+
+if ${at_least_one} ; then : ; else
+ # no hurd here, aborting silently
+ exit 0
+fi
+
+if ${all_of_them} && test -e /lib/ld.so.1 ; then : ; else
+ echo "Some Hurd stuff found, but not enough to boot." >&2
+ exit 1
+fi
+
+cat << EOF
+menuentry "${OS}" {
+ multiboot ${kernel} root=device:${GRUB_DEVICE}
+ module /hurd/${hurd_fs}.static --readonly \\
+ --multiboot-command-line='\${kernel-command-line}' \\
+ --host-priv-port='\${host-port}' \\
+ --device-master-port='\${device-port}' \\
+ --exec-server-task='\${exec-task}' -T typed '\${root}' \\
+ '\$(task-create)' '\$(task-resume)'
+ module /lib/ld.so.1 /hurd/exec '\$(exec-task=task-create)'
+}
+EOF
diff -Nur grub2/util/grub.d/10_linux.in grub2.update-grub/util/grub.d/10_linux.in
--- grub2/util/grub.d/10_linux.in 1970-01-01 01:00:00.000000000 +0100
+++ grub2.update-grub/util/grub.d/10_linux.in 2007-05-03 17:40:21.000000000 +0200
@@ -0,0 +1,59 @@
+#! /bin/sh -e
+
+# update-grub helper script.
+# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
+
+if [ "x${GRUB_DISTRIBUTOR}" = "" ] ; then
+ OS=GNU/Linux
+else
+ OS="${GRUB_DISTRIBUTOR} GNU/Linux"
+fi
+
+
+for linux in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
+ if test -e ${linux} ; then : ; else
+ continue
+ fi
+ echo "Found linux image: $linux" >&2
+ version=`echo $linux | sed -e "s,.*/[^0-9]*-,,g"`
+ basedir=`echo $linux | sed -e "s,/[^/]*$,,g"`
+ cat << EOF
+menuentry "${OS}, linux ${version}" {
+ linux ${linux} root=${GRUB_DEVICE} ro
+EOF
+ if test -e ${basedir}/initrd.img-${version} ; then
+ echo "Found initrd image: ${basedir}/initrd.img-${version}" >&2
+ cat << EOF
+ initrd ${basedir}/initrd.img-${version}
+EOF
+ fi
+ cat << EOF
+}
+EOF
+ cat << EOF
+menuentry "${OS}, linux ${version} (single-user mode)" {
+ linux ${linux} root=${GRUB_DEVICE} ro single
+EOF
+ if test -e ${basedir}/initrd.img-${version} ; then
+ cat << EOF
+ initrd ${basedir}/initrd.img-${version}
+EOF
+ fi
+ cat << EOF
+}
+EOF
+done
diff -Nur grub2/util/grub.d/README grub2.update-grub/util/grub.d/README
--- grub2/util/grub.d/README 1970-01-01 01:00:00.000000000 +0100
+++ grub2.update-grub/util/grub.d/README 2007-05-03 16:53:34.000000000 +0200
@@ -0,0 +1,11 @@
+
+All executable files in this directory are processed in shell expansion order.
+
+ 00_*: Reserved for 00_header.
+ 10_*: Native boot entries.
+ 20_*: Third party apps (e.g. memtest86+).
+
+The number namespace in-between is configurable by system installer and/or
+administrator. For example, you can add an entry to boot another OS as
+01_otheros, 11_otheros, etc, depending on the position you want it to occupy in
+the menu; and then adjust the default setting via /etc/default/grub.
diff -Nur grub2/util/update-grub.in grub2.update-grub/util/update-grub.in
--- grub2/util/update-grub.in 1970-01-01 01:00:00.000000000 +0100
+++ grub2.update-grub/util/update-grub.in 2007-05-03 17:42:23.000000000 +0200
@@ -0,0 +1,106 @@
+#! /bin/sh -e
+
+# Generate grub.cfg by inspecting /boot contents.
+# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St - Suite 330, Boston, MA 02110, USA.
+
+transform="@program_transform_name@"
+
+sysconfdir=@sysconfdir@
+grub_prefix=`echo /boot/grub | sed ${transform}`
+grub_cfg=${grub_prefix}/grub.cfg
+update_grub_dir=${sysconfdir}/grub.d
+test_mode=false
+
+if [ "x$UID" = "x" ] ; then
+ UID=`id -u`
+fi
+
+if [ "$UID" != 0 ] ; then
+ echo "$0: You must run this as root" >&2
+ exit 1
+fi
+
+if [ "$1" = "-y" ] ; then
+ echo "$0: warning: Ignoring -y option (no longer needed)." >&2
+fi
+
+if test -d ${update_grub_dir} ; then : ; else
+ if test -d ./grub.d ; then
+ update_grub_dir=./grub.d
+ test_mode=true
+ fi
+fi
+
+found=false
+old_IFS="$IFS"
+IFS=:
+for i in $PATH ; do
+ if test -x "$i/grub-probe" ; then
+ found=true
+ break
+ fi
+done
+IFS="$old_IFS"
+if ${found} ; then : ; else
+ echo "$0: grub-probe not found in PATH." >&2
+ exit 1
+fi
+
+if ${test_mode} ; then : ; else
+ exec > ${grub_cfg}.new
+ chmod 444 ${grub_cfg}.new
+fi
+
+if test -f ${sysconfdir}/default/grub ; then
+ . ${sysconfdir}/default/grub
+fi
+
+echo "Updating ${grub_cfg} ..." >&2
+
+cat << EOF
+#
+# DO NOT EDIT THIS FILE
+#
+# It is automaticaly generated by $0 using templates from ${update_grub_dir}
+#
+EOF
+
+export GRUB_DEVICE="`grub-probe --target=device ${grub_prefix}`"
+export GRUB_DRIVE="`grub-probe --target=drive ${grub_prefix}`"
+export GRUB_FS="`grub-probe --target=fs ${grub_prefix}`"
+
+for i in ${update_grub_dir}/* ; do
+ case $i in
+ # emacsen backup files. FIXME: support other editors
+ *~) ;;
+ *)
+ if test -x $i ; then
+ echo
+ echo "### BEGIN $i ###"
+ $i
+ echo "### END $i ###"
+ fi
+ ;;
+ esac
+done
+
+# none of the children aborted with error, install the new grub.cfg
+if ${test_mode} ; then : ; else
+ mv ${grub_cfg}.new ${grub_cfg}
+fi
+
+echo "done" >&2
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: update-grub2 patch
2007-05-03 15:48 ` Robert Millan
@ 2007-05-03 21:44 ` Yoshinori K. Okuji
2007-05-04 7:14 ` Robert Millan
0 siblings, 1 reply; 20+ messages in thread
From: Yoshinori K. Okuji @ 2007-05-03 21:44 UTC (permalink / raw)
To: The development of GRUB 2
On Thursday 03 May 2007 17:48, Robert Millan wrote:
> On Wed, May 02, 2007 at 03:31:16PM +0200, Robert Millan wrote:
> > > You should avoid ! in test. Use else instead.
> >
> > Earlier when I read the portability document I was pointed to, I found:
> >
> > "You may use `!' with `test', but not with `if'"
> >
> > Are you sure this change is required?
>
> Well, since this is just one line, I fixed it.
>
> Attached new patch fixes all three problems ('which', 'test !' and 'test
> -z|-n') and also adds code in 00_header.in to enable gfxterm when the
> unicode font is found in /boot/grub.
>
> Let me know if everything is ok now..
OK. Please go ahead.
Thanks,
Okuji
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: update-grub2 patch
2007-05-03 21:44 ` Yoshinori K. Okuji
@ 2007-05-04 7:14 ` Robert Millan
0 siblings, 0 replies; 20+ messages in thread
From: Robert Millan @ 2007-05-04 7:14 UTC (permalink / raw)
To: The development of GRUB 2
On Thu, May 03, 2007 at 11:44:14PM +0200, Yoshinori K. Okuji wrote:
> On Thursday 03 May 2007 17:48, Robert Millan wrote:
> > On Wed, May 02, 2007 at 03:31:16PM +0200, Robert Millan wrote:
> > > > You should avoid ! in test. Use else instead.
> > >
> > > Earlier when I read the portability document I was pointed to, I found:
> > >
> > > "You may use `!' with `test', but not with `if'"
> > >
> > > Are you sure this change is required?
> >
> > Well, since this is just one line, I fixed it.
> >
> > Attached new patch fixes all three problems ('which', 'test !' and 'test
> > -z|-n') and also adds code in 00_header.in to enable gfxterm when the
> > unicode font is found in /boot/grub.
> >
> > Let me know if everything is ok now..
>
> OK. Please go ahead.
Done!
--
Robert Millan
My spam trap is honeypot@aybabtu.com. Note: this address is only intended
for spam harvesters. Writing to it will get you added to my black list.
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2007-05-04 7:20 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-15 10:18 update-grub2 Robert Millan
2006-10-15 10:40 ` update-grub2 Declan Naughton
2006-10-15 11:16 ` update-grub2 Robert Millan
[not found] ` <8764elkryd.fsf@neumann.lab.ossystems.com.br>
2006-10-16 13:48 ` update-grub2 Robert Millan
2006-11-27 17:00 ` ping (update-grub2) Robert Millan
2006-11-27 22:20 ` Vincent Pelletier
2007-04-11 15:57 ` update-grub again (Re: ping (update-grub2)) Robert Millan
[not found] ` <20061127214807.GA23613@linkinnovations.com>
2006-11-28 6:32 ` ping (update-grub2) Robert Millan
2006-11-28 7:26 ` Yoshinori K. Okuji
2007-04-11 15:50 ` update-grub again (Re: ping (update-grub2)) Robert Millan
2007-04-17 12:49 ` update-grub2 patch Robert Millan
2007-04-17 13:26 ` Otavio Salvador
2007-04-21 13:38 ` Yoshinori K. Okuji
2007-04-29 23:22 ` Robert Millan
2007-05-01 20:45 ` Yoshinori K. Okuji
2007-05-02 13:31 ` Robert Millan
2007-05-02 15:35 ` Amin Azez
2007-05-03 15:48 ` Robert Millan
2007-05-03 21:44 ` Yoshinori K. Okuji
2007-05-04 7:14 ` Robert Millan
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.