From be6e35837afdcdb7c473cf5e9bcb94e2d821d8fe Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 17 Mar 2021 01:23:13 +0000 Subject: [PATCH] kernel.mk: Force setting TC_KERNEL with trailing + sign >= 4 The lack of commiting to exporting TC_KERNEL with the trailing '+' sign on kernels >= 4 to match Synology kernel EXTRA versioning complexifies the code throughout the Makefiles. This adds-up the '+' extra-version sign and alleviate the usage of multi-calls to version_* --- cross/rtl8812au/Makefile | 13 +------------ cross/rtl8814au/Makefile | 21 +++++++-------------- mk/spksrc.kernel.mk | 6 ------ 3 files changed, 8 insertions(+), 32 deletions(-) diff --git a/cross/rtl8812au/Makefile b/cross/rtl8812au/Makefile index 26468ab66eb..bd968aa5155 100644 --- a/cross/rtl8812au/Makefile +++ b/cross/rtl8812au/Makefile @@ -17,15 +17,9 @@ CONFIGURE_TARGET = nop COMPILE_TARGET = rtl8812au_compile INSTALL_TARGET = rtl8812au_install -#UNSUPPORTED_ARCHS = $(ARMv5_ARCHS) $(PPC_ARCHS) - include ../../mk/spksrc.cross-cc.mk -ifeq ($(call version_ge, ${TC_KERNEL}, 4),1) -PLIST_TRANSFORM = sed -e 's%@TC_KERNEL@%$(TC_KERNEL)+%' -else PLIST_TRANSFORM = sed -e 's%@TC_KERNEL@%$(TC_KERNEL)%' -endif .PHONY: rtl8812au_compile rtl8812au_compile: @@ -33,11 +27,6 @@ rtl8812au_compile: .PHONY: rtl8812au_install rtl8812au_install: -# Add "+" to EXTRAVERSION for kernels version >= 4.x -ifeq ($(call version_ge, ${TC_KERNEL}, 4),1) - $(RUN) mkdir -p $(INSTALL_DIR)$(INSTALL_PREFIX)/lib/modules/$(TC_KERNEL)+/kernel/drivers/net/wireless/ - @install -p -m 644 $(WORK_DIR)/$(PKG_DIR)/88XXau.ko $(INSTALL_DIR)$(INSTALL_PREFIX)/lib/modules/$(TC_KERNEL)+/kernel/drivers/net/wireless/ -else $(RUN) mkdir -p $(INSTALL_DIR)$(INSTALL_PREFIX)/lib/modules/$(TC_KERNEL)/kernel/drivers/net/wireless/ @install -p -m 644 $(WORK_DIR)/$(PKG_DIR)/88XXau.ko $(INSTALL_DIR)$(INSTALL_PREFIX)/lib/modules/$(TC_KERNEL)/kernel/drivers/net/wireless/ -endif + $(RUN) $(STRIP) --strip-debug $(INSTALL_DIR)$(INSTALL_PREFIX)/lib/modules/$(TC_KERNEL)/kernel/drivers/net/wireless/88XXau.ko diff --git a/cross/rtl8814au/Makefile b/cross/rtl8814au/Makefile index b560656a354..9f5d3b12229 100644 --- a/cross/rtl8814au/Makefile +++ b/cross/rtl8814au/Makefile @@ -17,15 +17,9 @@ CONFIGURE_TARGET = nop COMPILE_TARGET = rtl8814au_compile INSTALL_TARGET = rtl8814au_install -#UNSUPPORTED_ARCHS = $(ARMv5_ARCHS) $(PPC_ARCHS) - include ../../mk/spksrc.cross-cc.mk -ifeq ($(call version_ge, ${TC_KERNEL}, 4),1) -PLIST_TRANSFORM = sed -e 's%@TC_KERNEL@%$(TC_KERNEL)+%' -else PLIST_TRANSFORM = sed -e 's%@TC_KERNEL@%$(TC_KERNEL)%' -endif .PHONY: rtl8814au_compile rtl8814au_compile: @@ -33,17 +27,16 @@ rtl8814au_compile: .PHONY: rtl8814au_install rtl8814au_install: -# Add "+" to EXTRAVERSION for kernels version >= 4.x -ifeq ($(call version_ge, ${TC_KERNEL}, 4),1) - $(RUN) mkdir -p $(INSTALL_DIR)$(INSTALL_PREFIX)/lib/modules/$(TC_KERNEL)+/kernel/drivers/net/wireless/ - @install -p -m 644 $(WORK_DIR)/$(PKG_DIR)/8814au.ko $(INSTALL_DIR)$(INSTALL_PREFIX)/lib/modules/$(TC_KERNEL)+/kernel/drivers/net/wireless/ -else $(RUN) mkdir -p $(INSTALL_DIR)$(INSTALL_PREFIX)/lib/modules/$(TC_KERNEL)/kernel/drivers/net/wireless/ @install -p -m 644 $(WORK_DIR)/$(PKG_DIR)/8814au.ko $(INSTALL_DIR)$(INSTALL_PREFIX)/lib/modules/$(TC_KERNEL)/kernel/drivers/net/wireless/ -endif + $(RUN) $(STRIP) --strip-debug $(INSTALL_DIR)$(INSTALL_PREFIX)/lib/modules/$(TC_KERNEL)/kernel/drivers/net/wireless/8814au.ko + ################# # TODO: # 1) faire pointer le Makefile vers les cross-compilers - DONE -# 2) faire patch pour desactiver -Wimplicit-fallthrough=0 (rtl8812au uniquement) - TODO -# 3) AJOUTER $(STRIP) --strip-debug - TODO +# 2) faire patch pour desactiver -Wimplicit-fallthrough=0 (rtl8812au uniquement) - DONE +# 3) AJOUTER $(STRIP) --strip-debug - DONE +# 4) corriger le tc_vars pour TC_KERNEL avec + pour simplifier le code - DONE +# 5) corriger le spkclean vs REQUIRE_KERNEL - *TODO* +# 5) Repenser l'approche pour TC_TYPE - *TODO* ################# diff --git a/mk/spksrc.kernel.mk b/mk/spksrc.kernel.mk index 2cb5fbf593a..d34f881dea7 100644 --- a/mk/spksrc.kernel.mk +++ b/mk/spksrc.kernel.mk @@ -123,11 +123,5 @@ kernel_module_build: @$(MSG) Building kernel module module=$(module) $(RUN) LDFLAGS="" $(MAKE) -C $(WORK_DIR)/linux INSTALL_MOD_PATH=$(STAGING_INSTALL_PREFIX) modules M=$(word 2,$(subst :, ,$(module))) $(firstword $(subst :, ,$(module)))=m $(lastword $(subst :, ,$(module))).ko $(RUN) cat $(word 2,$(subst :, ,$(module)))/modules.order >> $(WORK_DIR)/linux/modules.order -# Install in directory tree with + suffix for kernels >= 4.0 -ifeq ($(call version_ge, ${TC_KERNEL}, 4),1) - $(RUN) mkdir -p $(STAGING_INSTALL_PREFIX)/lib/modules/$(TC_KERNEL)+/kernel/$(word 2,$(subst :, ,$(module))) - install -m 644 $(WORK_DIR)/linux/$(word 2,$(subst :, ,$(module)))/$(lastword $(subst :, ,$(module))).ko $(STAGING_INSTALL_PREFIX)/lib/modules/$(TC_KERNEL)+/kernel/$(word 2,$(subst :, ,$(module))) -else $(RUN) mkdir -p $(STAGING_INSTALL_PREFIX)/lib/modules/$(TC_KERNEL)/kernel/$(word 2,$(subst :, ,$(module))) install -m 644 $(WORK_DIR)/linux/$(word 2,$(subst :, ,$(module)))/$(lastword $(subst :, ,$(module))).ko $(STAGING_INSTALL_PREFIX)/lib/modules/$(TC_KERNEL)/kernel/$(word 2,$(subst :, ,$(module))) -endif