kiddin9 3 years ago
parent
commit
96d41c8978

+ 10 - 8
.github/workflows/Openwrt-AutoBuild.yml

@@ -149,8 +149,8 @@ jobs:
         fi
         cp -Rf ./diy/* ./ || true
         if [ -f "devices/${{matrix.target}}/default-settings" ]; then
-          echo >> package/*/*/my-default-settings/files/uci.defaults
-          cat devices/${{matrix.target}}/default-settings >> package/*/*/my-default-settings/files/uci.defaults
+          echo >> package/*/*/my-default-settings/files/etc/uci-defaults/95-default-settings
+          cat devices/${{matrix.target}}/default-settings >> package/*/*/my-default-settings/files/etc/uci-defaults/95-default-settings
         fi
         cp -f devices/common/$CONFIG_FILE .config
         if [ -f "devices/${{matrix.target}}/$CONFIG_FILE" ]; then
@@ -169,9 +169,9 @@ jobs:
     - name: Default PPPOE Setting
       if: env.PPPOE_USERNAME && env.PPPOE_PASSWD
       run: |
-        sed -i '$i uci set network.wan.username=${{ env.PPPOE_USERNAME }}' openwrt/package/*/*/my-default-settings/files/uci.defaults
-        sed -i '$i uci set network.wan.password=${{ env.PPPOE_PASSWD }}' openwrt/package/*/*/my-default-settings/files/uci.defaults
-        sed -i '$i uci commit network' openwrt/package/*/*/my-default-settings/files/uci.defaults
+        sed -i '$i uci set network.wan.username=${{ env.PPPOE_USERNAME }}' openwrt/package/*/*/my-default-settings/files/etc/uci-defaults/95-default-settings
+        sed -i '$i uci set network.wan.password=${{ env.PPPOE_PASSWD }}' openwrt/package/*/*/my-default-settings/files/etc/uci-defaults/95-default-settings
+        sed -i '$i uci commit network' openwrt/package/*/*/my-default-settings/files/etc/uci-defaults/95-default-settings
               
     - name: SSH connection to Actions
       uses: kiddin9/debugger-action@master
@@ -262,6 +262,8 @@ jobs:
           echo $md5 >> $i/version.txt
           echo v$REPO_BRANCH >> $i/version.txt
         done
+        mkdir ${{ env.REPO_BRANCH }}
+        cp -rf openwrt/bin/targets ${{ env.REPO_BRANCH }}/
         Emoji=("🎉" "🤞" "✨" "🎁" "🎈" "🎄" "🎨" "💋" "🍓" "🍕" "🍉" "💐" "🌴" "🚀" "🛸" "🗽" "⛅" "🌈" "🔥" "⛄" "🐶" "🏅" "🦄" "🐤")
         echo "EMOJI=${Emoji[$[$RANDOM % ${#Emoji[@]}]]}" >> $GITHUB_ENV
         if [ ${{matrix.target}} == "x86_64" ]; then
@@ -296,11 +298,11 @@ jobs:
       if: env.SSH_PRIVATE_KEY && ! contains(github.event.action, 'noser')
       with:
         SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
-        ARGS: "-avzr"
-        SOURCE: openwrt/bin/targets
+        ARGS: "-avzr --delete"
+        SOURCE: openwrt/${{ env.REPO_BRANCH }}/targets
         REMOTE_HOST: op.supes.top
         REMOTE_USER: root
-        TARGET: "/www/wwwroot/op.supes.top/releases/${{ env.REPO_BRANCH }}/"
+        TARGET: "/www/wwwroot/op.supes.top/releases/"
 
     - name: Upload firmware for artifact
       uses: actions/upload-artifact@main

+ 1 - 3
devices/Rpi-4B/diy.sh

@@ -3,9 +3,7 @@
 sed -i 's,ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305,ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256,g' package/feeds/kiddin9/luci-app-bypass/root/usr/share/ssrplus/gentrojanconfig
 sed -i 's,TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256,TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256,g' package/feeds/kiddin9/luci-app-bypass/root/usr/share/ssrplus/gentrojanconfig
 
-sed -i -e 's/ autocore-arm/ my-autocore-arm/' -e 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += luci-app-cpufreq/' target/linux/bcm27xx/Makefile
-
-sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES +=kmod-usb-net-asix-ax88179/' target/linux/bcm27xx/Makefile
+sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += my-autocore-arm luci-app-cpufreq kmod-usb-net-asix-ax88179 kmod-usb-net-rtl8152/' target/linux/bcm27xx/Makefile
 
 echo '
 CONFIG_ARM64_CRYPTO=y

+ 1 - 3
devices/common/diy.sh

