diff --git a/.github/workflows/vmlinux.h.yml b/.github/workflows/vmlinux.h.yml index cdd8eec..9a74e7c 100644 --- a/.github/workflows/vmlinux.h.yml +++ b/.github/workflows/vmlinux.h.yml @@ -9,53 +9,89 @@ on: jobs: gen-headers: - name: Generate vmlinux.h + name: Generate vmlinux.h (${{ matrix.arch }}) runs-on: ubuntu-latest + strategy: + matrix: + arch: + - x86_64 + - aarch64 + - arm + - loongarch64 + - ppc64le + - riscv64 + - s390x steps: - uses: actions/checkout@v4 - - name: Download Linux source + - name: Check out Linux source + uses: actions/checkout@v6 + with: + repository: 'torvalds/linux' + ref: 'v6.18' + fetch-depth: 1 + path: linux/ + + - name: Check out pahole source + uses: actions/checkout@v6 + with: + repository: 'acmel/dwarves' + ref: 'next' + fetch-depth: 1 + path: pahole/ + + - name: Install pahole shell: bash - run: ./scripts/download-latest-linux-release.sh + run: | + sudo apt -y install cmake git libdw-dev libelf-dev + cd pahole + mkdir -p build + cmake -B=build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr + make -C build -j$(nproc) + sudo make -C build install - name: Install dependencies shell: bash run: | ./scripts/install-dependencies.sh - ./scripts/install-pahole.sh ./scripts/install-bpftool.sh - - name: x86_64/vmlinux.h + - name: Generate ${{ matrix.arch }}/vmlinux.h shell: bash - run: ./scripts/gen-vmlinux-header.sh x86_64 + run: ./scripts/gen-vmlinux-header.sh ${{ matrix.arch }} - - name: aarch64/vmlinux.h - shell: bash - run: ./scripts/gen-vmlinux-header.sh aarch64 - - - name: arm/vmlinux.h - shell: bash - run: ./scripts/gen-vmlinux-header.sh arm - - - name: loongarch64/vmlinux.h - shell: bash - run: ./scripts/gen-vmlinux-header.sh loongarch64 + - name: Upload headers + uses: actions/upload-artifact@v4 + with: + name: vmlinux.h-${{ matrix.arch }} + if-no-files-found: error + path: ./vmlinux.h/${{ matrix.arch }} - - name: ppc64le/vmlinux.h - shell: bash - run: ./scripts/gen-vmlinux-header.sh ppc64le + combine-headers: + name: Combine all vmlinux.h headers + runs-on: ubuntu-latest + needs: gen-headers - - name: riscv64/vmlinux.h - shell: bash - run: ./scripts/gen-vmlinux-header.sh riscv64 + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + pattern: vmlinux.h-* - - name: s390x/vmlinux.h + - name: Reorganize headers shell: bash - run: ./scripts/gen-vmlinux-header.sh s390x + run: | + mkdir -p vmlinux.h + for dir in vmlinux.h-*/; do + arch="${dir#vmlinux.h-}" + arch="${arch%/}" + mkdir -p "vmlinux.h/$arch" + mv "$dir"* "vmlinux.h/$arch/" + done - - name: Upload headers + - name: Upload combined headers uses: actions/upload-artifact@v4 with: name: vmlinux.h diff --git a/scripts/download-latest-linux-release.sh b/scripts/download-latest-linux-release.sh deleted file mode 100755 index 11f03a6..0000000 --- a/scripts/download-latest-linux-release.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -eux - -sudo apt install -y curl jq tar xz-utils - -# pick the first stable release, it's usually the newest -url=$(curl -s https://www.kernel.org/releases.json \ - | jq -r '[.releases[] | select(.moniker == "mainline")][0].source') - -curl -LO "$url" -tar -xf $(basename "$url") - -dir=$(basename "$url" | sed 's/\.tar\.[gx]z$//') -mv $dir linux - -rm $(basename "$url") diff --git a/scripts/install-pahole.sh b/scripts/install-pahole.sh deleted file mode 100755 index ee62e4a..0000000 --- a/scripts/install-pahole.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -set -eux - -PAHOLE_ORIGIN=${PAHOLE_ORIGIN:-https://git.kernel.org/pub/scm/devel/pahole/pahole.git} -PAHOLE_REVISION=${PAHOLE_REVISION:-next} - -sudo apt -y install cmake git libdw-dev libelf-dev - -WORKSPACE=$(mktemp -d -t pahole.XXXXXX) -pushd "$WORKSPACE" -git clone ${PAHOLE_ORIGIN} \ - --branch "${PAHOLE_REVISION}" \ - --depth=1 \ - --single-branch -cd pahole -mkdir -p build -cmake -B=build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -make -C build -j$(nproc) -sudo make -C build install -popd -rm -rf "$WORKSPACE"