Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 18 additions & 20 deletions .github/scripts/prepare_test_kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,23 @@

set -e

if [[ "$KERNEL_VERSION" == "LATEST" ]]; then
git clone --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git kernel
cd kernel
cp "$GITHUB_WORKSPACE"/.github/scripts/.config .config
make -j $(nproc) olddefconfig all
else
KERNEL_VERSION_COMPLETE="$KERNEL_VERSION"-"$KERNEL_PATCH_VERSION".x86_64
PACKAGES_URL=https://kojipkgs.fedoraproject.org/packages/kernel/
PACKAGES_URL+="$KERNEL_VERSION"/"$KERNEL_PATCH_VERSION"/x86_64
IFS=- read KERNEL_UPSTREAM_VERSION KERNEL_PATCH_VERSION <<< $KERNEL_VERSION
KERNEL_VERSION_COMPLETE="$KERNEL_VERSION".x86_64
PACKAGES_URL=https://kojipkgs.fedoraproject.org/packages/kernel/
PACKAGES_URL+="$KERNEL_UPSTREAM_VERSION"/"$KERNEL_PATCH_VERSION"/x86_64

for package in core modules modules-extra devel; do
wget -nv "$PACKAGES_URL"/kernel-"$package"-"$KERNEL_VERSION_COMPLETE".rpm
rpm2cpio kernel-"$package"-"$KERNEL_VERSION_COMPLETE".rpm | cpio -di
done
find lib -name "*.xz" -exec xz -d {} \;
for package in core modules modules-core modules-extra devel; do
# modules-core package only exists for newer kernel versions, so continue if
# download fails
wget -nv "$PACKAGES_URL"/kernel-"$package"-"$KERNEL_VERSION_COMPLETE".rpm || continue
rpm2cpio kernel-"$package"-"$KERNEL_VERSION_COMPLETE".rpm | cpio -di
done
find lib -name "*.xz" -exec xz -d {} \;

mv lib/modules/"$KERNEL_VERSION_COMPLETE" kernel
mkdir -p kernel/arch/x86/boot
cp kernel/vmlinuz kernel/arch/x86/boot/bzImage
cp kernel/config kernel/.config
rsync -a usr/src/kernels/"$KERNEL_VERSION_COMPLETE"/ kernel/
fi
mv lib/modules/"$KERNEL_VERSION_COMPLETE" kernel
mkdir -p kernel/arch/x86/boot
cp kernel/vmlinuz kernel/arch/x86/boot/bzImage
cp kernel/config kernel/.config
rsync -a usr/src/kernels/"$KERNEL_VERSION_COMPLETE"/ kernel/

find kernel
13 changes: 0 additions & 13 deletions .github/scripts/prepare_test_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,3 @@ echo ::group::Install virtme
git clone https://github.com/amluto/virtme
sudo python3 -m pip install ./virtme
echo ::endgroup::


if [[ $KERNEL_VERSION == "LATEST" ]]; then
echo ::group::Install pahole
# In the repo there is only version 1.15 and we need newer.
git clone https://git.kernel.org/pub/scm/devel/pahole/pahole.git
mkdir pahole/build
cd pahole/build
cmake -D__LIB=lib ..
sudo make install
sudo ldconfig /usr/local/lib
echo ::endgroup::
fi
2 changes: 1 addition & 1 deletion .github/scripts/run_tests_in_vm.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

ENVVARS="KERNEL_VERSION KERNEL_PATCH_VERSION DID_UNSHARE CLANG LLC"
ENVVARS="KERNEL_VERSION DID_UNSHARE CLANG LLC"

touch ENVVARS
for v in $ENVVARS; do
Expand Down
47 changes: 24 additions & 23 deletions .github/workflows/selftests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,36 @@ on:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
selftest:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- KERNEL_VERSION: 6.1.9
KERNEL_PATCH_VERSION: 200.fc37
DID_UNSHARE: 0
- KERNEL_VERSION: 5.16.8
KERNEL_PATCH_VERSION: 200.fc35
DID_UNSHARE: 0
- KERNEL_VERSION: 5.11.0
KERNEL_PATCH_VERSION: 156.fc34
DID_UNSHARE: 1
- KERNEL_VERSION: 5.6.19
KERNEL_PATCH_VERSION: 300.fc32
DID_UNSHARE: 1
KERNEL_VERSION:
- "6.10.1-200.fc40"
- "6.6.14-200.fc39"
- "6.1.9-200.fc37"
- "5.16.8-200.fc35"
- "5.11.0-156.fc34"
- "5.6.19-300.fc32"
LLVM_VERSION:
- 16
- 17
- 18
- 19
fail-fast: false

env:
KERNEL_VERSION: ${{ matrix.KERNEL_VERSION }}
KERNEL_PATCH_VERSION: ${{ matrix.KERNEL_PATCH_VERSION }}
DID_UNSHARE: ${{ matrix.DID_UNSHARE }}
CLANG: clang-16
LLC: llc-16
LLVM_VERSION: ${{ matrix.LLVM_VERSION }}
CLANG: clang-${{ matrix.LLVM_VERSION }}
LLC: llc-${{ matrix.LLVM_VERSION }}
LLVM_STRIP: llvm-strip-${{ matrix.LLVM_VERSION }}
# can't use unshare on old kernels
DID_UNSHARE: ${{ (startsWith(matrix.KERNEL_VERSION, '5.6') || startsWith(matrix.KERNEL_VERSION, '5.11')) && 1 || 0 }}

steps:
- name: Check out repository code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
- name: Prepare packages
Expand All @@ -45,13 +46,13 @@ jobs:
- name: Prepare Clang
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main" | sudo tee -a /etc/apt/sources.list
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-$LLVM_VERSION main" | sudo tee -a /etc/apt/sources.list
sudo apt-get -qq update
sudo apt-get -qq -y install clang-16 lld-16 llvm-16
sudo apt-get -qq -y install clang-$LLVM_VERSION lld-$LLVM_VERSION llvm-$LLVM_VERSION
- name: Install latest bpftool
run: |
git clone --depth=1 --recurse-submodules https://github.com/libbpf/bpftool bpftool
make LLVM_STRIP=llvm-strip-16 -C bpftool/src
make -C bpftool/src
sudo make install -C bpftool/src prefix=/usr
- name: Compile
run: make
Expand Down
2 changes: 1 addition & 1 deletion lib/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,5 @@ test:
@echo " No tests defined"
else
test: all
$(Q)$(TEST_DIR)/test_runner.sh $(TEST_FILE)
$(Q)$(TEST_DIR)/test_runner.sh $(TEST_FILE) $(TESTS)
endif
Loading