Build stable kernel package #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: v6.5.10 | |
jobs: | |
build: | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Checkout Kernel ${{ env.KERNEL_STABLE_VER }} | |
run: | | |
git clone --depth 1 --branch ${{ env.KERNEL_STABLE_VER }} https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git linux-${{ env.KERNEL_STABLE_VER }} | |
- name: Setup dependencies | |
run: | | |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | |
sudo apt-get install -y build-essential \ | |
bc kmod cpio flex libncurses5-dev \ | |
libelf-dev libssl-dev dwarves bison \ | |
gawk openssl libssl-dev dkms libudev-dev \ | |
libpci-dev libiberty-dev autoconf \ | |
gcc-13 rpm debhelper lz4 | |
- 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" | |
curl -sSL https://raw.githubusercontent.com/CachyOS/kernel-patches/master/6.5/0002-amd-pref-core.patch | git apply -v --index \ | |
&& git commit -m "Applied amd-pref-core.patch" | |
curl -sSL https://raw.githubusercontent.com/CachyOS/kernel-patches/master/6.5/0003-bbr3.patch | git apply -v --index \ | |
&& git commit -m "Applied bbr3.patch" | |
curl -sSL https://raw.githubusercontent.com/CachyOS/kernel-patches/master/6.5/misc/0001-lrng.patch | git apply -v --index \ | |
&& git commit -m "Applied lrng.patch" | |
- 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" | |
# 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 | |
# MGLRU | |
scripts/config -e LRU_GEN -e LRU_GEN_ENABLED -d LRU_GEN_STATS | |
# Enable LRNG | |
scripts/config -d RANDOM_DEFAULT_IMPL \ | |
-e LRNG \ | |
-e LRNG_SHA256 \ | |
-e LRNG_COMMON_DEV_IF \ | |
-e LRNG_DRNG_ATOMIC \ | |
-e LRNG_SYSCTL \ | |
-e LRNG_RANDOM_IF \ | |
-e LRNG_AIS2031_NTG1_SEEDING_STRATEGY \ | |
-m LRNG_KCAPI_IF \ | |
-m LRNG_HWRAND_IF \ | |
-e LRNG_DEV_IF \ | |
-e LRNG_RUNTIME_ES_CONFIG \ | |
-e LRNG_IRQ_DFLT_TIMER_ES \ | |
-d LRNG_SCHED_DFLT_TIMER_ES \ | |
-e LRNG_TIMER_COMMON \ | |
-d LRNG_COLLECTION_SIZE_256 \ | |
-d LRNG_COLLECTION_SIZE_512 \ | |
-e LRNG_COLLECTION_SIZE_1024 \ | |
-d LRNG_COLLECTION_SIZE_2048 \ | |
-d LRNG_COLLECTION_SIZE_4096 \ | |
-d LRNG_COLLECTION_SIZE_8192 \ | |
--set-val LRNG_COLLECTION_SIZE 1024 \ | |
-e LRNG_HEALTH_TESTS \ | |
--set-val LRNG_RCT_CUTOFF 31 \ | |
--set-val LRNG_APT_CUTOFF 325 \ | |
-e LRNG_IRQ \ | |
-e LRNG_CONTINUOUS_COMPRESSION_ENABLED \ | |
-d LRNG_CONTINUOUS_COMPRESSION_DISABLED \ | |
-e LRNG_ENABLE_CONTINUOUS_COMPRESSION \ | |
-e LRNG_SWITCHABLE_CONTINUOUS_COMPRESSION \ | |
--set-val LRNG_IRQ_ENTROPY_RATE 256 \ | |
-e LRNG_JENT \ | |
--set-val LRNG_JENT_ENTROPY_RATE 16 \ | |
-e LRNG_CPU \ | |
--set-val LRNG_CPU_FULL_ENT_MULTIPLIER 1 \ | |
--set-val LRNG_CPU_ENTROPY_RATE 8 \ | |
-e LRNG_SCHED \ | |
--set-val LRNG_SCHED_ENTROPY_RATE 4294967295 \ | |
-e LRNG_DRNG_CHACHA20 \ | |
-m LRNG_DRBG \ | |
-m LRNG_DRNG_KCAPI \ | |
-e LRNG_SWITCH \ | |
-e LRNG_SWITCH_HASH \ | |
-m LRNG_HASH_KCAPI \ | |
-e LRNG_SWITCH_DRNG \ | |
-m LRNG_SWITCH_DRBG \ | |
-m LRNG_SWITCH_DRNG_KCAPI \ | |
-e LRNG_DFLT_DRNG_CHACHA20 \ | |
-d LRNG_DFLT_DRNG_DRBG \ | |
-d LRNG_DFLT_DRNG_KCAPI \ | |
-e LRNG_TESTING_MENU \ | |
-d LRNG_RAW_HIRES_ENTROPY \ | |
-d LRNG_RAW_JIFFIES_ENTROPY \ | |
-d LRNG_RAW_IRQ_ENTROPY \ | |
-d LRNG_RAW_RETIP_ENTROPY \ | |
-d LRNG_RAW_REGS_ENTROPY \ | |
-d LRNG_RAW_ARRAY \ | |
-d LRNG_IRQ_PERF \ | |
-d LRNG_RAW_SCHED_HIRES_ENTROPY \ | |
-d LRNG_RAW_SCHED_PID_ENTROPY \ | |
-d LRNG_RAW_SCHED_START_TIME_ENTROPY \ | |
-d LRNG_RAW_SCHED_NVCSW_ENTROPY \ | |
-d LRNG_SCHED_PERF \ | |
-d LRNG_ACVT_HASH \ | |
-d LRNG_RUNTIME_MAX_WO_RESEED_CONFIG \ | |
-d LRNG_TEST_CPU_ES_COMPRESSION \ | |
-e LRNG_SELFTEST \ | |
-d LRNG_SELFTEST_PANIC \ | |
-d LRNG_RUNTIME_FORCE_SEEDING_DISABLE | |
- name: Build | |
working-directory: linux-${{ env.KERNEL_STABLE_VER }} | |
env: | |
KDEB_COMPRESS: "xz" | |
KCFLAGS: "-O3" | |
run: | | |
make \ | |
LOCALVERSION="" \ | |
CC="gcc-13" \ | |
olddefconfig | |
# Build deb | |
make \ | |
LOCALVERSION="" \ | |
CC="gcc-13" \ | |
-j`nproc` \ | |
bindeb-pkg | |
# reset version | |
rm .version | |
# Build rpm | |
make \ | |
LOCALVERSION="" \ | |
CC="gcc-13" \ | |
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-*.deb | |
- name: Upload rpm | |
uses: actions/upload-artifact@v3 | |
with: | |
name: rpm | |
path: /home/runner/rpmbuild/RPMS/x86_64/*.rpm | |
- name: Release | |
if: ${{ github.event.inputs.release != 'none' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "linux-*.deb,/home/runner/rpmbuild/RPMS/x86_64/*.rpm" | |
prerelease: ${{ github.event.inputs.release == 'pre-release' }} | |
makeLatest: ${{ github.event.inputs.release == 'release' }} | |
tag: ${{ env.KERNEL_STABLE_VER }} |