From 8826649c425bd56956114f203c606bfcfa313fb2 Mon Sep 17 00:00:00 2001 From: CFC4N Date: Mon, 29 Apr 2024 22:38:54 +0800 Subject: [PATCH] workflows: set KERN_HEADERS env as INCLUDE_PATH on docker qemu(arm64) Signed-off-by: CFC4N --- .github/workflows/go-c-cpp.yml | 21 +++++++++------------ builder/Makefile.release | 2 ++ functions.mk | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/go-c-cpp.yml b/.github/workflows/go-c-cpp.yml index fc85a03c16..394cbfe9ad 100644 --- a/.github/workflows/go-c-cpp.yml +++ b/.github/workflows/go-c-cpp.yml @@ -173,7 +173,7 @@ jobs: uname -a apt-get update kernel_ver=`uname -r | cut -d'-' -f 1` - apt-get install --yes wget git build-essential pkgconf libelf-dev llvm-12 clang-12 linux-tools-generic linux-tools-common flex bison file gcc-x86-64-linux-gnu libssl-dev bc linux-source-${kernel_ver} + apt-get install --yes wget git build-essential pkgconf libelf-dev llvm-12 clang-12 linux-tools-generic linux-tools-common flex bison file gcc-x86-64-linux-gnu libssl-dev bc linux-source-${kernel_ver} wget https://go.dev/dl/go1.21.0.linux-arm64.tar.gz rm -rf /usr/local/go tar -C /usr/local -xzf go1.21.0.linux-arm64.tar.gz @@ -182,6 +182,7 @@ jobs: cd /usr/src/linux-source-${kernel_ver} test -f .config || make oldconfig > /dev/null make ARCH=x86 CROSS_COMPILE=x86_64-linux-gnu- prepare V=0 > /dev/null + make prepare V=0 > /dev/null ls -al /usr/src/linux-source-${kernel_ver} # Produce a binary artifact and place it in the mounted volume run: | @@ -202,20 +203,16 @@ jobs: cat /proc/1/sched git config --global --add safe.directory /source_code cd /source_code - echo "-------------------start: Build CO-RE Linux -------------------" - make env + echo "-------------------start: Build CO-RE Linux (include non-CO-RE)-------------------" + KERN_HEADERS=/usr/src/linux-source-${kernel_ver} make env make clean - make + KERN_HEADERS=/usr/src/linux-source-${kernel_ver} make bin/ecapture -v - echo "-------------------start: Build CO-RE (Cross-Compilation) Linux -------------------" + echo "-------------------start: Build non-CO-RE (Cross-Compilation) Linux -------------------" make clean - CROSS_ARCH=amd64 make env - CROSS_ARCH=amd64 make -j8 - echo "-------------------start: Build non-CO-RE Android -------------------" - make clean - make env - ANDROID=1 make nocore -j2 - + KERN_HEADERS=/usr/src/linux-source-${kernel_ver} CROSS_ARCH=amd64 make env + KERN_HEADERS=/usr/src/linux-source-${kernel_ver} CROSS_ARCH=amd64 make nocore -j8 + file bin/ecapture - name: Show the artifact # Items placed in /artifacts in the container will be in # ${PWD}/artifacts on the host. diff --git a/builder/Makefile.release b/builder/Makefile.release index 9cfc67c470..b01e2bb68a 100644 --- a/builder/Makefile.release +++ b/builder/Makefile.release @@ -98,6 +98,7 @@ snapshot: \ .check_$(CMD_TAR) \ .check_$(CMD_CHECKSUM) \ .check_$(CMD_GITHUB) + $(call allow-override,ANDROID,0) $(call release_tar,linux,) .PHONY: snapshot_android @@ -107,6 +108,7 @@ snapshot_android: \ .check_$(CMD_TAR) \ .check_$(CMD_CHECKSUM) \ .check_$(CMD_GITHUB) + $(call allow-override,ANDROID,1) $(call release_tar,android,) .PHONY: publish diff --git a/functions.mk b/functions.mk index f49b5c0273..0d6c39bdee 100644 --- a/functions.mk +++ b/functions.mk @@ -64,7 +64,7 @@ define release_tar $(call allow-override,TAR_DIR,ecapture-$(DEB_VERSION)-$(1)-$(GOARCH)$(CORE_PREFIX)) $(call allow-override,OUT_ARCHIVE,$(OUTPUT_DIR)/$(TAR_DIR).tar.gz) $(CMD_MAKE) clean - $(CMD_MAKE) $(2) + ANDROID=$(ANDROID) $(CMD_MAKE) $(2) # create the tar ball and checksum files $(CMD_MKDIR) -p $(TAR_DIR) $(CMD_CP) LICENSE $(TAR_DIR)/LICENSE