Re: [PATCH] automatic module_init ordering

Sam Ravnborg (sam@ravnborg.org)
Sun, 4 Aug 2002 00:11:47 +0200


On Fri, Aug 02, 2002 at 08:17:17PM -0500, Kai Germaschewski wrote:
> Yeah. Still not exactly clean. Another suggestion I got was
>
> + objs="$(sort $(local-objs-y))"; for o in $$objs; do \
>
> from Alex Riesen. This one looks the nicest to me.
Looks indeed better!
But in order to avoid malfunction for the directories where there
is no initcalls you still need to fiddle with $(if $(local-objs-y)
and similar for subdir-y.
The trick is to add only the needed number of ';', no more no less.
Try playing around with:

$> make mrproper allnoconfig
$> make

Another issue that I noticed after submitting the patch was that
due to the fact the 'echo' in gen_build... always create a .builtin_mods
file, there appear a number of lines only listing an empty directory
witin .allbuiltin_mods.
I would recommend to
1) Use sed to get rid of the empty lines,
2) to do something like this in the Makefile:
init/generated-initcalls.c: $(wildcard $(addsuffix /.builtin_mods,\
$(dir $(CORE_FILES) $(LIBS) $(DRIVERS) $(NETWORKS)))
$(CONFIG_SHELL) -e scripts/build-initcalls $< $^ $@
And then move the contatenation of the .builtin_mods files to
build-initcalls.

Giving the above a second thought I do not understand the usage of
"$^" when generating .allbuiltin_mods. Don't you miss initcalls in subdirs
that are not being updated?
I would say that an all or nothing approach is more correct.

Another issue:
If I do:
$> find -name '.builtin_mods' | xargs rm -f
$> make
the .builtin_mods files are not regenerated. Some rule are missing...

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/