how to save .config to ./arch/arm/configs/ in linux kernel configuration - linux

I have configuring the linux kernel 3.4. I have the defconfig file supplied by the chip vendor. I have applied the defconfig and then changed some more configuration using the menuconfig. Now i have the updated .config file.
I need to save this .config file into ./arch/arm/configs/ so that in future no need to redo the configurations I already did.
Thanks and Regards,
Giri

You can copy the .config manually to ./arch/arm/configs/(and probably add it to your version control also)
cp .config ./arch/arm/configs/CUSTOM_defconfig
And when you need to load this configuration just use:
make CUSTOM_defconfig

You can use buildroot utility to save your defconfig file using :
$> make savedefconfig
Then, you can find a file named "defconfig" in the same location of your .config file.

Related

Linux kernel defconfig options not in resulting .config using BuildRoot

I am building kernel version 2.6.39.4 via BuildRoot for an arm target.
I am using a custom defconfig file, into which I added the following 3 options:
CONFIG_WIRELESS=y
CONFIG_WEXT_PRIV=y
CONFIG_WIRELESS_EXT=y
In the resulting .config file for the kernel, the only option that I see out of the 3 I added to my defconfig is CONFIG_WIRELESS=y
Is this normal? I know some kernel config options are "hidden", but will that keep them from showing up in the final .config for the kernel?
Both WEST_PRIV and WIRELESS_EXT are blind options (i.e. they have no prompt, they are not visible in menuconfig/xconfig).
So you cannot simply set their value in a .config (or defconfig) file.
They are only enabled when another option selects them.
So you have to enable some relevent option that is visible, which will then automatically select WEXT_PRIV and WIRELESS_EXT.
I had the same issue, I solved it by just setting CONFIG_HOSTAP=y. This option causes the following option to be set as well:
CONFIG_WIRELESS=y
CONFIG_WIRELESS_EXT=y
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_WEXT_SPY=y
CONFIG_WEXT_PRIV=y
CONFIG_WLAN=y
CONFIG_LIB80211=y
CONFIG_LIB80211_CRYPT_WEP=y
CONFIG_LIB80211_CRYPT_CCMP=y
CONFIG_LIB80211_CRYPT_TKIP=y
I have verified that just setting CONFIG_HOSTAP=y in defconfig does indeed cause the above options to be enabled in .config when using buildroot.
here is the solution for some kernel versions :
https://lkml.org/lkml/2019/9/6/787
This patch adds parent that selects the wext_* configs.
later you need to go to your board config ie:
arch/arm/configs/imx_v7_android_defconfig
and add line:
CONFIG_WIRELESS_ALLCONFIG=y
then recompile the kernel , ie: on Android you do:
make -j32 kernelimage

Linux kernel configuration - enabling CONFIGURE_LOCALVERSION_AUTO

I have recently git cloned the kernel of Linus Torvalds. I want to build and install this kernel in my laptop. But because I want to use "kernel-of-the-day" I want to enable CONFIGURE_LOCALVERSION_AUTO option. But how should I enable this option I don't know that. Where to find this option?
Use menuconfig or xconfig, to configure Linux kernel these interfaces are used. Modifying .config file directly is discouraged. Inside your kernel source tree do make menuconfig or make xconfig - use anyone you like. On kernel configuration menu you'll find General Setup Option, inside this option you'll find Automatically append version information to the version string, toggle it to enable/disable.
After you have cloned the Linus repository repository. You would need to either create a fresh .config file in the ./linux folder or copy the existing config file from your /boot and later modify it. Then edit the .config file and set CONFIG_LOCALVERSION_AUTO=y
`cp /boot/config-`uname -r` .config`

when I run make menuconfig or make config how it works?

In a new kernel package there is two config files inside arch/x86/configs :
i386_defconfig 2. x86_64_defconfig
when I did make menuconfig, it generate .config file. But It has some default setting also. From where, it take these default setting ? Is it used one of these files or used from /boot directory or from some where else
same question for make config.
No, It won't pick the config file from /boot
It first determines the processor/OS architecture from $MACHTYPE of your system unless you explicitly mention "ARCH=" variable like in "make ARCH=arm menuconfig",
say
echo $MACHTYPE
x86_64-pc-linux-gnu
Then based on the found architecture, it gets the apt defconfig file from arch/found_arch/configs/apt_def_config_file
The default settings are present as files in the filesystem.
Execute: find . -name \*_defconfig inside your kernel sources.
The config files present in in /boot were most likely created by one of the packages you installed and not by the kernel build process itself.

how to revert back to default settings of make menuconfig

I am using ridgerun sdk..I made some settings in the config file through the command "make menuconfig"(but now i dont remember what settings i made). Now I want to cancel those settings in the config file and want the default settings. But the command "make mrproper" is not supported by Ridgerun sdk.Please suggest some solution for this.
The previous config file is renamed as .config.old Just copy it over the newer one
cp .config.old .config
Assuming RidgeRun SDK uses some derivative of the Linux kernel's kbuild then deleting (make sure to back it up first, of course!) the .config file in the build system's root folder will do the trick.

How do I configure the Linux kernel within Buildroot?

I'm trying to build a rootfs for an x86 target, which is all simple enough. However I can't figure out how I configure the kernel that buildroot produces. The first run through came up with menuconfig, but it's cached the .config since then and I can't see where to change it.
~650MB of kernel modules don't do good things to an embedded target :P
Is there an easy way to configure the kernel within buildroot? Something like the uclibc-menuconfig target would be perfect.
I always do the following:
configure Linux kernel: make linux-menuconfig
After leaving menuconfig your configuration will be stored in file: output/build/linux-XYZ/.config where XYZ is your kernel version.
After that you can copy file output/build/linux-*XYZ*/.config to board/your_kernel_config/.config
later in Buildroot menuconfig you can under kernel settings configure to use custom kernel config file and enter path: board/your_kernel_config/.config
Do not forget to set also defconfig to i386 in menuconfig:
Kernel —>
[*] Linux Kernel
(i386) Defconfig name
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES
Adds extra configs to your existing one.
E.g., if you are using buildroot as a submodule, the directory tree looks like:
.git/
buildroot/
.gitmodules
kernel-config-frag
E.g. to turn on CONFIG_DEBUG_FS, do:
echo 'CONFIG_DEBUG_FS=y' > kernel-config-frag
and then configure buildroot with:
cd buildroot
make qemu_x86_64_defconfig
echo 'BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES=../kernel-config-frag' >> buildroot/.config
make
This way you can git track just a diff between qemu_x86_64_defconfig and your extra configs.
I believe this uses scripts/kconfig/merge_config.sh form the kernel as mentioned at: How do you non-interactively turn on features in a Linux kernel .config file?
After you change the config fragment, just remember to do:
rm -rf buildroot/output/build/linux-*.*.*/
before the next build.
Minimal runnable example at: https://github.com/cirosantilli/linux-kernel-module-cheat/blob/bb8f4eb79565c9771356c80e0964c8fefc163e11/kernel-config-frag
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE
Selects the full .config to be used.
For some reason I have to nuke the kernel's .config for this to take effect? Why when I change BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE and run make linux-reconfigure the kernel .config does not change?
And the answer is:
make linux26-menuconfig
The steps are as follows:
cd buildroot/
make menuconfig
Kernel -> Linux Kernel -> Kernel version

Resources