Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows : release Android x86_64 use nocore model. #260

Merged
merged 9 commits into from
Nov 5, 2022
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
permissions:
actions: read
contents: read
Expand Down Expand Up @@ -77,6 +77,6 @@ jobs:

- run: |
make env
make
make nocore
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
13 changes: 7 additions & 6 deletions .github/workflows/go-c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ jobs:
- name: Install Compilers
run: |
sudo apt-get update
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-12 clang-12 linux-tools-common linux-tools-generic
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-9 clang-9 linux-tools-common linux-tools-generic
for tool in "clang" "llc" "llvm-strip"
do
sudo rm -f /usr/bin/$tool
sudo ln -s /usr/bin/$tool-12 /usr/bin/$tool
sudo ln -s /usr/bin/$tool-9 /usr/bin/$tool
done
shell: bash
- uses: actions/checkout@v3
- name: Build
run: |
make clean
make env
make
make nocore
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
- name: Test
run: go test -v ./...

build-on-ubuntu2204-arm64:
build-on-ubuntu2004-arm64:
runs-on: ubuntu-22.04
name: build on ubuntu-22.04 arm64
# Run steps on a matrix of 3 arch/distro combinations
Expand Down Expand Up @@ -177,16 +177,17 @@ jobs:
install: |
uname -a
apt-get update
apt-get install --yes wget git golang build-essential pkgconf libelf-dev llvm-14 clang-14 linux-tools-generic linux-tools-common
apt-get install --yes wget git golang build-essential pkgconf libelf-dev llvm-12 clang-12 linux-tools-generic linux-tools-common
# Produce a binary artifact and place it in the mounted volume
run: |
uname -a
date
export PATH=$PATH:/usr/local/bin
echo $PATH
for tool in "clang" "llc" "llvm-strip"
do
rm -f /usr/bin/$tool
ln -s /usr/bin/$tool-14 /usr/bin/$tool
ln -s /usr/bin/$tool-12 /usr/bin/$tool
done
clang --version
which bpftool
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:

build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -23,11 +23,11 @@ jobs:
- name: Install Compilers
run: |
sudo apt-get update
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-12 clang-12 linux-tools-common linux-tools-generic
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-9 clang-9 linux-tools-common linux-tools-generic
for tool in "clang" "llc" "llvm-strip"
do
sudo rm -f /usr/bin/$tool
sudo ln -s /usr/bin/$tool-12 /usr/bin/$tool
sudo ln -s /usr/bin/$tool-9 /usr/bin/$tool
done
shell: bash
- name: authenticate
Expand All @@ -52,7 +52,7 @@ jobs:
make env
make -f builder/Makefile.release release SNAPSHOT_VERSION=${{ steps.get_tags.outputs.VERSION }}

build-on-ubuntu2204-arm64:
build-on-ubuntu2004-arm64:
runs-on: ubuntu-22.04
name: build on ubuntu-22.04 arm64
# Run steps on a matrix of 3 arch/distro combinations
Expand Down Expand Up @@ -126,16 +126,17 @@ jobs:
install: |
uname -a
apt-get update
apt-get install --yes wget git golang build-essential pkgconf libelf-dev llvm-14 clang-14 linux-tools-generic linux-tools-common
apt-get install --yes wget git build-essential golang pkgconf libelf-dev llvm-12 clang-12 linux-tools-generic linux-tools-common
# Produce a binary artifact and place it in the mounted volume
run: |
uname -a
date
export PATH=$PATH:/usr/local/bin
echo $PATH
for tool in "clang" "llc" "llvm-strip"
do
rm -f /usr/bin/$tool
ln -s /usr/bin/$tool-14 /usr/bin/$tool
ln -s /usr/bin/$tool-12 /usr/bin/$tool
done
clang --version
which bpftool
Expand Down
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ $(KERN_OBJECTS): %.o: %.c \
-target bpfel -c $< -o $(subst kern/,user/bytecode/,$@) \
-fno-ident -fdebug-compilation-dir . -g -D__BPF_TARGET_MISSING="GCC error \"The eBPF is using target specific macros, please provide -target\"" \
-MD -MP
#KERNEL_LESS_5_2
$(CMD_CLANG) -D__TARGET_ARCH_$(LINUX_ARCH) \
$(EXTRA_CFLAGS) \
$(BPFHEADER) \
Expand Down Expand Up @@ -348,7 +347,6 @@ $(KERN_OBJECTS_NOCORE): %.nocore: %.c \
-march=bpf \
-filetype=obj \
-o $(subst kern/,user/bytecode/,$(subst .c,.o,$<))
# -DKERNEL_LESS_5_2
$(CMD_CLANG) \
$(BPFHEADER) \
-I $(KERN_SRC_PATH)/arch/$(LINUX_ARCH)/include \
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ Linux Kernel: >= 4.15.
## command
```shell
sudo apt-get update
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-12 clang-12 linux-tools-common linux-tools-generic
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-9 clang-9 linux-tools-common linux-tools-generic
for tool in "clang" "llc" "llvm-strip"
do
sudo rm -f /usr/bin/$tool
sudo ln -s /usr/bin/$tool-12 /usr/bin/$tool
sudo ln -s /usr/bin/$tool-9 /usr/bin/$tool
done
git clone git@github.com:ehids/ecapture.git
cd ecapture
Expand All @@ -187,7 +187,7 @@ bin/ecapture --help
```

