kiddin9 há 4 anos atrás
pai
commit
facbf4de6c

+ 3 - 1
.github/workflows/Openwrt-AutoBuild.yml

@@ -96,7 +96,9 @@ jobs:
     - name: Clone source code
       run: |
         [ "$REPO_BRANCH" ] ||
-            REPO_BRANCH="$(git ls-remote --tags git://github.com/openwrt/openwrt | cut -d/ -f3- | sort -t. -nk1,2 | awk '/^[^{]*$/{version=$1}END{print version}' | sed -e 's/v//')"
+            REPO_BRANCH="$((curl -gs -H 'Content-Type: application/json' \
+   -H "Authorization: Bearer ${{ secrets.REPO_TOKEN }}" \
+   -X POST -d '{ "query": "query {repository(owner: \"openwrt\", name: \"openwrt\") {refs(refPrefix: \"refs/tags/\", last: 4, orderBy: {field: TAG_COMMIT_DATE, direction: ASC}) {edges {node {name}}}}}"}' https://api.github.com/graphql) | jq -r '.data.repository.refs.edges[].node.name' | grep v21 | tail -n 1 | sed -e 's/v//')"
         git clone --depth 1 $REPO_URL -b v$REPO_BRANCH openwrt
         cd openwrt
         if [[ ${{matrix.target}} == "x86_64" ]]; then

+ 3 - 1
.github/workflows/repo-dispatcher.yml

@@ -69,7 +69,9 @@ jobs:
         else
           [ "$REPO_BRANCH" ] && exit 0;
           REPO_BRANCH_r=$(curl -s https://op.supes.top/firmware/x86_64/version.txt | tr "\r\n" "," | cut -f 3 -d ,)
-          REPO_BRANCH="$(git ls-remote --tags git://github.com/openwrt/openwrt | cut -d/ -f3- | sort -t. -nk1,2 | awk '/^[^{]*$/{version=$1}END{print version}')"
+          REPO_BRANCH="$((curl -gs -H 'Content-Type: application/json' \
+   -H "Authorization: Bearer ${{ secrets.REPO_TOKEN }}" \
+   -X POST -d '{ "query": "query {repository(owner: \"openwrt\", name: \"openwrt\") {refs(refPrefix: \"refs/tags/\", last: 4, orderBy: {field: TAG_COMMIT_DATE, direction: ASC}) {edges {node {name}}}}}"}' https://api.github.com/graphql) | jq -r '.data.repository.refs.edges[].node.name' | grep v21 | tail -n 1)"
             if [ $REPO_BRANCH_r != $REPO_BRANCH ]; then
               curl \
               -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \

+ 23 - 22
devices/common/diy.sh

@@ -6,16 +6,18 @@ sed -i '/	refresh_config();/d' scripts/feeds
 ./scripts/feeds install -a -p custom
 ./scripts/feeds install -a
 cd feeds/custom; git pull; cd -
-sed -i 's/\/cgi-bin\/\(luci\|cgi-\)/\/\1/g' `find package/feeds/custom/luci-*/ -name "*.lua" -or -name "*.htm*" -or -name "*.js"` &
-sed -i 's/Os/O2/g' include/target.mk
+(
+svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/package/network/services/ppp package/network/services/ppp
+svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/package/network/services/dnsmasq package/network/services/dnsmasq
 svn export --force https://github.com/coolsnowwolf/lede/trunk/tools/upx tools/upx
 svn export --force https://github.com/coolsnowwolf/lede/trunk/tools/ucl tools/ucl
-sed -i 's?zstd$?zstd ucl upx\n$(curdir)/upx/compile := $(curdir)/ucl/compile?g' tools/Makefile
 svn co https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/target/linux/generic/hack-5.4 target/linux/generic/hack-5.4
+curl -L https://git.io/J0klM --create-dirs -o package/network/config/firewall/patches/fullconenat.patch
+) &
+sed -i 's?zstd$?zstd ucl upx\n$(curdir)/upx/compile := $(curdir)/ucl/compile?g' tools/Makefile
+sed -i 's/\/cgi-bin\/\(luci\|cgi-\)/\/\1/g' `find package/feeds/custom/luci-*/ -name "*.lua" -or -name "*.htm*" -or -name "*.js"` &
+sed -i 's/Os/O2/g' include/target.mk
 rm -rf target/linux/generic/hack-5.4/220-gc_sections.patch
-#svn co https://github.com/immortalwrt/immortalwrt/branches/master/target/linux/generic/hack-5.10 target/linux/generic/hack-5.10
-svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/package/network/services/ppp package/network/services/ppp
-svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/package/network/services/dnsmasq package/network/services/dnsmasq
 sed -i 's/$(TARGET_DIR)) install/$(TARGET_DIR)) install --force-overwrite/' package/Makefile
 sed -i 's/root:.*/root:$1$tTPCBw1t$ldzfp37h5lSpO9VXk4uUE\/:18336:0:99999:7:::/g' package/base-files/files/etc/shadow
 sed -i '$a /etc/sysupgrade.conf' package/base-files/files/lib/upgrade/keep.d/base-files-essential
@@ -28,24 +30,8 @@ sed -i '$a CONFIG_ACPI=y\nCONFIG_X86_ACPI_CPUFREQ=y\nCONFIG_NR_CPUS=128\nCONFIG_
 CONFIG_CRYPTO_CHACHA20POLY1305=y\nCONFIG_BINFMT_MISC=y' `find target/linux -path "target/linux/*/config-*"`
 sed -i 's/max_requests 3/max_requests 20/g' package/network/services/uhttpd/files/uhttpd.config
 #rm -rf ./feeds/packages/lang/{golang,node}
-#svn export https://github.com/immortalwrt/packages/trunk/lang/golang feeds/packages/lang/golang
-#svn export https://github.com/immortalwrt/packages/trunk/lang/node feeds/packages/lang/node
-curl -L https://git.io/J0klM --create-dirs -o package/network/config/firewall/patches/fullconenat.patch
 sed -i 's?admin/status/channel_analysis??' package/feeds/luci/luci-mod-status/root/usr/share/luci/menu.d/luci-mod-status.json
 sed -i "s/askfirst/respawn/g" `find package target -name inittab`
-
-sed -i \
-	-e "s/+\(luci\|luci-ssl\|uhttpd\)\( \|$\)/\2/" \
-	-e "s/+nginx\( \|$\)/+nginx-ssl\1/" \
-	-e 's/+python\( \|$\)/+python3/' \
-	-e 's?../../lang?$(TOPDIR)/feeds/packages/lang?' \
-	package/feeds/custom/*/Makefile
-
-for ipk in $(ls -d package/feeds/custom/*); do
-	if [[ ! -d "$ipk/patches" ]]; then
-		sed -i "s/PKG_SOURCE_VERSION:=[0-9a-z]\{7,\}/PKG_SOURCE_VERSION:=HEAD/g" !(luci-app*)/Makefile
-	fi	
-done
 sed -i 's/$(VERSION) &&/$(VERSION) ;/g' include/download.mk
 date=`date +%m.%d.%Y`
 sed -i "s/DISTRIB_DESCRIPTION.*/DISTRIB_DESCRIPTION=\"%D %C by Kiddin'\"/g" package/base-files/files/etc/openwrt_release
@@ -53,6 +39,7 @@ sed -i "s/CONFIG_VERSION_CODE=.*/CONFIG_VERSION_CODE=\"$date\"/g" devices/common
 sed -i '$a cgi-timeout = 300' package/feeds/packages/uwsgi/files-luci-support/luci-webui.ini
 sed -i 's/limit-as.*/limit-as = 5000/' package/feeds/packages/uwsgi/files-luci-support/luci-webui.ini
 
+(
 if [ -f sdk.tar.xz ]; then
 	sed -i 's,$(STAGING_DIR_HOST)/bin/upx,upx,' package/feeds/custom/*/Makefile
 	mkdir sdk
@@ -67,3 +54,17 @@ if [ -f sdk.tar.xz ]; then
 	fi
 	ln -sf /usr/bin/python3 staging_dir/host/bin/python3
 fi
+) &
+
+sed -i \
+	-e "s/+\(luci\|luci-ssl\|uhttpd\)\( \|$\)/\2/" \
+	-e "s/+nginx\( \|$\)/+nginx-ssl\1/" \
+	-e 's/+python\( \|$\)/+python3/' \
+	-e 's?../../lang?$(TOPDIR)/feeds/packages/lang?' \
+	package/feeds/custom/*/Makefile
+
+for ipk in $(ls -d package/feeds/custom/*); do
+	if [[ ! -d "$ipk/patches" ]]; then
+		sed -i "s/PKG_SOURCE_VERSION:=[0-9a-z]\{7,\}/PKG_SOURCE_VERSION:=HEAD/g" !(luci-app*)/Makefile
+	fi	
+done

+ 1 - 1
devices/common/settings.ini

@@ -1,5 +1,5 @@
 REPO_URL="https://github.com/openwrt/openwrt"
-REPO_BRANCH="21.02.0"
+REPO_BRANCH=""
 CONFIG_FILE=".config"
 DIY_SH="diy.sh"
 FREE_UP_DISK="false"

+ 2 - 2
devices/nanopi-r2s/diy.sh

@@ -2,15 +2,15 @@
 
 shopt -s extglob
 rm -rf package/boot/uboot-rockchip
+(
 svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/package/boot/uboot-rockchip package/boot/uboot-rockchip
 svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/package/boot/arm-trusted-firmware-rockchip-vendor package/boot/arm-trusted-firmware-rockchip-vendor
 rm -rf target/linux/rockchip/!(patches-5.4)
 svn co https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/target/linux/rockchip target/linux/rockchip
 rm -rf target/linux/rockchip/{.svn,patches-5.4/.svn}
 svn co https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/target/linux/rockchip/patches-5.4 target/linux/rockchip/patches-5.4
-
 curl -L https://git.io/J0klE -o package/kernel/linux/modules/video.mk
-
+) &
 mkdir -p files/etc/rc.d
 curl -L https://git.io/J0kc3 --create-dirs -o files/usr/bin/start-rk3328-pwm-fan.sh
 curl -L https://git.io/J0kW8 --create-dirs -o files/etc/init.d/fa-rk3328-pwmfan

+ 2 - 2
devices/nanopi-r4s/diy.sh

@@ -2,15 +2,15 @@
 
 shopt -s extglob
 rm -rf package/boot/uboot-rockchip
+(
 svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/package/boot/uboot-rockchip package/boot/uboot-rockchip
 svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/package/boot/arm-trusted-firmware-rockchip-vendor package/boot/arm-trusted-firmware-rockchip-vendor
 rm -rf target/linux/rockchip/!(patches-5.4)
 svn co https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/target/linux/rockchip target/linux/rockchip
 rm -rf target/linux/rockchip/{.svn,patches-5.4/.svn}
 svn co https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/target/linux/rockchip/patches-5.4 target/linux/rockchip/patches-5.4
-
 curl -L https://git.io/J0klE -o package/kernel/linux/modules/video.mk
-
+) &
 mkdir -p files/etc/rc.d
 curl -L https://git.io/J0kRv --create-dirs -o files/usr/bin/start-rk3399-pwm-fan.sh
 curl -L https://git.io/J0kRG --create-dirs -o files/etc/init.d/fa-rk3399-pwmfan

+ 1 - 2
onekey/build.sh

@@ -82,8 +82,7 @@ case $CHOOSE in
 esac
 done
 
-REPO_BRANCH="$(git ls-remote --tags git://github.com/openwrt/openwrt | cut -d/ -f3- | sort -t. -nk1,2 | awk '/^[^{]*$/{version=$1}END{print version}'| sed -e 's/v//')"
-REPO_BRANCH="21.02.0"
+REPO_BRANCH="$(curl -s https://api.github.com/repos/openwrt/openwrt/tags | jq -r '.[].name' | grep v21 | head -n 1 | sed -e 's/v//')"
 git clone -b v$REPO_BRANCH --depth 1 https://github.com/openwrt/openwrt
 svn export https://github.com/kiddin9/OpenWrt_x86-r2s-r4s/trunk/devices openwrt/devices