Permalink
Browse files

Add MODULE_LOOSE_VERMAGIC option for compatibility with EH17 vermagic.

Avoids the problem where proprietary modules have a vermagic of
"2.6.35.7 preempt mod_unload ARMv7", and our kernels use ones like
"2.6.35.7-g1b570a1-dirty preempt mod_unload ARMv7".  This keeps the
otherwise-useful local version, but retains module compatibility across
kernel builds.

Change-Id: I7c43bdd62614a919a372085f66a9e1cf247e6f25
  • Loading branch information...
1 parent 6e520ec commit f90d862ea898a03849cf6b5ff94effd161552988 @mkasick mkasick committed with jt1134 Nov 1, 2011
Showing with 24 additions and 6 deletions.
  1. +8 −0 Makefile
  2. +1 −0 arch/arm/configs/p1_defconfig
  3. +0 −5 build_kernel.sh
  4. +8 −1 include/linux/vermagic.h
  5. +7 −0 init/Kconfig
View
@@ -914,6 +914,7 @@ endif
prepare2: prepare3 outputmakefile
prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \
+ include/generated/kernelversion.h \
include/config/auto.conf
$(cmd_crmodverdir)
@@ -947,12 +948,19 @@ define filechk_version.h
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
endef
+define filechk_kernelversion.h
+ (echo \#define KERNELVERSION \"$(KERNELVERSION)\";)
+endef
+
include/linux/version.h: $(srctree)/Makefile FORCE
$(call filechk,version.h)
include/generated/utsrelease.h: include/config/kernel.release FORCE
$(call filechk,utsrelease.h)
+include/generated/kernelversion.h: $(srctree)/Makefile FORCE
+ $(call filechk,kernelversion.h)
+
PHONY += headerdep
headerdep:
$(Q)find include/ -name '*.h' | xargs --max-args 1 scripts/headerdep.pl
@@ -153,6 +153,7 @@ CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_MODULE_LOOSE_VERMAGIC=y
CONFIG_BLOCK=y
CONFIG_LBDAF=y
# CONFIG_BLK_DEV_BSG is not set
View
@@ -2,9 +2,6 @@
TREE="device/samsung/vzwtab"
-#SRSLYWTF
-mv .git DONTLOOKATME
-
make clean mrproper
make ARCH=arm p1_defconfig
@@ -17,5 +14,3 @@ done
make -j8
cp arch/arm/boot/zImage ../../../"$TREE"/kernel
-mv DONTLOOKATME .git
-
View
@@ -1,3 +1,4 @@
+#include <generated/kernelversion.h>
#include <generated/utsrelease.h>
#include <linux/module.h>
@@ -26,8 +27,14 @@
#define MODULE_ARCH_VERMAGIC ""
#endif
+#ifdef CONFIG_MODULE_LOOSE_VERMAGIC
+#define MODULE_VERMAGIC_RELEASE KERNELVERSION " "
+#else
+#define MODULE_VERMAGIC_RELEASE UTS_RELEASE " "
+#endif
+
#define VERMAGIC_STRING \
- UTS_RELEASE " " \
+ MODULE_VERMAGIC_RELEASE \
MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \
MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS \
MODULE_ARCH_VERMAGIC
View
@@ -1271,6 +1271,13 @@ config MODULE_SRCVERSION_ALL
the version). With this option, such a "srcversion" field
will be created for all modules. If unsure, say N.
+config MODULE_LOOSE_VERMAGIC
+ bool "Do not include local version in vermagic string"
+ help
+ Use KERNELVERSION instead of (and which is a subset of) UTS_RELEASE in
+ the vermagic string. This allows compatibility with proprietary modules
+ that do not append any local version to UTS_RELEASE.
+
endif # MODULES
config INIT_ALL_POSSIBLE

0 comments on commit f90d862

Please sign in to comment.