I purchased an embedded (arm-based) Linux SBC and the manufacturer included an SD card with Ubuntu prebuilt.
I'm trying to recompile the kernel and modules to reproduce what the manufacturer shipped. I'm using their kernel source and the config I found on /boot however there's a huge size difference between their modules and mine. My modules folder compiles to 147MB whereas theirs is 8.9MB.
I thought perhaps I was somehow compiling extra modules however I compared .ko files individually and mine are consistently much larger.
I gather it is possible to compress modules via CONFIG_MODULE_COMPRESS_* however this what is in the config within /boot:
CONFIG_MODULE_COMPRESS_NONE=y# CONFIG_MODULE_COMPRESS_GZIP is not set# CONFIG_MODULE_COMPRESS_XZ is not set# CONFIG_MODULE_COMPRESS_ZSTD is not set
Could the manufacturer have overridden the compression settings when make modules
was run? How else could the size difference be explained?
FWIW I'm cross-compiling from my x86 Ubuntu desktop to ARM, using the following commands:
make -j4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LOCALVERSION=-kstr-sama5d27 zImagemake modules -j4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LOCALVERSION=-kstr-sama5d27make modules_install INSTALL_MOD_PATH=./modules ARCH=arm LOCALVERSION=-kstr-sama5d27
I see some guides recommend adding INSTALL_MOD_STRIP=1
to the install_modules command to reduce module size however this leads me to an error:
strip: unable to recognise the format of the input file