فهرست منبع

Revert to kernel 5.4

garypang13 4 سال پیش
والد
کامیت
9e59764c98

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

@@ -115,17 +115,12 @@ jobs:
         ln -sf /mnt/openwrt/dl openwrt/dl
         ln -sf /mnt/openwrt/staging_dir openwrt/staging_dir
         ln -sf /mnt/openwrt/build_dir/hostpkg openwrt/build_dir/hostpkg
+        
 
-    - name: Load && Update feeds
+    - name: Load custom configuration
       run: |
         cp -rf devices/common/. openwrt/
         cp -rf devices/${{matrix.target}}/. openwrt/
-        cd openwrt
-        ./scripts/feeds update -a
-        cd feeds/custom && git pull
-
-    - name: Load custom configuration
-      run: |
         cp -rf devices openwrt/
         cd openwrt
         chmod +x devices/common/$DIY_SH
@@ -203,15 +198,14 @@ jobs:
         rename -v "s/friendlyarm_//" *gz
         md5=$((md5sum *squashfs-sysupgrade* || md5sum *squashfs-combined-efi*) | awk '{print $1}') 2>/dev/null
         echo $md5 >> version.txt
-        kernel_version=$(cat ../openwrt/include/kernel-version.mk | grep LINUX_KERNEL_HASH-5.10* | cut -f 3 -d ' ')
-        echo $kernel_version >> version.txt
+        echo $REPO_BRANCH >> version.txt
         echo "FIRMWARE=$PWD" >> $GITHUB_ENV
         Emoji=("🎉" "🤞" "✨" "🎁" "🎈" "🎄" "🎨" "💋" "🍓" "🍕" "🍉" "💐" "🌴" "🚀" "🛸" "🗽" "⛅" "🌈" "🔥" "⛄" "🐶" "🏅" "🦄" "🐤")
         RANDOM=$$$(date +%s)
         rand=$[$RANDOM % ${#Emoji[@]}]
         echo "EMOJI=${Emoji[$rand]}" >> $GITHUB_ENV
         if [ ${{matrix.target}} == "x86_64" ]; then
-        echo "NOTICE=请分配不少于800M的存储容量" >> $GITHUB_ENV
+        echo "NOTICE=请分配不少于1G的存储容量" >> $GITHUB_ENV
         fi
 
     - name: Upload firmware for artifact

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

@@ -55,18 +55,14 @@ jobs:
           -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
           -d '{"event_type": "nanopi-r4s ${{ env.SSH }}", "client_payload": {"target": "nanopi-r4s"}}'
         else
-          kernel_r=$(curl -s https://op.supes.top/firmware/x86_64/version.txt | tr "\r\n" "," | cut -f 3 -d ,)
-          kernel_l=$(curl -s https://raw.githubusercontent.com/openwrt/openwrt/master/include/kernel-version.mk | grep LINUX_KERNEL_HASH-5.10* | cut -f 3 -d ' ')
-            if [ $kernel_r != $kernel_l ]; then
+          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}'| sed -e 's/v//')"
+            if [ $REPO_BRANCH_r != $REPO_BRANCH ]; then
               curl \
               -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
               -H "Accept: application/vnd.github.everest-preview+json" \
               -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
               -d '{"event_type": "x86_64 ${{ env.SSH }}", "client_payload": {"target": "x86_64"}}'
-            fi
-          kernel_r=$(curl -s https://op.supes.top/firmware/nanopi-r2s/version.txt | tr "\r\n" "," | cut -f 3 -d ,)
-          kernel_l=$(curl -s https://raw.githubusercontent.com/openwrt/openwrt/master/include/kernel-version.mk | grep LINUX_KERNEL_HASH-5.10* | cut -f 3 -d ' ')
-            if [ $kernel_r != $kernel_l ]; then
               curl \
               -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
               -H "Accept: application/vnd.github.everest-preview+json" \

+ 1 - 1
README.md

@@ -22,7 +22,7 @@
 <a href="https://t.me/opwrts" target="_blank">Telegram</a>
 ### 特色:
 
-+ Cutting edge,openwrt官方openwrt-21.02分支版本, 内核升级到5.10. 与官方最新源码同步.
++ Cutting edge,openwrt官方openwrt-21.02分支版本, 与官方最新源码同步.
 
 + 原生极致纯净,固件默认只包含基础上网功能,后台在线选装插件,自建插件仓库囊括了市面上主流开源插件,系统升级不丢失插件和配置.
 

+ 5 - 13
devices/common/diy.sh

@@ -1,28 +1,22 @@
 #!/bin/bash
 #=================================================
-rm -Rf feeds/custom/diy
-./scripts/feeds update luci packages custom
+echo "src-git custom https://github.com/kiddin9/openwrt-packages.git" >>feeds.conf.default
+./scripts/feeds update -a
+cd feeds/custom && git pull; cd -
 ./scripts/feeds install -a -p custom
 ./scripts/feeds install -a
 sed -i 's/Os/O2/g' include/target.mk
-rm -rf target/linux package/kernel
-svn export https://github.com/openwrt/openwrt/trunk/target/linux target/linux
-curl -L https://raw.githubusercontent.com/openwrt/openwrt/master/include/kernel-version.mk>include/kernel-version.mk
-svn export https://github.com/openwrt/openwrt/trunk/package/kernel package/kernel
-curl -L https://raw.githubusercontent.com/openwrt/openwrt/master/include/kernel-defaults.mk>include/kernel-defaults.mk
 rm -Rf tools/upx && svn export https://github.com/coolsnowwolf/lede/trunk/tools/upx tools/upx
 rm -Rf tools/ucl && svn export 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
-sed -i 's/ libelf//' tools/Makefile
 svn co https://github.com/immortalwrt/immortalwrt/branches/master/target/linux/generic/hack-5.4 target/linux/generic/hack-5.4
-svn co https://github.com/immortalwrt/immortalwrt/branches/master/target/linux/generic/hack-5.10 target/linux/generic/hack-5.10
-rm -rf target/linux/generic/hack-5.10/220-gc_sections.patch
+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/openwrt/openwrt/trunk/package/libs/libnfnetlink package/libs/libnfnetlink
 svn export --force https://github.com/immortalwrt/immortalwrt/branches/master/package/network/services/dnsmasq package/network/services/dnsmasq
 sed -i 's/$(TARGET_DIR)) install/$(TARGET_DIR)) install --force-overwrite/' package/Makefile
 sed -i '$a /etc/sysupgrade.conf' package/base-files/files/lib/upgrade/keep.d/base-files-essential
-sed -i '$a /etc/amule' package/base-files/files/lib/upgrade/keep.d/base-files-essential
 sed -i '$a /etc/acme' package/base-files/files/lib/upgrade/keep.d/base-files-essential
 sed -i '$a /etc/bench.log' package/base-files/files/lib/upgrade/keep.d/base-files-essential
 sed -i '/\/etc\/profile/d' package/base-files/files/lib/upgrade/keep.d/base-files-essential
@@ -35,7 +29,6 @@ sed -i 's/max_requests 3/max_requests 20/g' package/network/services/uhttpd/file
 #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
 wget -P package/network/config/firewall/patches/ https://github.com/coolsnowwolf/lede/raw/master/package/network/config/firewall/patches/fullconenat.patch
-sed -i "s/+nginx\( \|$\)/+nginx-ssl\1/g"  package/*/*/*/Makefile
 sed -i 's/+python\( \|$\)/+python3/g' package/*/*/*/Makefile
 sed -i 's?../../lang?$(TOPDIR)/feeds/packages/lang?g' package/feeds/custom/*/Makefile
 sed -i 's/PKG_BUILD_DIR:=/PKG_BUILD_DIR?=/g' feeds/luci/luci.mk
@@ -58,7 +51,6 @@ if [ -f sdk.tar.xz ]; then
 	tar -xJf sdk.tar.xz -C sdk
 	cp -rf sdk/*/staging_dir/* ./staging_dir/
 	rm -rf sdk.tar.xz sdk
-	rm -rf `find "staging_dir/host/" -maxdepth 2 -name 'libelf*'` || true
 	sed -i '/\(tools\|toolchain\)\/Makefile/d' Makefile
 	if [ -f /usr/bin/python ]; then
 		ln -sf /usr/bin/python staging_dir/host/bin/python

+ 0 - 5
devices/common/feeds.conf

@@ -1,5 +0,0 @@
-src-git packages https://git.openwrt.org/feed/packages.git;openwrt-21.02
-src-git luci https://git.openwrt.org/project/luci.git;openwrt-21.02
-src-git routing https://git.openwrt.org/feed/routing.git;openwrt-21.02
-# src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-21.02
-src-git custom https://github.com/kiddin9/openwrt-packages.git

+ 0 - 0
devices/common/patches/compressed-memory.patch → devices/common/patches/compressed-memory.patch.b


+ 25 - 0
devices/common/patches/ipvlan.patch

@@ -0,0 +1,25 @@
+--- a/package/kernel/linux/modules/netdevices.mk
++++ b/package/kernel/linux/modules/netdevices.mk
+@@ -885,6 +885,22 @@ endef
+ $(eval $(call KernelPackage,macvlan))
+ 
+ 
++define KernelPackage/ipvlan
++  SUBMENU:=$(NETWORK_DEVICES_MENU)
++  TITLE:=IP-VLAN support
++  KCONFIG:=CONFIG_IPVLAN
++  FILES:=$(LINUX_DIR)/drivers/net/ipvlan/ipvlan.ko
++  AUTOLOAD:=$(call AutoProbe,ipvlan)
++endef
++
++define KernelPackage/ipvlan/description
++ A kernel module which allows one to create virtual interfaces that
++ map packets to or from specific IP addresses to a particular interface
++endef
++
++$(eval $(call KernelPackage,ipvlan))
++
++
+ define KernelPackage/tulip
+   TITLE:=Tulip family network device support
+   DEPENDS:=@PCI_SUPPORT +kmod-mii

+ 0 - 11
devices/common/patches/rule_MKHASH.patch

@@ -1,11 +0,0 @@
---- a/rules.mk
-+++ b/rules.mk
-@@ -266,6 +266,8 @@ TARGET_CXX:=$(TARGET_CROSS)g++
- KPATCH:=$(SCRIPT_DIR)/patch-kernel.sh
- SED:=$(STAGING_DIR_HOST)/bin/sed -i -e
- ESED:=$(STAGING_DIR_HOST)/bin/sed -E -i -e
-+MKHASH:=$(STAGING_DIR_HOST)/bin/mkhash
-+export MKHASH
- CP:=cp -fpR
- LN:=ln -sf
- XARGS:=xargs -r

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

@@ -1,11 +1,13 @@
 #!/bin/bash
 
 rm -rf package/boot/uboot-rockchip
-svn export --force https://github.com/immortalwrt/immortalwrt/branches/master/package/boot/uboot-rockchip package/boot/uboot-rockchip
-svn export --force https://github.com/immortalwrt/immortalwrt/branches/master/target/linux/rockchip target/linux/rockchip
-svn export --force https://github.com/openwrt/openwrt/trunk/target/linux/rockchip/patches-5.10 target/linux/rockchip/patches-5.10
-rm -Rf target/linux/rockchip/patches-5.10/{006-*-NanoPi-R,007-*-R4S}.patch
-svn export https://github.com/immortalwrt/immortalwrt/branches/master/package/boot/arm-trusted-firmware-rockchip-vendor package/boot/arm-trusted-firmware-rockchip-vendor
+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
+svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/target/linux/rockchip/armv8/config-5.4 target/linux/rockchip/armv8/config-5.4
+svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/target/linux/rockchip/image target/linux/rockchip/image
+svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/target/linux/rockchip/files target/linux/rockchip/files
+svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/target/linux/rockchip/modules.mk target/linux/rockchip/modules.mk
+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://github.com/immortalwrt/immortalwrt/raw/master/package/kernel/linux/modules/video.mk>package/kernel/linux/modules/video.mk
 
@@ -15,8 +17,6 @@ wget -P files/etc/init.d/ https://github.com/friendlyarm/friendlywrt/raw/master-
 chmod +x files/usr/bin/start-rk3328-pwm-fan.sh files/etc/init.d/fa-rk3328-pwmfan
 ln -sf /etc/init.d/fa-rk3328-pwmfan files/etc/rc.d/S96fa-rk3328-pwmfan
 
-sed -i 's/5.4/5.10/g' target/linux/rockchip/Makefile
-
 sed -i 's,-mcpu=generic,-march=armv8-a+crypto+crc -mabi=lp64,g' include/target.mk
 
 sed -i "s,'eth1' 'eth0','eth0' 'eth1',g" target/linux/rockchip/armv8/base-files/etc/board.d/02_network

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

@@ -1,11 +1,13 @@
 #!/bin/bash
 
 rm -rf package/boot/uboot-rockchip
-svn export --force https://github.com/immortalwrt/immortalwrt/branches/master/package/boot/uboot-rockchip package/boot/uboot-rockchip
-svn export --force https://github.com/immortalwrt/immortalwrt/branches/master/target/linux/rockchip target/linux/rockchip
-svn export --force https://github.com/openwrt/openwrt/trunk/target/linux/rockchip/patches-5.10 target/linux/rockchip/patches-5.10
-rm -Rf target/linux/rockchip/patches-5.10/{006-*-NanoPi-R,007-*-R4S}.patch
-svn export https://github.com/immortalwrt/immortalwrt/branches/master/package/boot/arm-trusted-firmware-rockchip-vendor package/boot/arm-trusted-firmware-rockchip-vendor
+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
+svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/target/linux/rockchip/armv8/config-5.4 target/linux/rockchip/armv8/config-5.4
+svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/target/linux/rockchip/image target/linux/rockchip/image
+svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/target/linux/rockchip/files target/linux/rockchip/files
+svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/target/linux/rockchip/modules.mk target/linux/rockchip/modules.mk
+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://github.com/immortalwrt/immortalwrt/raw/master/package/kernel/linux/modules/video.mk>package/kernel/linux/modules/video.mk
 
@@ -14,8 +16,6 @@ wget -P files/usr/bin/ https://raw.githubusercontent.com/btyh17mxy/friendlywrt/f
 wget -P files/etc/init.d/ https://raw.githubusercontent.com/friendlyarm/friendlywrt/master-v19.07.1/target/linux/rockchip-rk3399/base-files/etc/init.d/fa-rk3399-pwmfan
 chmod +x files/usr/bin/start-rk3399-pwm-fan.sh files/etc/init.d/fa-rk3399-pwmfan
 ln -sf /etc/init.d/fa-rk3399-pwmfan files/etc/rc.d/S96fa-rk3399-pwmfan
-	
-sed -i 's/5.4/5.10/g' target/linux/rockchip/Makefile
 
 sed -i 's,-mcpu=generic,-march=armv8-a+crypto+crc -mabi=lp64,g' include/target.mk
 #sed -i 's,kmod-r8169,kmod-r8168,g' target/linux/rockchip/image/armv8.mk

+ 1 - 3
devices/x86_64/diy.sh

@@ -1,12 +1,10 @@
 #!/bin/bash
 
-sed -i 's/5.4/5.10/g' target/linux/x86/Makefile
-
 echo '
 CONFIG_CRYPTO_CHACHA20_X86_64=y
 CONFIG_CRYPTO_POLY1305_X86_64=y
 CONFIG_DRM=y
 CONFIG_DRM_I915=y
-' >> ./target/linux/x86/config-5.10
+' >> ./target/linux/x86/config-5.4
 
 sed -i "s/enabled '0'/enabled '1'/g" feeds/packages/utils/irqbalance/files/irqbalance.config

+ 6 - 8
onekey/compile.sh

@@ -82,19 +82,18 @@ 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//')"
 
-
-git clone -b openwrt-21.02 --depth 1 https://github.com/openwrt/openwrt
+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
 
 cd openwrt
-
 if [[ $firmware == "x86_64" ]]; then
-		wget -cO sdk.tar.xz https://mirrors.cloud.tencent.com/openwrt/releases/21.02-SNAPSHOT/targets/x86/64/openwrt-sdk-21.02-SNAPSHOT-x86-64_gcc-8.4.0_musl.Linux-x86_64.tar.xz
+		wget -cO sdk.tar.xz https://mirrors.cloud.tencent.com/openwrt/releases/$REPO_BRANCH/targets/x86/64/openwrt-sdk-$REPO_BRANCH-x86-64_gcc-8.4.0_musl.Linux-x86_64.tar.xz
 elif [[ $firmware =~ (nanopi-r2s|nanopi-r4s) ]]; then
-		wget -cO sdk.tar.xz https://mirrors.cloud.tencent.com/openwrt/releases/21.02-SNAPSHOT/targets/rockchip/armv8/openwrt-sdk-21.02-SNAPSHOT-rockchip-armv8_gcc-8.4.0_musl.Linux-x86_64.tar.xz
+		wget -cO sdk.tar.xz https://mirrors.cloud.tencent.com/openwrt/releases/$REPO_BRANCH/targets/rockchip/armv8/openwrt-sdk-$REPO_BRANCH-rockchip-armv8_gcc-8.4.0_musl.Linux-x86_64.tar.xz
 elif [[ $firmware == "Rpi-4B" ]]; then
-		wget -cO sdk.tar.xz https://mirrors.cloud.tencent.com/openwrt/releases/21.02-SNAPSHOT/targets/bcm27xx/bcm2711/openwrt-sdk-21.02-SNAPSHOT-bcm27xx-bcm2711_gcc-8.4.0_musl.Linux-x86_64.tar.xz
+		wget -cO sdk.tar.xz https://mirrors.cloud.tencent.com/openwrt/releases/$REPO_BRANCH/targets/bcm27xx/bcm2711/openwrt-sdk-$REPO_BRANCH-bcm27xx-bcm2711_gcc-8.4.0_musl.Linux-x86_64.tar.xz
 fi
 
 
@@ -103,8 +102,6 @@ ip=${ip:-"10.0.0.1"}
 echo "您的后台地址为: $ip"
 cp -rf devices/common/* ./
 cp -rf devices/$firmware/* ./
-./scripts/feeds update -a
-cp -Rf ./diy/* ./
 if [ -f "devices/common/diy.sh" ]; then
 		chmod +x devices/common/diy.sh
 		/bin/bash "devices/common/diy.sh"
@@ -113,6 +110,7 @@ if [ -f "devices/$firmware/diy.sh" ]; then
 		chmod +x devices/$firmware/diy.sh
 		/bin/bash "devices/$firmware/diy.sh"
 fi
+cp -Rf ./diy/* ./
 if [ -f "devices/common/default-settings" ]; then
 	sed -i "s/10.0.0.1/$ip/" devices/common/default-settings
 	cp -f devices/common/default-settings package/*/*/default-settings/files/uci.defaults

+ 1 - 2
onekey/recompile.sh

@@ -55,8 +55,6 @@ make clean
 [ -f ".config" ] && mv .config .config.bak
 cp -rf devices/common/* ./
 cp -rf devices/$firmware/* ./
-./scripts/feeds update -a
-cp -Rf ./diy/* ./
 if [ -f "devices/common/diy.sh" ]; then
 		chmod +x devices/common/diy.sh
 		/bin/bash "devices/common/diy.sh"
@@ -65,6 +63,7 @@ if [ -f "devices/$firmware/diy.sh" ]; then
 		chmod +x devices/$firmware/diy.sh
 		/bin/bash "devices/$firmware/diy.sh"
 fi
+cp -Rf ./diy/* ./
 if [ -f "devices/common/default-settings" ]; then
 	sed -i 's/10.0.0.1/$ip/' devices/common/default-settings
 	cp -f devices/common/default-settings package/*/*/default-settings/files/uci.defaults