Skip to content

Commit 7a25289

Browse files
committed
workflows: update linux source tar.bz2 file name.
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 <cfc4n.cs@gmail.com>
1 parent 18789f1 commit 7a25289

File tree

7 files changed

+41
-26
lines changed

7 files changed

+41
-26
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@ jobs:
5050
run: |
5151
sudo apt-get update
5252
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
53-
for tool in "clang" "llc" "llvm-strip"
5453
cd /usr/src
55-
sudo tar -xf linux-source.tar.bz2
56-
cd /usr/src/linux-source
54+
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
55+
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
56+
sudo tar -xf $source_file
57+
cd $source_dir
5758
test -f .config || sudo make oldconfig
5859
sudo make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- prepare V=0
59-
ls -al /usr/src/linux-source
60+
ls -al /usr/src/$source_dir
6061
shell: bash
6162
# Initializes the CodeQL tools for scanning.
6263
- name: Initialize CodeQL

.github/workflows/go-c-cpp.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@ jobs:
6666
sudo ln -s /usr/bin/$tool-14 /usr/bin/$tool
6767
done
6868
cd /usr/src
69-
sudo tar -xf linux-source.tar.bz2
70-
cd /usr/src/linux-source
69+
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
70+
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
71+
sudo tar -xf $source_file
72+
cd $source_dir
7173
test -f .config || sudo make oldconfig
7274
sudo make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- prepare V=0
73-
ls -al /usr/src/linux-source
75+
ls -al /usr/src/$source_dir
7476
shell: bash
7577
- uses: actions/checkout@v4
7678
with:
@@ -174,12 +176,14 @@ jobs:
174176
rm -rf /usr/local/go
175177
tar -C /usr/local -xzf go1.21.0.linux-arm64.tar.gz
176178
cd /usr/src
177-
tar -xf linux-source.tar.bz2
178-
cd /usr/src/linux-source
179+
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
180+
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
181+
tar -xf $source_file
182+
cd $source_dir
179183
test -f .config || make oldconfig > /dev/null
180184
make ARCH=x86 CROSS_COMPILE=x86_64-linux-gnu- prepare V=0 > /dev/null
181185
make prepare V=0 > /dev/null
182-
ls -al /usr/src/linux-source
186+
ls -al /usr/src/$source_dir
183187
# Produce a binary artifact and place it in the mounted volume
184188
run: |
185189
uname -a
@@ -197,17 +201,20 @@ jobs:
197201
cat /proc/1/cgroup
198202
echo "cat /proc/1/sched:"
199203
cat /proc/1/sched
204+
cd /usr/src
205+
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
206+
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
200207
git config --global --add safe.directory /source_code
201208
cd /source_code
202209
echo "-------------------start: Build CO-RE Linux (include non-CO-RE)-------------------"
203-
KERN_HEADERS=/usr/src/linux-source make env
210+
KERN_HEADERS=/usr/src/$source_dir make env
204211
make clean
205-
KERN_HEADERS=/usr/src/linux-source make
212+
KERN_HEADERS=/usr/src/$source_dir make
206213
bin/ecapture -v
207214
echo "-------------------start: Build non-CO-RE (Cross-Compilation) Linux -------------------"
208215
make clean
209-
KERN_HEADERS=/usr/src/linux-source CROSS_ARCH=amd64 make env
210-
KERN_HEADERS=/usr/src/linux-source CROSS_ARCH=amd64 make nocore -j8
216+
KERN_HEADERS=/usr/src/$source_dir CROSS_ARCH=amd64 make env
217+
KERN_HEADERS=/usr/src/$source_dir CROSS_ARCH=amd64 make nocore -j8
211218
file bin/ecapture
212219
- name: Show the artifact
213220
# Items placed in /artifacts in the container will be in

.github/workflows/release.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ jobs:
2323
sudo ln -s /usr/bin/$tool-14 /usr/bin/$tool
2424
done
2525
cd /usr/src
26-
sudo tar -xf linux-source.tar.bz2
27-
cd /usr/src/linux-source
26+
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
27+
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
28+
sudo tar -xf $source_file
29+
cd $source_dir
2830
test -f .config || sudo make oldconfig
2931
sudo make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- prepare V=0
30-
ls -al /usr/src/linux-source
32+
ls -al /usr/src/$source_dir
3133
shell: bash
3234
- uses: actions/checkout@v4
3335
with:

COMPILATION.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,12 @@ To cross-compile the eCapture tool, you need to install the kernel header files
8585
install the `linux-source` package.
8686

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

COMPILATION_CN.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@ bin/ecapture
102102
kernel_ver=`uname -r | cut -d'-' -f 1`
103103
sudo apt-get install -y linux-source-$kernel_ver
104104
cd /usr/src
105-
sudo tar -xf linux-source-${kernel_ver}.tar.bz2
106-
cd /usr/src/linux-source-${kernel_ver}
105+
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
106+
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
107+
sudo tar -xf $source_file
108+
cd $source_dir
107109
test -f .config || yes "" | sudo make oldconfig
108110
```
109111

README_JA.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,10 @@ bin/ecapture --help
200200
kernel_ver=`uname -r | cut -d'-' -f 1`
201201
sudo apt-get install -y linux-source-$kernel_ver
202202
cd /usr/src
203-
sudo tar -xf linux-source-${kernel_ver}.tar.bz2
204-
cd /usr/src/linux-source-${kernel_ver}
203+
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
204+
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
205+
sudo tar -xf $source_file
206+
cd $source_dir
205207
test -f .config || yes "" | sudo make oldconfig
206208
```
207209

variables.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ endif
172172
#
173173
ifdef CROSS_ARCH
174174
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
175-
KERN_HEADERS = $(LINUX_SOURCE_PATH)
175+
KERN_HEADERS = $(if $(KERN_HEADERS),$(KERN_HEADERS),$(LINUX_SOURCE_PATH))
176176
endif
177177
KERN_RELEASE ?= $(UNAME_R)
178178
KERN_BUILD_PATH ?= $(if $(KERN_HEADERS),$(KERN_HEADERS),/lib/modules/$(KERN_RELEASE)/build)

0 commit comments

Comments
 (0)