## compile without BTF
eCapture support NO BTF with command `make nocore` to compile on 2022/04/17.
eCapture support BTF disabled with command `make nocore` to compile on 2022/04/17.
```shell
make nocore
bin/ecapture --help
Expand Down
4 changes: 2 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ hook了`/bin/bash`的`readline`函数。

```shell
sudo apt-get update
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-12 clang-12 linux-tools-common linux-tools-generic
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-9 clang-9 linux-tools-common linux-tools-generic
for tool in "clang" "llc" "llvm-strip"
do
sudo rm -f /usr/bin/$tool
sudo ln -s /usr/bin/$tool-12 /usr/bin/$tool
sudo ln -s /usr/bin/$tool-9 /usr/bin/$tool
done
git clone git@github.com:ehids/ecapture.git
cd ecapture
Expand Down
33 changes: 30 additions & 3 deletions builder/Makefile.release
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

.PHONY: all
all: help
release: snapshot publish
release: snapshot snapshot_android publish

#
# make
Expand Down Expand Up @@ -118,6 +118,7 @@ help:

OUTPUT_DIR = ./bin
TAR_DIR = ecapture-$(SNAPSHOT_VERSION)-linux-$(UNAME_M)
TAR_DIR_ANDROID = ecapture-$(SNAPSHOT_VERSION)-android-$(UNAME_M)

# from CLI args.
RELEASE_NOTES ?= $(OUTPUT_DIR)/release_notes.txt
Expand All @@ -143,7 +144,8 @@ snapshot: \
.check_$(CMD_GITHUB)

# build binaries
$(MAKE)
$(MAKE) clean
$(MAKE) nocore
# create the tar ball and checksum files
$(CMD_MKDIR) -p $(TAR_DIR)
$(CMD_CP) LICENSE $(TAR_DIR)/LICENSE
Expand All @@ -157,16 +159,41 @@ snapshot: \
$(CMD_CHECKSUM) $(TAR_DIR).tar.gz > ./../$(OUT_CHECKSUMS)
cd ../

.PHONY: snapshot_android
snapshot_android: \
$(OUTPUT_DIR) \
| .check_tree \
.check_$(CMD_TAR) \
.check_$(CMD_CHECKSUM) \
.check_$(CMD_GITHUB)

# build binaries
$(MAKE) clean
ANDROID=1 $(MAKE) nocore
# create the tar ball and checksum files
$(CMD_MKDIR) -p $(TAR_DIR_ANDROID)
$(CMD_CP) LICENSE $(TAR_DIR_ANDROID)/LICENSE
$(CMD_CP) CHANGELOG.md $(TAR_DIR_ANDROID)/CHANGELOG.md
$(CMD_CP) README.md $(TAR_DIR_ANDROID)/README.md
$(CMD_CP) README_CN.md $(TAR_DIR_ANDROID)/README_CN.md
$(CMD_MV) $(OUTPUT_DIR)/ecapture $(TAR_DIR_ANDROID)/ecapture
$(CMD_MV) $(OUTPUT_DIR)/release_notes.txt $(TAR_DIR_ANDROID)/release_notes.txt
$(CMD_TAR) -czf $(OUT_ARCHIVE) $(TAR_DIR_ANDROID)
cd $(OUTPUT_DIR)
$(CMD_CHECKSUM) $(TAR_DIR_ANDROID).tar.gz >> ./../$(OUT_CHECKSUMS)
cd ../

.PHONY: publish
publish: \
$(OUTPUT_DIR) \
$(OUT_ARCHIVE) \
$(TAR_DIR_ANDROID) \
$(OUT_CHECKSUMS) \
| .check_tree \
.check_$(CMD_GITHUB)
#
# release it!
$(CMD_GITHUB) release create $(SNAPSHOT_VERSION) $(OUT_ARCHIVE) $(OUT_CHECKSUMS) --title "eCapture $(SNAPSHOT_VERSION)" --notes-file $(TAR_DIR)/release_notes.txt
$(CMD_GITHUB) release create $(SNAPSHOT_VERSION) $(OUT_ARCHIVE) $(TAR_DIR_ANDROID) $(OUT_CHECKSUMS) --title "eCapture $(SNAPSHOT_VERSION)" --notes-file $(TAR_DIR)/release_notes.txt

.PHONY: clean
clean:
Expand Down