-
Notifications
You must be signed in to change notification settings - Fork 10
/
vermagic.patch
32 lines (30 loc) · 1.24 KB
/
vermagic.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Index: config/Config-kernel.in
=====================================
--- config/Config-kernel.in
+++ config/Config-kernel.in
@@ -17,6 +17,12 @@ config KERNEL_SWAP
bool "Support for paging of anonymous memory (swap)"
default y
+config KERNEL_VERMAGIC
+ string "Specify vermagic for the build"
+ default ""
+ help
+ Specify kernel vermagic. Leave it empty if you don't know what it is.
+
config KERNEL_DEBUG_FS
bool "Compile the kernel with debug filesystem enabled"
default y
Index: include/kernel-defaults.mk
=====================================
--- include/kernel-defaults.mk
+++ include/kernel-defaults.mk
@@ -112,7 +112,9 @@
$(call Kernel/SetNoInitramfs)
rm -rf $(KERNEL_BUILD_DIR)/modules
$(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(MAKE) $(KERNEL_MAKEOPTS) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
- $(SH_FUNC) grep '=[ym]' $(LINUX_DIR)/.config | LC_ALL=C sort | md5s > $(LINUX_DIR)/.vermagic
+ VERMAGIC=`grep CONFIG_KERNEL_VERMAGIC $(TOPDIR)/.config | awk -F= '{print $$$$2}' | sed -e 's/"\(.*\)"/\1/g'`; \
+ [ -n "$$$$VERMAGIC" ] && echo $$$$VERMAGIC > $(LINUX_DIR)/.vermagic || \
+ ( $(SH_FUNC) grep '=[ym]' $(LINUX_DIR)/.config | LC_ALL=C sort | md5s > $(LINUX_DIR)/.vermagic )
endef
define Kernel/Configure/Initramfs