Skip to main content
1 of 4
Pro Backup
  • 5.1k
  • 14
  • 58
  • 87

The make localmodconfig command is still the right tool for the job. In fact make localmodconfig runs scripts/kconfig/streamline_config.pl.

###File input When reading the streamline_config.pl (perl) source code, there is an undocumented feature my $lsmod_file = $ENV{'LSMOD'}; that allows file input for loaded module detection instead of the output from the lsmod command.

###Live CD Because localmodconfig uses the output lsmod to detect the loaded modules. We run a Ubuntu Live CD on each of the different hardware setups, open a terminal (Ctrl+Alt+T), run lsmod and save its output.

###Concatenate output By concatenating the lsmod output files while stripping consecutive headers lines you can quickly create an input file that covers all your required kernel modules. We like to review the module list by hand and use a more manual recipe:

  1. $ cd linux-3.11.0/
    or go the directory where you will run your make command

  2. $ lsmod > lsmod.txt
    creates a text file with your loaded modules

  3. $ nano lsmod.txt
    will open the nano text editor, of course you can use your favorite editor application

  4. Append your desired modules that are not already there, to the bottom of this file (see for an example the bottom of this anwer), and save it when you are ready.
    Note: use spaces not tabs to match the column tabulator positions.

  5. $ export LSMOD="lsmod.txt"
    this will tell localmodconfig to use you file as input for loaded modules detection

  6. $ make localmodconfig as usual


###Example for what to append and not append to lsmod.txt (step 4):

Because the Intel D33217CK main board has Intel thermal sensors that we would like to read, we appended these lines:

x86_pkg_temp_thermal   13810  0
intel_powerclamp       14239  0

But we don't want to run virtual machines on this hardware, that is why we skipped these lines:

kvm_intel             128218  0
kvm                   364766  1 kvm_intel

It has an Apple (Broadcom) Gibabit ethernet adapter connected to its Thunderbolt port, so we appended:

tg3                   152066  0
ptp                    18156  1 tg3
pps_core               18546  1 ptp

We think we don't need volume mirroring, and therefor did not append:

dm_mirror              21715  0
dm_region_hash         15984  1 dm_mirror
dm_log                 18072  2 dm_region_hash,dm_mirror

And we also don't need graphics output (text will do on a headless server), so we did not include:

i915                  589697  3
i2c_algo_bit           13197  1 i915
drm_kms_helper         46867  1 i915
drm                   242354  4 i915,drm_kms_helper

For another machine we needed this Realtek ethernet driver:

r8169                  61434  0
mii                    13654  1 r8169
Pro Backup
  • 5.1k
  • 14
  • 58
  • 87