Changing hikey_defconfig

Hello. I’ve been trying to add some configurations for device drivers that I need to work with.

Since, changing .config file is just a temporary thing, I wanted to add some configurations directly on ~/hikey_linaro/arch/arm64/configs/hikey_defconfig file.

I found out that for some configurations, it is automatically added to .config file as I compile the hikey kernel.
However, some other configurations, they are not added to .config after compilation.

For instance, currently I’m trying to add CONFIG_VIDEOBUF2_VMALLOC and CONFIG_USB_PHY.
I cannot find those in .config file even after I run those two commands.

  • make ARCH=arm64 hikey_defconfig
  • make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j24
  1. Does anyone know how .config file is generated? (I could not find any useful sources on other websites.)

  2. Moreover, could anyone also suggest a way to make those configurations to be generated into .config file?

Thank you in advance for your help!

There are Kconfig files parsed at build time which are distributed across the build directory tree which describes the configuration symbols and among other things the relationships between symbols that rule a valid configuration combinations. One problem which is usually meet is when adding manually a configuration symbol without satisfying its dependencies, the symbol is then just discarded since the configuration is not valid.

I suggest you to use one of the available Linux kernel configuration tools, config, menuconfig, xconfig…
This should allow you to add/remove configuration without worrying about config symbol validity / dependencies.

  1. Import your base config file (hikey_defconfig) (saved in .config):
    $ export ARCH=arm64
    $ make hikey_defconfig

  2. Use config management tool to upgrade the config (saved in .config):
    $ make menuconfig

  3. (optional) Save your config file as ‘defconfig’ file.
    $ make savedefconfig

  4. build your kernel
    $ make CROSS_COMPILE=aarch64-linux-android- -j24

Note: You can walk through the config tree, or if looking for a particular symbol, use the search command to access or see the symbol directly (e.g slash with menuconfig).

Thank you for your help!