update-grub again (Re: ping (update-grub2))

2007-04-11 Thread Robert Millan
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 [EMAIL PROTECTED]  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


update-grub again (Re: ping (update-grub2))

2007-04-11 Thread Robert Millan
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 [EMAIL PROTECTED]  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


Re: ping (update-grub2)

2006-11-28 Thread Yoshinori K. Okuji
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


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: ping (update-grub2)

2006-11-27 Thread Robert Millan
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 [EMAIL PROTECTED]  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


Re: ping (update-grub2)

2006-11-27 Thread Vincent Pelletier
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


pgpP3rFKXucnz.pgp
Description: PGP signature
___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


ping (update-grub2)

2006-11-27 Thread Robert Millan

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 [EMAIL PROTECTED]  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.0 +0100
> +++ update-grub/update-grub   2006-10-15 00:49:37.0 +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.0 +0100
> +++ update-grub/update-grub.d/00_header   2006-10-15 11:42:32.0 
> +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.
> +#
> +# T