Skip to content

Commit

Permalink
kernel.mk: Revert changes to align with PR SynoCommunity#4526 and Syn…
Browse files Browse the repository at this point in the history
  • Loading branch information
th0ma7 committed Apr 18, 2021
1 parent b357b65 commit 9587ad1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
7 changes: 2 additions & 5 deletions mk/spksrc.cross-env.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ ENV += INSTALL_PREFIX=$(INSTALL_PREFIX)

ifeq ($(strip $(REQUIRE_KERNEL)),1)
ENV += REQUIRE_KERNEL_MODULE="$(REQUIRE_KERNEL_MODULE)"
ENV += KERNEL_ROOT=$(WORK_DIR)/../../../kernel/syno-$(ARCH)-$(TCVERSION)/work/source/linux
KERNEL_ROOT=$(WORK_DIR)/../../../kernel/syno-$(ARCH)-$(TCVERSION)/work/source/linux
ENV += KERNEL_ROOT=$(WORK_DIR)/linux
KERNEL_ROOT=$(WORK_DIR)/linux
endif

ifeq ($(strip $(REQUIRE_TOOLKIT)),1)
Expand Down Expand Up @@ -37,9 +37,6 @@ ENV += TC=$(TC)
ENV += $(TC_ENV)
endif

# Always export the TC_TYPE (DSM or SRM)
ENV += TC_TYPE=$(TC_TYPE)

#ifneq ($(COMPILE_MAKE_OPTIONS),)
#ENV += MAKEFLAGS="$(COMPILE_MAKE_OPTIONS)"
#endif
25 changes: 17 additions & 8 deletions mk/spksrc.kernel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ include ../../mk/spksrc.kernel-flags.mk
NAME = $(KERNEL_NAME)
COOKIE_PREFIX = linux-
URLS = $(KERNEL_DIST_SITE)/$(KERNEL_DIST_NAME)
PKG_DIR = linux
PKG_NAME = linux
PKG_DIR = $(PKG_NAME)
ifneq ($(KERNEL_DIST_FILE),)
LOCAL_FILE = $(KERNEL_DIST_FILE)
# download.mk uses PKG_DIST_FILE
Expand All @@ -33,7 +34,11 @@ COMPILE_TARGET = nop
else
COMPILE_TARGET = kernel_module_compile_target
endif
COPY_TARGET = nop
# spksrc.install.mk called for PRE_INSTALL_PLIST
# in order to generate a work*/linux.plist.auto
# later used by spksr.plist.mk to generate the
# diff based on .ko kernel objects
INSTALL_TARGET = nop

#####

Expand All @@ -60,10 +65,16 @@ include ../../mk/spksrc.configure.mk
compile: configure
include ../../mk/spksrc.compile.mk

install: compile
include ../../mk/spksrc.install.mk

plist: install
include ../../mk/spksrc.plist.mk

clean:
rm -fr work work-*

all: compile
all: install plist

### For make digests
include ../../mk/spksrc.generate-digests.mk
Expand All @@ -79,8 +90,8 @@ kernel_configure_target:
@$(MSG) "Updating kernel Makefile"
$(RUN) sed -i -r 's,^CROSS_COMPILE\s*.+,CROSS_COMPILE\t= $(TC_PATH)$(TC_PREFIX),' Makefile
$(RUN) sed -i -r 's,^ARCH\s*.+,ARCH\t= $(KERNEL_ARCH),' Makefile
# Add "+" to EXTRAVERSION for kernels version >= 4.x
ifeq ($(call version_ge, ${TC_KERNEL}, 4),1)
# Add "+" to EXTRAVERSION for kernels version >= 4.4
ifeq ($(call version_ge, ${TC_KERNEL}, 4.4),1)
$(RUN) sed -i -r -e 's,^EXTRAVERSION\s*.+,&+,' -e 's,=\+,= \+,' Makefile
endif
test -e $(WORK_DIR)/arch/$(KERNEL_ARCH) || $(RUN) ln -sf $(KERNEL_BASE_ARCH) arch/$(KERNEL_ARCH)
Expand Down Expand Up @@ -115,9 +126,7 @@ kernel_module_compile_target:
@for module in $(REQUIRE_KERNEL_MODULE); \
do \
$(MAKE) kernel_module_build module=$$module ; \
done \
# Create PLIST including all modules
$(RUN) find $(INSTALL_DIR)/$(INSTALL_PREFIX) -type f -name *.ko | sed -e 's,.*\(module\),\1,g' -e 's,^,lib:lib/,' > ../PLIST
done

kernel_module_build:
@$(MSG) Building kernel module module=$(module)
Expand Down

0 comments on commit 9587ad1

Please sign in to comment.