User Tools

Site Tools


kernel_modules

This is an old revision of the document!


Kernel Modules

The unit runs 4.9.166-fsl-imx-INIT-004, built from NXP's linux-imx tree at tag v4.9.166, with INIT's patches on top. The running config is /proc/config.gz. The stock build used OSELAS.Toolchain-2018.12.0 (gcc 8.2.1), per /proc/version.

The kernel is uniprocessor. CONFIG_SMP is not set, so only CPU0 comes up even though the i.MX6DL has two cores. It is a config choice, not a hardware limit, and it changes what /proc/cpuinfo and the scheduler look like:

zcat /proc/config.gz | grep CONFIG_SMP
# CONFIG_SMP is not set
cat /proc/cpuinfo

Stock modules

List what shipped with the image:

find /lib/modules/$(uname -r) -type f -name '*.ko'

The image ships 36. By family:

family modules
USB serial ftdi_sio, usbserial
video, backlight coda, v4l2-mem2mem, videobuf2-vmalloc, lcd
crypto cmac, xor, crc8, sha1-arm-neon, sha256-arm, xor-neon
filesystems btrfs, cifs, fat, vfat, ntfs, squashfs, fscache
NFS nfs, nfsv3, nfsv4, lockd, grace, sunrpc, auth_rpcgss
netfilter ip_tables, x_tables, xt_tcpudp, nf_reject_ipv4
WiFi mac80211, wlcore, wlcore_sdio, wl18xx
lib raid6_pq, oid_registry

ftdi_sio is the barcode bridge on ttyUSB0. The CAAM crypto engine is built in, not a module, and registers its algorithms in /proc/crypto. It has nothing to do with the cVEND HSM.

Building

Dockcross works for this. Use the dockcross/linux-armv7-lts container.

  1. Fetch the matching source: nxp-imx/linux-imx at v4.9.166. The tag is the base version from uname -r, so 4.9.166 for 4.9.166-fsl-imx-INIT-004.
  2. Copy /proc/config.gz off the unit and gunzip it to .config in the source root.
  3. Set CONFIG_LOCALVERSION_AUTO=n.
  4. Set what you need to m. CONFIG_SLIP=m builds drivers/net/slip/slip.ko, and the same pattern applies elsewhere.
  5. Set EXTRAVERSION = -fsl-imx-INIT-004 in the top-level Makefile. Take the suffix from uname -r if yours differs.
  6. In scripts/dtc/dtc-lexer.lex.c and scripts/dtc/dtc-lexer.lex.c_shipped, change YYLTYPE yylloc; to extern YYLTYPE yylloc;.
  7. Commit the tree. Uncommitted files add -dirty to the version magic.
  8. Build with make LOCALVERSION= -C . modules. Inside Dockcross you may need sudo make.
  9. scp the module over and insmod it. If it refuses, check dmesg.

Problems

A module built against the wrong config or tree fails to load with:

version magic '4.9.166-fsl-imx-INIT-004+ preempt ARMv7 p2v8 ' should be '4.9.166-fsl-imx-INIT-004 preempt ARMv7 p2v8 '
version magic '4.9.166-fsl-imx-INIT-004-dirty preempt ARMv7 p2v8 ' should be '4.9.166-fsl-imx-INIT-004 preempt ARMv7 p2v8 '

The trailing + means CONFIG_LOCALVERSION_AUTO picked up a git version. -dirty means the tree had uncommitted changes. Check:

  • CONFIG_LOCALVERSION_AUTO=n in .config.
  • LOCALVERSION= on the make line.
  • A clean git status.
kernel_modules.1795395101.txt.gz · Last modified: by qkb