2006-01-05 23:03:22

by Etienne Lorrain

[permalink] [raw]
Subject: [PATCH 1/3] boot with Gujin: add script/{gzcopy.c,gzparam.c} to generate linux.kgz file format

Gujin is a GPL bootloader (homepage http://gujin.org) which can not only
load the standard vmlinuz file format but also a simpler format, called
Gujin native format, filename using the extension *.kgz.
It is simply the standard ELF executable file vmlinux translated to binary
image by OBJCOPY and compressed by GZIP.
The GZIP format (rfc1952) define a way to add a comment to the GZIP file,
it is used extensively to add information to the kernel, like the loading
and running address, the processors supported, the 4 Kb memory parameter
address, the text/video modes accepted at startup. This comment string
is unlimited (finishes at the next '\0').
Unfortunately there isn't any tools around to display or manipulate this
field, vi/emacs would work but are not the best tools.

So this patch create a file script/gzcopy.c and Makefile rules to produce
script/gzcopy which can be use to view, change (set/append/prepend) comment
to GZIP files. Type "./script/gzcopy --help" for a list of switches.
This first file (and only this one) is released under a BSD license to
enable anybody else to add it in a "GZIP distribution" if needed,
it follow special rules for indentation and a special way to define
strings so that localisation should be simpler.

This patch also contains the simple script/gzparam.c file and its
Makefile rules - that is a simple standalone program to display a text
line on stdout containing the base pattern to generate the GZIP comment
itself for this configured kernel.
It extract the Linux configuration using file
../include/linux/autoconf.h because that seems to be the easiest way
when compilation time is not a problem.
Just type "make script/gzparam && ./script/gzparam" to see the line
produced after the kernel configuration.

Signed-off-by: [email protected]






___________________________________________________________________________
Nouveau : t?l?phonez moins cher avec Yahoo! Messenger ! D?couvez les tarifs exceptionnels pour appeler la France et l'international.
T?l?chargez sur http://fr.messenger.yahoo.com


Attachments:
patch-2.6.15-mm1-1 (39.74 kB)
4104093663-patch-2.6.15-mm1-1

2006-01-06 00:03:05

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH 1/3] boot with Gujin: add script/{gzcopy.c,gzparam.c} to generate linux.kgz file format

Etienne Lorrain <[email protected]> wrote:
>
> So this patch create a file script/gzcopy.c and Makefile rules to produce
> script/gzcopy which can be use to view, change (set/append/prepend) comment
> to GZIP files. Type "./script/gzcopy --help" for a list of switches.
> This first file (and only this one) is released under a BSD license to
> enable anybody else to add it in a "GZIP distribution" if needed,
> it follow special rules for indentation and a special way to define
> strings so that localisation should be simpler.
>
> This patch also contains the simple script/gzparam.c file and its
> Makefile rules - that is a simple standalone program to display a text
> line on stdout containing the base pattern to generate the GZIP comment
> itself for this configured kernel.

Those sound like things which should be distributed in the gzip package,
not in the kernel source tree?

2006-01-06 11:56:22

by Etienne Lorrain

[permalink] [raw]
Subject: Re: [PATCH 1/3] boot with Gujin: add script/{gzcopy.c,gzparam.c} to generate linux.kgz file format

--- Andrew Morton <[email protected]> wrote:
> Etienne Lorrain <[email protected]> wrote:
> >
> > So this patch create a file script/gzcopy.c and Makefile
> > rules to produce script/gzcopy which can be use to view,
> > change (set/append/prepend) comment to GZIP files.
> > ...
> > This patch also contains the simple script/gzparam.c file
> > and its Makefile rules - that is a simple standalone
> > program to display a text line on stdout containing the
> > base pattern to generate the GZIP comment itself for
> > this configured kernel.
>
> Those sound like things which should be distributed in
> the gzip package, not in the kernel source tree?

The file script/gzparam.c is only related to GZIP by the
fact that the text line printed on stdout will be inserted
into the linux.kgz file as a GZIP comment, it has nothing to
do with the GZIP format itself.
If you make and execute this gzparam manually, you will
see a line (depending on .config) printed on stdout like:
min_gujin_version=0x102 maskcpu=0x800000F0 maskDflags=0x021 \
loadadr=0x100000 maskvesa=0x...
gzparam means: kernel parameters to be inserted in the
comment line of the GZIP kernel file - to get a linux.kgz

The file script/gzcopy.c would be better distributed in a
GZIP package if there was one such package and everybody
upgrades this package before trying to compile the kernel.
But that file can also be considered as a better way than
using a script with sed/awk/cut/cat - its basic use is a
single string manipulation (initialise and concatenate
text strings - and insert it in a file at a defined offset).
This utility is not made to evolve at all, and is so simple
it does not worth bothering - a bit like:
Linux/arch/i386/boot/tools/build.c .
Note that I also send a message to jloup at the GZIP
homepage, but I am not sure I want to add another dependency
on GZIP package to build the kernel.

Etienne.







___________________________________________________________________________
Nouveau : t?l?phonez moins cher avec Yahoo! Messenger ! D?couvez les tarifs exceptionnels pour appeler la France et l'international.
T?l?chargez sur http://fr.messenger.yahoo.com