kiddin9 3 jaren geleden
bovenliggende
commit
30d6666e9a

+ 13 - 9
.github/workflows/Openwrt-AutoBuild.yml

@@ -185,9 +185,9 @@ jobs:
 
     - name: Cache
       uses: klever1988/cachewrtbuild@main
-      if: contains(github.event.action, 'nocache') == false
       with:
         ccache: 'true'
+        clean: ${{ contains(github.event.action, 'nocache') }}
         prefix: ${{ github.workspace }}/openwrt
 
     - name: Compile the firmware
@@ -200,13 +200,6 @@ jobs:
    
     - name: Check space usage
       run: df -hT
-   
-    - name: Upload bin directory
-      uses: actions/upload-artifact@main
-      if: env.UPLOAD_BIN_DIR_FOR_ARTIFACT == 'true'
-      with:
-        name: OpenWrt_bin_${{matrix.target}}
-        path: openwrt/bin
 
     - name: Organize files
       id: organize
@@ -215,7 +208,7 @@ 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
-        kernel_v="$(cat openwrt/include/kernel-version.mk | grep LINUX_KERNEL_HASH-5.10* | cut -f 2 -d - | cut -f 1 -d ' ')"
+        kernel_v="$(cat openwrt/include/kernel-5.10 | grep LINUX_KERNEL_HASH-5.10* | cut -f 2 -d - | cut -f 1 -d ' ')"
         mv -f openwrt/bin/targets/*/*/packages ./kmods/$kernel_v
         cd firmware
         echo "${{ env.VERSION }}.$(date +'%Y')" > version.txt
@@ -254,6 +247,17 @@ jobs:
         REMOTE_USER: root
         TARGET: "/www/wwwroot/op.supes.top/packages/${{ env.MTARGET }}/kmods/"
 
+    - name: Deploy imagebuilder 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"
+        SOURCE: openwrt/bin/
+        REMOTE_HOST: op.supes.top
+        REMOTE_USER: root
+        TARGET: "/www/wwwroot/op.supes.top/releases/${{ env.REPO_BRANCH }}/"
+
     - name: Upload firmware for artifact
       uses: actions/upload-artifact@main
       continue-on-error: true

+ 8 - 1
devices/common/.config

@@ -1,15 +1,21 @@
 
 CONFIG_GRUB_TIMEOUT="0"
-CONFIG_SIGNATURE_CHECK=n
 CONFIG_TARGET_ROOTFS_EXT4FS=n
 CONFIG_TARGET_ROOTFS_TARGZ=y
 CONFIG_LUCI_CSSTIDY=n
 CONFIG_GRUB_CONSOLE=n
 CONFIG_SIGNED_PACKAGES=n
+CONFIG_SIGNATURE_CHECK=n
 
 CONFIG_ALL_KMODS=y
 CONFIG_PACKAGE_kmod-rtl88x2bu=n
 
+CONFIG_IB=y
+CONFIG_IB_STANDALONE=n
+CONFIG_JSON_OVERVIEW_IMAGE_INFO=y
+
+CONFIG_FEED_telephony=n
+
 # IPv6支持:
 CONFIG_IPV6=y
 
@@ -25,6 +31,7 @@ CONFIG_PACKAGE_luci-app-autoreboot=y
 CONFIG_PACKAGE_luci-app-wizard=y
 CONFIG_PACKAGE_luci-app-ksmbd=y
 CONFIG_PACKAGE_luci-app-nginx-manager=y
+CONFIG_PACKAGE_luci-app-attendedsysupgrade=y
 
 # Themes
 

+ 4 - 8
devices/common/default-settings

@@ -18,13 +18,6 @@ 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
-KERNEL_V="$(uname -r)"
-ARCH="$(cat /etc/os-release | grep "OPENWRT_ARCH=" | cut -d \" -f 2)"
-sed -i "\$a src/gz openwrt_kmods https://op.supes.top/packages/$ARCH/kmods/$KERNEL_V" /etc/opkg/distfeeds.conf
-sed -i "\$a src/gz openwrt_kiddin9 https://op.supes.top/packages/$ARCH" /etc/opkg/distfeeds.conf
-
 echo $(uci -q get uhttpd.main.index_page) | grep -q "cgi-bin/luci" ||
 	uci -q add_list uhttpd.main.index_page='cgi-bin/luci' && uci commit uhttpd
 
