0
votes

I seem to successfully build a kernel image, but I can not generate all the modules I expect. I expect more modules since I see them enabled in the gconfig window. Here is a copy of my make session. Seems like make goes into the devices directories. I can not figure out why it is not create the .ko files. I expect to see .ko files. I have checked the Makefile in /drivers directory, and I can see that it is configured with a number of lines like

obj-$(CONFIG_PCI)               += pci/

Which directs make to build the pci module for instance. I think this implies that I should see a number .ko files. But I do not. I have seen just one .ko file for scsi module. I like to be able to build all of modules selected.

I also verified that a number of mudules are enabled when I issued:

make VARIANT_DEFCONFIG=msm8974_sec_hlte_spr_defconfig msm8974_sec_defconfig SELINUX_DEFCONFIG=selinux_defconfig gconfig

But as I said, I do not see any of them. What am I missing please?

@Subin - Thanks. I just tried make modules_install. I have to mention that I am cross compiling this for an arm target. I believe modules_install is for the purpose of installing the driver for the machine you are on? I got a message about needing to be in root, and I did not proceed. I have been wondering when I need to run it. What does it do exactly please?

Re: the make modules; I have run it before. I'll run it again and post the result. Since I got one .ko file I figured the issue is something different between that one module, and every other one enabled in my config. Here is what I got when I ran make modules:

sansari@ubuntu:~/WORKING_DIRECTORY$ make modules
CHK     include/linux/version.h
CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL    scripts/checksyscalls.sh
Building modules, stage 2.
MODPOST 1 modules

Re: your comment on the location of .ko files, I am doing a find to see if perhaps I am not looking at the right place, it only finds the one which was built. Not the other ones. Here is the output:

sansari@ubuntu:~/WORKING_DIRECTORY$ find . -type f -name "*.ko"
./drivers/scsi/scsi_wait_scan.ko
sansari@ubuntu:~/WORKING_DIRECTORY$ 

Should I perhaps run make v=1, in verbose mode that is? Would that provide more information on why the other modules are not built?

@Gil Hamilton - Thanks. You are right. Here is an excerpt of the .config file:

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set
# CONFIG_BLK_DEV_SR is not set
CONFIG_CHR_DEV_SG=y
CONFIG_CHR_DEV_SCH=y
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_SCAN_ASYNC=y
CONFIG_SCSI_WAIT_SCAN=m

This entry is the only one set to 'm'.

1
Have you run "make modules" and/or "make modules_install" ? If you want the modules in a specific directory, do "export INSTALL_MOD_PATH=<path>" before make modules_install. Else look in /lib/modules/<kernel version>/subin

1 Answers

0
votes

Most device driver modules in the linux kernel build system use a tristate (3-valued) configuration setting. The options are

  • 'n' (don't build at all),
  • 'y' (build and link statically into the main kernel object), and
  • 'm' (build as module for dynamic loading).

The values are determined by the content of .config. The values in .config are usually generated from an existing config file (look in arch/<ARCH>/configs for your <ARCH>). Also check the output of 'make help' for interesting configuration targets.

If you're not seeing the .ko files being created, that indicates the corresponding configuration variable is either set to 'y' or 'n'.