I have a situation here where I need to build same kernel against different configs. Now I was trying to build the kernel without doing a make clean but this gives me problem. There is possibility that one config has some drivers as built in and other may have same drive as a module. In my case, I want to avoid make clean to save time! Compiling a fresh kernel takes allot time and since, I've compiled the same kernel before with only few driver/modules changed, I would like to know any alternate option than cleaning the whole kernel.
Thanks!
You don’t have to rebuild the complete kernel if you are just working on a few modules. However, if your module requires changes to .config then do the steps below everytime to get a module built for a specific .config
modify/copy the .config as per the requirement into the src dir
make prepare
make scripts
make modules_prepare
make M=drivers/<some driver>
make M=drivers/<some driver> clean
Lets say you just want to compile wireless module only.
Now its files are under Linux_kernel/net/wireless folder
to compile only wireless modules.
cd Linux_kernel
make ARCH=arm modules M=$(pwd)/net/wireless/
It will generate two modules
Linux_kernel/net/wireless/cfg80211.ko
Linux_kernel/net/wireless/lib80211.ko
Now to clean these module
make ARCH=arm modules M=$(pwd)/net/wireless/ clean
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With