kiddin9 3 سال پیش
والد
کامیت
1d81e411f2

+ 30 - 4
.github/workflows/Openwrt-AutoBuild.yml

@@ -64,9 +64,15 @@ jobs:
         echo "UPLOAD_FIRMWARE_TO_WETRANSFER=${UPLOAD_FIRMWARE_TO_WETRANSFER}" >> $GITHUB_ENV
         if [ ${{matrix.target}} == "x86_64" ]; then
             echo "ARCH=linux/amd64" >> $GITHUB_ENV
+            echo "MTARGET=x86_64" >> $GITHUB_ENV
         elif [[ ${{matrix.target}} =~ (Rpi-4B|nanopi-r2s|nanopi-r4s) ]]; then
             echo "ARCH=linux/arm64" >> $GITHUB_ENV
         fi
+        if [ ${{matrix.target}} == "Rpi-4B" ]; then
+            echo "MTARGET=aarch64_cortex-a72" >> $GITHUB_ENV
+        elif [ ${{matrix.target}} == "nanopi-r2s" ]; then
+            echo "MTARGET=aarch64_generic" >> $GITHUB_ENV
+        fi
 
     - name: Trigger Packages Update
       run: |
@@ -115,7 +121,7 @@ jobs:
         elif [[ ${{matrix.target}} =~ "Rpi-4B" ]]; then
             curl -fL -m 60 -o sdk.tar.xz https://downloads.openwrt.org/releases/$REPO_BRANCH/targets/bcm27xx/bcm2711/openwrt-sdk-$REPO_BRANCH-bcm27xx-bcm2711_gcc-8.4.0_musl.Linux-x86_64.tar.xz || curl -fL -m 60 -o sdk.tar.xz https://openwrt.tetaneutral.net/releases/21.02-SNAPSHOT/targets/bcm27xx/bcm2711/openwrt-sdk-21.02-SNAPSHOT-bcm27xx-bcm2711_gcc-8.4.0_musl.Linux-x86_64.tar.xz
         fi
-        echo "REPO_BRANCH=v$REPO_BRANCH" >> $GITHUB_ENV
+        echo "REPO_BRANCH=$REPO_BRANCH" >> $GITHUB_ENV
         
     - name: Free up disk space
       if: env.FREE_UP_DISK == 'true'
@@ -127,7 +133,6 @@ jobs:
         ln -sf /mnt/openwrt/staging_dir openwrt/staging_dir
         ln -sf /mnt/openwrt/build_dir/hostpkg openwrt/build_dir/hostpkg
         
-
     - name: Load custom configuration
       run: |
         cp -rf devices/common/. openwrt/
@@ -210,13 +215,14 @@ jobs:
         mv -f openwrt/bin/targets/*/*/{*combined*,*sysupgrade*} ./firmware/ 2>/dev/null || true
         cp openwrt/.config  ./firmware/${{matrix.target}}.config
         cp openwrt/build_dir/target-*/linux-*/linux-*/.config ./firmware/${{matrix.target}}_kernel.config
+        mv -f openwrt/bin/targets/*/*/packages ./kmods
         cd firmware
         echo "${{ env.VERSION }}.$(date +'%Y')" > version.txt
         rename -v "s/^openwrt/${{ env.VERSION }}-openwrt/" * || true
         rename -v "s/friendlyarm_//" *gz || true
         md5=$((md5sum *squashfs-sysupgrade* || md5sum *squashfs-combined-efi*) | awk '{print $1}') 2>/dev/null
         echo $md5 >> version.txt
-        echo $REPO_BRANCH >> version.txt
+        echo v$REPO_BRANCH >> version.txt
         echo "FIRMWARE=$PWD" >> $GITHUB_ENV
         Emoji=("🎉" "🤞" "✨" "🎁" "🎈" "🎄" "🎨" "💋" "🍓" "🍕" "🍉" "💐" "🌴" "🚀" "🛸" "🗽" "⛅" "🌈" "🔥" "⛄" "🐶" "🏅" "🦄" "🐤")
         echo "EMOJI=${Emoji[$[$RANDOM % ${#Emoji[@]}]]}" >> $GITHUB_ENV
@@ -225,7 +231,7 @@ jobs:
         echo "NOTICE=请分配不少于1G的存储容量" >> $GITHUB_ENV
         fi
 
-    - name: Deploy files to server
+    - name: Deploy firmware to server
       uses: easingthemes/ssh-deploy@main
       if: env.SSH_PRIVATE_KEY && ! contains(github.event.action, 'noser')
       with:
@@ -236,6 +242,26 @@ jobs:
         REMOTE_USER: root
         TARGET: "/www/wwwroot/op.supes.top/firmware/${{matrix.target}}/"
 
+    - name: remote ssh command
+      uses: appleboy/ssh-action@master
+      if: env.SSH_PRIVATE_KEY && ! contains(github.event.action, 'noser') && env.MTARGET
+      with:
+        host: op.supes.top
+        username: root
+        key: ${{ env.SSH_PRIVATE_KEY }}
+        script: mkdir -p /www/wwwroot/op.supes.top/packages/${{ env.MTARGET }}/kmods/${{ env.REPO_BRANCH }}
+
+    - name: Deploy kmods to server
+      uses: easingthemes/ssh-deploy@main
+      if: env.SSH_PRIVATE_KEY && ! contains(github.event.action, 'noser') && env.MTARGET
+      with:
+        SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
+        ARGS: "-avzr --delete"
+        SOURCE: kmods/
+        REMOTE_HOST: op.supes.top
+        REMOTE_USER: root
+        TARGET: "/www/wwwroot/op.supes.top/packages/${{ env.MTARGET }}/kmods/${{ env.REPO_BRANCH }}/"
+
     - name: Upload firmware for artifact
       uses: actions/upload-artifact@main
       continue-on-error: true

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

