Re: Feedback on "kbuild: generate modules.builtin"

From: Michal Marek
Date: Fri Sep 25 2009 - 07:04:39 EST


Sam Ravnborg napsal(a):
> On Fri, Sep 18, 2009 at 12:49:29PM -0700, akpm@xxxxxxxxxxxxxxxxxxxx wrote:
>> From: Michal Marek <mmarek@xxxxxxx>
>>
>> To make it easier for tools like mkinitrd to detect whether a needed
>> module is missing or whether it is compiled into the kernel, install a
>> modules.builtin file listing all modules built into the kernel. This is
>> done by generating an alternate config file with all tristate =y options
>> set to =Y and reading the makefiles with this config included. The built
>> in modules then appear in obj-Y.
>
> Hi Michael.
>
> [Added Steven on cc: as he had done some kconfig
> hacking lately].
>
> Got some time (finally) to look at this.
> I understand the functionality and I have myself had the need
> to see builtin modules.

Hi Sam,

many thanks for the review and for the patch, I basically agree with all
what you said, except this one:

>> diff -puN Makefile~kbuild-generate-modulesbuiltin Makefile
>> --- a/Makefile~kbuild-generate-modulesbuiltin
>> +++ a/Makefile
>> @@ -871,6 +871,9 @@ $(sort $(vmlinux-init) $(vmlinux-main))
>> PHONY += $(vmlinux-dirs)
>> $(vmlinux-dirs): prepare scripts
>> $(Q)$(MAKE) $(build)=$@
>> +ifdef CONFIG_MODULES
>> + $(Q)$(MAKE) $(modbuiltin)=$@
>> +endif
>
> The other stuff we run after a completed build is the
> target vmlinux: just above.
> If there is no good reason not to do so please move
> it so we keep all these post processing steps in one place.

The reason is that I need to iterate over $(vmlinux-dirs) to descend
into subdirectories like Makefile.build does. Putting the command here
allows to just write $(MAKE) $(modbuiltin)=$@ and be done, in the
vmlinux target I would have to do the iteration manually.

I'll provide an updated patch soon.

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