Skip to content

Commit

Permalink
workflows: build failed on aarch 64 ubuntu : 'linux/kconfig.h' file n…
Browse files Browse the repository at this point in the history
…ot found #125

CROSS_COMPILE BPF is very difficult on x86_64 ARCH due include files is messy.
QEMU(uraimo/run-on-arch-action@v2) dont have linux header files in /lib/modules/$(ARCH)/ and other path. cant make nocore and ANDROID=1 make nocore
So cant compile a no CO:RE version ecapture with Github Action.
rollback release.yml to CO:RE version ARM64 eCapture builder.

Signed-off-by: CFC4N <[email protected]>
  • Loading branch information
cfc4n committed Jul 7, 2022
1 parent 544c54d commit 09216f1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ jobs:
tar -czf ${OUT_ARCHIVE} ${TAR_DIR}
cp ${OUT_ARCHIVE} "/artifacts/"
echo "-------------------end: Create ecapture.tar.gz of Linux -------------------"
echo "-------------------start: Create ecapture.tar.gz of Android kernel 4.18+ -------------------"
echo "-------------------start: Create ecapture.tar.gz of Android kernel CO:RE -------------------"
make env
make clean
ANDROID=1 make nocore
ANDROID=1 make
echo "-------------------ecapture --help-------------------"
echo "bin/ecapture -h"
echo "-------------------create tar.gz file-------------------"
Expand All @@ -182,7 +182,7 @@ jobs:
if [ -z "${SNAPSHOT_VERSION}" ]; then
SNAPSHOT_VERSION="v0.0.0"
fi
TAR_DIR=ecapture-${SNAPSHOT_VERSION}-android_4.18-${UNAME_M}
TAR_DIR=ecapture-${SNAPSHOT_VERSION}-android_core-${UNAME_M}
RELEASE_NOTES=${OUTPUT_DIR}/release_notes.txt
OUT_ARCHIVE=${OUTPUT_DIR}/${artifact_name}-android-${{ matrix.arch }}.tar.gz
mkdir -p ${TAR_DIR}
Expand All @@ -194,7 +194,7 @@ jobs:
cp ${OUTPUT_DIR}/release_notes.txt ${TAR_DIR}/release_notes.txt
tar -czf ${OUT_ARCHIVE} ${TAR_DIR}
cp ${OUT_ARCHIVE} "/artifacts/"
echo "-------------------end: Create ecapture.tar.gz of Android kernel 4.18+ -------------------"
echo "-------------------end: Create ecapture.tar.gz of Android kernel CO:RE -------------------"
echo "Produced artifact at /artifacts/${artifact_name}"
- name: Upload artifacts
Expand Down
38 changes: 20 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ GO_VERSION_MIN = $(shell echo $(GO_VERSION) | $(CMD_CUT) -d'.' -f2)
| .check_$(CMD_GO)
#
@if [ ${GO_VERSION_MAJ} -eq 1 ]; then
if [ ${GO_VERSION_MIN} -lt 16 ]; then
echo -n "you MUST use golang 1.16 or newer, "
if [ ${GO_VERSION_MIN} -lt 17 ]; then
echo -n "you MUST use golang 1.17 or newer, "
echo "your current golang version is ${GO_VERSION}"
exit 1
fi
Expand Down Expand Up @@ -169,24 +169,24 @@ endif
# Target Arch
#
BPFHEADER ?=
ifeq ($(UNAME_M),x86_64)
ARCH = x86_64
LINUX_ARCH = x86
GO_ARCH = amd64
BPFHEADER = -I ./kern \
-I ./kern/bpf/x86
AUTOGENCMD = $(CMD_BPFTOOL) btf dump file /sys/kernel/btf/vmlinux format c > kern/bpf/x86/vmlinux.h
endif

ifeq ($(UNAME_M),aarch64)
ARCH = arm64
LINUX_ARCH = arm64
GO_ARCH = arm64
BPFHEADER = -I ./kern \
-I ./kern/bpf/arm64
AUTOGENCMD = ls -al kern/bpf/arm64/vmlinux.h
ARCH = arm64
LINUX_ARCH = arm64
GO_ARCH = arm64
BPFHEADER = -I ./kern \
-I ./kern/bpf/arm64
AUTOGENCMD = ls -al kern/bpf/arm64/vmlinux.h
else
# x86_64 default
ARCH = x86_64
LINUX_ARCH = x86
GO_ARCH = amd64
BPFHEADER = -I ./kern \
-I ./kern/bpf/x86
AUTOGENCMD = $(CMD_BPFTOOL) btf dump file /sys/kernel/btf/vmlinux format c > kern/bpf/x86/vmlinux.h
endif


#
# include vpath
#
Expand Down Expand Up @@ -219,7 +219,7 @@ KERN_OBJECTS_NOCORE = ${KERN_SOURCES:.c=.nocore}
.PHONY: env
env:
@echo ---------------------------------------
@echo "Makefile Environment:"
@echo "eCapture Makefile Environment:"
@echo ---------------------------------------
@echo "PARALLEL $(PARALLEL)"
@echo ---------------------------------------
Expand Down Expand Up @@ -248,6 +248,8 @@ env:
@echo "KERN_SRC_PATH $(KERN_SRC_PATH)"
@echo ---------------------------------------
@echo "GO_ARCH $(GO_ARCH)"
@echo "ANDROID $(ANDROID)"
@echo "AUTOGENCMD $(AUTOGENCMD)"
@echo ---------------------------------------

#
Expand Down

0 comments on commit 09216f1

Please sign in to comment.