├── scripts ├── x86-64_customization.sh ├── 00_init.sh ├── 01_customize_packages.sh └── 02_convert_translation.sh ├── .gitignore ├── COPYING ├── patches └── fullconenat-luci.patch ├── README.md ├── .github └── workflows │ ├── clean.yml │ ├── cache.yml │ └── ci.yml ├── default-settings ├── Makefile └── files │ └── zzz-default-settings └── config └── x86-64_defconfig /scripts/x86-64_customization.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | source ./01_customize_packages.sh 6 | 7 | exit 0 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | !.gitkeep 2 | .DS_Store 3 | .initialized 4 | .restored 5 | .Spotlight-v100 6 | immortalwrt* 7 | lede 8 | openwrt 9 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | SPDX-License-Identifier: GPL-2.0-only 2 | 3 | In addition, other licenses may also apply. 4 | 5 | All contributions here are subject to this COPYING file. 6 | -------------------------------------------------------------------------------- /patches/fullconenat-luci.patch: -------------------------------------------------------------------------------- 1 | --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js 2 | +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js 3 | @@ -57,6 +57,8 @@ return view.extend({ 4 | 5 | o = s.option(form.Flag, 'drop_invalid', _('Drop invalid packets')); 6 | 7 | + o = s.option(form.Flag, 'fullcone', _('Enable FullCone-NAT')); 8 | + 9 | var p = [ 10 | s.option(form.ListValue, 'input', _('Input')), 11 | s.option(form.ListValue, 'output', _('Output')), 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #### 提醒 2 | 3 | - 默认密码:无 4 | - 固件包的增减基于我目前用到的设备 5 | - 上游为 openwrt 官方,原汁原味,一些 package 取自第三方 6 | - 内置一些 usb 无线 ac 网卡与千兆有线网卡 7 | - 各设备内置的应用,可以查看 config 文件夹 8 | - 如需添加其他包或设备,请 fork 后自行在如下文件中添加 9 | - scripts/ 10 | - config/ 11 | - 不同版本,存储在不同的 branch,所以想自行编译的话,请 fork 所有分支 12 | 13 | #### 感谢 14 | 15 | - [![coolsnowwolf](https://img.shields.io/badge/Lede-Lean-orange.svg?style=flat&logo=appveyor)](https://github.com/coolsnowwolf/lede) 16 | - [![Lienol](https://img.shields.io/badge/OpenWrt-Lienol-orange.svg?style=flat&logo=appveyor)](https://github.com/Lienol/openwrt) 17 | - [![CTCGFW](https://img.shields.io/badge/OpenWrt-CTCGFW-orange.svg?style=flat&logo=appveyor)](https://github.com/immortalwrt/immortalwrt) 18 | -------------------------------------------------------------------------------- /.github/workflows/clean.yml: -------------------------------------------------------------------------------- 1 | name: Clean old workflow runs 2 | on: 3 | workflow_dispatch: 4 | # Run at 01:00 every six days. 5 | schedule: 6 | - cron: '0 1 */6 * *' 7 | 8 | jobs: 9 | del_runs: 10 | runs-on: ubuntu-latest 11 | strategy: 12 | matrix: 13 | file: ['cache.yml', 'clean.yml'] 14 | permissions: 15 | actions: write 16 | contents: read 17 | steps: 18 | - name: Delete workflow runs 19 | uses: Mattraks/delete-workflow-runs@v2 20 | with: 21 | token: ${{ github.token }} 22 | repository: ${{ github.repository }} 23 | delete_workflow_pattern: ${{ matrix.file }} 24 | retain_days: 1 25 | keep_minimum_runs: 1 26 | -------------------------------------------------------------------------------- /default-settings/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2007-2021 OpenWrt.org 3 | # Copyright (C) 2010 Vertical Communications 4 | # 5 | # This is free software, licensed under the GNU General Public License v2. 6 | # See /LICENSE for more information. 7 | # 8 | 9 | include $(TOPDIR)/rules.mk 10 | 11 | PKG_NAME:=default-settings 12 | PKG_RELEASE:=1 13 | 14 | PKG_LICENSE:=GPL-3.0 15 | 16 | include $(INCLUDE_DIR)/package.mk 17 | 18 | # wireguard: kmod-wireguard 19 | # ipsec: kmod-{ipsec,ipsec4,ipsec6,ipt-ipsec,pppol2tp} 20 | 21 | define Package/default-settings 22 | SECTION:=luci 23 | CATEGORY:=LuCI 24 | TITLE:=LuCI support for Default Settings 25 | PKGARCH:=all 26 | DEPENDS:= \ 27 | +kmod-wireguard \ 28 | +libustream-mbedtls \ 29 | +luci \ 30 | +@LUCI_LANG_zh_Hans 31 | endef 32 | 33 | define Build/Compile 34 | endef 35 | 36 | define Package/default-settings/install 37 | $(INSTALL_DIR) $(1)/etc/uci-defaults 38 | $(INSTALL_BIN) ./files/zzz-default-settings $(1)/etc/uci-defaults/99-default-settings 39 | endef 40 | 41 | $(eval $(call BuildPackage,default-settings)) 42 | -------------------------------------------------------------------------------- /default-settings/files/zzz-default-settings: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # lang 4 | uci set luci.main.lang=auto 5 | uci commit luci 6 | 7 | # system settings 8 | uci -q batch <<-EOF 9 | set system.@system[0].timezone=CST-8 10 | set system.@system[0].zonename=Asia/Shanghai 11 | 12 | set system.@system[0].zram_priority=100 13 | 14 | delete system.ntp.server 15 | add_list system.ntp.server="ntp.tencent.com" 16 | add_list system.ntp.server="ntp1.aliyun.com" 17 | add_list system.ntp.server="ntp.ntsc.ac.cn" 18 | add_list system.ntp.server="cn.pool.ntp.org" 19 | EOF 20 | uci commit system 21 | 22 | # uhttpd 23 | uci set uhttpd.main.rfc1918_filter=0 24 | uci set uhttpd.main.redirect_https=0 25 | uci commit uhttpd && service uhttpd reload 26 | 27 | # dnsmasq 28 | sed -i '/log-facility/d' /etc/dnsmasq.conf 29 | echo "log-facility=/dev/null" >> /etc/dnsmasq.conf 30 | 31 | # feed 32 | sed -i 's,downloads.openwrt.org,mirror.sjtu.edu.cn/openwrt,g' /etc/opkg/distfeeds.conf 33 | 34 | opkg flag hold luci-app-firewall 35 | opkg flag hold firewall 36 | opkg flag hold dnsmasq-full 37 | 38 | # luci cache 39 | rm -rf /tmp/luci-modulecache/ 40 | rm -f /tmp/luci-indexcache 41 | 42 | exit 0 43 | -------------------------------------------------------------------------------- /.github/workflows/cache.yml: -------------------------------------------------------------------------------- 1 | name: Fetch Cache 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: "00 00 1,7,13,19,25,31 * *" 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-22.04 11 | strategy: 12 | matrix: 13 | target: ['x86-64'] 14 | branch: ['24.10'] 15 | 16 | steps: 17 | - name: Clone Repository 18 | uses: actions/checkout@v4 19 | with: 20 | ref: ${{ matrix.branch }} 21 | 22 | - name: Clone OpenWrt 23 | run: | 24 | git clone https://github.com/openwrt/openwrt.git 25 | 26 | - name: Get variable 27 | working-directory: ./openwrt 28 | id: var 29 | run: | 30 | case ${{ matrix.branch }} in 31 | 24.10) 32 | _release_tag=$(git tag --sort=taggerdate --list 'v24.*' | tail -1) 33 | git checkout $_release_tag 34 | ;; 35 | *) 36 | echo "Can't get local/upstream's branch/tags" 37 | ;; 38 | esac 39 | 40 | - name: Get cache toolchain 41 | uses: HiGarfield/cachewrtbuild@main 42 | with: 43 | prefix: ${{ github.workspace }}/openwrt 44 | mixkey: ${{ matrix.target }} 45 | skip_saving: 'true' 46 | -------------------------------------------------------------------------------- /scripts/00_init.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ex 4 | 5 | 6 | __get_other-repos() { 7 | git clone -b master --depth 1 --single-branch https://github.com/coolsnowwolf/lede lede 8 | git clone -b master --depth 1 --single-branch https://github.com/immortalwrt/immortalwrt immortalwrt 9 | git clone -b master --depth 1 --single-branch https://github.com/immortalwrt/packages immortalwrt-packages 10 | git clone -b master --depth 1 --single-branch https://github.com/immortalwrt/luci immortalwrt-luci 11 | echo "src-git nikki https://github.com/nikkinikki-org/OpenWrt-nikki.git;main" >> ./openwrt/feeds.conf.default 12 | } 13 | 14 | __patch_fullconenat() { 15 | # patch kernel 16 | cp -f ./lede/target/linux/generic/hack-6.12/952-add-net-conntrack-events-support-multiple-registrant.patch ./openwrt/target/linux/generic/hack-6.12/ 17 | # disable KERNEL_WERROR 18 | sed -i 's,imply KERNEL_WERROR,#imply KERNEL_WERROR,g' ./openwrt/toolchain/gcc/Config.version 19 | # fullconenat-nft 20 | cp -rf ./immortalwrt/package/network/utils/fullconenat-nft ./openwrt/package/network/utils/ 21 | # libnftnl 22 | rm -rf ./openwrt/package/libs/libnftnl 23 | cp -rf ./immortalwrt/package/libs/libnftnl ./openwrt/package/libs/ 24 | # nftables 25 | rm -rf ./openwrt/package/network/utils/nftables/ 26 | cp -rf ./immortalwrt/package/network/utils/nftables ./openwrt/package/network/utils/ 27 | # firewall4 28 | rm -rf ./openwrt/package/network/config/firewall4 29 | cp -rf ./immortalwrt/package/network/config/firewall4 ./openwrt/package/network/config/ 30 | # patch luci 31 | patch -d ./openwrt/feeds/luci -p1 -i ../../../patches/fullconenat-luci.patch 32 | } 33 | 34 | case $1 in 35 | other-repos) __get_other-repos ;; 36 | patch-fullconenat) __patch_fullconenat ;; 37 | *) echo "input error" ;; 38 | esac 39 | 40 | exit 0 41 | -------------------------------------------------------------------------------- /config/x86-64_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_TARGET_x86=y 2 | CONFIG_TARGET_x86_64=y 3 | CONFIG_TARGET_x86_64_DEVICE_generic=y 4 | CONFIG_TARGET_ROOTFS_PARTSIZE=512 5 | # CONFIG_TARGET_ROOTFS_TARGZ is not set 6 | 7 | CONFIG_GRUB_TIMEOUT="1" 8 | CONFIG_LUCI_SRCDIET=y 9 | 10 | CONFIG_PACKAGE_ath10k-firmware-qca9888=y 11 | CONFIG_PACKAGE_ath10k-firmware-qca988x=y 12 | CONFIG_PACKAGE_ath10k-firmware-qca9984=y 13 | CONFIG_PACKAGE_autocore=y 14 | CONFIG_PACKAGE_automount=y 15 | CONFIG_PACKAGE_brcmfmac-firmware-43602a1-pcie=y 16 | CONFIG_PACKAGE_default-settings=y 17 | # CONFIG_PACKAGE_dnsmasq is not set 18 | CONFIG_PACKAGE_dnsmasq-full=y 19 | CONFIG_PACKAGE_fdisk=y 20 | CONFIG_PACKAGE_kmod-8139cp=y 21 | CONFIG_PACKAGE_kmod-8139too=y 22 | CONFIG_PACKAGE_kmod-ath10k=y 23 | CONFIG_PACKAGE_kmod-igbvf=y 24 | CONFIG_PACKAGE_kmod-macvlan=y 25 | CONFIG_PACKAGE_kmod-mmc-spi=y 26 | CONFIG_PACKAGE_kmod-mt7663u=y 27 | CONFIG_PACKAGE_kmod-mt76x0u=y 28 | CONFIG_PACKAGE_kmod-mt76x2u=y 29 | CONFIG_PACKAGE_kmod-nft-fullcone=y 30 | CONFIG_PACKAGE_kmod-pcnet32=y 31 | CONFIG_PACKAGE_kmod-r8125=y 32 | CONFIG_PACKAGE_kmod-rtl8192cu=y 33 | CONFIG_PACKAGE_kmod-rtl8812au-ct=y 34 | CONFIG_PACKAGE_kmod-tulip=y 35 | CONFIG_PACKAGE_kmod-usb-hid=y 36 | CONFIG_PACKAGE_kmod-usb-net-asix-ax88179=y 37 | CONFIG_PACKAGE_kmod-usb-net-rndis=y 38 | CONFIG_PACKAGE_kmod-usb-net-rtl8152-vendor=y 39 | CONFIG_PACKAGE_kmod-vmxnet3=y 40 | CONFIG_PACKAGE_lm-sensors-detect=y 41 | CONFIG_PACKAGE_luci-app-accesscontrol=y 42 | CONFIG_PACKAGE_luci-app-arpbind=y 43 | CONFIG_PACKAGE_luci-app-autoreboot=y 44 | CONFIG_PACKAGE_luci-app-ksmbd=y 45 | CONFIG_PACKAGE_luci-app-nikki=y 46 | CONFIG_PACKAGE_luci-app-ramfree=y 47 | CONFIG_PACKAGE_luci-app-upnp=y 48 | CONFIG_PACKAGE_luci-app-usb-printer=y 49 | CONFIG_PACKAGE_luci-app-vlmcsd=y 50 | CONFIG_PACKAGE_luci-app-zerotier=y 51 | CONFIG_PACKAGE_luci-ssl=y 52 | CONFIG_PACKAGE_luci-theme-bootstrap=y 53 | CONFIG_PACKAGE_odhcp6c=y 54 | CONFIG_PACKAGE_odhcpd-ipv6only=y 55 | # CONFIG_PACKAGE_open-vm-tools is not set 56 | CONFIG_PACKAGE_wpad-basic-mbedtls=y 57 | CONFIG_PACKAGE_zram-swap=y 58 | -------------------------------------------------------------------------------- /scripts/01_customize_packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # create directory 4 | [[ ! -d package/new ]] && mkdir -p package/new 5 | 6 | # arpbind 7 | cp -rf ../immortalwrt-luci/applications/luci-app-arpbind package/new/ 8 | 9 | # AutoCore 10 | cp -rf ../immortalwrt/package/emortal/autocore package/new/ 11 | cp -rf ../immortalwrt/package/utils/mhz package/utils/ 12 | rm -rf feeds/luci/modules/luci-base 13 | cp -rf ../immortalwrt-luci/modules/luci-base feeds/luci/modules 14 | rm -rf feeds/luci/modules/luci-mod-status 15 | cp -rf ../immortalwrt-luci/modules/luci-mod-status feeds/luci/modules/ 16 | 17 | # automount 18 | cp -rf ../lede/package/lean/automount package/new/ 19 | cp -rf ../lede/package/lean/ntfs3-mount package/new/ 20 | 21 | # cpufreq 22 | cp -rf ../immortalwrt-luci/applications/luci-app-cpufreq package/new/ 23 | cp -rf ../immortalwrt/package/emortal/cpufreq package/new/ 24 | 25 | # dnsmasq 26 | rm -rf package/network/services/dnsmasq 27 | cp -rf ../immortalwrt/package/network/services/dnsmasq package/network/services/ 28 | 29 | # Realtek RTL8152/8153 30 | cp -rf ../immortalwrt/package/kernel/r8152 package/new/ 31 | 32 | # Release Ram 33 | cp -rf ../immortalwrt-luci/applications/luci-app-ramfree package/new/ 34 | 35 | # Scheduled Reboot 36 | cp -rf ../immortalwrt-luci/applications/luci-app-autoreboot package/new/ 37 | 38 | # ShadowsocksR Plus+ 39 | #svn export -q https://github.com/fw876/helloworld/trunk package/helloworld 40 | #svn export -q https://github.com/coolsnowwolf/packages/trunk/net/shadowsocks-libev package/helloworld/shadowsocks-libev 41 | #rm -rf ./feeds/packages/net/{xray-core,shadowsocks-libev} 42 | 43 | # USB Printer 44 | cp -rf ../immortalwrt-luci/applications/luci-app-usb-printer package/new/ 45 | 46 | # vlmcsd 47 | cp -rf ../immortalwrt-luci/applications/luci-app-vlmcsd package/new/ 48 | cp -rf ../immortalwrt-packages/net/vlmcsd package/new/ 49 | 50 | # Zerotier 51 | cp -rf ../immortalwrt-luci/applications/luci-app-zerotier package/new/ 52 | 53 | # default settings and translation 54 | cp -rf ../default-settings package/new/ 55 | 56 | # fix include luci.mk 57 | find package/new/ -type f -name Makefile -exec sed -i 's,../../luci.mk,$(TOPDIR)/feeds/luci/luci.mk,g' {} + 58 | -------------------------------------------------------------------------------- /scripts/02_convert_translation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # [CTCGFW]Project-OpenWrt 3 | # Use it under GPLv3, please. 4 | # -------------------------------------------------------- 5 | # Convert translation files zh-cn to zh_Hans 6 | # The script is still in testing, welcome to report bugs. 7 | 8 | po_file="$({ find |grep -E "[a-z0-9]+\.zh\-cn.+po"; } 2>"/dev/null")" 9 | for a in ${po_file} 10 | do 11 | [ -n "$(grep "Language: zh_CN" "$a")" ] && sed -i "s/Language: zh_CN/Language: zh_Hans/g" "$a" 12 | po_new_file="$(echo -e "$a"|sed "s/zh-cn/zh_Hans/g")" 13 | mv "$a" "${po_new_file}" 2>"/dev/null" 14 | done 15 | 16 | po_file2="$({ find |grep "/zh-cn/" |grep "\.po"; } 2>"/dev/null")" 17 | for b in ${po_file2} 18 | do 19 | [ -n "$(grep "Language: zh_CN" "$b")" ] && sed -i "s/Language: zh_CN/Language: zh_Hans/g" "$b" 20 | po_new_file2="$(echo -e "$b"|sed "s/zh-cn/zh_Hans/g")" 21 | mv "$b" "${po_new_file2}" 2>"/dev/null" 22 | done 23 | 24 | lmo_file="$({ find |grep -E "[a-z0-9]+\.zh_Hans.+lmo"; } 2>"/dev/null")" 25 | for c in ${lmo_file} 26 | do 27 | lmo_new_file="$(echo -e "$c"|sed "s/zh_Hans/zh-cn/g")" 28 | mv "$c" "${lmo_new_file}" 2>"/dev/null" 29 | done 30 | 31 | lmo_file2="$({ find |grep "/zh_Hans/" |grep "\.lmo"; } 2>"/dev/null")" 32 | for d in ${lmo_file2} 33 | do 34 | lmo_new_file2="$(echo -e "$d"|sed "s/zh_Hans/zh-cn/g")" 35 | mv "$d" "${lmo_new_file2}" 2>"/dev/null" 36 | done 37 | 38 | po_dir="$({ find |grep "/zh-cn" |sed "/\.po/d" |sed "/\.lmo/d"; } 2>"/dev/null")" 39 | for e in ${po_dir} 40 | do 41 | po_new_dir="$(echo -e "$e"|sed "s/zh-cn/zh_Hans/g")" 42 | mv "$e" "${po_new_dir}" 2>"/dev/null" 43 | done 44 | 45 | makefile_file="$({ find|grep Makefile |sed "/Makefile./d"; } 2>"/dev/null")" 46 | for f in ${makefile_file} 47 | do 48 | [ -n "$(grep "zh-cn" "$f")" ] && sed -i "s/zh-cn/zh_Hans/g" "$f" 49 | [ -n "$(grep "zh_Hans.lmo" "$f")" ] && sed -i "s/zh_Hans.lmo/zh-cn.lmo/g" "$f" 50 | done 51 | 52 | makefile_file="$({ find package | grep Makefile | sed "/Makefile./d"; } 2>"/dev/null")" 53 | for g in ${makefile_file}; do 54 | [ -n "$(grep "golang-package.mk" "$g")" ] && sed -i "s,\../..,\$(TOPDIR)/feeds/packages,g" "$g" 55 | [ -n "$(grep "luci.mk" "$g")" ] && sed -i "s,\../..,\$(TOPDIR)/feeds/luci,g" "$g" 56 | done 57 | 58 | exit 0 59 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Build OpenWrt 2 | run-name: Build OpenWrt ${{ github.event.inputs.branch }} 3 | 4 | on: 5 | workflow_dispatch: 6 | inputs: 7 | branch: 8 | description: 'your local repo branch' 9 | required: true 10 | default: '24.10' 11 | type: choice 12 | options: 13 | - 'master' 14 | - '24.10' 15 | targets: 16 | description: 'target devices' 17 | required: true 18 | default: "['x86-64']" 19 | type: choice 20 | options: 21 | - "['x86-64']" 22 | 23 | jobs: 24 | build: 25 | runs-on: ubuntu-24.04 26 | strategy: 27 | matrix: 28 | target: ${{ fromJSON(github.event.inputs.targets) }} 29 | 30 | steps: 31 | - name: Maximize build space 32 | uses: easimon/maximize-build-space@master 33 | with: 34 | swap-size-mb: 1024 35 | temp-reserve-mb: 512 36 | root-reserve-mb: 4608 37 | remove-dotnet: 'true' 38 | remove-android: 'true' 39 | remove-haskell: 'true' 40 | remove-codeql: 'true' 41 | 42 | - name: Clone Repository 43 | uses: actions/checkout@v4 44 | with: 45 | ref: ${{ github.event.inputs.branch }} 46 | 47 | - name: Init build dependencies 48 | env: 49 | DEBIAN_FRONTEND: noninteractive 50 | run: | 51 | sudo -E apt-get -qq update 52 | sudo /bin/bash -c "$(curl -sL https://git.io/vokNn)" 53 | sudo -E apt-fast -y -qq install asciidoc bash bcc bin86 binutils bison build-essential bzip2 file flex g++-multilib gawk gcc-multilib gettext git gzip help2man intltool libboost-dev libelf-dev libncurses-dev libssl-dev libthread-queue-any-perl libusb-dev libxml-parser-perl patch perl-modules python3-dev python3-pip python3-pyelftools python3-setuptools rsync sharutils swig time unzip util-linux wget xsltproc zlib1g-dev zip 54 | sudo -E apt-fast -y -qq install android-sdk-libsparse-utils dos2unix dwarves quilt 55 | pip3 install --user -U pylibfdt --break-system-packages 56 | sudo -E apt-get -qq autoremove --purge 57 | sudo -E apt-get -qq clean 58 | sudo -E git config --global user.name 'github-actions[bot]' 59 | sudo -E git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' 60 | df -h 61 | 62 | - name: Clone OpenWrt 63 | run: | 64 | git clone https://github.com/openwrt/openwrt.git 65 | 66 | - name: Get variable 67 | working-directory: ./openwrt 68 | id: var 69 | run: | 70 | case ${{ github.event.inputs.branch }} in 71 | master) 72 | _release_tag=snapshot-r$(date +%g.%j) 73 | _prerelease=true 74 | ;; 75 | 24.10) 76 | _release_tag=$(git tag --sort=taggerdate --list 'v24.*' | tail -1) 77 | git checkout $_release_tag 78 | _prerelease=false 79 | ;; 80 | *) 81 | echo "Can't get local/upstream's branch/tags" 82 | ;; 83 | esac 84 | case ${{ matrix.target }} in 85 | x86-64) _device=x86-64 ;; 86 | *) echo "wrong devices" ;; 87 | esac 88 | _artifact=${{ matrix.target }} 89 | _artifact_path=openwrt/bin/targets/${_artifact/-//} 90 | echo "release_tag=$_release_tag" >> $GITHUB_OUTPUT 91 | echo "prerelease=$_prerelease" >> $GITHUB_OUTPUT 92 | echo "device=$_device" >> $GITHUB_OUTPUT 93 | echo "artifact=$_artifact_path" >> $GITHUB_OUTPUT 94 | 95 | - name: Fetch Other repos 96 | run: | 97 | ./scripts/00_init.sh other-repos 98 | 99 | - name: Feeds update & install 100 | working-directory: ./openwrt 101 | run: | 102 | ./scripts/feeds update -a && ./scripts/feeds install -a 103 | 104 | - name: Customize Packages 105 | working-directory: ./openwrt 106 | run: | 107 | cp -L ../scripts/${{ steps.var.outputs.device }}_customization.sh . 108 | cp ../scripts/01_customize_packages.sh . 109 | /bin/bash ${{ steps.var.outputs.device }}_customization.sh 110 | 111 | - if: matrix.target == 'x86-64' 112 | name: FullCone Nat 113 | run: | 114 | ./scripts/00_init.sh patch-fullconenat 115 | 116 | - name: Convert Translation 117 | working-directory: ./openwrt 118 | run: | 119 | cp ../scripts/02_convert_translation.sh . 120 | /bin/bash 02_convert_translation.sh 121 | 122 | - name: Get cache toolchain 123 | uses: HiGarfield/cachewrtbuild@main 124 | with: 125 | prefix: ${{ github.workspace }}/openwrt 126 | mixkey: ${{ matrix.target }} 127 | 128 | - name: Make Config 129 | working-directory: ./openwrt 130 | run: | 131 | cp ../config/${{ steps.var.outputs.device }}_defconfig .config 132 | make defconfig 133 | 134 | - name: Make Download 135 | working-directory: ./openwrt 136 | run: | 137 | make download -j`nproc` 138 | 139 | - name: Compile OpenWrt 140 | working-directory: ./openwrt 141 | run: | 142 | make -j`nproc` || make -j1 V=s 143 | 144 | - name: Assemble Artifact 145 | run: | 146 | ls ${{ steps.var.outputs.artifact }} 147 | cat ${{ steps.var.outputs.artifact }}/config.buildinfo 148 | rm -rf ${{ steps.var.outputs.artifact }}/{packages,*.buildinfo,*.json,*.manifest,*kernel.bin,*-rootfs.*,sha256sums} 149 | 150 | - name: Upload Release 151 | uses: softprops/action-gh-release@v2 152 | env: 153 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 154 | with: 155 | draft: false 156 | target_commitish: ${{ github.event.inputs.branch }} 157 | prerelease: ${{ steps.var.outputs.prerelease }} 158 | tag_name: ${{ steps.var.outputs.release_tag }} 159 | files: ${{ steps.var.outputs.artifact }}/* 160 | --------------------------------------------------------------------------------