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

View File

@@ -5,11 +5,15 @@ sudo apt install python3-pyquery -y
python3 get-newest-version.py $1
#VERSION=$(grep 'Kernel Configuration' < config | awk '{print $3}')
# add deb-src to sources.list
VERSION=`cat /tmp/kernelversion.txt`
URL=`cat /tmp/kernelurl.txt`
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
exit
fi
@@ -26,7 +30,12 @@ tar -xvf linux-"$VERSION".tar.xz
cd linux-"$VERSION" || exit
# copy config file
cp ../config .config
# 使用 deepin hwe config编译
if [[ $2 == 1 ]]; then
cp ../config-6.1.11-amd64-desktop-hwe .config
else
cp ../config .config
fi
#
# disable DEBUG_INFO to speedup build
scripts/config --disable DEBUG_INFO
@@ -39,19 +48,79 @@ scripts/config --set-str SYSTEM_TRUSTED_KEYS ""
CPU_CORES=$(($(grep -c processor < /proc/cpuinfo)*2))
sudo make bindeb-pkg -j"$CPU_CORES"
# 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
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
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
Version: $VERSION
Maintainer: gfdgd xi <3025613752@qq.com>
@@ -67,10 +136,10 @@ Section: utils
Installed-Size: 0
Description: 内核(虚包)
EOF
if [[ ! -d deb-$MAINVERSION ]]; then
mkdir -pv deb-$MAINVERSION/DEBIAN
fi
cat > deb-$MAINVERSION/DEBIAN/control <<EOF
if [[ ! -d deb-$MAINVERSION ]]; then
mkdir -pv deb-$MAINVERSION/DEBIAN
fi
cat > deb-$MAINVERSION/DEBIAN/control <<EOF
Package: linux-kernel-dclc-gfdgdxi-$MAINVERSION
Version: $VERSION
Maintainer: gfdgd xi <3025613752@qq.com>
@@ -86,14 +155,15 @@ Section: utils
Installed-Size: 0
Description: 内核(虚包)
EOF
dpkg -b deb linux-kernel-dclc-gfdgdxi_${VERSION}_amd64.deb
dpkg -b deb-$MAINVERSION linux-kernel-dclc-gfdgdxi-$MAINVERSION_${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 提交$VERSION
git push
dpkg -b deb linux-kernel-dclc-gfdgdxi_${VERSION}_amd64.deb
dpkg -b deb-$MAINVERSION linux-kernel-dclc-gfdgdxi-${MAINVERSION}_${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
fi