@@ -22,7 +22,7 @@ sed -i '/$(curdir)\/compile:/c\$(curdir)/compile: package/opkg/host/compile' pac
 
 sed -i "s/DEFAULT_PACKAGES:=/DEFAULT_PACKAGES:=luci-app-advanced luci-app-firewall luci-app-gpsysupgrade luci-app-opkg luci-app-bypass luci-app-upnp luci-app-autoreboot \
 luci-app-wizard luci-app-attendedsysupgrade dnsmasq-full luci-base luci-compat luci-lib-ipkg \
-coremark my-default-settings wget-ssl curl htop nano iptables-mod-fullconenat zram-swap kmod-lib-zstd kmod-tcp-bbr bash \
+coremark wget-ssl curl htop nano iptables-mod-fullconenat zram-swap kmod-lib-zstd kmod-tcp-bbr bash \
 wpad-basic-wolfssl kmod-usb2 kmod-usb3 automount /" include/target.mk
 sed -i "/dnsmasq \\\/d" include/target.mk
 
@@ -45,8 +45,6 @@ svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-5.10
 rm -rf target/linux/generic/hack-5.10/{220-gc_sections*,781-dsa-register*,780-drivers-net*}
 ) &
 
-chmod +x files/usr/bin/* files/etc/init.d/*
-
 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/kiddin9/luci-*/ -name "*.lua" -or -name "*.htm*" -or -name "*.js"` &
 sed -i 's/Os/O2/g' include/target.mk

+ 0 - 7
devices/common/diy/target/linux/rockchip/files/etc/init.d/fa-fancontrol

@@ -1,7 +0,0 @@
-#!/bin/sh /etc/rc.common
-
-START=21
-start() {
-    /usr/bin/fa-fancontrol.sh &
-}
-

+ 0 - 69
devices/common/diy/target/linux/rockchip/files/usr/bin/fa-fancontrol.sh

@@ -1,69 +0,0 @@
-#!/bin/bash
-
-# determine fan controller
-if [ -d /sys/devices/platform/pwm-fan ]; then
-    echo "pls use /usr/bin/fa-fancontrol.sh."
-    exit 1
-fi
-
-if [ ! -d /sys/class/pwm/pwmchip0 ]; then
-    echo "this model does not support pwm."
-    exit 1
-fi
-if [ ! -d /sys/class/pwm/pwmchip0/pwm0 ]; then
-    echo 0 > /sys/class/pwm/pwmchip0/export
-fi
-sleep 1
-while [ ! -d /sys/class/pwm/pwmchip0/pwm0 ];
-do
-    sleep 1
-done
-ISENABLE=`cat /sys/class/pwm/pwmchip0/pwm0/enable`
-if [ $ISENABLE -eq 1 ]; then
-    echo 0 > /sys/class/pwm/pwmchip0/pwm0/enable
-fi
-echo 50000 > /sys/class/pwm/pwmchip0/pwm0/period
-echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable
-
-# max speed run 5s
-echo 46990 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
-sleep 5
-echo 25000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
-
-# declare -a CpuTemps=(55000 43000 38000 32000)
-# declare -a PwmDutyCycles=(1000 20000 30000 45000)
-
-declare -a CpuTemps=(75000 63000 58000 52000)
-declare -a PwmDutyCycles=(25000 35000 45000 46990)
-
-declare -a Percents=(100 75 50 25)
-DefaultDuty=49990
-DefaultPercents=0
-
-while true
-do
-	temp=$(cat /sys/class/thermal/thermal_zone0/temp)
-	INDEX=0
-	FOUNDTEMP=0
-	DUTY=$DefaultDuty
-	PERCENT=$DefaultPercents
-	
-	for i in 0 1 2 3; do
-		if [ $temp -gt ${CpuTemps[$i]} ]; then
-			INDEX=$i
-			FOUNDTEMP=1
-			break
-		fi	
-	done
-	if [ ${FOUNDTEMP} == 1 ]; then
-		DUTY=${PwmDutyCycles[$i]}
-		PERCENT=${Percents[$i]}
-	fi
-
-	echo $DUTY > /sys/class/pwm/pwmchip0/pwm0/duty_cycle;
-
-        # echo "temp: $temp, duty: $DUTY, ${PERCENT}%"
-        # cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq
-
-	sleep 2s;
-done

+ 2 - 2
onekey/build.sh

@@ -111,11 +111,11 @@ if [ -f "devices/$firmware/diy.sh" ]; then
 fi
 cp -Rf ./diy/* ./
 if [ -f "devices/common/default-settings" ]; then
-	sed -i 's/10.0.0.1/$ip/' package/*/*/my-default-settings/files/uci.defaults
+	sed -i 's/10.0.0.1/$ip/' package/*/*/my-default-settings/files/etc/uci-defaults/95-default-settings
 fi
 if [ -f "devices/$firmware/default-settings" ]; then
 	sed -i "s/10.0.0.1/$ip/" devices/$firmware/default-settings
-	cat devices/$firmware/default-settings >> package/*/*/my-default-settings/files/uci.defaults
+	cat devices/$firmware/default-settings >> package/*/*/my-default-settings/files/etc/uci-defaults/95-default-settings
 fi
 if [ -n "$(ls -A "devices/common/patches" 2>/dev/null)" ]; then
           find "devices/common/patches" -type f -name '*.patch' ! -name '*.revert.patch' -print0 | sort -z | xargs -I % -t -0 -n 1 sh -c "cat '%'  | patch -d './' -p1 --forward"