Issue
I need to build kernel to have vermagic
3.10.28-gbc1b510-33899-g9fa745e SMP preempt mod_unload modversions ARMv7
but after building and verification some module via modinfo it displays
3.10.28 preempt mod_unload modversions ARMv6
Looks like I can't load module because different vermagic. How to build kernel and modules for vermagic to be axactly the same ?. I'm using buildroot.
I created this shell script in order to prepare for build
#!/bin/sh
export PATH=$PATH:/buildroot-2018.02.3/output/host/arm-buildroot-linux-gnueabi/bin:/buildroot-2018.02.3/output/host/bin:/buildroot-2018.02.3/output/host/sbin:/buildroot-2018.02.3/output/host/bin
export LD_LIBRARY_PATH=/buildroot-2018.02.3/output/host/lib
export LIBRARY_PATH=/buildroot-2018.02.3/output/host/lib
export PKG_CONFIG_PATH=/buildroot-2018.02.3/output/host/arm-buildroot-linux-gnueabi/sysroot/usr/lib/pkgconfig
exec /bin/bash
then I enter folder
/buildroot-2018.02.3/output/build/linux-3.10.28/
and
make distclean
make clean
then copy .config and
make ARCH=arm menuconfig
and
make -j9 ARCH=arm
I'm using original kernel konfig with additionaly selected a few options to build as modules without modifications of any other.
Solution
There is linux-3.10.28/arch/arm/Makefile file. In this file there are those defines
arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
I found suggestion somewhere which lead me to replace
arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
with
arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
I olso uncommented these two:
tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
tune-$(CONFIG_CPU_V6K) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
I added
-gbc1b510-33899-g9fa745e SMP
as local_version in kernel .config
and now version string print by modinfo is the same.
Answered By - Daro