Re: [PATCH] automatic module_init ordering

From: Kai Germaschewski (
Date: Thu Aug 01 2002 - 22:19:04 EST

On Fri, 2 Aug 2002, Roman Zippel wrote:

> This is latest version of the automatic module_init ordering patch.
> IMO the patch is almost ready. A bit annoying problem is that
> -DKBUILD_MODNAME=unix becomes -DKBUILD_MODNAME=1. An undef helps
> of course, but I'm not sure whether we should put it on the command
> line or in the source.
> This patch depends on Kai's KBUILD_MODNAME patch.
> Kai, do you see any possible kbuild problem left? I hope I found
> everything. :)

> + for o in $(sort $(local-objs-y)); do \
> + if [ -n "$$($(OBJDUMP) -h $$o | grep .initcall.module)" ]; then \
> + echo $$o; \
> + fi \
> + done > $@; \
> + for s in $(sort $(subdir-y)); do \
> + sed "s,^,$$s/," < $$s/.builtin_mods; \
> + done >> $@

I had to replace this with

        for o in `echo $(sort $(local-objs-y))`; do \

and the like, since otherwise my shell (bash) would complain about an
empty "for o in ; do". Maybe there's a less hacky way to handle that?

BTW, it'd be also nice if scripts/build-initcalls would add some \n's to
init/generated-initcalls.c ;)

The "unix" thing is stupid. The obvious way around that is
-DKBUILD_MODNAME="unix", but unfortunately, I don't know of any
"unstringify" preprocessing function, so that doesn't work easily, either.

Well, I cannot think of a nicer solution there (and I tried ;), other than
these small issues things look very nice, though.


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:18 EST