This commit is contained in:
debuggerx 2021-08-03 14:07:27 +08:00
parent d6ff6cfb5b
commit f6691914c7
5 changed files with 11071 additions and 0 deletions

27
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Build deb packages
on: push
jobs:
build:
name: Build my artifact
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 1024
swap-size-mb: 1024
remove-dotnet: 'true'
remove-android: 'true'
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: sudo bash build_action.sh
- name: Artifact
uses: actions/upload-artifact@v2
with:
name: artifact
path: artifact/

36
build_action.sh Normal file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env bash
VERSION=$(grep 'Kernel Configuration' < config | awk '{print $3}')
# 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
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
# apply patches
# shellcheck source=src/util.sh
source ./patch.d/*.sh
# build deb packages
CPU_CORES=$(grep -c processor < /proc/cpuinfo)
make deb-pkg -j"$CPU_CORES"
# copy deb packages to artifact dir
cd ..
mkdir "artifact"
# shellcheck disable=SC2010
cp "$(ls -- *.deb | grep -v dbg)" artifact/

26
build_on_uos.sh Normal file
View File

@ -0,0 +1,26 @@
#!/usr/bin/env bash
# add deb-src to sources.list
echo "deb-src https://home-packages.chinauos.com/home plum main contrib non-free" >> /etc/apt/sources.list
# install dep
sudo apt update
sudo apt install -y wget
sudo apt build-dep -y linux
# download kernel source
wget http://www.kernel.org/pub/linux/kernel/v5.x/linux-5.10.41.tar.xz
tar -xf linux-5.10.41.tar.xz
cd linux-5.10.41 || exit
# copy config file
cp /boot/config-5.10.41-amd64-desktop .config
# change version string
sed -i "s/-desktop/-debuggerx/g" .config
# reduce ACPI_MAX_LOOP_TIMEOUT value
sed -i "/ACPI_MAX_LOOP_TIMEOUT/s/30/3/g" include/acpi/acconfig.h
CPU_CORES=$(grep -c processor < /proc/cpuinfo)
make deb-pkg -j"$CPU_CORES"

10978
config Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
# reduce ACPI_MAX_LOOP_TIMEOUT value
sed -i "/ACPI_MAX_LOOP_TIMEOUT/s/30/3/g" include/acpi/acconfig.h