diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-02-26 06:51:58 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-02-26 06:51:58 -0800 |
| commit | ccec1be4cd369f9c1b5ca661950e5bbd600861db (patch) | |
| tree | 9ad54ce131daf475f0725aff0626f11e930b0faf /scripts/Makefile | |
| parent | f6455f35df182d8ba5751c099b5d356079051400 (diff) | |
[PATCH] Add a MODULE_VERSION macro
From: Rusty Russell <rusty@au1.ibm.com>
The way it works is that the .mod file contains the name of the module (as
before), but succeeding lines are the constituent parts (assumed to be .c
files, which usually works: if they use MODULE_VERSION in a file for which
this isn't true we'll get a warning).
As we postprocess modules, we look in the .modinfo section for a
"version=", which is placed by the MODULE_VERSION() macro. This will be of
form "version=<macroarg>" "\0" [24 chars] "\0". The 24 chars are replaced
by the md4 sum of the .c files and any files they #include using '#include
"file"' which are found in the current directory. Whitespace is collapsed
outside strings, and comments are ignored for purposes of the sum.
The result is a .modinfo entry such as
version=1.16ac-rustytest B13E9451C4CA3B89577DEFF
At the kernel summit, various people asked for a MODULE_VERSION macro to
store module strings (for later access through sysfs). A simple md4 is
needed to identify changes in modules which, inevitably, do not update the
version. It skips whitespace and comments, and includes #includes which
are in the same dir.
The module versions should be set according to this definition, based on
the RPM one, or CVS Revision tags. Violators will be shot.
[<epoch>`:']<version>[`-'<extraversion>]
<epoch>: A (small) unsigned integer which allows you to start versions
anew. If not mentioned, it's zero. eg. "2:1.0" is after
"1:2.0".
<version>: The <version> may contain only alphanumerics.
<extraversion>: Like <version>, but inserted for local
customizations, eg "rh3" or "rusty1".
Comparison of two versions (assuming same epoch):
Split each into all-digit and all-alphabetical parts. Compare each one one
at a time: digit parts numerically, alphabetical in ASCII order. So 0.10
comes after 0.9.
Diffstat (limited to 'scripts/Makefile')
| -rw-r--r-- | scripts/Makefile | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/Makefile b/scripts/Makefile index c03384ce37ae..044afd55a77d 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -12,7 +12,7 @@ host-progs := fixdep split-include conmakehash docproc kallsyms modpost \ mk_elfconfig pnmtologo bin2c always := $(host-progs) empty.o -modpost-objs := modpost.o file2alias.o +modpost-objs := modpost.o file2alias.o sumversion.o subdir-$(CONFIG_MODVERSIONS) += genksyms @@ -24,7 +24,7 @@ $(addprefix $(obj)/,$(filter-out fixdep,$(always)) $(subdir-y)): $(obj)/fixdep # dependencies on generated files need to be listed explicitly -$(obj)/modpost.o $(obj)/file2alias.o: $(obj)/elfconfig.h +$(obj)/modpost.o $(obj)/file2alias.o $(obj)/sumversion.o: $(obj)/elfconfig.h quiet_cmd_elfconfig = MKELF $@ cmd_elfconfig = $(obj)/mk_elfconfig $(ARCH) < $< > $@ |
