-
Notifications
You must be signed in to change notification settings - Fork 11
132 lines (114 loc) · 4.01 KB
/
build-deb.yml
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Build
on:
pull_request:
branches:
- '*'
workflow_dispatch:
inputs:
branch:
description: 'branch name to build'
required: true
default: 'kvm-nyx-5.10.73'
publish:
description: 'publish a Github release'
required: true
default: 'false'
jobs:
debian_package:
runs-on: intellabs-01
container:
image: ubuntu:22.04
defaults:
run:
shell: bash
steps:
- name: Ensure node and git
run: apt-get update && apt-get install -y nodejs git
- run: |
# BRANCH=${{ inputs.branch }}
BRANCH=kvm-nyx-6.0
# remove / (forbidden character in upload-artifact name)
BRANCH=${BRANCH//\//}
# env.ref = kafl/sdv-6.1
echo "ref=${{ inputs.branch }}" >> $GITHUB_ENV
# env.ref_art = kaflsdv-6.1 (for artifact name)
echo "ref_art=${BRANCH///}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
ref: ${{ env.ref }}
path: sources
- name: Ensure sudo
run: apt-get update && apt-get install -y sudo
- name: Install build deps
run: sudo apt-get install -y libelf-dev dwarves debhelper-compat flex bison bc cpio kmod libssl-dev rsync python3 rpm
- name: Get ubuntu's 22.04 6.5.0-27-generic kernel config
run: |
sudo apt install -y zstd
apt download linux-modules-6.5.0-27-generic
ar x linux-modules-6.5.0-27-generic_6.5.0-27.28~22.04.1_amd64.deb data.tar.zst
tar -xvf data.tar.zst './boot/config-6.5.0-27-generic'
mv boot/config-6.5.0-27-generic sources/.config
rm -r boot/ data.tar.zst *.deb
- name: Configure kernel and enable Nyx
run: |
# disable kernel signature
./scripts/config --disable SYSTEM_TRUSTED_KEYS
./scripts/config --disable SYSTEM_REVOCATION_KEYS
# enable KVM
./scripts/config --module KVM
# disable KVM_WERROR (otherwise compilation issues in modified KVM)
./scripts/config --disable KVM_WERROR
# enable Nyx
./scripts/config --enable KVM_NYX
# disable KVM_HYPERV due to compilation issue
./scripts/config --disable KVM_HYPERV
# tweak locaversion
./scripts/config --set-str LOCALVERSION -nyx
# save space
./scripts/config --disable DEBUG_INFO
./scripts/config --enable MODULE_COMPRESS
./scripts/config --enable MODULE_COMPRESS_ZSTD
working-directory: sources
- name: Configure SDV kernel
if: "contains(env.ref, 'sdv')"
run: |
./scripts/config --enable INTEL_TDX_HOST
# tweak locaversion
./scripts/config --set-str LOCALVERSION -sdv
working-directory: sources
- name: make olddefconfig
run: make olddefconfig
working-directory: sources
- name: Build kernel
run: |
make -j$(nproc) bindeb-pkg binrpm-pkg
working-directory: sources
- uses: actions/upload-artifact@v4
with:
name: linux-${{ env.ref_art }}
path: '*.deb'
- run: rm -rf *.deb
release:
# this job makes an official Github release
if: ${{ inputs.publish == 'true' }}
needs: [debian_package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
BRANCH=${{ inputs.branch }}
# remove / (forbidden character in upload-artifact name)
BRANCH=${BRANCH///}
# env.ref_art = kaflsdv-6.1 (for artifact name)
echo "ref_art=${BRANCH///}" >> $GITHUB_ENV
# download all artifacts to the current dir
- uses: actions/download-artifact@v4
with:
name: linux-${{ env.ref_art }}
- name: Create a Release
id: create_release
uses: softprops/action-gh-release@v1
with:
name: 'Prebuild host kernel package for ${{ inputs.branch }}'
tag_name: ${{ inputs.branch }}
files: '*.deb'