Skip to content

Commit

Permalink
workflows: update linux source tar.bz2 file name.
Browse files Browse the repository at this point in the history
error output:
Reading state information...
E: Unable to locate package linux-source-6.8.0
E: Couldn't find any package by glob 'linux-source-6.8.0'
E: Couldn't find any package by regex 'linux-source-6.8.0'
Error: Process completed with exit code 100.

Signed-off-by: CFC4N <[email protected]>
  • Loading branch information
cfc4n committed Sep 30, 2024
1 parent 18789f1 commit 7a25289
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 26 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm clang linux-tools-common linux-tools-generic flex bison gcc-aarch64-linux-gnu libssl-dev linux-source
for tool in "clang" "llc" "llvm-strip"
cd /usr/src
sudo tar -xf linux-source.tar.bz2
cd /usr/src/linux-source
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
sudo tar -xf $source_file
cd $source_dir
test -f .config || sudo make oldconfig
sudo make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- prepare V=0
ls -al /usr/src/linux-source
ls -al /usr/src/$source_dir
shell: bash
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
27 changes: 17 additions & 10 deletions .github/workflows/go-c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ jobs:
sudo ln -s /usr/bin/$tool-14 /usr/bin/$tool
done
cd /usr/src
sudo tar -xf linux-source.tar.bz2
cd /usr/src/linux-source
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
sudo tar -xf $source_file
cd $source_dir
test -f .config || sudo make oldconfig
sudo make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- prepare V=0
ls -al /usr/src/linux-source
ls -al /usr/src/$source_dir
shell: bash
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -174,12 +176,14 @@ jobs:
rm -rf /usr/local/go
tar -C /usr/local -xzf go1.21.0.linux-arm64.tar.gz
cd /usr/src
tar -xf linux-source.tar.bz2
cd /usr/src/linux-source
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
tar -xf $source_file
cd $source_dir
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
ls -al /usr/src/$source_dir
# Produce a binary artifact and place it in the mounted volume
run: |
uname -a
Expand All @@ -197,17 +201,20 @@ jobs:
cat /proc/1/cgroup
echo "cat /proc/1/sched:"
cat /proc/1/sched
cd /usr/src
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
git config --global --add safe.directory /source_code
cd /source_code
echo "-------------------start: Build CO-RE Linux (include non-CO-RE)-------------------"
KERN_HEADERS=/usr/src/linux-source make env
KERN_HEADERS=/usr/src/$source_dir make env
make clean
KERN_HEADERS=/usr/src/linux-source make
KERN_HEADERS=/usr/src/$source_dir make
bin/ecapture -v
echo "-------------------start: Build non-CO-RE (Cross-Compilation) Linux -------------------"
make clean
KERN_HEADERS=/usr/src/linux-source CROSS_ARCH=amd64 make env
KERN_HEADERS=/usr/src/linux-source CROSS_ARCH=amd64 make nocore -j8
KERN_HEADERS=/usr/src/$source_dir CROSS_ARCH=amd64 make env
KERN_HEADERS=/usr/src/$source_dir CROSS_ARCH=amd64 make nocore -j8
file bin/ecapture
- name: Show the artifact
# Items placed in /artifacts in the container will be in
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ jobs:
sudo ln -s /usr/bin/$tool-14 /usr/bin/$tool
done
cd /usr/src
sudo tar -xf linux-source.tar.bz2
cd /usr/src/linux-source
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
sudo tar -xf $source_file
cd $source_dir
test -f .config || sudo make oldconfig
sudo make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- prepare V=0
ls -al /usr/src/linux-source
ls -al /usr/src/$source_dir
shell: bash
- uses: actions/checkout@v4
with:
Expand Down
9 changes: 5 additions & 4 deletions COMPILATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ To cross-compile the eCapture tool, you need to install the kernel header files
install the `linux-source` package.

```shell
kernel_ver=`uname -r | cut -d'-' -f 1`
sudo apt-get install -y linux-source-$kernel_ver
sudo apt-get install -y linux-source
cd /usr/src
sudo tar -xf linux-source-${kernel_ver}.tar.bz2
cd /usr/src/linux-source-${kernel_ver}
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
sudo tar -xf $source_file
cd $source_dir
test -f .config || yes "" | sudo make oldconfig
```

Expand Down
6 changes: 4 additions & 2 deletions COMPILATION_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ bin/ecapture
kernel_ver=`uname -r | cut -d'-' -f 1`
sudo apt-get install -y linux-source-$kernel_ver
cd /usr/src
sudo tar -xf linux-source-${kernel_ver}.tar.bz2
cd /usr/src/linux-source-${kernel_ver}
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
sudo tar -xf $source_file
cd $source_dir
test -f .config || yes "" | sudo make oldconfig
```

Expand Down
6 changes: 4 additions & 2 deletions README_JA.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,10 @@ bin/ecapture --help
kernel_ver=`uname -r | cut -d'-' -f 1`
sudo apt-get install -y linux-source-$kernel_ver
cd /usr/src
sudo tar -xf linux-source-${kernel_ver}.tar.bz2
cd /usr/src/linux-source-${kernel_ver}
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
sudo tar -xf $source_file
cd $source_dir
test -f .config || yes "" | sudo make oldconfig
```

Expand Down
2 changes: 1 addition & 1 deletion variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ endif
#
ifdef CROSS_ARCH
KERNEL_HEADER_GEN = test -e arch/$(LINUX_ARCH)/kernel/asm-offsets.s || yes "" | $(SUDO) make ARCH=$(LINUX_ARCH) CROSS_COMPILE=$(CMD_CC_PREFIX) prepare V=0
KERN_HEADERS = $(LINUX_SOURCE_PATH)
KERN_HEADERS = $(if $(KERN_HEADERS),$(KERN_HEADERS),$(LINUX_SOURCE_PATH))
endif
KERN_RELEASE ?= $(UNAME_R)
KERN_BUILD_PATH ?= $(if $(KERN_HEADERS),$(KERN_HEADERS),/lib/modules/$(KERN_RELEASE)/build)
Expand Down

0 comments on commit 7a25289

Please sign in to comment.