-
Notifications
You must be signed in to change notification settings - Fork 10
111 lines (97 loc) · 2.81 KB
/
vmlinux.h.yml
File metadata and controls
111 lines (97 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: vmlinux.h
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
inputs:
kernel-ref:
description: 'Kernel version (Git tag/ref)'
required: true
# Keep in sync with string used in `checkout` invocation below.
default: 'v6.19'
workflow_call:
jobs:
gen-headers:
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: Check out Linux source
uses: actions/checkout@v6
with:
repository: 'torvalds/linux'
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.kernel-ref || 'v6.19' }}
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: |
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-bpftool.sh
- name: Generate ${{ matrix.arch }}/vmlinux.h
shell: bash
run: ./scripts/gen-vmlinux-header.sh ${{ matrix.arch }}
- name: Upload headers
uses: actions/upload-artifact@v4
with:
name: vmlinux.h-${{ matrix.arch }}
if-no-files-found: error
path: ./vmlinux.h/${{ matrix.arch }}
combine-headers:
name: Combine all vmlinux.h headers
runs-on: ubuntu-latest
needs: gen-headers
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: vmlinux.h-*
- name: Reorganize headers
shell: bash
run: |
mkdir -p vmlinux.h
for dir in vmlinux.h-*/; do
arch="${dir#vmlinux.h-}"
arch="${arch%/}"
# Map architecture names to match include/ directory structure
target_arch="$arch"
case "$arch" in
ppc64le) target_arch="powerpc" ;;
esac
mkdir -p "vmlinux.h/$target_arch"
mv "$dir"* "vmlinux.h/$target_arch/"
done
- name: Upload combined headers
uses: actions/upload-artifact@v4
with:
name: vmlinux.h
if-no-files-found: error
path: ./vmlinux.h