Do kernel README :
"make localmodconfig" Create a config based on current config and loaded modules (lsmod). Disables any module option that is not needed for the loadedmodules.
To create a localmodconfig for another machine, store the lsmod of that machine into a file and pass it in as a LSMOD parameter.
target$ lsmod > /tmp/mylsmod target$ scp /tmp/mylsmod host:/tmp host$ make LSMOD=/tmp/mylsmod localmodconfig
The above also works when cross compiling.
"make localyesconfig" Similar to localmodconfig, except it will convert all module options to built in (=y) options.