auto-building
This commit is contained in:
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@@ -1,5 +1,7 @@
|
|||||||
name: Build kernel deb packages
|
name: Build kernel deb packages(6)
|
||||||
on:
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -24,4 +26,4 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
env:
|
env:
|
||||||
PASSWORD: ${{ secrets.PASSWORD }}
|
PASSWORD: ${{ secrets.PASSWORD }}
|
||||||
run: bash build_action.sh
|
run: bash build_action.sh 6
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
#!/usr/bin/env bash
|
#!/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
|
sed -i "/deb-src/s/# //g" /etc/apt/sources.list
|
||||||
|
|
||||||
# install dep
|
|
||||||
sudo apt update
|
sudo apt update
|
||||||
|
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`
|
||||||
|
curl https://github.com/gfdgd-xi/dclc-kernel/raw/main/$VERSION/index.html
|
||||||
|
if [[ $? == 0 ]]; then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
# install dep
|
||||||
sudo apt install -y wget xz-utils make gcc flex bison dpkg-dev bc rsync kmod cpio libssl-dev git lsb vim libelf-dev
|
sudo apt install -y wget xz-utils make gcc flex bison dpkg-dev bc rsync kmod cpio libssl-dev git lsb vim libelf-dev
|
||||||
sudo apt build-dep -y linux
|
sudo apt build-dep -y linux
|
||||||
|
|
||||||
@@ -13,7 +20,7 @@ sudo apt build-dep -y linux
|
|||||||
cd "${GITHUB_WORKSPACE}" || exit
|
cd "${GITHUB_WORKSPACE}" || exit
|
||||||
|
|
||||||
# download kernel source
|
# download kernel source
|
||||||
wget http://www.kernel.org/pub/linux/kernel/v6.x/linux-$VERSION.tar.gz
|
wget $URL
|
||||||
tar -xf linux-"$VERSION".tar.gz
|
tar -xf linux-"$VERSION".tar.gz
|
||||||
cd linux-"$VERSION" || exit
|
cd linux-"$VERSION" || exit
|
||||||
|
|
||||||
|
|||||||
42
get-newest-version.py
Normal file
42
get-newest-version.py
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import pyquery
|
||||||
|
|
||||||
|
def CompareVersion(old, new):
|
||||||
|
oldList = old.split(".")
|
||||||
|
newList = new.split(".")
|
||||||
|
for i in range(len(oldList)):
|
||||||
|
oldN = int(oldList[i])
|
||||||
|
try:
|
||||||
|
newN = int(newList[i])
|
||||||
|
except:
|
||||||
|
newN = 0
|
||||||
|
if newN > oldN:
|
||||||
|
return 1
|
||||||
|
if newN < oldN:
|
||||||
|
return -1
|
||||||
|
return 0
|
||||||
|
|
||||||
|
version=sys.argv[1]
|
||||||
|
newestVersion = "0.0.0"
|
||||||
|
newestUrl = ""
|
||||||
|
programVersionList = pyquery.PyQuery(url=f"https://cdn.kernel.org/pub/linux/kernel/v{version}.x/")
|
||||||
|
for i in programVersionList("a").items():
|
||||||
|
#continue
|
||||||
|
url = i.attr.href
|
||||||
|
if url[-7:] == ".tar.xz" and url[:6] == "linux-":
|
||||||
|
nowversion = os.path.basename(url).lower().replace("linux-", "").replace(".tar.xz", "")
|
||||||
|
if "-" in nowversion:
|
||||||
|
nowversion = nowversion[:nowversion.index("-")]
|
||||||
|
print(newestUrl)
|
||||||
|
if CompareVersion(newestVersion, nowversion) == 1:
|
||||||
|
newestVersion = nowversion
|
||||||
|
newestUrl = url
|
||||||
|
print(newestVersion)
|
||||||
|
newestUrl = f"https://cdn.kernel.org/pub/linux/kernel/v{version}.x/{newestUrl}"
|
||||||
|
print(newestUrl)
|
||||||
|
with open("/tmp/kernelversion.txt", "w") as file:
|
||||||
|
file.write(newestVersion)
|
||||||
|
with open("/tmp/kernelurl.txt", "w") as file:
|
||||||
|
file.write(newestUrl)
|
||||||
Reference in New Issue
Block a user