Re: [PATCH] automatic module_init ordering

From: Sam Ravnborg (
Date: Sat Aug 03 2002 - 17:11:47 EST

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,\
        $(CONFIG_SHELL) -e scripts/build-initcalls $< $^ $@
And then move the contatenation of the .builtin_mods files to

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...

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Aug 07 2002 - 22:00:24 EST