├── .config.n1.docker ├── .config.openwrt ├── .github └── workflows │ ├── k2p-build.yml │ └── n1-build.yml ├── README.md └── n1 ├── .dockerignore ├── Dockerfile ├── Readme.md ├── build.sh ├── diy.sh └── patches ├── cpustat ├── luci-admin-status-index-html.patch └── rc.local /.config.n1.docker: -------------------------------------------------------------------------------- 1 | CONFIG_TARGET_armvirt=y 2 | CONFIG_TARGET_armvirt_64=y 3 | CONFIG_TARGET_armvirt_64_Default=y 4 | CONFIG_LIBCURL_COOKIES=y 5 | CONFIG_LIBCURL_FILE=y 6 | CONFIG_LIBCURL_FTP=y 7 | CONFIG_LIBCURL_HTTP=y 8 | CONFIG_LIBCURL_NO_SMB="!" 9 | CONFIG_LIBCURL_OPENSSL=y 10 | CONFIG_LIBCURL_PROXY=y 11 | # CONFIG_OPENSSL_ENGINE_BUILTIN is not set 12 | CONFIG_OPENSSL_WITH_COMPRESSION=y 13 | CONFIG_OPENSSL_WITH_DTLS=y 14 | CONFIG_OPENSSL_WITH_EC2M=y 15 | CONFIG_OPENSSL_WITH_NPN=y 16 | CONFIG_PACKAGE_6in4=y 17 | # CONFIG_PACKAGE_UnblockNeteaseMusic is not set 18 | # CONFIG_PACKAGE_UnblockNeteaseMusicGo is not set 19 | # CONFIG_PACKAGE_adbyby is not set 20 | CONFIG_PACKAGE_bash=y 21 | CONFIG_PACKAGE_brook=y 22 | CONFIG_PACKAGE_ca-bundle=y 23 | CONFIG_PACKAGE_chinadns-ng=y 24 | CONFIG_PACKAGE_coreutils-nohup=y 25 | CONFIG_PACKAGE_curl=y 26 | CONFIG_PACKAGE_haproxy=y 27 | CONFIG_PACKAGE_ip-tiny=y 28 | CONFIG_PACKAGE_ip6tables=y 29 | CONFIG_PACKAGE_iptables-mod-ipopt=y 30 | CONFIG_PACKAGE_ipv6helper=y 31 | CONFIG_PACKAGE_kcptun-client=y 32 | # CONFIG_PACKAGE_kmod-crypto-user is not set 33 | CONFIG_PACKAGE_kmod-ipt-ipopt=y 34 | CONFIG_PACKAGE_kmod-ipt-nat6=y 35 | CONFIG_PACKAGE_kmod-iptunnel=y 36 | CONFIG_PACKAGE_kmod-iptunnel4=y 37 | CONFIG_PACKAGE_kmod-nf-nat6=y 38 | CONFIG_PACKAGE_kmod-sit=y 39 | CONFIG_PACKAGE_kmod-tun=y 40 | CONFIG_PACKAGE_libcap=y 41 | # CONFIG_PACKAGE_libcares is not set 42 | CONFIG_PACKAGE_libcurl=y 43 | CONFIG_PACKAGE_libgd=y 44 | # CONFIG_PACKAGE_libhttp-parser is not set 45 | CONFIG_PACKAGE_libjpeg=y 46 | CONFIG_PACKAGE_libltdl=y 47 | CONFIG_PACKAGE_liblua5.3=y 48 | CONFIG_PACKAGE_libncurses=y 49 | # CONFIG_PACKAGE_libnghttp2 is not set 50 | CONFIG_PACKAGE_libopenssl-devcrypto=y 51 | CONFIG_PACKAGE_libpng=y 52 | CONFIG_PACKAGE_libreadline=y 53 | CONFIG_PACKAGE_libwebp=y 54 | CONFIG_PACKAGE_libwebsockets-full=y 55 | # CONFIG_PACKAGE_luci-app-accesscontrol is not set 56 | # CONFIG_PACKAGE_luci-app-adbyby-plus is not set 57 | # CONFIG_PACKAGE_luci-app-arpbind is not set 58 | # CONFIG_PACKAGE_luci-app-autoreboot is not set 59 | # CONFIG_PACKAGE_luci-app-filetransfer is not set 60 | CONFIG_PACKAGE_luci-app-openclash=y 61 | CONFIG_PACKAGE_luci-app-passwall=y 62 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Brook=y 63 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks=y 64 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Trojan=y 65 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Trojan_GO=y 66 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_kcptun=y 67 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_simple-obfs=y 68 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_v2ray-plugin=y 69 | # CONFIG_PACKAGE_luci-app-rclone_INCLUDE_fuse-utils is not set 70 | # CONFIG_PACKAGE_luci-app-rclone_INCLUDE_rclone-ng is not set 71 | # CONFIG_PACKAGE_luci-app-rclone_INCLUDE_rclone-webui is not set 72 | CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Kcptun=y 73 | CONFIG_PACKAGE_luci-app-ttyd=y 74 | # CONFIG_PACKAGE_luci-app-unblockmusic is not set 75 | CONFIG_PACKAGE_luci-app-vnstat=y 76 | # CONFIG_PACKAGE_luci-app-vsftpd is not set 77 | CONFIG_PACKAGE_luci-app-wrtbwmon=y 78 | CONFIG_PACKAGE_luci-i18n-ttyd-zh-cn=y 79 | CONFIG_PACKAGE_luci-i18n-vnstat-zh-cn=y 80 | CONFIG_PACKAGE_luci-i18n-wrtbwmon-zh-cn=y 81 | # CONFIG_PACKAGE_luci-lib-fs is not set 82 | CONFIG_PACKAGE_luci-proto-ipv6=y 83 | CONFIG_PACKAGE_luci-theme-material=y 84 | # CONFIG_PACKAGE_node is not set 85 | CONFIG_PACKAGE_odhcp6c=y 86 | CONFIG_PACKAGE_odhcp6c_ext_cer_id=0 87 | CONFIG_PACKAGE_odhcpd-ipv6only=y 88 | CONFIG_PACKAGE_odhcpd_ipv6only_ext_cer_id=0 89 | CONFIG_PACKAGE_tcping=y 90 | CONFIG_PACKAGE_terminfo=y 91 | CONFIG_PACKAGE_trojan-go=y 92 | CONFIG_PACKAGE_ttyd=y 93 | CONFIG_PACKAGE_unzip=y 94 | CONFIG_PACKAGE_vnstat=y 95 | CONFIG_PACKAGE_vnstati=y 96 | # CONFIG_PACKAGE_vsftpd-alt is not set 97 | # CONFIG_TARGET_ROOTFS_CPIOGZ is not set 98 | # CONFIG_TARGET_ROOTFS_INITRAMFS is not set 99 | # CONFIG_TARGET_ROOTFS_SQUASHFS is not set 100 | CONFIG_TROJAN_GO_COMPRESS_UPX=y 101 | # CONFIG_UnblockNeteaseMusic_Go is not set 102 | # CONFIG_UnblockNeteaseMusic_NodeJS is not set 103 | -------------------------------------------------------------------------------- /.config.openwrt: -------------------------------------------------------------------------------- 1 | CONFIG_TARGET_ramips=y 2 | CONFIG_TARGET_ramips_mt7621=y 3 | CONFIG_TARGET_ramips_mt7621_DEVICE_k2p=y 4 | CONFIG_DRIVER_11AC_SUPPORT=y 5 | CONFIG_DRIVER_11N_SUPPORT=y 6 | CONFIG_DRIVER_11W_SUPPORT=y 7 | CONFIG_KERNEL_AIO=y 8 | CONFIG_KERNEL_BLK_CGROUP=y 9 | CONFIG_KERNEL_CGROUPS=y 10 | CONFIG_KERNEL_CGROUP_CPUACCT=y 11 | CONFIG_KERNEL_CGROUP_DEVICE=y 12 | CONFIG_KERNEL_CGROUP_FREEZER=y 13 | CONFIG_KERNEL_CGROUP_PIDS=y 14 | CONFIG_KERNEL_CGROUP_SCHED=y 15 | CONFIG_KERNEL_CPUSETS=y 16 | CONFIG_KERNEL_FAIR_GROUP_SCHED=y 17 | CONFIG_KERNEL_FANOTIFY=y 18 | CONFIG_KERNEL_FHANDLE=y 19 | CONFIG_KERNEL_FREEZER=y 20 | CONFIG_KERNEL_IPC_NS=y 21 | CONFIG_KERNEL_MEMCG=y 22 | CONFIG_KERNEL_MEMCG_KMEM=y 23 | CONFIG_KERNEL_MM_OWNER=y 24 | CONFIG_KERNEL_NAMESPACES=y 25 | CONFIG_KERNEL_NETPRIO_CGROUP=y 26 | CONFIG_KERNEL_NET_CLS_CGROUP=y 27 | CONFIG_KERNEL_NET_NS=y 28 | CONFIG_KERNEL_PID_NS=y 29 | CONFIG_KERNEL_RESOURCE_COUNTERS=y 30 | CONFIG_KERNEL_RT_GROUP_SCHED=y 31 | CONFIG_KERNEL_SECCOMP=y 32 | CONFIG_KERNEL_SECCOMP_FILTER=y 33 | CONFIG_KERNEL_USER_NS=y 34 | CONFIG_KERNEL_UTS_NS=y 35 | CONFIG_LIBSODIUM_MINIMAL=y 36 | CONFIG_LUCI_APP_MTKWIFI=y 37 | CONFIG_LUCI_APP_WEBCONSOLE=y 38 | CONFIG_LUCI_LANG_zh_Hans=y 39 | CONFIG_MTK_APCLI_SUPPORT=y 40 | CONFIG_MTK_ATE_SUPPORT=y 41 | CONFIG_MTK_BACKGROUND_SCAN_SUPPORT=y 42 | CONFIG_MTK_BAND_STEERING=y 43 | CONFIG_MTK_BRCM_256QAM_SUPPORT=y 44 | CONFIG_MTK_CHIP_MT7615E=y 45 | CONFIG_MTK_DBDC_MODE=y 46 | CONFIG_MTK_DOT11W_PMF_SUPPORT=y 47 | CONFIG_MTK_DOT11_N_SUPPORT=y 48 | CONFIG_MTK_DOT11_VHT_AC=y 49 | CONFIG_MTK_FIRST_IF_EEPROM_FLASH=y 50 | CONFIG_MTK_FIRST_IF_EPAELNA=y 51 | CONFIG_MTK_FIRST_IF_MT7615E=y 52 | CONFIG_MTK_GREENAP_SUPPORT=y 53 | CONFIG_MTK_G_BAND_256QAM_SUPPORT=y 54 | CONFIG_MTK_HDR_TRANS_RX_SUPPORT=y 55 | CONFIG_MTK_HDR_TRANS_TX_SUPPORT=y 56 | CONFIG_MTK_ICAP_SUPPORT=y 57 | CONFIG_MTK_IGMP_SNOOP_SUPPORT=y 58 | CONFIG_MTK_MAC_REPEATER_SUPPORT=y 59 | CONFIG_MTK_MBSS_SUPPORT=y 60 | CONFIG_MTK_MCAST_RATE_SPECIFIC=y 61 | CONFIG_MTK_MT_AP_SUPPORT=m 62 | CONFIG_MTK_MT_DFS_SUPPORT=y 63 | CONFIG_MTK_MT_MAC=y 64 | CONFIG_MTK_MT_WIFI=y 65 | CONFIG_MTK_MT_WIFI_PATH="mt_wifi" 66 | CONFIG_MTK_MULTI_PROFILE_SUPPORT=y 67 | CONFIG_MTK_MUMIMO_SUPPORT=y 68 | CONFIG_MTK_MU_RA_SUPPORT=y 69 | CONFIG_MTK_PCIE_ASPM_DYM_CTRL_SUPPORT=y 70 | CONFIG_MTK_PRE_CAL_TRX_SET1_SUPPORT=y 71 | CONFIG_MTK_PRE_CAL_TRX_SET2_SUPPORT=y 72 | CONFIG_MTK_RED_SUPPORT=y 73 | CONFIG_MTK_RLM_CAL_CACHE_SUPPORT=y 74 | CONFIG_MTK_RTMP_FLASH_SUPPORT=y 75 | CONFIG_MTK_RT_FIRST_CARD=7615 76 | CONFIG_MTK_RT_FIRST_CARD_EEPROM="flash" 77 | CONFIG_MTK_RT_FIRST_IF_RF_OFFSET=0xc0000 78 | CONFIG_MTK_SECOND_IF_NONE=y 79 | CONFIG_MTK_SMART_CARRIER_SENSE_SUPPORT=y 80 | CONFIG_MTK_SPECTRUM_SUPPORT=y 81 | CONFIG_MTK_SUPPORT_OPENWRT=y 82 | CONFIG_MTK_TCP_RACK_SUPPORT=y 83 | CONFIG_MTK_THIRD_IF_NONE=y 84 | CONFIG_MTK_TPC_SUPPORT=y 85 | CONFIG_MTK_TXBF_SUPPORT=y 86 | CONFIG_MTK_UAPSD=y 87 | CONFIG_MTK_VHT_TXBF_2G_EPIGRAM_IE_SUPPORT=y 88 | CONFIG_MTK_VOW_SUPPORT=y 89 | CONFIG_MTK_WDS_SUPPORT=y 90 | CONFIG_MTK_WIFI_BASIC_FUNC=y 91 | CONFIG_MTK_WIFI_DRIVER=y 92 | CONFIG_MTK_WIFI_MODE_AP=m 93 | CONFIG_MTK_WIFI_MT_MAC=y 94 | CONFIG_MTK_WSC_INCLUDED=y 95 | CONFIG_MTK_WSC_V2_SUPPORT=y 96 | CONFIG_OPENSSL_ENGINE=y 97 | CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM=y 98 | CONFIG_OPENSSL_WITH_ASM=y 99 | CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y 100 | CONFIG_OPENSSL_WITH_CMS=y 101 | CONFIG_OPENSSL_WITH_COMPRESSION=y 102 | CONFIG_OPENSSL_WITH_DEPRECATED=y 103 | CONFIG_OPENSSL_WITH_DTLS=y 104 | CONFIG_OPENSSL_WITH_EC2M=y 105 | CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y 106 | CONFIG_OPENSSL_WITH_NPN=y 107 | CONFIG_OPENSSL_WITH_PSK=y 108 | CONFIG_OPENSSL_WITH_SRP=y 109 | CONFIG_OPENSSL_WITH_TLS13=y 110 | CONFIG_PACKAGE_MAC80211_DEBUGFS=y 111 | CONFIG_PACKAGE_MAC80211_MESH=y 112 | CONFIG_PACKAGE_bash=m 113 | CONFIG_PACKAGE_ca-certificates=m 114 | CONFIG_PACKAGE_cgi-io=y 115 | CONFIG_PACKAGE_coreutils=m 116 | CONFIG_PACKAGE_coreutils-base64=m 117 | CONFIG_PACKAGE_coreutils-nohup=m 118 | CONFIG_PACKAGE_dnsmasq-full=m 119 | CONFIG_PACKAGE_dnsmasq_full_auth=y 120 | CONFIG_PACKAGE_dnsmasq_full_conntrack=y 121 | CONFIG_PACKAGE_dnsmasq_full_dhcp=y 122 | CONFIG_PACKAGE_dnsmasq_full_dhcpv6=y 123 | CONFIG_PACKAGE_dnsmasq_full_dnssec=y 124 | CONFIG_PACKAGE_dnsmasq_full_ipset=y 125 | CONFIG_PACKAGE_dnsmasq_full_noid=y 126 | CONFIG_PACKAGE_dnsmasq_full_tftp=y 127 | CONFIG_PACKAGE_haproxy=m 128 | CONFIG_PACKAGE_hostapd-common=y 129 | CONFIG_PACKAGE_ip-tiny=y 130 | CONFIG_PACKAGE_ipset=y 131 | CONFIG_PACKAGE_iptables-mod-conntrack-extra=y 132 | CONFIG_PACKAGE_iptables-mod-ipopt=y 133 | CONFIG_PACKAGE_iptables-mod-tproxy=m 134 | CONFIG_PACKAGE_iw=y 135 | CONFIG_PACKAGE_iwinfo=y 136 | CONFIG_PACKAGE_kmod-cfg80211=y 137 | CONFIG_PACKAGE_kmod-ipt-conntrack-extra=y 138 | CONFIG_PACKAGE_kmod-ipt-ipopt=y 139 | CONFIG_PACKAGE_kmod-ipt-ipset=y 140 | CONFIG_PACKAGE_kmod-ipt-raw=y 141 | CONFIG_PACKAGE_kmod-ipt-tproxy=m 142 | CONFIG_PACKAGE_kmod-mac80211=y 143 | CONFIG_PACKAGE_kmod-mt76-core=y 144 | CONFIG_PACKAGE_kmod-mt7615e=y 145 | CONFIG_PACKAGE_kmod-mt_wifi=y 146 | CONFIG_PACKAGE_kmod-nf-conntrack-netlink=m 147 | CONFIG_PACKAGE_kmod-nfnetlink=y 148 | CONFIG_PACKAGE_libatomic=m 149 | CONFIG_PACKAGE_libev=m 150 | CONFIG_PACKAGE_libgmp=m 151 | CONFIG_PACKAGE_libipset=y 152 | CONFIG_PACKAGE_libiwinfo=y 153 | CONFIG_PACKAGE_libiwinfo-lua=y 154 | CONFIG_PACKAGE_libltdl=m 155 | CONFIG_PACKAGE_liblua=y 156 | CONFIG_PACKAGE_liblucihttp=y 157 | CONFIG_PACKAGE_liblucihttp-lua=y 158 | CONFIG_PACKAGE_libmbedtls=m 159 | CONFIG_PACKAGE_libmnl=y 160 | CONFIG_PACKAGE_libncurses=m 161 | CONFIG_PACKAGE_libnetfilter-conntrack=m 162 | CONFIG_PACKAGE_libnettle=m 163 | CONFIG_PACKAGE_libnfnetlink=m 164 | CONFIG_PACKAGE_libopenssl=m 165 | CONFIG_PACKAGE_libpcre=m 166 | CONFIG_PACKAGE_libreadline=m 167 | CONFIG_PACKAGE_librt=y 168 | CONFIG_PACKAGE_libsodium=m 169 | CONFIG_PACKAGE_libubus-lua=y 170 | CONFIG_PACKAGE_libuci-lua=y 171 | CONFIG_PACKAGE_libuuid=y 172 | CONFIG_PACKAGE_libuv=m 173 | CONFIG_PACKAGE_lua=y 174 | CONFIG_PACKAGE_luci=y 175 | CONFIG_PACKAGE_luci-app-firewall=y 176 | CONFIG_PACKAGE_luci-app-mwan3=y 177 | CONFIG_PACKAGE_luci-app-opkg=y 178 | CONFIG_PACKAGE_luci-app-upnp=y 179 | CONFIG_PACKAGE_luci-base=y 180 | CONFIG_PACKAGE_luci-compat=y 181 | CONFIG_PACKAGE_luci-i18n-base-zh-cn=y 182 | CONFIG_PACKAGE_luci-i18n-firewall-zh-cn=y 183 | CONFIG_PACKAGE_luci-i18n-mwan3-zh-cn=y 184 | CONFIG_PACKAGE_luci-i18n-opkg-zh-cn=y 185 | CONFIG_PACKAGE_luci-i18n-upnp-zh-cn=y 186 | CONFIG_PACKAGE_luci-lib-ip=y 187 | CONFIG_PACKAGE_luci-lib-jsonc=y 188 | CONFIG_PACKAGE_luci-lib-nixio=y 189 | CONFIG_PACKAGE_luci-mod-admin-full=y 190 | CONFIG_PACKAGE_luci-mod-network=y 191 | CONFIG_PACKAGE_luci-mod-status=y 192 | CONFIG_PACKAGE_luci-mod-system=y 193 | CONFIG_PACKAGE_luci-proto-ipv6=y 194 | CONFIG_PACKAGE_luci-proto-ppp=y 195 | CONFIG_PACKAGE_luci-theme-bootstrap=y 196 | CONFIG_PACKAGE_miniupnpd=y 197 | CONFIG_PACKAGE_mtk-luci-plugin=y 198 | CONFIG_PACKAGE_mwan3=y 199 | CONFIG_PACKAGE_resolveip=m 200 | CONFIG_PACKAGE_rpcd=y 201 | CONFIG_PACKAGE_rpcd-mod-file=y 202 | CONFIG_PACKAGE_rpcd-mod-iwinfo=y 203 | CONFIG_PACKAGE_rpcd-mod-luci=y 204 | CONFIG_PACKAGE_rpcd-mod-rrdns=y 205 | CONFIG_PACKAGE_shadowsocks-libev-config=m 206 | CONFIG_PACKAGE_shadowsocks-libev-ss-local=m 207 | CONFIG_PACKAGE_shadowsocks-libev-ss-redir=m 208 | CONFIG_PACKAGE_terminfo=m 209 | CONFIG_PACKAGE_uhttpd=y 210 | CONFIG_PACKAGE_uhttpd-mod-ubus=y 211 | CONFIG_PACKAGE_unzip=m 212 | CONFIG_PACKAGE_wifi-l1profile=y 213 | CONFIG_PACKAGE_wireless-regdb=y 214 | CONFIG_PACKAGE_wpad-basic=y 215 | CONFIG_PACKAGE_zlib=m 216 | # CONFIG_TARGET_ROOTFS_INITRAMFS is not set 217 | CONFIG_WPA_MSG_MIN_PRIORITY=3 218 | CONFIG_first_card=y 219 | CONFIG_first_card_EEPROM_name="e2p" 220 | CONFIG_first_card_EEPROM_offset="0x0" 221 | CONFIG_first_card_EEPROM_size="0x5000" 222 | CONFIG_first_card_apcli_ifname="apcli" 223 | CONFIG_first_card_bf_sku_path="/etc/wireless/mediatek/mt7615e-sku-bf.dat" 224 | CONFIG_first_card_ext_ifname="ra" 225 | CONFIG_first_card_init_compatible="mt7615e" 226 | CONFIG_first_card_init_script="/lib/wifi/mt7615e.lua" 227 | CONFIG_first_card_main_ifname="ra0" 228 | CONFIG_first_card_mesh_ifname="mesh" 229 | CONFIG_first_card_name="MT7622" 230 | CONFIG_first_card_nvram_zone="dev1" 231 | CONFIG_first_card_profile_path="/etc/wireless/mediatek/mt7622.1.dat" 232 | CONFIG_first_card_single_sku_path="/etc/wireless/mediatek/mt7615e-sku.dat" 233 | CONFIG_first_card_wds_ifname="wds" 234 | -------------------------------------------------------------------------------- /.github/workflows/k2p-build.yml: -------------------------------------------------------------------------------- 1 | name: OpenWrt k2p CI 2 | on: 3 | schedule: 4 | - cron: 0 7 * * 5 5 | push: 6 | branches: 7 | - master 8 | paths: 9 | - '.config.openwrt' 10 | - '.github/workflows/k2p-build.yml' 11 | 12 | 13 | jobs: 14 | build: 15 | runs-on: ubuntu-latest 16 | steps: 17 | 18 | - name: Checkout - clone repository 19 | uses: actions/checkout@v2 20 | 21 | - name: Install - system build dependencies 22 | run: | 23 | sudo swapoff /swapfile || echo "no swapfile" 24 | sudo rm -rf /swapfile /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc || echo "clean partly" 25 | sudo -E apt-get -qq update 26 | sudo -E apt-get -yqq install subversion build-essential libncurses5-dev zlib1g-dev gawk git ccache gettext libssl-dev xsltproc zip 27 | sudo -E apt-get -yqq autoremove --purge 28 | sudo -E apt-get -qq clean 29 | 30 | - name: Download - openwrt source download 31 | run: | 32 | git clone -b openwrt-19.07 https://github.com/openwrt/openwrt.git 33 | 34 | - name: Update - openwrt source update and install 35 | run: | 36 | cd openwrt 37 | ./scripts/feeds update -a 38 | ./scripts/feeds install -a 39 | 40 | - name: Clone - openwrt plugin source 41 | run: | 42 | cd openwrt 43 | git clone https://github.com/MeIsReallyBa/k2p-openwrt-mt7615_5.0.2.0 package/mtk 44 | 45 | - name: Config - official openwrt k2p build config 46 | run: | 47 | cp .config.openwrt openwrt/.config 48 | cd openwrt 49 | make defconfig 50 | 51 | - name: Download - openwrt build dependencies 52 | run: | 53 | cd openwrt 54 | make download -j8 55 | 56 | - name: Build - make openwrt source 57 | run: | 58 | cd openwrt 59 | make -j$(nproc) 60 | 61 | - name: Remove - delete packages files 62 | run: | 63 | cd openwrt/bin/targets/ramips/mt7621/ 64 | rm -rf packages/ 65 | ls -hl 66 | 67 | - name: Upload - push to artifact file 68 | uses: actions/upload-artifact@v1 69 | with: 70 | name: openwrt-k2p 71 | path: openwrt/bin/targets/ramips/mt7621/ 72 | -------------------------------------------------------------------------------- /.github/workflows/n1-build.yml: -------------------------------------------------------------------------------- 1 | name: n1 docker OpenWrt CI 2 | on: 3 | schedule: 4 | - cron: 0 7 * * 6 5 | push: 6 | branches: 7 | - master 8 | paths: 9 | - '.config.n1.docker' 10 | - 'n1/**' 11 | - '.github/workflows/n1-build.yml' 12 | #watch: 13 | # types: [started] 14 | env: 15 | SSH_ACTIONS: false 16 | REPO_URL: https://github.com/coolsnowwolf/lede 17 | REPO_BRANCH: master 18 | 19 | jobs: 20 | build: 21 | runs-on: ubuntu-latest 22 | steps: 23 | 24 | - name: Checkout - clone repository 25 | uses: actions/checkout@v2 26 | 27 | - name: Install - system build dependencies 28 | run: | 29 | sudo swapoff /swapfile || echo "no /swapfile" 30 | sudo rm -rf /swapfile /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc || echo "clean partly" 31 | sudo -E apt-get -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* mysql* php* 32 | sudo -E apt-get -qq update 33 | sudo -E apt-get -yqq install subversion build-essential libncurses5-dev zlib1g-dev gawk git ccache gettext libssl-dev xsltproc zip pigz 34 | sudo -E apt-get -yqq autoremove --purge 35 | sudo -E apt-get -qq clean 36 | 37 | - name: Download - openwrt source download 38 | run: | 39 | git clone $REPO_URL openwrt 40 | 41 | - name: mount - link /mnt 42 | run: | 43 | sudo mkdir -p -m 777 /mnt/openwrt/staging_dir 44 | mkdir -p openwrt/staging_dir && ln -s /mnt/openwrt/staging_dir openwrt/staging_dir 45 | 46 | - name: Update - openwrt source update and install 47 | run: | 48 | cd openwrt 49 | git clone https://github.com/kenzok8/openwrt-packages.git package/openwrt-packages 50 | git clone https://github.com/kenzok8/small.git package/small 51 | ./scripts/feeds update -a 52 | ./scripts/feeds install -a 53 | 54 | - name: Config - n1 docker openwrt build config 55 | run: | 56 | [ -e n1/diy.sh ] && mv n1/diy.sh openwrt/diy.sh 57 | cp .config.n1.docker openwrt/.config 58 | cd openwrt 59 | [ -e diy.sh ] && chmod +x diy.sh && bash diy.sh 60 | make defconfig 61 | 62 | - name: SSH connection to Actions 63 | uses: P3TERX/debugger-action@main 64 | if: env.SSH_ACTIONS == 'true' 65 | 66 | - name: Download - openwrt build dependencies 67 | run: | 68 | cd openwrt 69 | make download -j8 70 | 71 | - name: Build - make openwrt source 72 | run: | 73 | cd openwrt 74 | make -j$(nproc) 75 | 76 | - name: Docker file - copy Docker file 77 | run: | 78 | cp openwrt/bin/targets/armvirt/64/openwrt-armvirt-64-default-rootfs.tar.gz n1 79 | sudo cp -r n1 /mnt 80 | 81 | - name: Image - build docker image 82 | run: | 83 | cd /mnt/n1 84 | sudo bash build.sh 85 | 86 | - name: Upload - push to artifact file 87 | uses: actions/upload-artifact@v1 88 | with: 89 | name: docker-n1 90 | path: /mnt/n1/opt/imgs 91 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 利用github提供的actions编译k2p的openwrt官方固件 2 | 3 | # openwrt-k2p 4 | 采用官方源编译 5 | 编译版本19.07 6 | 每周或者.config.openwrt更新时编译一次 7 | 本固件只包含mwan3和upnp 8 | 9 | # n1-docker 10 | 采用lean和lienol源码编译 11 | 每周或者.config.n1.docker或者n1目录更新时编译一次 12 | 本固件包含ssr-plus, passwall,OpenClash,VnStat,kms,upnp,turbo acc ,ttyd 13 | 默认管理地址已修改为192.168.2.2 14 | -------------------------------------------------------------------------------- /n1/.dockerignore: -------------------------------------------------------------------------------- 1 | openwrt-armvirt-64-default-rootfs.tar.gz 2 | -------------------------------------------------------------------------------- /n1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM scratch 2 | ADD openwrt-armvirt-64-default-rootfs-patched.tar / 3 | EXPOSE 22 80 443 4 | # using exec format so that /sbin/init is proc 1 (see procd docs) 5 | ENTRYPOINT ["/sbin/init"] 6 | -------------------------------------------------------------------------------- /n1/Readme.md: -------------------------------------------------------------------------------- 1 | 编译N1适用的适用docker运行的openwrt镜像 2 | 基于Lean和Lienol源码 3 | 由于Lean和Lienol删除了部分代码,这里采用了第三方仓库 4 | -------------------------------------------------------------------------------- /n1/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TAG=latest 4 | if [ ! -z "$1" ];then 5 | TAG=$1 6 | fi 7 | 8 | TMPDIR=openwrt_rootfs 9 | OUTDIR=opt/imgs 10 | IMG_NAME=zorz/openwrt-aarch64 11 | 12 | [ -d "$TMPDIR" ] && rm -rf "$TMPDIR" 13 | mkdir -p "$OUTDIR" 14 | mkdir -p "$TMPDIR" && \ 15 | gzip -dc openwrt-armvirt-64-default-rootfs.tar.gz | ( cd "$TMPDIR" && tar xf - ) && \ 16 | cp -f patches/rc.local "$TMPDIR/etc/" && \ 17 | cp -f patches/cpustat "$TMPDIR/usr/bin/" && \ 18 | chmod 755 "$TMPDIR/usr/bin/cpustat" && \ 19 | cat patches/luci-admin-status-index-html.patch | (cd "$TMPDIR/usr/lib/lua/luci/view/admin_status/" && patch -p0) && \ 20 | sed -e "s/net.nf_conntrack_max net.ipv4.netfilter.ip_conntrack_max/net.netfilter.nf_conntrack_max net.nf_conntrack_max net.ipv4.netfilter.ip_conntrack_max \| head -n 1/" -i "$TMPDIR/usr/lib/lua/luci/view/admin_status/index.htm" && \ 21 | rm -f "$TMPDIR/etc/bench.log" && \ 22 | echo "17 3 * * * /etc/coremark.sh" >> "$TMPDIR/etc/crontabs/root" && \ 23 | (cd "$TMPDIR" && tar cf ../openwrt-armvirt-64-default-rootfs-patched.tar .) && \ 24 | rm -f DockerImg-OpenwrtArm64-${TAG}.gz && \ 25 | docker build -t ${IMG_NAME}:${TAG} . && \ 26 | rm -f openwrt-armvirt-64-default-rootfs-patched.tar && \ 27 | rm -rf "$TMPDIR" && \ 28 | docker save ${IMG_NAME}:${TAG} | pigz -9 > $OUTDIR/docker-img-openwrt-aarch64-${TAG}.gz 29 | -------------------------------------------------------------------------------- /n1/diy.sh: -------------------------------------------------------------------------------- 1 | sed -i 's/192.168.1.1/192.168.2.2/g' package/base-files/files/bin/config_generate 2 | -------------------------------------------------------------------------------- /n1/patches/cpustat: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | use strict; 3 | use utf8; 4 | binmode(STDOUT, ":utf8"); 5 | 6 | sub get_soc_temp { 7 | my @fnames=( 8 | '/sys/devices/virtual/thermal/thermal_zone0/temp', 9 | '/sys/devices/platform/scpi/scpi:sensors/hwmon/hwmon0/temp1_input', 10 | ); 11 | my $fh; 12 | my $temp = "Unknown"; 13 | for my $fname (@fnames) { 14 | if( -f $fname ) { 15 | open $fh, "<", $fname; 16 | $temp = sprintf "%0.1f℃", <$fh> / 1000; 17 | close $fh; 18 | return $temp; 19 | } 20 | } 21 | return $temp; 22 | } 23 | 24 | sub get_cpu_freq { 25 | my @fnames=( 26 | '/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq', 27 | ); 28 | my $fh; 29 | my $freq = "Unknown"; 30 | for my $fname (@fnames) { 31 | if( -f $fname ) { 32 | open $fh, "<", $fname; 33 | $freq = sprintf "%dMhz", <$fh> / 1000; 34 | close $fh; 35 | return $freq; 36 | } 37 | } 38 | return $freq; 39 | } 40 | 41 | print &get_cpu_freq, " / ", &get_soc_temp, "\n"; 42 | 43 | -------------------------------------------------------------------------------- /n1/patches/luci-admin-status-index-html.patch: -------------------------------------------------------------------------------- 1 | --- index.htm.orig 2019-10-16 16:24:47.760501830 +0800 2 | +++ index.htm 2019-10-16 22:48:42.912193719 +0800 3 | @@ -17,6 +17,7 @@ 4 | local sysinfo = luci.util.ubus("system", "info") or { } 5 | local boardinfo = luci.util.ubus("system", "board") or { } 6 | local unameinfo = nixio.uname() or { } 7 | + local cpustat = luci.sys.exec("/usr/bin/cpustat") or "?" 8 | 9 | local meminfo = sysinfo.memory or { 10 | total = 0, 11 | @@ -43,7 +44,7 @@ 12 | fs.readfile("/proc/sys/net/netfilter/nf_conntrack_count") or "") or 0 13 | 14 | local conn_max = tonumber(luci.sys.exec( 15 | - "sysctl -n -e net.nf_conntrack_max net.ipv4.netfilter.ip_conntrack_max" 16 | + "sysctl -n -e net.netfilter.nf_conntrack_max net.nf_conntrack_max net.ipv4.netfilter.ip_conntrack_max | head -n 1" 17 | ):match("%d+")) or 4096 18 | 19 | local rv = { 20 | @@ -57,7 +58,8 @@ 21 | conncount = conn_count, 22 | leases = stat.dhcp_leases(), 23 | leases6 = stat.dhcp6_leases(), 24 | - wifinets = stat.wifi_networks() 25 | + wifinets = stat.wifi_networks(), 26 | + cpustat = luci.sys.exec("/usr/bin/cpustat") or "?" 27 | } 28 | 29 | if wan then 30 | @@ -629,6 +631,9 @@ 31 | if (e = document.getElementById('localtime')) 32 | e.innerHTML = info.localtime; 33 | 34 | + if (e = document.getElementById('cpustat')) 35 | + e.innerHTML = info.cpustat; 36 | + 37 | if (e = document.getElementById('uptime')) 38 | e.innerHTML = String.format('%t', info.uptime); 39 | 40 | @@ -687,6 +692,7 @@ 41 |