[Ksummit-discuss] [PATCH 2/2] kconfig: new command line kernel configuration tool

Linus Walleij linus.walleij at linaro.org
Sun Jul 9 03:56:47 UTC 2017


On Fri, Jul 7, 2017 at 11:02 AM, Dan Carpenter <dan.carpenter at oracle.com> wrote:

> Krzysztof Kozlowski wrote:
>> However why not extending existing scripts/config? It
>> already has the feature for setting kconfig options (without looking
>> at dependencies - so like >> of yours).
>
> I didn't know about scripts/config when I wrote it.  scripts/config is
> essentially a UI around "echo CONFIG_FOO=m >> .config".  It's totally
> useless.

Maybe useless for you but i use it every day in my work. To compile a kernel
for a purpose I have a custom makefile.mak in my top kernel dir
that calls scripts/config to set stuff up on-the-fly with multiple rules like
this:

config-base: FORCE
        @mkdir -p $(build_dir)
        @cp $(rootfs) $(build_dir)/$(rootfsbase)
        $(MAKE) $(make_options) u8500_defconfig

config-initramfs: have-rootfs config-base
        # Configure in the initramfs
        $(CURDIR)/scripts/config --file $(config_file) \
        --enable BLK_DEV_INITRD \
        --set-str INITRAMFS_SOURCE $(rootfsbase) \
        --enable RD_GZIP \
        --enable INITRAMFS_COMPRESSION_GZIP

(....)

config: config-common config-distro config-initramfs
        $(CURDIR)/scripts/config --file $(config_file) \
        --enable USE_OF \
        --enable ARM_APPENDED_DTB \
        --enable ARM_ATAG_DTB_COMPAT \
        --enable PROC_DEVICETREE
        yes "" | make $(make_options) oldconfig

For the full Makefile see:

https://dflund.se/~triad/krad/makefiles/ux500.mak

There are several of these, like some that create a minimal
i586 system with busybox on an initramfs:
https://dflund.se/~triad/krad/makefiles/i586.mak

I don't know if I am stupid in using this rather than config
fragments, but it works for me.

That said, what you have brewing looks better :)

Yours,
Linus Walleij


More information about the Ksummit-discuss mailing list