Clean only selected modules before building linux kernel

I have a situation where I need to build the same kernel for different configurations. Now I tried to build a kernel without doing any cleanup, but this creates problems. There is a possibility that one configuration has multiple drivers as built-in, while another may have the same drive as the module. In my case, I want to avoid cleaning to save time! Compiling a new kernel takes a long time and since then I have compiled the same kernel before only a few drivers / modules have changed, I would like to know any alternative than clearing the whole kernel.

Thank!

+3


source to share


2 answers


You don't need to rebuild the full kernel if you are just working on multiple modules. However, if your module requires changes in .config

, follow these steps each time 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

      

+3


source


Let's say you just want to compile only the wireless module. Now its files are in the folderLinux_kernel/net/wireless

to compile only wireless modules.

cd Linux_kernel
make ARCH=arm modules M=$(pwd)/net/wireless/

      

It will generate two modules



Linux_kernel / network / wireless / cfg80211.ko

Linux_kernel / networking / wireless / lib80211.ko

Now to clear the module

make ARCH=arm modules M=$(pwd)/net/wireless/ clean

      

+2


source







All Articles