@@ -24,4 +24,4 @@ CONFIG_REALTEK_PHY=y
 CONFIG_CPU_FREQ_GOV_USERSPACE=y
 CONFIG_CPU_FREQ_GOV_ONDEMAND=y
 CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
-' >> ./target/linux/bcm27xx/bcm2711/config-5.4
+' >> ./target/linux/bcm27xx/bcm2711/config-5.4

+ 1 - 0
devices/common/.config

@@ -7,6 +7,7 @@ CONFIG_LUCI_CSSTIDY=n
 CONFIG_GRUB_CONSOLE=n
 CONFIG_SIGNED_PACKAGES=n
 
+CONFIG_ALL_KMODS=y
 # IPv6支持:
 CONFIG_IPV6=y
 

+ 1 - 1
devices/common/default-settings

@@ -19,9 +19,9 @@ uci commit dockerd
 sed -i '/profile.d/d' /lib/upgrade/keep.d/base-files
 
 sed -i '/openwrt_kiddin9/d' /etc/opkg/distfeeds.conf
+sed -i 's?\(src/gz openwrt_\(core\|telephony\)\)?#\1?' /etc/opkg/distfeeds.conf
 VERSION="$(cat /etc/os-release | grep "VERSION=" | cut -d \" -f 2)"
 ARCH="$(cat /etc/os-release | grep "OPENWRT_ARCH=" | cut -d \" -f 2)"
-sed -i "s?\(targets/.*\)/packages?\1/$VERSION?" /etc/opkg/distfeeds.conf
 sed -i "\$a src/gz openwrt_kmods https://op.supes.top/packages/$ARCH/kmods/$VERSION" /etc/opkg/distfeeds.conf
 sed -i "\$a src/gz openwrt_kiddin9 https://op.supes.top/packages/$ARCH" /etc/opkg/distfeeds.conf
 

+ 1 - 4
devices/common/diy.sh

@@ -19,10 +19,6 @@ curl -sfL https://git.io/J0klM --create-dirs -o package/network/config/firewall/
 curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/target/linux/generic/hack-5.4/601-netfilter-export-udp_get_timeouts-function.patch -o target/linux/generic/hack-5.4/601-netfilter-export-udp_get_timeouts-function.patch
 ) &
 
-REPO_BRANCH="$(curl -s https://api.github.com/repos/openwrt/openwrt/tags | jq -r '.[].name' | grep v21 | head -n 1 | sed -e 's/v//')"
-vermagic="$(curl -sfL https://downloads.openwrt.org/releases/$REPO_BRANCH/targets/x86/64/kmods/ | grep -o 'href="5\..*/"' | cut -d - -f 3 | cut -d / -f 1)"
-sed -i "s/^.*vermagic$/\techo "$vermagic" > \$(LINUX_DIR)\/.vermagic/" include/kernel-defaults.mk
-
 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
@@ -49,6 +45,7 @@ sed -i "/DISTRIB_DESCRIPTION/c\DISTRIB_DESCRIPTION=\"%D %C by Kiddin'\"" package
 sed -i "/CONFIG_VERSION_CODE=/c\CONFIG_VERSION_CODE=\"$date\"" devices/common/.config
 sed -i '$a cgi-timeout = 300' package/feeds/packages/uwsgi/files-luci-support/luci-webui.ini
 sed -i '/limit-as/c\limit-as = 5000' package/feeds/packages/uwsgi/files-luci-support/luci-webui.ini
+sed -i "s/^.*vermagic$/\techo '1' > \$(LINUX_DIR)\/.vermagic/" include/kernel-defaults.mk
 
 sed -i \
 	-e "s/+\(luci\|luci-ssl\|uhttpd\)\( \|$\)/\2/" \

+ 0 - 2
devices/nanopi-r2c/diy.sh

@@ -48,5 +48,3 @@ CONFIG_CPU_FREQ_GOV_USERSPACE=y
 CONFIG_CPU_FREQ_GOV_ONDEMAND=y
 CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
 ' >> ./target/linux/rockchip/armv8/config-5.4
-
-

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

@@ -48,5 +48,3 @@ CONFIG_CPU_FREQ_GOV_USERSPACE=y
 CONFIG_CPU_FREQ_GOV_ONDEMAND=y
 CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
 ' >> ./target/linux/rockchip/armv8/config-5.4
-
-

+ 0 - 1
devices/nanopi-r4s/diy.sh

@@ -46,4 +46,3 @@ CONFIG_CRYPTO_DEV_ROCKCHIP=y
 CONFIG_HW_RANDOM_ROCKCHIP=y
 ' >> ./target/linux/rockchip/armv8/config-5.4
 
-

+ 1 - 0
devices/x86_64/diy.sh

@@ -13,3 +13,4 @@ CONFIG_DRM_I915=y
 ' >> ./target/linux/x86/config-5.4
 
 sed -i "s/enabled '0'/enabled '1'/g" feeds/packages/utils/irqbalance/files/irqbalance.config
+