@@ -47,7 +40,10 @@ test $version -lt 1 && {
 	uci -q set luci.main.lang='auto'
 	uci -q set luci.main.mediaurlbase=/luci-static/edge
 	uci commit luci
-
+	
+	uci -q set dropbear.@dropbear[0].Interface='lan'
+	uci commit dropbear
+	
 	uci -q get system.@system[0] >/dev/null 2>&1 && {
 		uci -q set system.@system[0].hostname="${DISTRIB_ID}"
 		uci -q set system.@system[0].zonename='Asia/Shanghai'

+ 7 - 5
devices/common/diy.sh

@@ -1,16 +1,18 @@
 #!/bin/bash
 #=================================================
 shopt -s extglob
-kernel_version="$(curl -sfL https://github.com/openwrt/openwrt/commits/master/include/kernel-version.mk | grep -o 'href=".*>kernel: bump 5.10' | head -1 | cut -d / -f 5 | cut -d "#" -f 1)"
+commitid="$(curl -sfL https://github.com/openwrt/openwrt/commits/master/include | grep -o 'href=".*>kernel: bump 5.10' | head -1 | cut -d / -f 5 | cut -d "#" -f 1)"
 version="$(git rev-parse HEAD)"
-git checkout $kernel_version
+git checkout $commitid
 git checkout HEAD^
-mv -f target/linux package/kernel include/kernel-version.mk include/kernel-defaults.mk .github/
+kernel_v="$(cat include/kernel-5.10 | grep LINUX_KERNEL_HASH-5.10* | cut -f 2 -d - | cut -f 1 -d ' ')"
+sed -i "s?targets/%S/packages?packages/%A/kmods/$kernel_v?" include/feeds.mk
+mv -f target/linux package/kernel include/kernel-version.mk include/kernel-5.10 include/kernel-defaults.mk .github/
 git checkout $version
-rm -rf target/linux package/kernel include/kernel-version.mk include/kernel-defaults.mk
+rm -rf target/linux package/kernel include/kernel-version.mk include/kernel-5.10 include/kernel-defaults.mk
 mv -f .github/linux target/
 mv -f .github/kernel package/
-mv -f .github/kernel-version.mk .github/kernel-defaults.mk include/
+mv -f  .github/kernel-version.mk .github/kernel-5.10 .github/kernel-defaults.mk include/
 sed -i 's/ libelf//' tools/Makefile
 
 sed -i '/	refresh_config();/d' scripts/feeds

+ 12 - 0
devices/common/patches/feeds.patch

@@ -0,0 +1,12 @@
+--- a/include/feeds.mk
++++ b/include/feeds.mk
+@@ -6,7 +6,7 @@
+ -include $(TMP_DIR)/.packageauxvars
+ 
+ FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*))
+-FEEDS_AVAILABLE:=$(sort $(FEEDS_INSTALLED) $(shell $(SCRIPT_DIR)/feeds list -n 2>/dev/null))
++FEEDS_AVAILABLE:=$(shell $(SCRIPT_DIR)/feeds list -n 2>/dev/null)
+ 
+ PACKAGE_SUBDIRS=$(PACKAGE_DIR)
+ ifneq ($(CONFIG_PER_FEED_REPO),)
+

+ 17 - 0
devices/common/patches/imagebuilder.patch

@@ -0,0 +1,17 @@
+--- a/target/imagebuilder/Makefile
++++ b/target/imagebuilder/Makefile
+@@ -38,13 +38,12 @@ $(BIN_DIR)/$(IB_NAME).tar.xz: clean
+ 		./files/repositories.conf \
+ 		$(TMP_DIR)/.targetinfo \
+ 		$(TMP_DIR)/.packageinfo \
++		$(TOPDIR)/files \
+ 		$(PKG_BUILD_DIR)/
+ 
+-ifeq ($(CONFIG_IB_STANDALONE),)
+ 	echo '## Remote package repositories' >> $(PKG_BUILD_DIR)/repositories.conf
+ 	$(call FeedSourcesAppend,$(PKG_BUILD_DIR)/repositories.conf)
+ 	$(VERSION_SED_SCRIPT) $(PKG_BUILD_DIR)/repositories.conf
+-endif
+ 
+ ifeq ($(CONFIG_BUILDBOT),)
+ 	$(INSTALL_DIR) $(PKG_BUILD_DIR)/packages

+ 2 - 8
devices/common/patches/opkginstall.patch

@@ -151,7 +151,7 @@
  						opkg="$opkg $1"
  						shift
  					;;
-@@ -35,8 +35,31 @@ case "$action" in
+@@ -35,8 +35,32 @@ case "$action" in
  			if flock -x 200; then
  				$opkg $action "$@" </dev/null >/tmp/opkg.out 2>/tmp/opkg.err
  				code=$?
@@ -166,6 +166,7 @@
 +						}
 +					;;
 +					remove)
++						. /etc/profile.d/opkg.sh; opkg save
 +						[ ! "$(opkg list-installed | cut -f 1 -d ' ' | grep -w $@)" ] && {
 +							rm -f /tmp/opkg.err
 +						}
@@ -206,13 +207,6 @@
  		mkdir -p "$ETCBACKUP_DIR"
  		# Avoid touching filesystem on each backup
  		RAMFS="$(mktemp -d -t sysupgrade.XXXXXX)"
-@@ -249,6 +250,8 @@ do_save_conffiles() {
- 			\( -exec test -f /overlay/upper/{} \; -exec echo {} overlay \; \) -o \
- 			\( -exec echo {} unknown \; \) \
- 			\) | sed -e 's,.*/,,;s/\.control /\t/' > ${INSTALLED_PACKAGES}
-+	else
-+		uci -q del opkg.auto; uci commit opkg
- 	fi
  
  	v "Saving config files..."