forked from debuggerx01/kernel_deb_builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_action.sh
39 lines (29 loc) · 911 Bytes
/
build_action.sh
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
#!/usr/bin/env bash
VERSION="5.15.102"
# # add deb-src to sources.list
sed -i "/deb-src/s/# //g" /etc/apt/sources.list
# install dep
sudo apt update
sudo apt install -y wget git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison
sudo apt build-dep -y linux
# change dir to workplace
cd "${GITHUB_WORKSPACE}" || exit
# download kernel source
wget http://www.kernel.org/pub/linux/kernel/v5.x/linux-"$VERSION".tar.xz
tar -xf linux-"$VERSION".tar.xz
cd linux-"$VERSION" || exit
# copy config file
cp ../config .config
# disable DEBUG_INFO to speedup build
scripts/config --disable DEBUG_INFO
# apply patches
# shellcheck source=src/util.sh
patch -p1 < ../patch.d/gpl.patch
# build deb packages
CPU_CORES=$(($(grep -c processor < /proc/cpuinfo)*2))
make deb-pkg -j"$CPU_CORES"
# move deb packages to artifact dir
cd ..
rm -rfv *dbg*.deb
mkdir "artifact"
mv ./*.deb artifact/