summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/build.mk6
-rw-r--r--mk/image.mk4
-rw-r--r--mk/kernel-build.mk41
-rw-r--r--mk/package.mk2
-rw-r--r--scripts/make-module-ipkgs.sh3
-rw-r--r--target/Makefile2
-rw-r--r--target/arm/Makefile2
7 files changed, 28 insertions, 32 deletions
diff --git a/mk/build.mk b/mk/build.mk
index 0b4b9feee..69ff9e3d8 100644
--- a/mk/build.mk
+++ b/mk/build.mk
@@ -176,7 +176,7 @@ ifeq ($(ADK_TARGET_OS_BAREMETAL),y)
$(MAKE) -f mk/build.mk package/hostcompile toolchain/final
endif
ifeq ($(ADK_TARGET_OS_LINUX),y)
- $(MAKE) -f mk/build.mk package/hostcompile toolchain/final target/config-prepare target/compile package/compile root_clean package/install target/install package_index
+ $(MAKE) -f mk/build.mk package/hostcompile toolchain/final target/config-prepare target/compile package_clean package/compile root_clean package/install target/install package_index
endif
endif
@@ -252,6 +252,10 @@ newpackage:
$(SED) 's#@VER@#$(VER)#' $(ADK_TOPDIR)/package/$(PKG)/Makefile
@echo "Edit package/$(PKG)/Makefile to complete"
+package_clean:
+ rm -rf $(PACKAGE_DIR)
+ mkdir -p $(PACKAGE_DIR)
+
root_clean:
rm -rf $(TARGET_DIR)
mkdir -p $(TARGET_DIR)
diff --git a/mk/image.mk b/mk/image.mk
index 84d6ab9a8..65332bd4b 100644
--- a/mk/image.mk
+++ b/mk/image.mk
@@ -146,14 +146,14 @@ endif
${FW_DIR}/${ROOTFSTARBALL}: ${TARGET_DIR}/.adk kernel-package
cd ${TARGET_DIR}; find . | sed -n '/^\.\//s///p' | sort | \
- $(CPIO) -o -Hustar --owner=0:0 | $(XZ) -c >$@
+ $(CPIO) --quiet -o -Hustar --owner=0:0 | $(XZ) -c >$@
ifeq ($(ADK_TARGET_QEMU),y)
@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
endif
${FW_DIR}/${ROOTFSUSERTARBALL}: ${TARGET_DIR}/.adk
cd ${TARGET_DIR}; find . | grep -v ./boot/ | sed -n '/^\.\//s///p' | sort | \
- $(CPIO) -o -Hustar --owner=0:0 | $(XZ) -c >$@
+ $(CPIO) --quiet -o -Hustar --owner=0:0 | $(XZ) -c >$@
${STAGING_TARGET_DIR}/${INITRAMFS}_list: ${TARGET_DIR}/.adk
env PATH='${HOST_PATH}' $(BASH) ${LINUX_DIR}/scripts/gen_initramfs_list.sh -u squash -g squash \
diff --git a/mk/kernel-build.mk b/mk/kernel-build.mk
index 65d3baba9..5db052c33 100644
--- a/mk/kernel-build.mk
+++ b/mk/kernel-build.mk
@@ -31,6 +31,10 @@ KERNEL_FILE:=vmlinux
KERNEL_TARGET:=$(ADK_TARGET_KERNEL)
endif
+ifneq ($(KERNEL_MODULES_USED),)
+KERNEL_TARGET+=modules
+endif
+
ifeq ($(ADK_RUNTIME_DEV_UDEV),y)
ADK_DEPMOD:=$(STAGING_HOST_DIR)/usr/bin/depmod
else
@@ -53,7 +57,6 @@ endif
$(LINUX_DIR)/.config: $(LINUX_DIR)/.prepared
$(START_TRACE) "target/$(ADK_TARGET_ARCH)-kernel-configure.. "
- -for f in $(TARGETS);do if [ -f $$f ];then rm $$f;fi;done
echo "-${KERNEL_RELEASE}" >${LINUX_DIR}/localversion
ifeq ($(ADK_TARGET_KERNEL_USE_DEFCONFIG),y)
${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} $(ADK_TARGET_KERNEL_DEFCONFIG) $(MAKE_TRACE)
@@ -67,22 +70,19 @@ else
$(CP) $(BUILD_DIR)/.kernelconfig $(LINUX_DIR)/mini.config
${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} KCONFIG_ALLCONFIG=mini.config allnoconfig $(MAKE_TRACE)
endif
- touch -c $(LINUX_DIR)/.config
$(CMD_TRACE) " done"
$(END_TRACE)
$(LINUX_DIR)/$(KERNEL_FILE): $(LINUX_DIR)/.config
$(START_TRACE) "target/$(ADK_TARGET_ARCH)-kernel-compile.. "
${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} -j${ADK_MAKE_JOBS} $(KERNEL_TARGET) $(MAKE_TRACE)
- touch -c $(LINUX_DIR)/$(KERNEL_FILE)
$(CMD_TRACE) " done"
$(END_TRACE)
-$(LINUX_BUILD_DIR)/modules: $(LINUX_DIR)/$(KERNEL_FILE)
- $(START_TRACE) "target/$(ADK_TARGET_ARCH)-kernel-modules-compile.. "
- ${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} -j${ADK_MAKE_JOBS} modules $(MAKE_TRACE)
- $(CMD_TRACE) " done"
- $(END_TRACE)
+prepare:
+compile: $(LINUX_DIR)/$(KERNEL_FILE)
+install:
+ifneq ($(KERNEL_MODULES_USED),)
$(START_TRACE) "target/$(ADK_TARGET_ARCH)-kernel-modules-install.. "
rm -rf $(LINUX_BUILD_DIR)/modules
${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} \
@@ -91,9 +91,9 @@ $(LINUX_BUILD_DIR)/modules: $(LINUX_DIR)/$(KERNEL_FILE)
modules_install $(MAKE_TRACE)
$(CMD_TRACE) " done"
$(END_TRACE)
-ifneq ($(ADK_RUNTIME_DEV_UDEV),y)
- $(START_TRACE) "target/$(ADK_TARGET_ARCH)-create-packages.. "
- @mkdir -p ${PACKAGE_DIR}
+ifeq ($(ADK_RUNTIME_DEV_UDEV),)
+ $(START_TRACE) "target/$(ADK_TARGET_ARCH)-kernel-modules-create-packages.. "
+ rm -f ${PACKAGE_DIR}/kmod-*
PATH='${HOST_PATH}' ${BASH} ${SCRIPT_DIR}/make-module-ipkgs.sh \
"${ADK_TARGET_CPU_ARCH}" \
"${KERNEL_VERSION}" \
@@ -103,21 +103,10 @@ ifneq ($(ADK_RUNTIME_DEV_UDEV),y)
$(CMD_TRACE) " done"
$(END_TRACE)
endif
-
-prepare:
-ifneq ($(KERNEL_MODULES_USED),)
-compile: $(LINUX_BUILD_DIR)/modules
-else
-compile: $(LINUX_DIR)/$(KERNEL_FILE)
-endif
-install: compile
-ifneq ($(KERNEL_MODULES_USED),)
- $(START_TRACE) "target/${ADK_TARGET_ARCH}-modules-install.. "
-ifeq ($(ADK_TARGET_PACKAGE_IPKG)$(ADK_TARGET_PACKAGE_OPKG),y)
- $(PKG_INSTALL) $(wildcard ${PACKAGE_DIR}/kmod-*) $(MAKE_TRACE)
-else
- $(foreach pkg,$(wildcard ${PACKAGE_DIR}/kmod-*),$(shell $(PKG_INSTALL) $(pkg)))
-endif
+ $(START_TRACE) "target/${ADK_TARGET_ARCH}-kernel-modules-install-packages.. "
+ for pkg in $(PACKAGE_DIR)/kmod-*; do \
+ [[ -e "$$pkg" ]] && $(PKG_INSTALL) $$pkg; \
+ done
$(CMD_TRACE) " done"
$(END_TRACE)
endif
diff --git a/mk/package.mk b/mk/package.mk
index 31fbe7faa..d61722989 100644
--- a/mk/package.mk
+++ b/mk/package.mk
@@ -273,7 +273,7 @@ endif
ifeq (,$(filter devonly,$(7)))
$${PKG_BUILD} $${IDIR_$(1)} $${PACKAGE_DIR} $(MAKE_TRACE)
-ifneq ($(ADK_DEBUG),y)
+ifneq ($(ADK_DEBUG),)
$${PKG_BUILD} $${IDIR_$(1)_DBG} $${PACKAGE_DIR} $(MAKE_TRACE)
endif
endif
diff --git a/scripts/make-module-ipkgs.sh b/scripts/make-module-ipkgs.sh
index e50340c0a..04eaffaa5 100644
--- a/scripts/make-module-ipkgs.sh
+++ b/scripts/make-module-ipkgs.sh
@@ -65,6 +65,9 @@ done
#done
#echo
+# start with empty directory, avoid leftovers after version change
+rm -rf ${BUILD_DIR}/linux-modules
+
for modname in ${!modpaths[@]}; do
find_modlevel $modname
diff --git a/target/Makefile b/target/Makefile
index ae29b2a10..2b6498011 100644
--- a/target/Makefile
+++ b/target/Makefile
@@ -176,7 +176,7 @@ endif
%-compile: %-prepare
$(MAKE) -C $(patsubst %-compile,%,$@) compile
-%-install: %-compile
+%-install:
$(MAKE) -C $(patsubst %-install,%,$@) install
%-targethelp:
diff --git a/target/arm/Makefile b/target/arm/Makefile
index 7452b0022..efadc88b3 100644
--- a/target/arm/Makefile
+++ b/target/arm/Makefile
@@ -138,7 +138,7 @@ endif
kernel-strip:
ifeq ($(ADK_TARGET_KERNEL_GIT_REPO_NAME),rpi)
@echo adding DT trailer to kernel $(MAKE_TRACE)
- PATH='$(HOST_PATH)' perl $(LINUX_DIR)/scripts/mkknlimg $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
+ PATH='$(HOST_PATH)' perl $(LINUX_DIR)/scripts/mkknlimg $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL) $(MAKE_TRACE)
else
@cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
endif