-
Notifications
You must be signed in to change notification settings - Fork 4
156 lines (144 loc) · 5.96 KB
/
stable.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Build stable Kernel Package
on:
workflow_dispatch:
inputs:
release:
type: choice
description: Release type
options:
- none
- pre-release
- release
env:
HOME: /home/runner
KERNEL_STABLE_VER: 6.6.4
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Checkout Linux Kernel ${{ env.KERNEL_STABLE_VER }}
run: |
git clone --depth 1 --branch v${{ env.KERNEL_STABLE_VER }} https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux linux-${{ env.KERNEL_STABLE_VER }}
- name: Setup dependencies
run: |
sudo apt-get install -y build-essential \
bc kmod cpio flex libncurses-dev \
libelf-dev libssl-dev dwarves bison \
gawk openssl libssl-dev dkms libudev-dev \
libpci-dev libiberty-dev autoconf \
rpm debhelper lz4 ccache
- name: Apply patch
working-directory: linux-${{ env.KERNEL_STABLE_VER }}
run: |
git config user.name "GitHub Actions"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git clone https://gitlab.com/xanmod/linux-patches.git ../xanmod-patches \
&& git am ../xanmod-patches/linux-6.6.y-xanmod/net/netfilter/*.patch \
&& git am ../xanmod-patches/linux-6.6.y-xanmod/net/tcp/bbr3/*.patch \
&& git am ../xanmod-patches/linux-6.6.y-xanmod/net/tcp/cloudflare/*.patch
git clone https://github.com/clearlinux-pkgs/linux.git ../clear-patches \
&& for i in $(grep '^Patch' ../clear-patches/linux.spec |\
grep -Ev '^Patch0132|^Patch0118|^Patch0113|^Patch0138|^Patch0139' | sed -n 's/.*: //p'); do
echo "Applying patch ${i}..."
patch -Np1 -i "../clear-patches/${i}"
git commit -am "[PATCH]: clearlinux-pkgs/linux/${i}"
done
curl -sSL https://gist.githubusercontent.com/love4taylor/111d56cd2b1dc149cba6d80f617f47b1/raw/1ea1a5df138c881d5b29ea1a02bb3e88f1ff9b4b/0001-net-tcp_brutal-make-it-as-a-built-in-kernel-module.patch | patch -Np1 && git commit -am "net-tcp_brutal: make it as a built-in kernel module"
- name: Copy .config and setup some config
working-directory: linux-${{ env.KERNEL_STABLE_VER }}
run: |
cp ../config.stable .config
scripts/config --set-str LOCALVERSION "-l4t-bbr3"
# FULLCONENAT
scripts/config -e NFT_FULLCONE
# xt_FLOWOFFLOAD
scripts/config -e NETFILTER_XT_TARGET_FLOWOFFLOAD
# BBR3
scripts/config -m TCP_CONG_CUBIC \
-d DEFAULT_CUBIC \
-e TCP_CONG_BBR \
-e DEFAULT_BBR \
--set-str DEFAULT_TCP_CONG bbr
# BBR3 doesn't work properly with FQ_CODEL
scripts/config -m NET_SCH_FQ_CODEL \
-e NET_SCH_FQ \
-d DEFAULT_FQ_CODEL \
-e DEFAULT_FQ \
--set-str DEFAULT_NET_SCH fq
# TCP Brutal
scripts/config -m TCP_CONG_BRUTAL
# MGLRU
scripts/config -e LRU_GEN -e LRU_GEN_ENABLED -d LRU_GEN_STATS
# Disable DEBUG
scripts/config -d DEBUG_INFO \
-d DEBUG_INFO_BTF \
-d DEBUG_INFO_DWARF4 \
-d DEBUG_INFO_DWARF5 \
-d PAHOLE_HAS_SPLIT_BTF \
-d DEBUG_INFO_BTF_MODULES \
-d SLUB_DEBUG \
-d PM_DEBUG \
-d PM_ADVANCED_DEBUG \
-d PM_SLEEP_DEBUG \
-d ACPI_DEBUG \
-d SCHED_DEBUG \
-d LATENCYTOP \
-d DEBUG_PREEMPT \
-d DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT \
-e DEBUG_INFO_NONE
- name: Build
working-directory: linux-${{ env.KERNEL_STABLE_VER }}
env:
KBUILD_BUILD_TIMESTAMP: ''
KDEB_COMPRESS: "xz"
run: |
make \
LOCALVERSION="" \
CC="ccache gcc" \
olddefconfig
# Build deb
make \
LOCALVERSION="" \
CC="ccache gcc" \
-j`nproc` \
bindeb-pkg
# reset version
rm .version
# Build rpm
make \
LOCALVERSION="" \
CC="ccache gcc" \
RPMOPTS="--nodeps" \
-j`nproc` \
rpm-pkg
- name: Upload config
uses: actions/upload-artifact@v3
with:
name: config
path: linux-${{ env.KERNEL_STABLE_VER }}/.config
- name: Upload deb
uses: actions/upload-artifact@v3
with:
name: deb
path: |
linux-image-${{ env.KERNEL_STABLE_VER }}-l4t-bbr3_*.deb
linux-headers-${{ env.KERNEL_STABLE_VER }}-l4t-bbr3_*.deb
linux-libc-dev_${{ env.KERNEL_STABLE_VER }}*.deb
- name: Upload rpm
uses: actions/upload-artifact@v3
with:
name: rpm
path: linux-${{ env.KERNEL_STABLE_VER }}/rpmbuild/RPMS/x86_64/kernel*-${{ env.KERNEL_STABLE_VER }}_*.rpm
- name: Release
if: ${{ github.event.inputs.release != 'none' }}
uses: ncipollo/release-action@v1
with:
artifacts: |
linux-image-${{ env.KERNEL_STABLE_VER }}-l4t-bbr3_*.deb
linux-headers-${{ env.KERNEL_STABLE_VER }}-l4t-bbr3_*.deb
linux-libc-dev_${{ env.KERNEL_STABLE_VER }}*.deb
linux-${{ env.KERNEL_STABLE_VER }}/rpmbuild/RPMS/x86_64/kernel*-${{ env.KERNEL_STABLE_VER }}_*.rpm
prerelease: ${{ github.event.inputs.release == 'pre-release' }}
makeLatest: ${{ github.event.inputs.release == 'release' }}
tag: v${{ env.KERNEL_STABLE_VER }}-l4t-bbr3