This commit is contained in:
2023-07-03 22:18:30 +08:00
parent bd229ee0ca
commit 3b31355206
3 changed files with 11796 additions and 31 deletions

29
.github/workflows/build-hwe-3.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: Build HWE kernel deb packages(3)
on:
schedule:
- cron: '0 11 * * *'
workflow_dispatch:
jobs:
build:
name: Build kernel
runs-on: ubuntu-latest
steps:
# 由于默认的 Ubuntu 环境只有 17G 左右的剩余空间,所以我们需要先利用如下 action 对编译环境进行扩容
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
# 这个值是保留给系统的空间大小,之前设置太小,总会在安装依赖或者编译过程中报设备空间不足的错误而导致编译失败
root-reserve-mb: 4096
swap-size-mb: 512
remove-dotnet: 'true'
remove-android: 'true'
- name: Checkout
uses: actions/checkout@v3
- name: Build
env:
PASSWORD: ${{ secrets.PASSWORD }}
run: bash build_action.sh 3 1

View File

@@ -5,11 +5,15 @@ sudo apt install python3-pyquery -y
python3 get-newest-version.py $1 python3 get-newest-version.py $1
#VERSION=$(grep 'Kernel Configuration' < config | awk '{print $3}') #VERSION=$(grep 'Kernel Configuration' < config | awk '{print $3}')
# add deb-src to sources.list # add deb-src to sources.list
VERSION=`cat /tmp/kernelversion.txt` VERSION=`cat /tmp/kernelversion.txt`
URL=`cat /tmp/kernelurl.txt` URL=`cat /tmp/kernelurl.txt`
MAINVERSION=`expr substr $VERSION 1 1` MAINVERSION=`expr substr $VERSION 1 1`
curl https://github.com/gfdgd-xi/dclc-kernel/raw/main/$VERSION/index.html | grep 404 SHOWVERSION=$VERSION
# 使用 deepin hwe config编译
if [[ $2 == 1 ]]; then
SHOWVERSION=$VERSION-hwe
fi
curl https://github.com/gfdgd-xi/dclc-kernel/raw/main/$SHOWVERSION/index.html | grep 404
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
exit exit
fi fi
@@ -26,7 +30,12 @@ tar -xvf linux-"$VERSION".tar.xz
cd linux-"$VERSION" || exit cd linux-"$VERSION" || exit
# copy config file # copy config file
# 使用 deepin hwe config编译
if [[ $2 == 1 ]]; then
cp ../config-6.1.11-amd64-desktop-hwe .config
else
cp ../config .config cp ../config .config
fi
# #
# disable DEBUG_INFO to speedup build # disable DEBUG_INFO to speedup build
scripts/config --disable DEBUG_INFO scripts/config --disable DEBUG_INFO
@@ -39,6 +48,66 @@ scripts/config --set-str SYSTEM_TRUSTED_KEYS ""
CPU_CORES=$(($(grep -c processor < /proc/cpuinfo)*2)) CPU_CORES=$(($(grep -c processor < /proc/cpuinfo)*2))
sudo make bindeb-pkg -j"$CPU_CORES" sudo make bindeb-pkg -j"$CPU_CORES"
if [[ $2 == 1 ]]; then
# move deb packages to artifact dir
cd ..
mkdir "artifact"
#cp ./*.deb artifact/
git clone https://gfdgd-xi:$PASSWORD@github.com/gfdgd-xi/dclc-kernel
#cd dclc-kernel
mkdir dclc-kernel/$VERSION
rm -rfv *dbg*.deb
mv ./*.deb dclc-kernel/$VERSION
cd dclc-kernel/$VERSION
cd ..
cd head
cat > deb/DEBIAN/control <<EOF
Package: linux-kernel-dclc-gfdgdxi-hwe
Version: $VERSION
Maintainer: gfdgd xi <3025613752@qq.com>
Homepage: https://github.com/gfdgd-xi/dclc-kernel
Architecture: amd64
Severity: serious
Certainty: possible
Check: binaries
Type: binary, udeb
Priority: optional
Depends: linux-headers-$VERSION-amd64-desktop-hwe, linux-image-$VERSION-amd64-desktop-hwe
Section: utils
Installed-Size: 0
Description: 内核(虚包)
EOF
if [[ ! -d deb-$MAINVERSION ]]; then
mkdir -pv deb-$MAINVERSION/DEBIAN
fi
cat > deb-$MAINVERSION/DEBIAN/control <<EOF
Package: linux-kernel-dclc-gfdgdxi-$MAINVERSION-hwe
Version: $VERSION
Maintainer: gfdgd xi <3025613752@qq.com>
Homepage: https://github.com/gfdgd-xi/dclc-kernel
Architecture: amd64
Severity: serious
Certainty: possible
Check: binaries
Type: binary, udeb
Priority: optional
Depends: linux-headers-$VERSION-amd64-desktop-hwe, linux-image-$VERSION-amd64-desktop-hwe
Section: utils
Installed-Size: 0
Description: 内核(虚包)
EOF
dpkg -b deb linux-kernel-dclc-gfdgdxi-hwe_${VERSION}_amd64.deb
dpkg -b deb-$MAINVERSION linux-kernel-dclc-gfdgdxi-$MAINVERSION-hwe_${VERSION}_amd64.deb
cd ..
bash ./repack-zstd --scan .
./build.py
git add .
git pull
git config --global user.email 3025613752@qq.com
git config --global user.name gfdgd-xi
git commit -m 提交$MAINVERSION
git push
else
# move deb packages to artifact dir # move deb packages to artifact dir
cd .. cd ..
mkdir "artifact" mkdir "artifact"
@@ -87,7 +156,7 @@ Installed-Size: 0
Description: 内核(虚包) Description: 内核(虚包)
EOF EOF
dpkg -b deb linux-kernel-dclc-gfdgdxi_${VERSION}_amd64.deb dpkg -b deb linux-kernel-dclc-gfdgdxi_${VERSION}_amd64.deb
dpkg -b deb-$MAINVERSION linux-kernel-dclc-gfdgdxi-$MAINVERSION_${VERSION}_amd64.deb dpkg -b deb-$MAINVERSION linux-kernel-dclc-gfdgdxi-${MAINVERSION}_${VERSION}_amd64.deb
cd .. cd ..
bash ./repack-zstd --scan . bash ./repack-zstd --scan .
./build.py ./build.py
@@ -95,5 +164,6 @@ git add .
git pull git pull
git config --global user.email 3025613752@qq.com git config --global user.email 3025613752@qq.com
git config --global user.name gfdgd-xi git config --global user.name gfdgd-xi
git commit -m 提交$VERSION git commit -m 提交$MAINVERSION
git push git push
fi

File diff suppressed because it is too large Load Diff