diff --git a/.github/workflows/Hanwckf_4.4_kernal_CI.yml b/.github/workflows/Hanwckf_4.4_kernal_CI.yml new file mode 100644 index 00000000..6af9a59d --- /dev/null +++ b/.github/workflows/Hanwckf_4.4_kernal_CI.yml @@ -0,0 +1,89 @@ +# Build from hanwckf's kernal4.4 repo +# BY: TurBoTse + +name: Build from hanwckf's kernal4.4 repo + +on: + workflow_dispatch: + inputs: +# schedule: # 自动编译 +# - cron: 0 19 * * * # 每天国际时间19点,北京时间凌晨3点执行 + watch: # 监视操作 + types: [started] # 点击 Star 之后 +env: + build_dir: /opt/padavan # 源码目录 + images_dir: /opt/images # 固件目录 + work_dir: /opt/padavan/trunk # 工作目录 + config_dir: /opt/padavan/trunk/configs/templates # 设备模板目录 + src_git: https://github.com/hanwckf/padavan-4.4.git # 源码地址 + +jobs: + build: + name: build + runs-on: ubuntu-20.04 + if: github.event.repository.owner.id == github.event.sender.id # 自己点的 Star + env: + build_variant: ${{ matrix.build_variant }} + targets: ${{ matrix.targets }} + strategy: + matrix: + include: + - build_variant: "mt7621" + targets: "K2P_nano K2P DIR-878 CR660x JCG-Q20" + - build_variant: "mt7621-usb-1" + targets: "XY-C1 JCG-836PRO JCG-Y2" + - build_variant: "mt7621-usb-2" + targets: "DIR-882 JCG-AC860M NETGEAR-BZV MI-R3P" + steps: + - name: Checkout main # 导入主分支 + uses: actions/checkout@v2 + - name: Prepare environment # 准备编译环境 + run: | # 安装依赖包 + sudo apt update + sudo apt install libtool-bin gperf python3-docutils autopoint gettext + sudo timedatectl set-timezone 'Asia/Shanghai' # 设置时区 + - name: Clone source code + run: | # 克隆源码 + git clone --depth=1 $src_git $build_dir + - name: Run shellcheck + run: | + cd $work_dir + if [ -f ./tools/shellcheck.sh ]; then sh ./tools/shellcheck.sh; fi + - name: Prepare toolchain + run: | # 下载预编译的构建工具链 + mkdir -p $images_dir + cd $build_dir/toolchain-mipsel + sh dl_toolchain.sh + - name: Modify custom configs + run: | # 拷贝文件并修改 + if [ -d hanwckf_4.4/config ]; then cp -f hanwckf_4.4/config/* $work_dir; fi + if [ -d hanwckf_4.4/modify ]; then cp -rf hanwckf_4.4/modify/* $work_dir; fi + if [ -d hanwckf_4.4/scripts ]; then cp -f hanwckf_4.4/scripts/* $work_dir; fi + cd $config_dir + for m in $targets; do if [ -f $m.config ]; then \ + for MOD in UFSD FAT EXFAT EXT2 EXT3 EXT4 XFS FUSE SWAP; do + sed -i "s/CONFIG_FIRMWARE_ENABLE_${MOD}=y/CONFIG_FIRMWARE_ENABLE_${MOD}=n/" $m.config; done; \ + for MOD in UVC SERIAL AUDIO LPRD U2EC HDPARM PARTED SMBD FTPD ARIA ARIA_WEB_CONTROL DUMP1090 RTL_SDR HID XFRM QOS IMQ IFB IPSET NFSD NFSC CIFS NTFS_3G TCPDUMP SMBD36 WINS SMBD_SYSLOG RPL2TP EAP_PEAP HTTPS SFTP DROPBEAR DROPBEAR_FAST_CODE OPENSSH OPENVPN SSWAN OPENSSL_EC OPENSSL_EXE XUPNPD MINIDLNA FIREFLY FFMPEG_NEW TRANSMISSION TRANSMISSION_WEB_CONTROL CURL GDUT_DRCOM DOGCOM MINIEAP NJIT_CLIENT NAPT66 SOFTETHERVPN_SERVER SOFTETHERVPN_CLIENT SOFTETHERVPN_CMD VLMCSD TTYD LRZSZ HTOP NANO IPERF3 MTR SOCAT SRELAY MENTOHUST SCUTCLIENT FRPC FRPS TUNSAFE WIREGUARD SHADOWSOCKS XRAY V2RAY TROJAN SSOBFS ADBYBY KOOLPROXY SMARTDNS SMARTDNSBIN ADGUARDHOME CADDY CADDYBIN WYY WYYBIN ZEROTIER ALIDDNS DDNSTO ALDRIVER MENTOHUST SQM DNSFORWARDER CLOUDFLAREDDNS NVPPROXY DDNS_SSL SSSERVER NPC KUMASOCKS IPT2SOCKS MICROSOCKS; do + sed -i "s/CONFIG_FIRMWARE_INCLUDE_${MOD}=y/CONFIG_FIRMWARE_INCLUDE_${MOD}=n/" $m.config; done; \ + fi; done + cd $work_dir + for m in $targets; do if [ -f $m.config ]; then echo "拷贝 $m.config"; cp -f ./$m.config $config_dir/$m.config; fi; done; \ + for m in $targets; do if [ -f public.sh ]; then echo "执行 public.sh"; sh ./public.sh; fi; if [ -f $m.sh ]; then echo "执行 $m.sh"; sh ./$m.sh; fi; done; \ + - name: Start build firmware + run: | # 执行构建固件 + cd $work_dir + for m in $targets; do fakeroot ./build_firmware_ci $m; \ + if [ $? = 0 ]; then cp -f images/*.trx $images_dir/Hanwckf_${m}_$(date +%Y%m%d).trx; else exit 1; fi; \ + ./clear_tree_simple >/dev/null 2>&1; done + - name: Upload images to Artifact + if: ${{ success() }} + uses: actions/upload-artifact@v2.2.1 + with: + name: Hanwckf_4.4_${{ env.build_variant }} + path: ${{ env.images_dir }} + - name: Upload images to WeTransfer + if: ${{ github.event.inputs.uploadwet == 'true' && success() }} + run: | # 上传到 WeTransfer + curl -fsSL git.io/file-transfer | sh + ./transfer wet -s -p 16 --no-progress ${images_dir} 2>&1 | tee wetransfer.log + echo "::warning file=wetransfer.com::$(cat wetransfer.log | grep https)" \ No newline at end of file diff --git a/.github/workflows/Hanwckf_CI.yml b/.github/workflows/Hanwckf_CI.yml new file mode 100644 index 00000000..8856d27e --- /dev/null +++ b/.github/workflows/Hanwckf_CI.yml @@ -0,0 +1,91 @@ +# Build from hanwckf repo +# BY: TurBoTse + +name: Build from hanwckf repo + +on: + workflow_dispatch: + inputs: +# schedule: # 自动编译 +# - cron: 0 19 * * * # 每天国际时间19点,北京时间凌晨3点执行 + watch: # 监视操作 + types: [started] # 点击 Star 之后 +env: + build_dir: /opt/padavan # 源码目录 + images_dir: /opt/images # 固件目录 + work_dir: /opt/padavan/trunk # 工作目录 + config_dir: /opt/padavan/trunk/configs/templates # 设备模板目录 + src_git: https://github.com/hanwckf/rt-n56u.git # 源码地址 + +jobs: + build: + name: build + runs-on: ubuntu-20.04 + if: github.event.repository.owner.id == github.event.sender.id # 自己点的 Star + env: + build_variant: ${{ matrix.build_variant }} + targets: ${{ matrix.targets }} + strategy: + matrix: + include: + - build_variant: "mt7620" + targets: "PSG1208 PSG1218 NEWIFI-MINI MI-MINI MI-3 OYE-001 5K-W20" + - build_variant: "mt7621" + targets: "K2P_nano K2P DIR-878 RM2100 CR660x" + - build_variant: "mt7621-usb" + targets: "XY-C1 JCG-836PRO JCG-AC860M JCG-Y2 DIR-882 A3004NS MSG1500 WR1200JS MI-R3G NEWIFI3 B70" + - build_variant: "mt7628" + targets: "HC5861B MI-NANO MZ-R13 MZ-R13P 360P2 HC5761A HC5661A" + steps: + - name: Checkout main # 导入主分支 + uses: actions/checkout@v2 + - name: Prepare environment # 准备编译环境 + run: | # 安装依赖包 + sudo apt update + sudo apt install libtool-bin gperf python3-docutils autopoint gettext + sudo timedatectl set-timezone 'Asia/Shanghai' # 设置时区 + - name: Clone source code + run: | # 克隆源码 + git clone --depth=1 $src_git $build_dir + - name: Run shellcheck + run: | + cd $work_dir + if [ -f ./tools/shellcheck.sh ]; then sh ./tools/shellcheck.sh; fi + - name: Prepare toolchain + run: | # 下载预编译的构建工具链 + mkdir -p $images_dir + cd $build_dir/toolchain-mipsel + sh dl_toolchain.sh + - name: Modify custom configs + run: | # 拷贝文件并修改 + if [ -d hanwckf/config ]; then cp -f hanwckf/config/* $work_dir; fi + if [ -d hanwckf/modify ]; then cp -rf hanwckf/modify/* $work_dir; fi + if [ -d hanwckf/scripts ]; then cp -f hanwckf/scripts/* $work_dir; fi + cd $config_dir + for m in $targets; do if [ -f $m.config ]; then \ + for MOD in UFSD FAT EXFAT EXT2 EXT3 EXT4 XFS FUSE SWAP; do + sed -i "s/CONFIG_FIRMWARE_ENABLE_${MOD}=y/CONFIG_FIRMWARE_ENABLE_${MOD}=n/" $m.config; done; \ + for MOD in UVC SERIAL AUDIO LPRD U2EC HDPARM PARTED SMBD FTPD ARIA ARIA_WEB_CONTROL DUMP1090 RTL_SDR HID XFRM QOS IMQ IFB IPSET NFSD NFSC CIFS NTFS_3G TCPDUMP SMBD36 WINS SMBD_SYSLOG RPL2TP EAP_PEAP HTTPS SFTP DROPBEAR DROPBEAR_FAST_CODE OPENSSH OPENVPN SSWAN OPENSSL_EC OPENSSL_EXE XUPNPD MINIDLNA FIREFLY FFMPEG_NEW TRANSMISSION TRANSMISSION_WEB_CONTROL CURL GDUT_DRCOM DOGCOM MINIEAP NJIT_CLIENT NAPT66 SOFTETHERVPN_SERVER SOFTETHERVPN_CLIENT SOFTETHERVPN_CMD VLMCSD TTYD LRZSZ HTOP NANO IPERF3 MTR SOCAT SRELAY MENTOHUST SCUTCLIENT FRPC FRPS TUNSAFE WIREGUARD SHADOWSOCKS XRAY V2RAY TROJAN SSOBFS ADBYBY KOOLPROXY SMARTDNS SMARTDNSBIN ADGUARDHOME CADDY CADDYBIN WYY WYYBIN ZEROTIER ALIDDNS DDNSTO ALDRIVER MENTOHUST SQM DNSFORWARDER CLOUDFLAREDDNS NVPPROXY DDNS_SSL SSSERVER NPC KUMASOCKS IPT2SOCKS MICROSOCKS; do + sed -i "s/CONFIG_FIRMWARE_INCLUDE_${MOD}=y/CONFIG_FIRMWARE_INCLUDE_${MOD}=n/" $m.config; done; \ + fi; done + cd $work_dir + for m in $targets; do if [ -f $m.config ]; then echo "拷贝 $m.config"; cp -f ./$m.config $config_dir/$m.config; fi; done; \ + for m in $targets; do if [ -f public.sh ]; then echo "执行 public.sh"; sh ./public.sh; fi; if [ -f $m.sh ]; then echo "执行 $m.sh"; sh ./$m.sh; fi; done; \ + - name: Start build firmware + run: | # 执行构建固件 + cd $work_dir + for m in $targets; do fakeroot ./build_firmware_ci $m; \ + if [ $? = 0 ]; then cp -f images/*.trx $images_dir/Hanwckf_${m}_$(date +%Y%m%d).trx; else exit 1; fi; \ + ./clear_tree_simple >/dev/null 2>&1; done + - name: Upload images to Artifact + if: ${{ success() }} + uses: actions/upload-artifact@v2.2.1 + with: + name: Hanwckf_3.4_${{ env.build_variant }} + path: ${{ env.images_dir }} + - name: Upload images to WeTransfer + if: ${{ github.event.inputs.uploadwet == 'true' && success() }} + run: | # 上传到 WeTransfer + curl -fsSL git.io/file-transfer | sh + ./transfer wet -s -p 16 --no-progress ${images_dir} 2>&1 | tee wetransfer.log + echo "::warning file=wetransfer.com::$(cat wetransfer.log | grep https)" diff --git a/.github/workflows/MeIsReallyBa_4.4_kernal_CI .yml b/.github/workflows/MeIsReallyBa_4.4_kernal_CI .yml new file mode 100644 index 00000000..cf102e8c --- /dev/null +++ b/.github/workflows/MeIsReallyBa_4.4_kernal_CI .yml @@ -0,0 +1,107 @@ +# Build from MeIsReallyBa's kernal4.4 repo +# BY: TurBoTse + +name: Build from MeIsReallyBa's kernal4.4 repo + +on: + workflow_dispatch: + inputs: +# schedule: # 自动编译 +# - cron: 0 19 * * * # 每天国际时间19点,北京时间凌晨3点执行 + watch: # 监视操作 + types: [started] # 点击 Star 之后 +env: + build_dir: /opt/padavan # 源码目录 + images_dir: /opt/images # 固件目录 + work_dir: /opt/padavan/trunk # 工作目录 + config_dir: /opt/padavan/trunk/configs/templates # 设备模板目录 + src_git: https://github.com/MeIsReallyBa/padavan-4.4.git # 源码地址 + +jobs: + build: + name: build + runs-on: ubuntu-20.04 + if: github.event.repository.owner.id == github.event.sender.id # 自己点的 Star + env: + build_variant: ${{ matrix.build_variant }} + targets: ${{ matrix.targets }} + strategy: + matrix: + include: + - build_variant: "mt7621" + targets: "K2P" + - build_variant: "mt7621" + targets: "R2100" + steps: + - name: Checkout main # 导入主分支 + uses: actions/checkout@v2 + - name: Prepare environment # 准备编译环境 + run: | # 安装依赖包 + sudo apt update + sudo apt install libtool-bin gperf python3-docutils autopoint gettext + sudo timedatectl set-timezone 'Asia/Shanghai' # 设置时区 + - name: Clone source code + run: | # 克隆源码 + git clone --depth=1 $src_git $build_dir + - name: Run shellcheck + run: | + cd $work_dir + if [ -f ./tools/shellcheck.sh ]; then sh ./tools/shellcheck.sh; fi + - name: Prepare toolchain + run: | # 下载预编译的构建工具链 + mkdir -p $images_dir + cd $build_dir/toolchain-mipsel + sh dl_toolchain.sh + - name: Modify custom configs + run: | # 拷贝文件并修改 + if [ -d meIsreallyba/config ]; then cp -f meIsreallyba/config/* $work_dir; fi + if [ -d meIsreallyba/modify ]; then cp -rf meIsreallyba/modify/* $work_dir; fi + if [ -d meIsreallyba/scripts ]; then cp -f meIsreallyba/scripts/* $work_dir; fi + cd $config_dir + for m in $targets; do if [ -f $m.config ]; then \ + ##科学上网## + echo "CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS=n" >> $m.config #科学上网插件,选择n后全部有关插件都不集成 + echo "CONFIG_FIRMWARE_INCLUDE_XRAY=n" >> $m.config #集成xray执行文件 ~4.5M + echo "CONFIG_FIRMWARE_INCLUDE_V2RAY=n" >> $m.config #集成v2ray执行文件 + echo "CONFIG_FIRMWARE_INCLUDE_TROJAN=n" >> $m.config #集成trojan执行文件 ~1.2M + echo "CONFIG_FIRMWARE_INCLUDE_SSOBFS=n" >> $m.config #simple-obfs混淆插件 + ##广告管理## + echo "CONFIG_FIRMWARE_INCLUDE_ADBYBY=n" >> $m.config #adbyby plus+ + ##DNS服务## + echo "CONFIG_FIRMWARE_INCLUDE_SMARTDNS=n" >> $m.config #smartdns + echo "CONFIG_FIRMWARE_INCLUDE_ADGUARDHOME=n" >> $m.config #adg DNS去AD + ##内网穿透服务## + echo "CONFIG_FIRMWARE_INCLUDE_ZEROTIER=n" >> $m.config #zerotier ~1.3M + echo "CONFIG_FIRMWARE_INCLUDE_ALIDDNS=n" >> $m.config #aliddns + echo "CONFIG_FIRMWARE_INCLUDE_DDNSTO=n" >> $m.config #ddnsto ~0.5M + echo "CONFIG_FIRMWARE_INCLUDE_ALDRIVER=n" >> $m.config #ALDRIVER ~3m + echo "CONFIG_FIRMWARE_INCLUDE_SQM=n" >> $m.config #SQM + ##CPU超频## + echo "CONFIG_FIRMWARE_INCLUDE_OC=n" >> $m.config #CPU超频开关 + echo 'CONFIG_FIRMWARE_MT7621_OC="0x312"' >> $m.config #此处填写对应频率的十六进制:1000Mhz=0x312 1100Mhz=0x362 1120Mhz=0x372 1200Mhz=0x3B2 + for MOD in UFSD FAT EXFAT EXT2 EXT3 EXT4 XFS FUSE SWAP; do + sed -i "s/CONFIG_FIRMWARE_ENABLE_${MOD}=y/CONFIG_FIRMWARE_ENABLE_${MOD}=n/" $m.config; done; \ + for MOD in UVC SERIAL AUDIO LPRD U2EC HDPARM PARTED SMBD FTPD ARIA ARIA_WEB_CONTROL DUMP1090 RTL_SDR HID XFRM QOS IMQ IFB IPSET NFSD NFSC CIFS NTFS_3G TCPDUMP SMBD36 WINS SMBD_SYSLOG RPL2TP EAP_PEAP HTTPS SFTP DROPBEAR DROPBEAR_FAST_CODE OPENSSH OPENVPN SSWAN OPENSSL_EC OPENSSL_EXE XUPNPD MINIDLNA FIREFLY FFMPEG_NEW TRANSMISSION TRANSMISSION_WEB_CONTROL CURL GDUT_DRCOM DOGCOM MINIEAP NJIT_CLIENT NAPT66 SOFTETHERVPN_SERVER SOFTETHERVPN_CLIENT SOFTETHERVPN_CMD VLMCSD TTYD LRZSZ HTOP NANO IPERF3 MTR SOCAT SRELAY MENTOHUST SCUTCLIENT FRPC FRPS TUNSAFE WIREGUARD SHADOWSOCKS XRAY V2RAY TROJAN SSOBFS ADBYBY KOOLPROXY SMARTDNS SMARTDNSBIN ADGUARDHOME CADDY CADDYBIN WYY WYYBIN ZEROTIER ALIDDNS DDNSTO ALDRIVER MENTOHUST SQM DNSFORWARDER CLOUDFLAREDDNS NVPPROXY DDNS_SSL SSSERVER NPC KUMASOCKS IPT2SOCKS MICROSOCKS; do + sed -i "s/CONFIG_FIRMWARE_INCLUDE_${MOD}=y/CONFIG_FIRMWARE_INCLUDE_${MOD}=n/" $m.config; done; \ + fi; done + cd $work_dir + for m in $targets; do if [ -f $m.config ]; then echo "拷贝 $m.config"; cp -f ./$m.config $config_dir/$m.config; fi; done; \ + for m in $targets; do if [ -f public.sh ]; then echo "执行 public.sh"; sh ./public.sh; fi; if [ -f $m.sh ]; then echo "执行 $m.sh"; sh ./$m.sh; fi; done; \ + - name: Start build firmware + run: | # 执行构建固件 + cd $work_dir + for m in $targets; do fakeroot ./build_firmware_ci $m; \ + if [ $? = 0 ]; then cp -f images/*.trx $images_dir/MeIsReallyBa_${m}_$(date +%Y%m%d).trx; else exit 1; fi; \ + ./clear_tree_simple >/dev/null 2>&1; done + - name: Upload images to Artifact + if: ${{ success() }} + uses: actions/upload-artifact@v2.2.1 + with: + name: MeIsReallyBa_4.4_${{ env.build_variant }} + path: ${{ env.images_dir }} + - name: Upload images to WeTransfer + if: ${{ github.event.inputs.uploadwet == 'true' && success() }} + run: | # 上传到 WeTransfer + curl -fsSL git.io/file-transfer | sh + ./transfer wet -s -p 16 --no-progress ${images_dir} 2>&1 | tee wetransfer.log + echo "::warning file=wetransfer.com::$(cat wetransfer.log | grep https)" diff --git a/.github/workflows/delete_old_workflow_runs.yml b/.github/workflows/delete_old_workflow_runs.yml new file mode 100644 index 00000000..4f844743 --- /dev/null +++ b/.github/workflows/delete_old_workflow_runs.yml @@ -0,0 +1,24 @@ +name: Delete old workflow runs +on: + workflow_dispatch: + inputs: + days: + description: 'Number of days.' + required: true + default: 90 + minimum_runs: + description: 'The minimum runs to keep for each workflow.' + required: true + default: 6 + +jobs: + del_runs: + runs-on: ubuntu-latest + steps: + - name: Delete workflow runs + uses: Mattraks/delete-workflow-runs@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + retain_days: ${{ github.event.inputs.days }} + keep_minimum_runs: ${{ github.event.inputs.minimum_runs }} \ No newline at end of file diff --git a/.github/workflows/vb1980_kvr_CI.yml b/.github/workflows/vb1980_kvr_CI.yml new file mode 100644 index 00000000..592bed0e --- /dev/null +++ b/.github/workflows/vb1980_kvr_CI.yml @@ -0,0 +1,138 @@ +# Build from vb1980 kvr repo +# BY: TurBoTse + +name: Build from vb1980 kvr repo + +on: + workflow_dispatch: + inputs: +# schedule: # 自动编译 +# - cron: 0 19 * * * # 每天国际时间19点,北京时间凌晨3点执行 + watch: # 监视操作 + types: [started] # 点击 Star 之后 +env: + build_dir: /opt/padavan # 源码目录 + images_dir: /opt/images # 固件目录 + work_dir: /opt/padavan/trunk # 工作目录 + config_dir: /opt/padavan/trunk/configs/templates # 设备模板目录 + src_git: https://github.com/vb1980/Padavan-KVR.git # 源码地址 + +jobs: + build: + name: build + runs-on: ubuntu-20.04 + if: github.event.repository.owner.id == github.event.sender.id # 自己点的 Star + env: + build_variant: ${{ matrix.build_variant }} + targets: ${{ matrix.targets }} + strategy: + matrix: + include: + - build_variant: "mt7620" + targets: "PSG1208 PSG1218 NEWIFI-MINI MI-MINI MI-3 OYE-001 5K-W20" + - build_variant: "mt7621" + targets: "K2P-5.0 DIR-878-5.0 RM2100 R2100" + - build_variant: "mt7621-usb-1" + targets: "A3004NS MSG1500 WR1200JS E8820V2 NEWIFI3 RT-AC1200GU" + - build_variant: "mt7621-usb-2" + targets: "JCG-836PRO-5.0 JCG-AC860M-5.0 JCG-Y2-5.0 DIR-882-5.0 MI-R3G B70" + - build_variant: "mt7628" + targets: "360P2 HC5861B HC5761A HC5661A MI-NANO MZ-R13 MZ-R13P" + steps: + - name: Checkout main # 导入主分支 + uses: actions/checkout@v2 + - name: Prepare environment # 准备编译环境 + run: | # 安装依赖包 + sudo apt update + sudo apt install libtool-bin gperf python3-docutils autopoint gettext + sudo timedatectl set-timezone 'Asia/Shanghai' # 设置时区 + - name: Clone source code + run: | # 克隆源码 + git clone --depth=1 $src_git $build_dir + - name: Run shellcheck + run: | + cd $work_dir + if [ -f ./tools/shellcheck.sh ]; then sh ./tools/shellcheck.sh; fi + - name: Prepare toolchain + run: | # 下载预编译的构建工具链 + mkdir -p $images_dir + cd $build_dir/toolchain-mipsel + sh dl_toolchain.sh + - name: Set golang + run: | + cp -f vb1980/scripts/go.sh $(pwd) + sudo chmod 777 ./go.sh + bash ./go.sh + - name: Modify custom configs + run: | # 拷贝文件并修改 + if [ -d vb1980/config ]; then cp -f vb1980/config/* $work_dir; fi + if [ -d vb1980/modify ]; then cp -rf vb1980/modify/* $work_dir; fi + if [ -d vb1980/scripts ]; then cp -f vb1980/scripts/* $work_dir; fi + cd $config_dir + for m in $targets; do if [ -f $m.config ]; then \ + ##科学上网## + echo "CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS=n" >> $m.config #科学上网插件,选择n后全部有关插件都不集成 + echo "CONFIG_FIRMWARE_INCLUDE_XRAY=n" >> $m.config #集成xray执行文件 ~4.5M + echo "CONFIG_FIRMWARE_INCLUDE_V2RAY=n" >> $m.config #集成v2ray执行文件 + echo "CONFIG_FIRMWARE_INCLUDE_TROJAN=n" >> $m.config #集成trojan执行文件 ~1.2M + echo "CONFIG_FIRMWARE_INCLUDE_SSOBFS=n" >> $m.config #simple-obfs混淆插件 + echo "CONFIG_FIRMWARE_INCLUDE_SSSERVER=n" >> $m.config #SS server + echo "CONFIG_FIRMWARE_INCLUDE_KUMASOCKS=n" >> $m.config #socks5 + echo "CONFIG_FIRMWARE_INCLUDE_IPT2SOCKS=n" >> $m.config + echo "CONFIG_FIRMWARE_INCLUDE_MICROSOCKS=n" >> $m.config + echo "CONFIG_FIRMWARE_INCLUDE_NPC=n" >> $m.config #npc + ##广告管理## + echo "CONFIG_FIRMWARE_INCLUDE_ADBYBY=n" >> $m.config #adbyby plus+ + echo "CONFIG_FIRMWARE_INCLUDE_KOOLPROXY=n" >> $m.config #KP广告过滤 + ##DNS服务## + echo "CONFIG_FIRMWARE_INCLUDE_SMARTDNS=n" >> $m.config #smartdns + echo "CONFIG_FIRMWARE_INCLUDE_SMARTDNSBIN=n" >> $m.config #smartdns二进制文件 + echo "CONFIG_FIRMWARE_INCLUDE_ADGUARDHOME=n" >> $m.config #adg DNS去AD + echo "CONFIG_FIRMWARE_INCLUDE_DNSFORWARDER=n" >> $m.config #DNSFORWARDER + echo "CONFIG_FIRMWARE_INCLUDE_CLOUDFLAREDDNS=n" >> $m.config #CLOUDFLAREDDNS + echo "CONFIG_FIRMWARE_INCLUDE_NVPPROXY=n" >> $m.config #NVPPROXY + ##文件管理## + echo "CONFIG_FIRMWARE_INCLUDE_CADDY=n" >> $m.config #在线文件管理服务 + echo "CONFIG_FIRMWARE_INCLUDE_CADDYBIN=n" >> $m.config #集成caddu执行文件,此文件有13M,请注意固件大小 + ##音乐解锁## + echo "CONFIG_FIRMWARE_INCLUDE_WYY=n" >> $m.config #网易云解锁 + echo "CONFIG_FIRMWARE_INCLUDE_WYYBIN=n" >> $m.config #网易云解锁GO版本执行文件(2M多)注意固件超大小 + ##内网穿透服务## + echo "CONFIG_FIRMWARE_INCLUDE_ZEROTIER=n" >> $m.config #zerotier ~1.3M + echo "CONFIG_FIRMWARE_INCLUDE_ALIDDNS=n" >> $m.config #aliddns + echo "CONFIG_FIRMWARE_INCLUDE_DDNSTO=n" >> $m.config #ddnsto ~0.5M + echo "CONFIG_FIRMWARE_INCLUDE_ALDRIVER=n" >> $m.config #ALDRIVER ~3m + echo "CONFIG_FIRMWARE_INCLUDE_SQM=n" >> $m.config #SQM + echo "CONFIG_FIRMWARE_INCLUDE_WIREGUARD=n" >>.config #wireguard 10k + for MOD in UFSD FAT EXFAT EXT2 EXT3 EXT4 XFS FUSE SWAP; do + sed -i "s/CONFIG_FIRMWARE_ENABLE_${MOD}=y/CONFIG_FIRMWARE_ENABLE_${MOD}=n/" $m.config; done; \ + for MOD in UVC SERIAL AUDIO LPRD U2EC HDPARM PARTED SMBD FTPD ARIA ARIA_WEB_CONTROL DUMP1090 RTL_SDR HID XFRM QOS IMQ IFB IPSET NFSD NFSC CIFS NTFS_3G TCPDUMP SMBD36 WINS SMBD_SYSLOG RPL2TP EAP_PEAP HTTPS SFTP DROPBEAR DROPBEAR_FAST_CODE OPENSSH OPENVPN SSWAN OPENSSL_EC OPENSSL_EXE XUPNPD MINIDLNA FIREFLY FFMPEG_NEW TRANSMISSION TRANSMISSION_WEB_CONTROL CURL GDUT_DRCOM DOGCOM MINIEAP NJIT_CLIENT NAPT66 SOFTETHERVPN_SERVER SOFTETHERVPN_CLIENT SOFTETHERVPN_CMD VLMCSD TTYD LRZSZ HTOP NANO IPERF3 MTR SOCAT SRELAY MENTOHUST SCUTCLIENT FRPC FRPS TUNSAFE WIREGUARD SHADOWSOCKS XRAY V2RAY TROJAN SSOBFS ADBYBY KOOLPROXY SMARTDNS SMARTDNSBIN ADGUARDHOME CADDY CADDYBIN WYY WYYBIN ZEROTIER ALIDDNS DDNSTO ALDRIVER MENTOHUST SQM DNSFORWARDER CLOUDFLAREDDNS NVPPROXY DDNS_SSL SSSERVER NPC KUMASOCKS IPT2SOCKS MICROSOCKS; do + sed -i "s/CONFIG_FIRMWARE_INCLUDE_${MOD}=y/CONFIG_FIRMWARE_INCLUDE_${MOD}=n/" $m.config; done; \ + fi; done + cd $work_dir + for m in $targets; do if [ -f $m.config ]; then echo "拷贝 $m.config"; cp -f ./$m.config $config_dir/$m.config; fi; done; \ + for m in $targets; do if [ -f public.sh ]; then echo "执行 public.sh"; sh ./public.sh; fi; if [ -f $m.sh ]; then echo "执行 $m.sh"; sh ./$m.sh; fi; done; \ + - name: Set busybox's version to compile + run: | + cd $work_dir/user/busybox + sed -i "s/SRC_NAME=busybox.*/SRC_NAME=busybox-1.24.x/g" ./Makefile + cd $work_dir + sed -i "s/busybox_id=\"1.34.1\"/busybox_id=\"1.24.x\"/g" ./build_firmware_modify + - name: Start build firmware + run: | # 执行构建固件 + cd $work_dir + for m in $targets; do fakeroot ./build_firmware_ci $m; \ + if [ $? = 0 ]; then cp -f images/*.trx $images_dir/vb1980_${m}_$(date +%Y%m%d).trx; else exit 1; fi; \ + ./clear_tree_simple >/dev/null 2>&1; done + - name: Upload images to Artifact + if: ${{ success() }} + uses: actions/upload-artifact@v2.2.1 + with: + name: vb1980_3.4_kvr_${{ env.build_variant }} + path: ${{ env.images_dir }} + - name: Upload images to WeTransfer + if: ${{ github.event.inputs.uploadwet == 'true' && success() }} + run: | # 上传到 WeTransfer + curl -fsSL git.io/file-transfer | sh + ./transfer wet -s -p 16 --no-progress ${images_dir} 2>&1 | tee wetransfer.log + echo "::warning file=wetransfer.com::$(cat wetransfer.log | grep https)" diff --git a/README.md b/README.md new file mode 100644 index 00000000..9ba84e61 --- /dev/null +++ b/README.md @@ -0,0 +1,50 @@ +# Padavan 固件自定义修改并全自动编译 + +直接 Fork 修改好之后点击 Star 按钮即可开始自动编译 ( 自己点击 Star 才会运行 请不要重复点击 点一次运行一次 ) + +点击 [Actions](https://github.com/TurBoTse/Padavan-Build/actions) 按钮查看项目运行状态 编译好的固件也在里面 + +Vb1980_kvr_CI 源码使用 [vb1980](https://github.com/vb1980/Padavan-KVR.git) + +Hanwckf_CI 源码使用 [Hanwckf](https://github.com/hanwckf/rt-n56u.git) + +Hanwckf_4.4_kernal_CI 源码使用 [Hanwckf](https://github.com/hanwckf/padavan-4.4.git) + +MeIsReallyBa_4.4_kernal_CI 源码使用 [MeIsReallyBa](https://github.com/MeIsReallyBa/padavan-4.4.git) + +用户名: admin + +登录密码: admin + +IP地址: 192.168.2.1 + +WiFi名称: 2G: Padavan + +WiFi名称: 5G: Padavan_5G + +WiFi密码: 1234567890 + +如要修改请编辑 [public.sh](https://github.com/TurBoTse/Padavan-Build/blob/main/hanwckf/scripts/public.sh) + +宽带账号和密码 默认AP模式 打开桥接 超频 集成插件等更多请参考[K2P.sh](https://github.com/TurBoTse/Padavan-Build/blob/main/hanwckf/scripts/K2P.sh) + +( 注: 每个设备需要不同的IP地址 WiFi名称等请不要合并编译修改如下 ) + +示例: 打开 [Padavan_CI.yml](https://github.com/TurBoTse/Padavan-Build/blob/main/.github/workflows/Hanwckf_CI.yml) 修改 + + - build_variant: "mt7620" + targets: "PSG1208 PSG1218 NEWIFI-MINI MI-MINI MI-3 OYE-001 5K-W20" + +修改为: + + - build_variant: "mt7620" + targets: "PSG1208" + - build_variant: "mt7620" + targets: "PSG1218" + - build_variant: "mt7620" + targets: "NEWIFI-MINI" + +编译脚本带有启用和禁用插件设置 ( 先执行这项再执行自定义的 ) + + +启用和禁用插件也可以修改 *.config 放在 [hanwckf/config](https://github.com/TurBoTse/Padavan-Build/tree/main/hanwckf/config) diff --git a/hanwckf/README.md b/hanwckf/README.md new file mode 100644 index 00000000..33fc1414 --- /dev/null +++ b/hanwckf/README.md @@ -0,0 +1,7 @@ +# README + +config 存放设备适配文件 *.config + +modify 存放要修改的文件( 注意存放路径要对应 ) + +scripts 存放设备执行脚本 *.sh diff --git a/hanwckf/config/README.md b/hanwckf/config/README.md new file mode 100644 index 00000000..6823b8fb --- /dev/null +++ b/hanwckf/config/README.md @@ -0,0 +1,3 @@ +# README + +存放设备的适配文件 例如: K2P.config \ No newline at end of file diff --git a/hanwckf/modify/user/rc/net.c b/hanwckf/modify/user/rc/net.c new file mode 100755 index 00000000..2ebb481f --- /dev/null +++ b/hanwckf/modify/user/rc/net.c @@ -0,0 +1,961 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "rc.h" + +#define SR_BUF_LEN (8192) + +static int +route_manip(int cmd, char *ifname, int metric, char *dst, char *gateway, char *genmask) +{ + int s; + struct rtentry rt; + + /* Open a raw socket to the kernel */ + if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + goto err; + } + + /* Fill in rtentry */ + memset(&rt, 0, sizeof(rt)); + if (dst) { + inet_aton(dst, &sin_addr(&rt.rt_dst)); + } + if (gateway) { + inet_aton(gateway, &sin_addr(&rt.rt_gateway)); + } + if (genmask) { + inet_aton(genmask, &sin_addr(&rt.rt_genmask)); + } + rt.rt_metric = metric; + rt.rt_flags = RTF_UP; + if (sin_addr(&rt.rt_gateway).s_addr) { + rt.rt_flags |= RTF_GATEWAY; + } + if (sin_addr(&rt.rt_genmask).s_addr == INADDR_BROADCAST) { + rt.rt_flags |= RTF_HOST; + } + rt.rt_dev = ifname; + + /* Force address family to AF_INET */ + rt.rt_dst.sa_family = AF_INET; + rt.rt_gateway.sa_family = AF_INET; + rt.rt_genmask.sa_family = AF_INET; + + if (ioctl(s, cmd, &rt) < 0) { + goto err; + } + + close(s); + return 0; + + err: + close(s); + return errno; +} + +int +route_add(char *ifname, int metric, char *dst, char *gateway, char *genmask) +{ + return route_manip(SIOCADDRT, ifname, metric+1, dst, gateway, genmask); +} + +int +route_del(char *ifname, int metric, char *dst, char *gateway, char *genmask) +{ + return route_manip(SIOCDELRT, ifname, metric+1, dst, gateway, genmask); +} + +int +control_static_routes(char *ift, char *ifname, int is_add) +{ + char word[128], *next; + char *route_buf; + char *ipaddr, *netmask, *gateway, *metric; + + if (is_add && nvram_invmatch("sr_enable_x", "1")) + return 0; + + route_buf = (char *)malloc(SR_BUF_LEN*sizeof(char)); + if (!route_buf) + return -1; + + fill_static_routes(route_buf, SR_BUF_LEN, ift); + + foreach(word, route_buf, next) { + netmask = word; + ipaddr = strsep(&netmask, ":"); + if (!ipaddr || !netmask) + continue; + gateway = netmask; + netmask = strsep(&gateway, ":"); + if (!netmask || !gateway) + continue; + metric = gateway; + gateway = strsep(&metric, ":"); + if (!gateway || !metric) + continue; + if (!is_valid_ipv4(gateway)) + gateway = nvram_safe_get("wanx_gateway"); // oleg patch + + if (is_add) + route_add(ifname, atoi(metric), ipaddr, gateway, netmask); + else + route_del(ifname, atoi(metric), ipaddr, gateway, netmask); + } + + free(route_buf); + + return 0; +} + +char* +sanity_hostname(char *hname) +{ + char *c; + + for (c = hname; *c; c++) { + if (*c == 0x20) + *c = '_'; + } + + return hname; +} + +char* +get_our_hostname(void) +{ + char* host_name = nvram_safe_get("computer_name"); + if (!(*host_name) || !is_valid_hostname(host_name)) + host_name = nvram_safe_get("productid"); + return sanity_hostname(host_name); +} + +int +is_same_subnet(const char *ip1, const char *ip2, const char *msk) +{ + unsigned int addr1, addr2, mask; + + addr1 = ntohl(inet_addr(ip1)); + addr2 = ntohl(inet_addr(ip2)); + mask = ntohl(inet_addr(msk)); + + return (addr1 & mask) == (addr2 & mask); +} + +int +is_same_subnet2(const char *ip1, const char *ip2, const char *msk1, const char *msk2) +{ + unsigned int addr1, addr2, mask, mask1, mask2; + + addr1 = ntohl(inet_addr(ip1)); + addr2 = ntohl(inet_addr(ip2)); + mask1 = ntohl(inet_addr(msk1)); + mask2 = ntohl(inet_addr(msk2)); + + mask = (mask1 < mask2) ? mask1 : mask2; + + return (addr1 & mask) == (addr2 & mask); +} + +void +create_vlan_iface(const char *dev_ifname, int vid, int prio, int mtu, const char *hwaddr, int do_up) +{ + char vlan_ifname[24]; + + snprintf(vlan_ifname, sizeof(vlan_ifname), "%s.%d", dev_ifname, vid); + if (!is_interface_exist(vlan_ifname)) + vconfig_add_if(dev_ifname, vid); + else + ifconfig(vlan_ifname, 0, NULL, NULL); + + if (prio >= 0 && prio <= 7) + vconfig_egress_map(vlan_ifname, 0, prio); + + if (mtu >= 1280) + set_interface_mtu(vlan_ifname, mtu); + + if (hwaddr) + set_interface_hwaddr(vlan_ifname, hwaddr); + + if (do_up) + ifconfig(vlan_ifname, IFUP, "0.0.0.0", NULL); +} + +void +remove_vlan_iface(const char *vlan_ifname) +{ + if (!strstr(vlan_ifname, ".")) + return; + if (!is_interface_exist(vlan_ifname)) + return; + ifconfig(vlan_ifname, 0, NULL, NULL); + vconfig_del_if(vlan_ifname); +} + +void +stop_udpxy(void) +{ + char* svcs[] = { "udpxy", NULL }; + + kill_services(svcs, 3, 1); +} + +void +start_udpxy(char *wan_ifname) +{ + if (nvram_get_int("udpxy_enable_x") < 1024) + return; + + eval("/usr/sbin/udpxy", + "-m", wan_ifname, + "-p", nvram_safe_get("udpxy_enable_x"), + "-B", "65536", + "-c", nvram_safe_get("udpxy_clients"), + "-M", nvram_safe_get("udpxy_renew_period") + ); +} + +#if defined(APP_XUPNPD) +int +is_xupnpd_support(void) +{ + return check_if_file_exist("/usr/bin/xupnpd"); +} + +void +stop_xupnpd(void) +{ + char* svcs[] = { "xupnpd", NULL }; + + if (!is_xupnpd_support()) + return; + + kill_services(svcs, 3, 1); +} + +void +start_xupnpd(char *wan_ifname) +{ + int i, xport, has_daemon; + FILE *fp1, *fp2; + char tmp1[64], tmp2[64], line[256]; + char *dir_src = "/etc_ro/xupnpd"; + char *dir_dst = "/etc/storage/xupnpd"; + char *xdir1[] = { "config", "playlists", NULL }; + char *xdir2[] = { "plugins", "profiles", NULL }; + char *xlua[] = { "_http", "_m3u", "_main", "_mime", "_soap", "_ssdp", "_webapp", NULL }; + + if (!is_xupnpd_support()) + return; + + unlink("/var/run/xupnpd.pid"); + + xport = nvram_get_int("xupnpd_enable_x"); + if (xport < 1024) + return; + + if (!check_if_dir_exist(dir_dst)) + mkdir(dir_dst, 0755); + + for (i=0; xdir1[i]; i++) { + snprintf(tmp2, sizeof(tmp2), "%s/%s", dir_dst, xdir1[i]); + if (!check_if_dir_exist(tmp2)) + mkdir(tmp2, 0755); + } + + for (i=0; xdir2[i]; i++) { + snprintf(tmp2, sizeof(tmp2), "%s/%s", dir_dst, xdir2[i]); + if (!check_if_dir_exist(tmp2)) { + snprintf(tmp1, sizeof(tmp1), "%s/%s", dir_src, xdir2[i]); + if (get_mtd_size("Storage") > 0x10000) + doSystem("cp -rf %s %s", tmp1, tmp2); + else + symlink(tmp1, tmp2); + } + } + + for (i=0; xlua[i]; i++) { + snprintf(tmp2, sizeof(tmp2), "%s/xupnpd%s.lua", dir_dst, xlua[i]); + unlink(tmp2); + } + + snprintf(tmp1, sizeof(tmp1), "%s/xupnpd%s.lua", dir_src, ""); + snprintf(tmp2, sizeof(tmp2), "%s/xupnpd%s.lua", dir_dst, ""); + if (!check_if_file_exist(tmp2)) + doSystem("cp -f %s %s", tmp1, tmp2); + + snprintf(tmp1, sizeof(tmp1), "%s/config/common.lua.tmp", dir_dst); + snprintf(tmp2, sizeof(tmp2), "%s/config/common.lua", dir_dst); + fp1 = fopen(tmp1, "w"); + if (fp1) { + fp2 = fopen(tmp2, "r"); + if (fp2) { + while (fgets(line, sizeof(line), fp2)){ + if (strstr(line, "mcast_interface") && !strstr(line, "--")) + snprintf(line, sizeof(line), "cfg[\"mcast_interface\"]=\"%s\"\n", wan_ifname); + else if (strstr(line, "http_port") && !strstr(line, "--")) + snprintf(line, sizeof(line), "cfg[\"http_port\"]=%d\n", xport); + fprintf(fp1, "%s", line); + } + fclose(fp2); + } + fclose(fp1); + doSystem("mv -f %s %s", tmp1, tmp2); + } + + has_daemon = 0; + snprintf(tmp1, sizeof(tmp1), "%s/xupnpd.lua.tmp", dir_dst); + snprintf(tmp2, sizeof(tmp2), "%s/xupnpd.lua", dir_dst); + fp1 = fopen(tmp1, "w"); + if (fp1) { + fp2 = fopen(tmp2, "r"); + if (fp2) { + while (fgets(line, sizeof(line), fp2)){ + if (strstr(line, "cfg.mcast_interface=") && !strstr(line, "--")) + snprintf(line, sizeof(line), "cfg.mcast_interface='%s'\n", wan_ifname); + else if (strstr(line, "cfg.http_port=") && !strstr(line, "--")) + snprintf(line, sizeof(line), "cfg.http_port=%d\n", xport); + else if (strstr(line, "cfg.udpxy_url=")) { + char *lua_rem = "--"; + char *lan_addr = nvram_safe_get("lan_ipaddr_t"); + int udpxy_port = nvram_get_int("udpxy_enable_x"); + if (udpxy_port > 1023 && nvram_match("xupnpd_udpxy", "1")) + lua_rem = ""; + if (udpxy_port == 0) + udpxy_port = 4022; + snprintf(line, sizeof(line), "%scfg.udpxy_url='http://%s:%d'\n", lua_rem, lan_addr, udpxy_port); + } + else if (strstr(line, "cfg.daemon") && !strstr(line, "--")) { + snprintf(line, sizeof(line), "cfg.daemon=true\n"); + has_daemon = 1; + } + fprintf(fp1, "%s", line); + } + fclose(fp2); + } + fclose(fp1); + doSystem("mv -f %s %s", tmp1, tmp2); + + if (has_daemon) + eval("/usr/bin/xupnpd"); + else + system("/usr/bin/xupnpd &"); + } +} +#endif + +void +stop_igmpproxy(char *wan_ifname) +{ + char *svcs[] = { "xupnpd", "udpxy", "igmpproxy", NULL }; + + /* check used IPTV via VLAN interface */ + if (wan_ifname) { + char *viptv_iflast = nvram_safe_get("viptv_ifname"); + if (*viptv_iflast && is_interface_exist(viptv_iflast) && strcmp(wan_ifname, viptv_iflast)) + return; + } + + kill_services(svcs, 3, 1); +} + +void +start_igmpproxy(char *wan_ifname) +{ + FILE *fp; + char *igmpproxy_conf = "/etc/igmpproxy.conf"; + char *altnet, *altnet_mask, *viptv_iflast; + + /* check used IPTV via VLAN interface */ + viptv_iflast = nvram_safe_get("viptv_ifname"); + if (*viptv_iflast && is_interface_exist(viptv_iflast) && strcmp(wan_ifname, viptv_iflast)) + return; + + /* Always close old instance of igmpproxy and udpxy (interface may changed) */ + stop_igmpproxy(wan_ifname); + + start_udpxy(wan_ifname); +#if defined(APP_XUPNPD) + start_xupnpd(wan_ifname); +#endif + + if (nvram_invmatch("mr_enable_x", "1")) + return; + + fp = fopen(igmpproxy_conf, "w"); + if (fp) { + altnet = nvram_get("mr_altnet_x"); + if (altnet && strlen(altnet) > 6) + altnet_mask = altnet; + else + altnet_mask = "0.0.0.0/0"; + fprintf(fp, "# automatically generated\n"); + if (nvram_invmatch("mr_qleave_x", "0")) + fprintf(fp, "quickleave\n"); + fprintf(fp, "\nphyint %s %s ratelimit 0 threshold 1\n", wan_ifname, "upstream"); + fprintf(fp, "\taltnet %s\n", altnet_mask); + fprintf(fp, "\nphyint %s %s ratelimit 0 threshold 1\n", IFNAME_BR, "downstream"); + fprintf(fp, "\n"); + + fclose(fp); + } + + eval("/bin/igmpproxy", igmpproxy_conf); +} + +void +restart_iptv(int is_ap_mode) +{ + config_bridge(is_ap_mode); + + if (!is_ap_mode) { + char *wan_ifname, *viptv_iflast; + + /* check used IPTV via VLAN interface */ + viptv_iflast = nvram_safe_get("viptv_ifname"); + if (*viptv_iflast && is_interface_exist(viptv_iflast)) + wan_ifname = viptv_iflast; + else + wan_ifname = get_man_ifname(0); + start_igmpproxy(wan_ifname); + } else { + stop_igmpproxy(NULL); + start_udpxy(IFNAME_BR); +#if defined(APP_XUPNPD) + start_xupnpd(IFNAME_BR); +#endif + } +} + +void +flush_conntrack_table(char *ip) +{ + if (!ip) + ip = "f"; // flush all table + fput_string("/proc/net/nf_conntrack", ip); +} + +void +flush_route_caches(void) +{ + system("ip route flush cache"); +} + +void +clear_if_route4(char *ifname) +{ + doSystem("ip route flush dev %s scope %s", ifname, "global"); +} + +int +is_ftp_conntrack_loaded(int ftp_port0, int ftp_port1) +{ + char ports_use[64] = {0}; + char ports_val[64]; + + if (module_param_get("nf_conntrack_ftp", "ports", ports_use, sizeof(ports_use))) + return 0; + + if (ftp_port0 || ftp_port1) + { + if (ftp_port0 && ftp_port1) + sprintf(ports_val, "%d,%d", ftp_port0, ftp_port1); + else if (ftp_port0) + sprintf(ports_val, "%d", ftp_port0); + else + sprintf(ports_val, "%d", ftp_port1); + + if (strcmp(ports_val, ports_use) == 0) + return 2; + } + + return 1; +} + +#if defined (USE_HW_NAT) +static int +is_hwnat_loaded(void) +{ + int result = 0; + char offload_val[32] = {0}; + + if (!is_module_loaded("hw_nat")) + return result; + + result |= 0x1; + + if (module_param_get("hw_nat", "wifi_offload", offload_val, sizeof(offload_val)) == 0) { + if (offload_val[0] == '1' || offload_val[0] == 'Y') + result |= 0x2; + } + + if (module_param_get("hw_nat", "udp_offload", offload_val, sizeof(offload_val)) == 0) { + if (offload_val[0] == '1' || offload_val[0] == 'Y') + result |= 0x4; + } + +#if defined(USE_IPV6_HW_NAT) + if (module_param_get("hw_nat", "ipv6_offload", offload_val, sizeof(offload_val)) == 0) { + if (offload_val[0] == '1' || offload_val[0] == 'Y') + result |= 0x8; + } +#endif + + return result; +} + +static int +is_hwnat_allow_ipv6(void) +{ +#if defined(USE_IPV6_HW_NAT) + int ipv6_type = get_ipv6_type(); + +#if defined(USE_HW_NAT_V2) + if (nvram_get_int("ip6_ppe_on") && (ipv6_type != IPV6_DISABLED)) + return 1; +#else + if (nvram_get_int("ip6_ppe_on") && (ipv6_type == IPV6_NATIVE_STATIC || ipv6_type == IPV6_NATIVE_DHCP6)) + return 1; +#endif +#endif + return 0; +} + +static int +is_hwnat_allow(void) +{ + int result = 0; + int sw_mode = nvram_get_int("sw_mode"); + + int hw_nat_mode = nvram_get_int("hw_nat_mode"); + + if (sw_mode != 1 && sw_mode != 4) + return result; + + if (hw_nat_mode == 2) + return result; + + result |= 0x1; + + if (hw_nat_mode == 1 || hw_nat_mode == 4) + result |= 0x2; // wifi_offload=1 + + if (hw_nat_mode == 3 || hw_nat_mode == 4) + result |= 0x4; // udp_offload=1 + + if (is_hwnat_allow_ipv6()) + result |= 0x8; // ipv6_offload=1 + + return result; +} + +static void +hwnat_load(int allow_mask) +{ + char hnat_param[80]; + int wifi_offload, udp_offload, wan_vid; + + wifi_offload = (allow_mask & 0x2) ? 1 : 0; + udp_offload = (allow_mask & 0x4) ? 1 : 0; + wan_vid = get_vlan_vid_wan(); + + snprintf(hnat_param, sizeof(hnat_param), "wifi_offload=%d udp_offload=%d wan_vid=%d", wifi_offload, udp_offload, wan_vid); +#if defined(USE_IPV6_HW_NAT) + if (allow_mask & 0x8) + strcat(hnat_param, " ipv6_offload=1"); +#endif + module_smart_load("hw_nat", hnat_param); +} + +static void +hwnat_configure(int allow_mask) +{ + const char *hwnat_status = "Disabled"; + + if (!is_module_loaded("hw_nat")) { + logmessage(LOGNAME, "%s: %s", "Hardware NAT/Routing", hwnat_status); + return; + } + + module_param_set_int("hw_nat", "wan_vid", get_vlan_vid_wan()); + module_param_set_int("hw_nat", "ttl_regen", (nvram_get_int("wan_ttl_fix") == 1) ? 0 : 1); + + if (allow_mask & 0x2) +#if defined(USE_WWAN_HW_NAT) + hwnat_status = "Enabled, IPoE/PPPoE offload [WAN/WWAN]<->[LAN/WLAN]"; +#else + hwnat_status = "Enabled, IPoE/PPPoE offload [WAN]<->[LAN/WLAN]"; +#endif + else + hwnat_status = "Enabled, IPoE/PPPoE offload [WAN]<->[LAN]"; + + logmessage(LOGNAME, "%s: %s", "Hardware NAT/Routing", hwnat_status); + logmessage(LOGNAME, "%s: IPv4 UDP flow offload - %s", "Hardware NAT/Routing", (allow_mask & 0x4) ? "ON" : "OFF"); +#if defined(USE_IPV6_HW_NAT) + logmessage(LOGNAME, "%s: IPv6 routes offload - %s", "Hardware NAT/Routing", (allow_mask & 0x8) ? "ON" : "OFF"); +#endif +} +#endif /* USE_HW_NAT */ + +#if 0 +static int +is_fastnat_allow(void) +{ + if ( nvram_match("sw_nat_mode", "1") && nvram_match("sw_mode", "1") ) + return 1; + + return 0; +} +#endif + +void +hw_vlan_tx_map(int idx, int vid) +{ + char vlan_tx_data[16]; + + /* use slots 6..10 for custom VID + NOTE: slots 11..15 used by hw_nat WiFi/USB offload */ + if (vid < 6 || idx < 6 || idx > 10) + return; + + /* map VLAN VID to raeth (for support RT3883/MT7620 HW_VLAN_TX with VID > 15) */ + snprintf(vlan_tx_data, sizeof(vlan_tx_data), "%d: %d", idx, vid); + +#if defined (CONFIG_RALINK_RT3883) + fput_string("/proc/rt3883/vlan_tx", vlan_tx_data); +#elif defined (CONFIG_RALINK_MT7620) + fput_string("/proc/mt7620/vlan_tx", vlan_tx_data); +#endif +} + +void +reload_nat_modules(void) +{ + int loaded_ftp; + int needed_ftp0 = 0; + int needed_ftp1 = 0; + int needed_sip = 0; + int needed_h323 = 0; + int needed_rtsp = 0; + int needed_pptp = 0; + int wan_nat_x = nvram_get_int("wan_nat_x"); +#if defined (USE_HW_NAT) + int hwnat_allow = is_hwnat_allow(); + int hwnat_loaded = is_hwnat_loaded(); +#endif + + if (!get_ap_mode()) + { + needed_ftp0 = nvram_get_int("nf_alg_ftp0"); + needed_ftp1 = nvram_get_int("nf_alg_ftp1"); + if (needed_ftp0 < 21 || needed_ftp0 > 65535) needed_ftp0 = 0; + if (needed_ftp1 < 1024 || needed_ftp1 > 65535) needed_ftp1 = 0; + + if (nvram_match("nf_alg_pptp", "1")) + needed_pptp = 1; + + if (nvram_match("nf_alg_h323", "1")) + needed_h323 = 1; + + if (nvram_match("nf_alg_rtsp", "1")) + needed_rtsp = 1; + + if (nvram_match("nf_alg_sip", "1")) + needed_sip = 1; + } + +#if defined (USE_HW_NAT) + if ((hwnat_loaded) && ((!hwnat_allow) || (hwnat_loaded != hwnat_allow))) + { + hwnat_loaded = 0; + module_smart_unload("hw_nat", 0); + if (hwnat_allow) + sleep(1); + } +#endif + + if (needed_pptp) + { + module_smart_load("nf_conntrack_pptp", NULL); + if (wan_nat_x != 0) + module_smart_load("nf_nat_pptp", NULL); + } + else + module_smart_unload("nf_nat_pptp", 1); + + if (needed_rtsp) + { + module_smart_load("nf_conntrack_rtsp", "ports=554,8554"); + if (wan_nat_x != 0) + module_smart_load("nf_nat_rtsp", NULL); + } + else + module_smart_unload("nf_nat_rtsp", 1); + + if (needed_h323) + { + module_smart_load("nf_conntrack_h323", NULL); + if (wan_nat_x != 0) + module_smart_load("nf_nat_h323", NULL); + } + else + module_smart_unload("nf_nat_h323", 1); + + if (needed_sip) + { + module_smart_load("nf_conntrack_sip", NULL); + if (wan_nat_x != 0) + module_smart_load("nf_nat_sip", NULL); + } + else + module_smart_unload("nf_nat_sip", 1); + + loaded_ftp = is_ftp_conntrack_loaded(needed_ftp0, needed_ftp1); + if (loaded_ftp == 1) + { + module_smart_unload("nf_nat_ftp", 0); + module_smart_unload("nf_conntrack_ftp", 0); + } + + if ((loaded_ftp != 2) && (needed_ftp0 || needed_ftp1)) + { + char ports_val[32]; + + if (needed_ftp0 && needed_ftp1) + sprintf(ports_val, "ports=%d,%d", needed_ftp0, needed_ftp1); + else if (needed_ftp0) + sprintf(ports_val, "ports=%d", needed_ftp0); + else + sprintf(ports_val, "ports=%d", needed_ftp1); + + module_smart_load("nf_conntrack_ftp", ports_val); + if (wan_nat_x != 0) + module_smart_load("nf_nat_ftp", NULL); + } + +#if defined (USE_HW_NAT) + if (hwnat_allow && !hwnat_loaded) + hwnat_load(hwnat_allow); + + hwnat_configure(hwnat_allow); +#endif +#if defined (USE_SFE) + int sfe_enable = nvram_get_int("sfe_enable"); + int sfe_loaded = is_module_loaded("fast_classifier"); + + if (sfe_loaded && !sfe_enable) { + module_smart_unload("fast_classifier", 1); + doSystem("echo 1 > /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal"); + doSystem("echo 1 > /proc/sys/net/netfilter/nf_conntrack_tcp_no_window_check"); + sfe_loaded = 0; + } + if (sfe_enable && !sfe_loaded) { + doSystem("echo 0 > /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal"); + doSystem("echo 0 > /proc/sys/net/netfilter/nf_conntrack_tcp_no_window_check"); + module_smart_load("fast_classifier", NULL); + sfe_loaded = 1; + } + if (sfe_loaded) { + if (sfe_enable == 1) + doSystem("echo 0 > /sys/fast_classifier/skip_to_bridge_ingress"); + else if (sfe_enable == 2) + doSystem("echo 1 > /sys/fast_classifier/skip_to_bridge_ingress"); + } +#endif +} + +void +restart_firewall(void) +{ + if (get_ap_mode()) + return; + + /* re-build iptables rules */ + start_firewall_ex(); + + /* update UPnP forwards from lease file */ + update_upnp(); +} + +void +set_ipv4_forward(int is_on) +{ + char tmp[64]; + + /* enable/disable forwarding IPv4 */ + sprintf(tmp, "/proc/sys/net/%s/%s", "ipv4", "ip_forward"); + fput_int(tmp, (is_on) ? 1 : 0); +} + +void +set_nf_conntrack(void) +{ + int i_nf_nat, i_nf_val; + +#if (BOARD_RAM_SIZE < 32) + int i_nf_lim = 4096; +#elif (BOARD_RAM_SIZE < 64) + int i_nf_lim = 16384; +#elif (BOARD_RAM_SIZE < 128) + int i_nf_lim = 65536; +#elif (BOARD_RAM_SIZE < 256) + int i_nf_lim = 262144; +#else + int i_nf_lim = 327680; +#endif + + i_nf_val = nvram_get_int("nf_nat_type"); + if (i_nf_val == 2) + i_nf_nat = 0; // Linux + else if (i_nf_val == 1) + i_nf_nat = 1; // FCONE + else + i_nf_nat = 2; // RCONE + fput_int("/proc/sys/net/netfilter/nf_conntrack_nat_mode", i_nf_nat); + + i_nf_val = nvram_safe_get_int("nf_max_conn", 16384, 4096, i_nf_lim); + fput_int("/proc/sys/net/nf_conntrack_max", i_nf_val); +} + +void +set_tcp_syncookies(void) +{ + char tmp[64]; + int fw_syn_cook = nvram_get_int("fw_syn_cook"); + + sprintf(tmp, "/proc/sys/net/%s/%s", "ipv4", "tcp_syncookies"); + fput_int(tmp, (fw_syn_cook) ? 1 : 0); + + /* Tweak DoS-related... */ + sprintf(tmp, "/proc/sys/net/%s/%s", "ipv4", "icmp_ignore_bogus_error_responses"); + fput_int(tmp, 1); + + sprintf(tmp, "/proc/sys/net/%s/%s", "ipv4", "icmp_echo_ignore_broadcasts"); + fput_int(tmp, 1); +} + +void +set_tcp_tweaks(void) +{ + char tmp[64]; + + /* Tweak TCP IPv4 performance */ + sprintf(tmp, "/proc/sys/net/%s/%s", "ipv4", "tcp_fin_timeout"); + fput_int(tmp, 40); // def: 60 + + sprintf(tmp, "/proc/sys/net/%s/%s", "ipv4", "tcp_keepalive_intvl"); + fput_int(tmp, 30); // def: 75 + + sprintf(tmp, "/proc/sys/net/%s/%s", "ipv4", "tcp_keepalive_probes"); + fput_int(tmp, 5); // def: 9 + + sprintf(tmp, "/proc/sys/net/%s/%s", "ipv4", "tcp_keepalive_time"); + fput_int(tmp, 1800); // def: 7200 + + sprintf(tmp, "/proc/sys/net/%s/%s", "ipv4", "tcp_retries2"); + fput_int(tmp, 5); // def: 15 + + sprintf(tmp, "/proc/sys/net/%s/%s", "ipv4", "tcp_syn_retries"); + fput_int(tmp, 3); // def: 5 + + sprintf(tmp, "/proc/sys/net/%s/%s", "ipv4", "tcp_synack_retries"); + fput_int(tmp, 3); // def: 5 + +// sprintf(tmp, "/proc/sys/net/%s/%s", "ipv4", "tcp_tw_recycle"); +// fput_int(tmp, 1); + + sprintf(tmp, "/proc/sys/net/%s/%s", "ipv4", "tcp_tw_reuse"); + fput_int(tmp, 1); + + sprintf(tmp, "/proc/sys/net/%s/%s", "ipv4", "tcp_rfc1337"); + fput_int(tmp, 1); +} + +void +set_passthrough_pppoe(int is_on) +{ + char pthrough[32], *lan_if, *wan_if; + + lan_if = "null"; + wan_if = lan_if; + + if (is_on && nvram_match("fw_pt_pppoe", "1")) { + lan_if = IFNAME_BR; + wan_if = get_man_ifname(0); + } + + snprintf(pthrough, sizeof(pthrough), "%s,%s\n", lan_if, wan_if); + + /* enable/disable kernel-mode PPPoE passthrough */ + fput_string("/proc/net/pthrough/pppoe", pthrough); +} + +void +set_igmp_mld_version(void) +{ + int force_value; + const char *ifname = get_man_ifname(0); + + force_value = nvram_safe_get_int("force_igmp", 2, 0, 2); + + set_interface_conf_int("ipv4", "all", "force_igmp_version", force_value); + set_interface_conf_int("ipv4", ifname, "force_igmp_version", force_value); + set_interface_conf_int("ipv4", IFNAME_BR, "force_igmp_version", force_value); + +#if defined (USE_IPV6) + force_value = nvram_safe_get_int("force_mld", 0, 0, 1); + + set_interface_conf_int("ipv6", "all", "force_mld_version", force_value); + set_interface_conf_int("ipv6", ifname, "force_mld_version", force_value); + set_interface_conf_int("ipv6", IFNAME_BR, "force_mld_version", force_value); +#endif +} + +void +set_libc_gai(int ipv4_first) +{ + if (ipv4_first) { + FILE *fp = fopen("/etc/gai.conf", "w"); + if (fp) { + fprintf(fp, "precedence %s\n", "ipv4"); + fclose(fp); + } + } else { + unlink("/etc/gai.conf"); + } +} + diff --git a/hanwckf/modify/user/www/Makefile b/hanwckf/modify/user/www/Makefile new file mode 100755 index 00000000..0822a0d6 --- /dev/null +++ b/hanwckf/modify/user/www/Makefile @@ -0,0 +1,164 @@ +ifndef ROOTDIR +ROOTDIR=../.. +endif + +ROMFS_DIR = $(ROOTDIR)/romfs + +include $(ROOTDIR)/user/shared/boards.mk + +PROJECT_HOME_URL="https:\/\/github.com\/hanwckf\/rt-n56u\/" +PROJECT_HOME_URL_MOD="https:\/\/github.com\/TurBoTse\/rt-n56u\/" + +LABEL_COPYRIGHT_TEXT='© 2011-2022 Padavan<\/a> \& N56U project community \& by TurBoTse<\/a>' + +BOARD_PATTERN=s/ZVMODELVZ/$(CONFIG_FIRMWARE_PRODUCT_ID)/g +COPYR_PATTERN=s/ZVCOPYRVZ/$(LABEL_COPYRIGHT_TEXT)/g +DWURL_PATTERN=s/ZVDWURLVZ/$(PROJECT_HOME_URL)/g +DWURL_MOD_PATTERN=s/ZVMODWURLVZ/$(PROJECT_HOME_URL_MOD)/g + +WEBUI_NAME=n56u_ribbon_fixed + +all: + +romfs: + echo "Make www romfs" + rm -Rf $(ROMFS_DIR)/www + cp -R $(WEBUI_NAME) $(ROMFS_DIR)/www + rm -f $(ROMFS_DIR)/www/httpd_check.htm + echo "ASUSTeK" > $(ROMFS_DIR)/www/httpd_check.htm + cd $(ROMFS_DIR)/www && ln -sf /opt/share/www/custom custom + cp dict/EN.header $(ROMFS_DIR)/www +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_BR),y) + echo "LANG_BR=Brazil" >> $(ROMFS_DIR)/www/EN.header + cp dict/BR.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_CZ),y) + echo "LANG_CZ=Česky" >> $(ROMFS_DIR)/www/EN.header + cp dict/CZ.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_DA),y) + echo "LANG_DA=Dansk" >> $(ROMFS_DIR)/www/EN.header + cp dict/DA.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_DE),y) + echo "LANG_DE=Deutsch" >> $(ROMFS_DIR)/www/EN.header + cp dict/DE.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_ES),y) + echo "LANG_ES=Español" >> $(ROMFS_DIR)/www/EN.header + cp dict/ES.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_FI),y) + echo "LANG_FI=Finsk" >> $(ROMFS_DIR)/www/EN.header + cp dict/FI.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_FR),y) + echo "LANG_FR=Français" >> $(ROMFS_DIR)/www/EN.header + cp dict/FR.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_NO),y) + echo "LANG_NO=Norsk" >> $(ROMFS_DIR)/www/EN.header + cp dict/NO.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_PL),y) + echo "LANG_PL=Polski" >> $(ROMFS_DIR)/www/EN.header + cp dict/PL.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_RU),y) + echo "LANG_RU=Pусский" >> $(ROMFS_DIR)/www/EN.header + cp dict/RU.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_SV),y) + echo "LANG_SV=Svensk" >> $(ROMFS_DIR)/www/EN.header + cp dict/SV.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_UK),y) + echo "LANG_UK=Українська" >> $(ROMFS_DIR)/www/EN.header + cp dict/UK.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_CN),y) + echo "LANG_CN=简体中文" >> $(ROMFS_DIR)/www/EN.header + cp dict/CN.dict $(ROMFS_DIR)/www +endif + cat $(ROMFS_DIR)/www/EN.header dict/EN.footer > $(ROMFS_DIR)/www/EN.dict + sed $(BOARD_PATTERN) -i $(ROMFS_DIR)/www/*.dict + sed $(COPYR_PATTERN) -i $(ROMFS_DIR)/www/*.dict + sed $(DWURL_PATTERN) -i $(ROMFS_DIR)/www/*.dict + sed $(DWURL_MOD_PATTERN) -i $(ROMFS_DIR)/www/*.dict + rm -f $(ROMFS_DIR)/www/EN.header + rm -f $(ROMFS_DIR)/www/bootstrap/js/bootstrap.js + rm -f $(ROMFS_DIR)/www/bootstrap/js/engage.itoggle.js + rm -f $(ROMFS_DIR)/www/bootstrap/js/jquery.backgroundpos.min.js + rm -f $(ROMFS_DIR)/www/bootstrap/js/jquery.easing.1.3.js + rm -f $(ROMFS_DIR)/www/bootstrap/css/bootstrap.css +ifeq ($(BOARD_HAS_2G_RADIO),0) + rm -f $(INSTALLDIR)/www/Advanced_ACL2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WAdvanced2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WGuest2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_Wireless2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WMode2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WSecurity2g_Content.asp + rm -f $(INSTALLDIR)/www/Main_WStatus2g_Content.asp + rm -f $(INSTALLDIR)/www/wireless_2g.js + rm -f $(INSTALLDIR)/www/wds_aplist_2g.asp + rm -f $(INSTALLDIR)/www/device-map/router2g.asp +endif +ifeq ($(BOARD_HAS_5G_RADIO),0) + rm -f $(INSTALLDIR)/www/Advanced_ACL_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WAdvanced_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WGuest_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_Wireless_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WMode_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WSecurity_Content.asp + rm -f $(INSTALLDIR)/www/Main_WStatus_Content.asp + rm -f $(INSTALLDIR)/www/wireless.js + rm -f $(INSTALLDIR)/www/wds_aplist.asp + rm -f $(INSTALLDIR)/www/device-map/router.asp +endif +ifndef CONFIG_IPV6 + rm -f $(INSTALLDIR)/www/Advanced_IPv6_Content.asp +endif +ifndef CONFIG_ATA + rm -f $(INSTALLDIR)/www/device-map/sata.asp +endif +ifndef CONFIG_USB_SUPPORT + rm -f $(INSTALLDIR)/www/Advanced_Modem_others.asp + rm -f $(INSTALLDIR)/www/Advanced_Printer_others.asp + rm -f $(INSTALLDIR)/www/modem_isp.js + rm -f $(INSTALLDIR)/www/device-map/modem.asp + rm -f $(INSTALLDIR)/www/device-map/printer.asp + rm -f $(INSTALLDIR)/www/device-map/hub.asp +endif +ifneq ($(STORAGE_ENABLED),y) + rm -f $(INSTALLDIR)/www/Advanced_AiDisk_ftp.asp + rm -f $(INSTALLDIR)/www/Advanced_AiDisk_others.asp + rm -f $(INSTALLDIR)/www/Advanced_AiDisk_samba.asp + rm -f $(INSTALLDIR)/www/aidisk.asp + rm -f $(INSTALLDIR)/www/disk_folder_tree.js + rm -f $(INSTALLDIR)/www/device-map/disk.asp + rm -f $(INSTALLDIR)/www/device-map/safely_remove_disk.asp + rm -rf $(INSTALLDIR)/www/aidisk + rm -rf $(INSTALLDIR)/www/images/AiDisk + rm -rf $(INSTALLDIR)/www/images/Tree +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_SCUTCLIENT),y) + rm -f $(INSTALLDIR)/www/scutclient.asp + rm -f $(INSTALLDIR)/www/scutclient_log.asp + rm -f $(INSTALLDIR)/www/scutclient_action.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_MENTOHUST),y) + rm -f $(INSTALLDIR)/www/mentohust.asp + rm -f $(INSTALLDIR)/www/mentohust_log.asp + rm -f $(INSTALLDIR)/www/mentohust_action.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_DNSFORWARDER),y) + rm -f $(INSTALLDIR)/www/dns-forwarder.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS),y) + rm -f $(INSTALLDIR)/www/Shadowsocks.asp + rm -f $(INSTALLDIR)/www/Shadowsocks_action.asp + rm -f $(INSTALLDIR)/www/Shadowsocks_log.asp +endif + +clean: + @echo "Clean www romfs" diff --git a/hanwckf/modify/user/www/n56u_ribbon_fixed/bootstrap/img/asus_logo.png b/hanwckf/modify/user/www/n56u_ribbon_fixed/bootstrap/img/asus_logo.png new file mode 100755 index 00000000..dd0ebf82 Binary files /dev/null and b/hanwckf/modify/user/www/n56u_ribbon_fixed/bootstrap/img/asus_logo.png differ diff --git a/hanwckf/scripts/K2P.sh b/hanwckf/scripts/K2P.sh new file mode 100644 index 00000000..ab801ff6 --- /dev/null +++ b/hanwckf/scripts/K2P.sh @@ -0,0 +1,34 @@ +##################################################################### +# cd /opt/rt-n56u/trunk 执行在这个目录下 +# +# 修改默认参数(不同设备拷贝到相应 *.sh) by: TurBoTse +##################################################################### + +lan_ip="192.168.6" # LAN 地址 别写后面的 .1 +default_path="./user/shared" # 默认配置路径 +config="./configs/templates/K2P.config" # 默认配置文件 + +echo "修改 LAN IP 地址" +sed -i "s/192.168.2/$lan_ip/g" $default_path/defaults.h + +#echo "设置为PPPOE模式并写入账号和密码" +#sed -i 's/{ "wan_proto", "dhcp" }/{ "wan_proto", "pppoe" }/g' $default_path/defaults.c +#sed -i 's/{ "wan_pppoe_username", "" }/{ "wan_pppoe_username", "你的宽带账号" }/g' $default_path/defaults.c +#sed -i 's/{ "wan_pppoe_passwd", "" }/{ "wan_pppoe_passwd", "宽带密码" }/g' $default_path/defaults.c + +#echo "设置为AP模式" +#echo "#define BOARD_ROLE_REPEATER 1" >> ./configs/boards/K2P/board.h + +#echo "打开2G无线桥接" +#sed -i 's/{ "rt_mode_x", "0" }/{ "rt_mode_x", "4" }/g' $default_path/defaults.c + +#echo "打开5G无线桥接" +#sed -i 's/{ "wl_mode_x", "0" }/{ "wl_mode_x", "4" }/g' $default_path/defaults.c + +#echo "超频到 900MHz " +#sed -i '/CONFIG_FIRMWARE_CPU_900MHZ/d' $config +#echo "CONFIG_FIRMWARE_CPU_900MHZ=y" >> $config + +#echo "集成 KMS 激活服务器" +#sed -i "s/CONFIG_FIRMWARE_INCLUDE_VLMCSD=n/CONFIG_FIRMWARE_INCLUDE_VLMCSD=y/g" $config + diff --git a/hanwckf/scripts/README.md b/hanwckf/scripts/README.md new file mode 100644 index 00000000..629eec35 --- /dev/null +++ b/hanwckf/scripts/README.md @@ -0,0 +1,3 @@ +# README + +存放设备的执行脚本 例如: K2P.sh \ No newline at end of file diff --git a/hanwckf/scripts/public.sh b/hanwckf/scripts/public.sh new file mode 100644 index 00000000..cb997966 --- /dev/null +++ b/hanwckf/scripts/public.sh @@ -0,0 +1,47 @@ +##################################################################### +# cd /opt/rt-n56u/trunk 执行在这个目录下 +# +# 修改默认参数(不同设备拷贝到相应 *.sh) by: TurBoTse +##################################################################### + +user_name="admin" # 用户名 +user_password="admin" # 登录密码 +lan_ip="192.168.2" # LAN 地址 别写后面的 .1 +wlan_2g_ssid="Padavan" # 2G 无线名称 +wlan_5g_ssid="Padavan_5G" # 5G 无线名称 +wlan_guest_2g_ssid="Padavan_Guset" # 2G 访客无线名称 +wlan_guest_5g_ssid="Padavan_Guest_5G" # 5G 访客无线名称 +wlan_2g_psk="1234567890" # 2G WIFI密码最少8位 空白为不设置 +wlan_5g_psk="1234567890" # 5G WIFI密码最少8位 空白为不设置 +version_time=$(date +%Y%m%d) # 更新时版本号时间: 20210101 +default_file="./user/shared/defaults.h" # 默认配置文件 + +echo "修改用户名" +sed -i 's/SYS_USER_ROOT "admin"/SYS_USER_ROOT "'$user_name'"/g' $default_file + +echo "修改登陆密码" +sed -i 's/DEF_ROOT_PASSWORD "admin"/DEF_ROOT_PASSWORD "'$user_password'"/g' $default_file + +echo "修改 LAN IP 地址" +sed -i "s/192.168.2/$lan_ip/g" $default_file + +echo "修改 2G 无线名称" +sed -i 's/DEF_WLAN_2G_SSID BOARD_PID "_%s"/DEF_WLAN_2G_SSID "'$wlan_2g_ssid'"/g' $default_file + +echo "修改 5G 无线名称" +sed -i 's/DEF_WLAN_5G_SSID BOARD_PID "_5G_%s"/DEF_WLAN_5G_SSID "'$wlan_5g_ssid'"/g' $default_file + +echo "修改 2G 访客无线名称" +sed -i 's/DEF_WLAN_2G_GSSID BOARD_PID "_GUEST_%s"/DEF_WLAN_2G_GSSID "'$wlan_guest_2g_ssid'"/g' $default_file + +echo "修改 5G 访客无线名称" +sed -i 's/DEF_WLAN_5G_GSSID BOARD_PID "_GUEST_5G_%s"/DEF_WLAN_5G_GSSID "'$wlan_guest_5g_ssid'"/g' $default_file + +echo "修改 2.4GHz WIFI 密码" +sed -i 's/DEF_WLAN_2G_PSK "1234567890"/DEF_WLAN_2G_PSK "'$wlan_2g_psk'"/g' $default_file + +echo "修改 5GHz WIFI 密码" +sed -i 's/DEF_WLAN_5G_PSK "1234567890"/DEF_WLAN_5G_PSK "'$wlan_5g_psk'"/g' $default_file + +echo "更新版本号时间" +sed -i "s/FIRMWARE_BUILDS_REV=.*/FIRMWARE_BUILDS_REV=$version_time/g" ./versions.inc diff --git a/hanwckf_4.4/README.md b/hanwckf_4.4/README.md new file mode 100644 index 00000000..33fc1414 --- /dev/null +++ b/hanwckf_4.4/README.md @@ -0,0 +1,7 @@ +# README + +config 存放设备适配文件 *.config + +modify 存放要修改的文件( 注意存放路径要对应 ) + +scripts 存放设备执行脚本 *.sh diff --git a/hanwckf_4.4/config/README.md b/hanwckf_4.4/config/README.md new file mode 100644 index 00000000..6823b8fb --- /dev/null +++ b/hanwckf_4.4/config/README.md @@ -0,0 +1,3 @@ +# README + +存放设备的适配文件 例如: K2P.config \ No newline at end of file diff --git a/hanwckf_4.4/modify/user/www/Makefile b/hanwckf_4.4/modify/user/www/Makefile new file mode 100644 index 00000000..ab958bad --- /dev/null +++ b/hanwckf_4.4/modify/user/www/Makefile @@ -0,0 +1,164 @@ +ifndef ROOTDIR +ROOTDIR=../.. +endif + +ROMFS_DIR = $(ROOTDIR)/romfs + +include $(ROOTDIR)/user/shared/boards.mk + +PROJECT_HOME_URL="https:\/\/github.com\/hanwckf\/padavan-4.4\/" +PROJECT_HOME_URL_MOD="https:\/\/github.com\/TurBoTse\/padavan-4.4\/" + +LABEL_COPYRIGHT_TEXT='© 2011-2022 Padavan<\/a> \& N56U project community \& by TurBoTse<\/a>' + +BOARD_PATTERN=s/ZVMODELVZ/$(CONFIG_FIRMWARE_PRODUCT_ID)/g +COPYR_PATTERN=s/ZVCOPYRVZ/$(LABEL_COPYRIGHT_TEXT)/g +DWURL_PATTERN=s/ZVDWURLVZ/$(PROJECT_HOME_URL)/g +DWURL_MOD_PATTERN=s/ZVMODWURLVZ/$(PROJECT_HOME_URL_MOD)/g + +WEBUI_NAME=n56u_ribbon_fixed + +all: + +romfs: + echo "Make www romfs" + rm -Rf $(ROMFS_DIR)/www + cp -R $(WEBUI_NAME) $(ROMFS_DIR)/www + rm -f $(ROMFS_DIR)/www/httpd_check.htm + echo "ASUSTeK" > $(ROMFS_DIR)/www/httpd_check.htm + cd $(ROMFS_DIR)/www && ln -sf /opt/share/www/custom custom + cp dict/EN.header $(ROMFS_DIR)/www +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_BR),y) + echo "LANG_BR=Brazil" >> $(ROMFS_DIR)/www/EN.header + cp dict/BR.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_CZ),y) + echo "LANG_CZ=Česky" >> $(ROMFS_DIR)/www/EN.header + cp dict/CZ.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_DA),y) + echo "LANG_DA=Dansk" >> $(ROMFS_DIR)/www/EN.header + cp dict/DA.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_DE),y) + echo "LANG_DE=Deutsch" >> $(ROMFS_DIR)/www/EN.header + cp dict/DE.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_ES),y) + echo "LANG_ES=Español" >> $(ROMFS_DIR)/www/EN.header + cp dict/ES.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_FI),y) + echo "LANG_FI=Finsk" >> $(ROMFS_DIR)/www/EN.header + cp dict/FI.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_FR),y) + echo "LANG_FR=Français" >> $(ROMFS_DIR)/www/EN.header + cp dict/FR.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_NO),y) + echo "LANG_NO=Norsk" >> $(ROMFS_DIR)/www/EN.header + cp dict/NO.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_PL),y) + echo "LANG_PL=Polski" >> $(ROMFS_DIR)/www/EN.header + cp dict/PL.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_RU),y) + echo "LANG_RU=Pусский" >> $(ROMFS_DIR)/www/EN.header + cp dict/RU.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_SV),y) + echo "LANG_SV=Svensk" >> $(ROMFS_DIR)/www/EN.header + cp dict/SV.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_UK),y) + echo "LANG_UK=Українська" >> $(ROMFS_DIR)/www/EN.header + cp dict/UK.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_CN),y) + echo "LANG_CN=简体中文" >> $(ROMFS_DIR)/www/EN.header + cp dict/CN.dict $(ROMFS_DIR)/www +endif + cat $(ROMFS_DIR)/www/EN.header dict/EN.footer > $(ROMFS_DIR)/www/EN.dict + sed $(BOARD_PATTERN) -i $(ROMFS_DIR)/www/*.dict + sed $(COPYR_PATTERN) -i $(ROMFS_DIR)/www/*.dict + sed $(DWURL_PATTERN) -i $(ROMFS_DIR)/www/*.dict + sed $(DWURL_MOD_PATTERN) -i $(ROMFS_DIR)/www/*.dict + rm -f $(ROMFS_DIR)/www/EN.header + rm -f $(ROMFS_DIR)/www/bootstrap/js/bootstrap.js + rm -f $(ROMFS_DIR)/www/bootstrap/js/engage.itoggle.js + rm -f $(ROMFS_DIR)/www/bootstrap/js/jquery.backgroundpos.min.js + rm -f $(ROMFS_DIR)/www/bootstrap/js/jquery.easing.1.3.js + rm -f $(ROMFS_DIR)/www/bootstrap/css/bootstrap.css +ifeq ($(BOARD_HAS_2G_RADIO),0) + rm -f $(INSTALLDIR)/www/Advanced_ACL2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WAdvanced2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WGuest2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_Wireless2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WMode2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WSecurity2g_Content.asp + rm -f $(INSTALLDIR)/www/Main_WStatus2g_Content.asp + rm -f $(INSTALLDIR)/www/wireless_2g.js + rm -f $(INSTALLDIR)/www/wds_aplist_2g.asp + rm -f $(INSTALLDIR)/www/device-map/router2g.asp +endif +ifeq ($(BOARD_HAS_5G_RADIO),0) + rm -f $(INSTALLDIR)/www/Advanced_ACL_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WAdvanced_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WGuest_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_Wireless_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WMode_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WSecurity_Content.asp + rm -f $(INSTALLDIR)/www/Main_WStatus_Content.asp + rm -f $(INSTALLDIR)/www/wireless.js + rm -f $(INSTALLDIR)/www/wds_aplist.asp + rm -f $(INSTALLDIR)/www/device-map/router.asp +endif +ifndef CONFIG_IPV6 + rm -f $(INSTALLDIR)/www/Advanced_IPv6_Content.asp +endif +ifndef CONFIG_ATA + rm -f $(INSTALLDIR)/www/device-map/sata.asp +endif +ifndef CONFIG_USB_SUPPORT + rm -f $(INSTALLDIR)/www/Advanced_Modem_others.asp + rm -f $(INSTALLDIR)/www/Advanced_Printer_others.asp + rm -f $(INSTALLDIR)/www/modem_isp.js + rm -f $(INSTALLDIR)/www/device-map/modem.asp + rm -f $(INSTALLDIR)/www/device-map/printer.asp + rm -f $(INSTALLDIR)/www/device-map/hub.asp +endif +ifneq ($(STORAGE_ENABLED),y) + rm -f $(INSTALLDIR)/www/Advanced_AiDisk_ftp.asp + rm -f $(INSTALLDIR)/www/Advanced_AiDisk_others.asp + rm -f $(INSTALLDIR)/www/Advanced_AiDisk_samba.asp + rm -f $(INSTALLDIR)/www/aidisk.asp + rm -f $(INSTALLDIR)/www/disk_folder_tree.js + rm -f $(INSTALLDIR)/www/device-map/disk.asp + rm -f $(INSTALLDIR)/www/device-map/safely_remove_disk.asp + rm -rf $(INSTALLDIR)/www/aidisk + rm -rf $(INSTALLDIR)/www/images/AiDisk + rm -rf $(INSTALLDIR)/www/images/Tree +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_SCUTCLIENT),y) + rm -f $(INSTALLDIR)/www/scutclient.asp + rm -f $(INSTALLDIR)/www/scutclient_log.asp + rm -f $(INSTALLDIR)/www/scutclient_action.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_MENTOHUST),y) + rm -f $(INSTALLDIR)/www/mentohust.asp + rm -f $(INSTALLDIR)/www/mentohust_log.asp + rm -f $(INSTALLDIR)/www/mentohust_action.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_DNSFORWARDER),y) + rm -f $(INSTALLDIR)/www/dns-forwarder.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS),y) + rm -f $(INSTALLDIR)/www/Shadowsocks.asp + rm -f $(INSTALLDIR)/www/Shadowsocks_action.asp + rm -f $(INSTALLDIR)/www/Shadowsocks_log.asp +endif + +clean: + @echo "Clean www romfs" diff --git a/hanwckf_4.4/modify/user/www/n56u_ribbon_fixed/bootstrap/img/asus_logo.png b/hanwckf_4.4/modify/user/www/n56u_ribbon_fixed/bootstrap/img/asus_logo.png new file mode 100644 index 00000000..dd0ebf82 Binary files /dev/null and b/hanwckf_4.4/modify/user/www/n56u_ribbon_fixed/bootstrap/img/asus_logo.png differ diff --git a/hanwckf_4.4/scripts/K2P.sh b/hanwckf_4.4/scripts/K2P.sh new file mode 100644 index 00000000..b6176541 --- /dev/null +++ b/hanwckf_4.4/scripts/K2P.sh @@ -0,0 +1,34 @@ +##################################################################### +# cd /opt/rt-n56u/trunk 执行在这个目录下 +# +# 修改默认参数(不同设备拷贝到相应 *.sh) by: TurBoTse +##################################################################### + +lan_ip="192.168.6" # LAN 地址 别写后面的 .1 +default_path="./user/shared" # 默认配置路径 +config="./configs/templates/K2P.config" # 默认配置文件 + +echo "修改 LAN IP 地址" +sed -i "s/192.168.2/$lan_ip/g" $default_path/defaults.h + +#echo "设置为PPPOE模式并写入账号和密码" +#sed -i 's/{ "wan_proto", "dhcp" }/{ "wan_proto", "pppoe" }/g' $default_path/defaults.c +#sed -i 's/{ "wan_pppoe_username", "" }/{ "wan_pppoe_username", "你的宽带账号" }/g' $default_path/defaults.c +#sed -i 's/{ "wan_pppoe_passwd", "" }/{ "wan_pppoe_passwd", "宽带密码" }/g' $default_path/defaults.c + +#echo "设置为 AP模式" +#echo "#define BOARD_ROLE_REPEATER 1" >> ./configs/boards/K2P/board.h + +#echo "打开2G无线桥接" +#sed -i 's/{ "rt_mode_x", "0" }/{ "rt_mode_x", "4" }/g' $default_path/defaults.c + +#echo "打开5G无线桥接" +#sed -i 's/{ "wl_mode_x", "0" }/{ "wl_mode_x", "4" }/g' $default_path/defaults.c + +#echo "集成科学插件" +#grep "CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS=n" $config +#if [ $? -eq 0 ]; then +# for MOD in SHADOWSOCKS IPSET EAP_PEAP OPENSSH OPENSSL_EC OPENSSL_EXE CURL; do +# sed -i "s/CONFIG_FIRMWARE_INCLUDE_${MOD}=n/CONFIG_FIRMWARE_INCLUDE_${MOD}=y/g" $config +# done +#fi diff --git a/hanwckf_4.4/scripts/README.md b/hanwckf_4.4/scripts/README.md new file mode 100644 index 00000000..629eec35 --- /dev/null +++ b/hanwckf_4.4/scripts/README.md @@ -0,0 +1,3 @@ +# README + +存放设备的执行脚本 例如: K2P.sh \ No newline at end of file diff --git a/hanwckf_4.4/scripts/public.sh b/hanwckf_4.4/scripts/public.sh new file mode 100644 index 00000000..cb997966 --- /dev/null +++ b/hanwckf_4.4/scripts/public.sh @@ -0,0 +1,47 @@ +##################################################################### +# cd /opt/rt-n56u/trunk 执行在这个目录下 +# +# 修改默认参数(不同设备拷贝到相应 *.sh) by: TurBoTse +##################################################################### + +user_name="admin" # 用户名 +user_password="admin" # 登录密码 +lan_ip="192.168.2" # LAN 地址 别写后面的 .1 +wlan_2g_ssid="Padavan" # 2G 无线名称 +wlan_5g_ssid="Padavan_5G" # 5G 无线名称 +wlan_guest_2g_ssid="Padavan_Guset" # 2G 访客无线名称 +wlan_guest_5g_ssid="Padavan_Guest_5G" # 5G 访客无线名称 +wlan_2g_psk="1234567890" # 2G WIFI密码最少8位 空白为不设置 +wlan_5g_psk="1234567890" # 5G WIFI密码最少8位 空白为不设置 +version_time=$(date +%Y%m%d) # 更新时版本号时间: 20210101 +default_file="./user/shared/defaults.h" # 默认配置文件 + +echo "修改用户名" +sed -i 's/SYS_USER_ROOT "admin"/SYS_USER_ROOT "'$user_name'"/g' $default_file + +echo "修改登陆密码" +sed -i 's/DEF_ROOT_PASSWORD "admin"/DEF_ROOT_PASSWORD "'$user_password'"/g' $default_file + +echo "修改 LAN IP 地址" +sed -i "s/192.168.2/$lan_ip/g" $default_file + +echo "修改 2G 无线名称" +sed -i 's/DEF_WLAN_2G_SSID BOARD_PID "_%s"/DEF_WLAN_2G_SSID "'$wlan_2g_ssid'"/g' $default_file + +echo "修改 5G 无线名称" +sed -i 's/DEF_WLAN_5G_SSID BOARD_PID "_5G_%s"/DEF_WLAN_5G_SSID "'$wlan_5g_ssid'"/g' $default_file + +echo "修改 2G 访客无线名称" +sed -i 's/DEF_WLAN_2G_GSSID BOARD_PID "_GUEST_%s"/DEF_WLAN_2G_GSSID "'$wlan_guest_2g_ssid'"/g' $default_file + +echo "修改 5G 访客无线名称" +sed -i 's/DEF_WLAN_5G_GSSID BOARD_PID "_GUEST_5G_%s"/DEF_WLAN_5G_GSSID "'$wlan_guest_5g_ssid'"/g' $default_file + +echo "修改 2.4GHz WIFI 密码" +sed -i 's/DEF_WLAN_2G_PSK "1234567890"/DEF_WLAN_2G_PSK "'$wlan_2g_psk'"/g' $default_file + +echo "修改 5GHz WIFI 密码" +sed -i 's/DEF_WLAN_5G_PSK "1234567890"/DEF_WLAN_5G_PSK "'$wlan_5g_psk'"/g' $default_file + +echo "更新版本号时间" +sed -i "s/FIRMWARE_BUILDS_REV=.*/FIRMWARE_BUILDS_REV=$version_time/g" ./versions.inc diff --git a/meIsreallyba/README.md b/meIsreallyba/README.md new file mode 100644 index 00000000..33fc1414 --- /dev/null +++ b/meIsreallyba/README.md @@ -0,0 +1,7 @@ +# README + +config 存放设备适配文件 *.config + +modify 存放要修改的文件( 注意存放路径要对应 ) + +scripts 存放设备执行脚本 *.sh diff --git a/meIsreallyba/config/README.md b/meIsreallyba/config/README.md new file mode 100644 index 00000000..6823b8fb --- /dev/null +++ b/meIsreallyba/config/README.md @@ -0,0 +1,3 @@ +# README + +存放设备的适配文件 例如: K2P.config \ No newline at end of file diff --git a/meIsreallyba/modify/build_firmware_modify b/meIsreallyba/modify/build_firmware_modify new file mode 100644 index 00000000..4c90eab3 --- /dev/null +++ b/meIsreallyba/modify/build_firmware_modify @@ -0,0 +1,200 @@ +#!/bin/bash + +if [ -z "$1" ] || [ "$EUID" != 0 ]; then + echo "Please run 'fakeroot $0 PRODUCT_NAME' to start build (see 'configs/templates/')" + echo "For Windows Subsystem for Linux(WSL), use 'fakeroot-tcp' instead of 'fakeroot', or run with sudo" + exit 1 +fi + +if [ ! -f configs/templates/$1.config ] ; then + echo "configs/templates/$1.config not found!" + exit 1 +fi + +cp -f configs/templates/$1.config .config + +ROOTDIR=`pwd` +export ROOTDIR=$ROOTDIR + +kernel_id="4.4.x" +kernel_cf="" +kernel_tf="" +busybox_id="1.24.x" +busybox_cf="$ROOTDIR/configs/boards/busybox.config" +busybox_tf="$ROOTDIR/user/busybox/busybox-${busybox_id}/.config" +board_h="" +board_mk="" +paragon_hfsplus=0 + +func_enable_kernel_param() +{ + if [ -n "`grep \^\"\# $1 is not set\" $kernel_tf`" ] ; then + sed -i "s/\# $1 is not set/$1=y/" $kernel_tf + fi +} + +func_disable_kernel_param() +{ + if [ -n "`grep \^$1=y $kernel_tf`" ] ; then + sed -i "s/$1=y/\# $1 is not set/" $kernel_tf + elif [ -n "`grep \^$1=m $kernel_tf`" ] ; then + sed -i "s/$1=m/\# $1 is not set/" $kernel_tf + fi +} + +func_enable_busybox_param() +{ + if [ -n "`grep \^\"\# $1 is not set\" $busybox_tf`" ] ; then + sed -i "s/\# $1 is not set/$1=y/" $busybox_tf + fi +} + +func_disable_busybox_param() +{ + if [ -n "`grep \^$1=y $busybox_tf`" ] ; then + sed -i "s/$1=y/\# $1 is not set/" $busybox_tf + fi +} +. $ROOTDIR/toolchain.inc +echo "CONFIG_TOOLCHAIN_DIR=${CONFIG_TOOLCHAIN_DIR}" >> .config + +# load project root config +. $ROOTDIR/.config + +if [ ! -f "$ROOTDIR/vendors/Ralink/config.arch" ] ; then + echo "Project product dir not found! Terminate." + exit 1 +fi + +if [ ! -d "$ROOTDIR/$CONFIG_LINUXDIR" ] ; then + echo "Project Linux Kernel dir ($CONFIG_LINUXDIR) not found! Terminate." + exit 1 +fi + +board_h="$ROOTDIR/configs/boards/$CONFIG_FIRMWARE_PRODUCT_ID/board.h" +board_mk="$ROOTDIR/configs/boards/$CONFIG_FIRMWARE_PRODUCT_ID/board.mk" +kernel_cd="$ROOTDIR/configs/boards/$CONFIG_FIRMWARE_PRODUCT_ID" +kernel_tf="$ROOTDIR/$CONFIG_LINUXDIR/.config" + +if [ "$CONFIG_FIRMWARE_TYPE_ROOTFS_IN_RAM" = "y" ] ; then + kernel_cf="${kernel_cd}/kernel-${kernel_id}.ram.config" +elif [ -n "$CONFIG_FIRMWARE_KERNEL_CONFIG" ]; then + kernel_cf="${kernel_cd}/$CONFIG_FIRMWARE_KERNEL_CONFIG" +else + kernel_cf="${kernel_cd}/kernel-${kernel_id}.config" +fi + +if [ ! -f "$kernel_cf" ] ; then + echo "Target kernel config ($kernel_cf) not found! Terminate." + exit 1 +fi + +if [ ! -f "$busybox_cf" ] ; then + echo "Target BusyBox config ($busybox_cf) not found! Terminate." + exit 1 +fi + +if [ ! -f "$board_h" ] ; then + echo "Target board header ($board_h) not found! Terminate." + exit 1 +fi + +if [ ! -f "$board_mk" ] ; then + echo "Target board descriptor ($board_mk) not found! Terminate." + exit 1 +fi + +rm -rf $ROOTDIR/romfs +rm -rf $ROOTDIR/images +mkdir -p $ROOTDIR/romfs +mkdir -p $ROOTDIR/images + +# load source kernel config +. "$kernel_cf" + +echo --------------------------COPY-CONFIG----------------------------- +######################### FOR-ALL-DEVICES ############################# +ln -sf vendors/Ralink/config.arch config.arch +cp -fL "$kernel_cf" "$kernel_tf" +cp -fL "$busybox_cf" "$busybox_tf" +cp -fL "$board_mk" "$ROOTDIR/user/shared/board.mk" +cp -fL "$board_h" "$ROOTDIR/user/shared/include/ralink_board.h" +############################# SMP ##################################### +if [ -n "$CONFIG_SMP" ] ; then + func_enable_busybox_param "CONFIG_FEATURE_TOP_SMP_CPU" + func_enable_busybox_param "CONFIG_FEATURE_TOP_SMP_PROCESS" +fi +############################# RTC ##################################### +if [ -n "$CONFIG_RTC_CLASS" ] ; then + func_enable_busybox_param "CONFIG_HWCLOCK" +fi +# SFE +if [ "$CONFIG_FIRMWARE_INCLUDE_SFE" = "y" ] ; then + func_enable_kernel_param "CONFIG_SHORTCUT_FE" +fi +# wireguard +if [ "$CONFIG_FIRMWARE_INCLUDE_WIREGUARD" = "y" ]; then + func_enable_kernel_param "CONFIG_WIREGUARD" +else + func_disable_kernel_param "CONFIG_WIREGUARD" +fi +# SQM QOS +if [ "$CONFIG_FIRMWARE_INCLUDE_SQM" = "y" ]; then + func_enable_kernel_param "CONFIG_NF_CONNTRACK_EVENTS" + sed -i "/CONFIG_NF_CONNTRACK_EVENTS=y/a\CONFIG_NF_CONNTRACK_CHAIN_EVENTS=y" $kernel_tf + func_enable_kernel_param "CONFIG_NF_CONNTRACK_TIMEOUT" + func_enable_kernel_param "CONFIG_NET_SCH_SFQ" "m" + sed -i "/CONFIG_NET_SCH_SFQ=m/a\CONFIG_NET_SCH_CAKE=m" $kernel_tf + func_enable_kernel_param "CONFIG_NET_SCH_CODEL" "m" + func_enable_kernel_param "CONFIG_NET_ACT_IPT" "m" + func_enable_kernel_param "CONFIG_IFB" +fi +#cpu超频 +if [ "$CONFIG_FIRMWARE_INCLUDE_OC" = "y" ]; then + sed -i "/CONFIG_RALINK_MT7621=y/a\CONFIG_MT7621_OC=y" $kernel_tf + sed -i '/CONFIG_MT7621_OC=y/a\CONFIG_MT7621_CPU_FREQ="'$CONFIG_FIRMWARE_MT7621_OC'"' $kernel_tf +fi + +############################# USB ##################################### +if [ "$CONFIG_FIRMWARE_ENABLE_USB" != "y" ] || [ -z "$CONFIG_USB_SUPPORT" ] ; then + func_disable_busybox_param "CONFIG_FDISK" + func_disable_busybox_param "CONFIG_FEATURE_FDISK_WRITABLE" + func_disable_busybox_param "CONFIG_FEATURE_FDISK_ADVANCED" + func_disable_busybox_param "CONFIG_MICROCOM" + func_disable_busybox_param "CONFIG_EJECT" + func_disable_busybox_param "CONFIG_FEATURE_EJECT_SCSI" + func_disable_busybox_param "CONFIG_MKSWAP" + func_disable_busybox_param "CONFIG_SWAPONOFF" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_FAT" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_EXFAT" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_NTFS" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_HFS" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_EXT" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_XFS" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_LINUXSWAP" +else +if [ "$CONFIG_FIRMWARE_ENABLE_UFSD" != "y" ] || [ $paragon_hfsplus -eq 0 ] ; then + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_HFS" +fi +############################ exFAT #################################### +if [ "$CONFIG_FIRMWARE_ENABLE_EXFAT" != "y" ] ; then + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_EXFAT" +fi +############################# XFS ##################################### +if [ "$CONFIG_FIRMWARE_ENABLE_XFS" != "y" ] ; then + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_XFS" +fi +############################# SWAP #################################### +if [ "$CONFIG_FIRMWARE_ENABLE_SWAP" != "y" ] ; then + func_disable_busybox_param "CONFIG_MKSWAP" + func_disable_busybox_param "CONFIG_SWAPONOFF" +fi +fi +############################# XFRM #################################### +#if [ "$CONFIG_FIRMWARE_INCLUDE_SSWAN" = "y" ] ; then +# CONFIG_FIRMWARE_INCLUDE_XFRM=y +#fi +echo --------------------------MAKE-DEP-------------------------------- +make dep +echo --------------------------MAKE-ALL-------------------------------- +make diff --git a/meIsreallyba/modify/user/www/Makefile b/meIsreallyba/modify/user/www/Makefile new file mode 100644 index 00000000..bfbe53cc --- /dev/null +++ b/meIsreallyba/modify/user/www/Makefile @@ -0,0 +1,190 @@ +ifndef ROOTDIR +ROOTDIR=../.. +endif + +ROMFS_DIR = $(ROOTDIR)/romfs + +include $(ROOTDIR)/user/shared/boards.mk + +PROJECT_HOME_URL="https:\/\/github.com\/hanwckf\/padavan-4.4\/" +PROJECT_HOME_URL_MOD="https:\/\/github.com\/TurBoTse\/padavan-4.4\/" + +LABEL_COPYRIGHT_TEXT='© 2011-2022 Padavan<\/a> \& N56U project community \& by TurBoTse<\/a>' + +BOARD_PATTERN=s/ZVMODELVZ/$(CONFIG_FIRMWARE_PRODUCT_ID)/g +COPYR_PATTERN=s/ZVCOPYRVZ/$(LABEL_COPYRIGHT_TEXT)/g +DWURL_PATTERN=s/ZVDWURLVZ/$(PROJECT_HOME_URL)/g +DWURL_MOD_PATTERN=s/ZVMODWURLVZ/$(PROJECT_HOME_URL_MOD)/g + +WEBUI_NAME=n56u_ribbon_fixed + +all: + +romfs: + echo "Make www romfs" + rm -Rf $(ROMFS_DIR)/www + cp -R $(WEBUI_NAME) $(ROMFS_DIR)/www + rm -f $(ROMFS_DIR)/www/httpd_check.htm + echo "ASUSTeK" > $(ROMFS_DIR)/www/httpd_check.htm + cd $(ROMFS_DIR)/www && ln -sf /opt/share/www/custom custom + cp dict/EN.header $(ROMFS_DIR)/www +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_BR),y) + echo "LANG_BR=Brazil" >> $(ROMFS_DIR)/www/EN.header + cp dict/BR.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_CZ),y) + echo "LANG_CZ=Česky" >> $(ROMFS_DIR)/www/EN.header + cp dict/CZ.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_DA),y) + echo "LANG_DA=Dansk" >> $(ROMFS_DIR)/www/EN.header + cp dict/DA.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_DE),y) + echo "LANG_DE=Deutsch" >> $(ROMFS_DIR)/www/EN.header + cp dict/DE.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_ES),y) + echo "LANG_ES=Español" >> $(ROMFS_DIR)/www/EN.header + cp dict/ES.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_FI),y) + echo "LANG_FI=Finsk" >> $(ROMFS_DIR)/www/EN.header + cp dict/FI.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_FR),y) + echo "LANG_FR=Français" >> $(ROMFS_DIR)/www/EN.header + cp dict/FR.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_NO),y) + echo "LANG_NO=Norsk" >> $(ROMFS_DIR)/www/EN.header + cp dict/NO.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_PL),y) + echo "LANG_PL=Polski" >> $(ROMFS_DIR)/www/EN.header + cp dict/PL.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_RU),y) + echo "LANG_RU=Pусский" >> $(ROMFS_DIR)/www/EN.header + cp dict/RU.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_SV),y) + echo "LANG_SV=Svensk" >> $(ROMFS_DIR)/www/EN.header + cp dict/SV.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_UK),y) + echo "LANG_UK=Українська" >> $(ROMFS_DIR)/www/EN.header + cp dict/UK.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_CN),y) + echo "LANG_CN=简体中文" >> $(ROMFS_DIR)/www/EN.header + cp dict/CN.dict $(ROMFS_DIR)/www +endif + cat $(ROMFS_DIR)/www/EN.header dict/EN.footer > $(ROMFS_DIR)/www/EN.dict + sed $(BOARD_PATTERN) -i $(ROMFS_DIR)/www/*.dict + sed $(COPYR_PATTERN) -i $(ROMFS_DIR)/www/*.dict + sed $(DWURL_PATTERN) -i $(ROMFS_DIR)/www/*.dict + sed $(DWURL_MOD_PATTERN) -i $(ROMFS_DIR)/www/*.dict + rm -f $(ROMFS_DIR)/www/EN.header + rm -f $(ROMFS_DIR)/www/bootstrap/js/bootstrap.js + rm -f $(ROMFS_DIR)/www/bootstrap/js/engage.itoggle.js + rm -f $(ROMFS_DIR)/www/bootstrap/js/jquery.backgroundpos.min.js + rm -f $(ROMFS_DIR)/www/bootstrap/js/jquery.easing.1.3.js + rm -f $(ROMFS_DIR)/www/bootstrap/css/bootstrap.css +ifeq ($(BOARD_HAS_2G_RADIO),0) + rm -f $(INSTALLDIR)/www/Advanced_ACL2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WAdvanced2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WGuest2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_Wireless2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WMode2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WSecurity2g_Content.asp + rm -f $(INSTALLDIR)/www/Main_WStatus2g_Content.asp + rm -f $(INSTALLDIR)/www/wireless_2g.js + rm -f $(INSTALLDIR)/www/wds_aplist_2g.asp + rm -f $(INSTALLDIR)/www/device-map/router2g.asp +endif +ifeq ($(BOARD_HAS_5G_RADIO),0) + rm -f $(INSTALLDIR)/www/Advanced_ACL_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WAdvanced_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WGuest_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_Wireless_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WMode_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WSecurity_Content.asp + rm -f $(INSTALLDIR)/www/Main_WStatus_Content.asp + rm -f $(INSTALLDIR)/www/wireless.js + rm -f $(INSTALLDIR)/www/wds_aplist.asp + rm -f $(INSTALLDIR)/www/device-map/router.asp +endif +ifndef CONFIG_IPV6 + rm -f $(INSTALLDIR)/www/Advanced_IPv6_Content.asp +endif +ifndef CONFIG_ATA + rm -f $(INSTALLDIR)/www/device-map/sata.asp +endif +ifndef CONFIG_USB_SUPPORT + rm -f $(INSTALLDIR)/www/Advanced_Modem_others.asp + rm -f $(INSTALLDIR)/www/Advanced_Printer_others.asp + rm -f $(INSTALLDIR)/www/modem_isp.js + rm -f $(INSTALLDIR)/www/device-map/modem.asp + rm -f $(INSTALLDIR)/www/device-map/printer.asp + rm -f $(INSTALLDIR)/www/device-map/hub.asp +endif +ifneq ($(STORAGE_ENABLED),y) + rm -f $(INSTALLDIR)/www/Advanced_AiDisk_ftp.asp + rm -f $(INSTALLDIR)/www/Advanced_AiDisk_others.asp + rm -f $(INSTALLDIR)/www/Advanced_AiDisk_samba.asp + rm -f $(INSTALLDIR)/www/aidisk.asp + rm -f $(INSTALLDIR)/www/disk_folder_tree.js + rm -f $(INSTALLDIR)/www/device-map/disk.asp + rm -f $(INSTALLDIR)/www/device-map/safely_remove_disk.asp + rm -rf $(INSTALLDIR)/www/aidisk + rm -rf $(INSTALLDIR)/www/images/AiDisk + rm -rf $(INSTALLDIR)/www/images/Tree +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_SCUTCLIENT),y) + rm -f $(INSTALLDIR)/www/scutclient.asp + rm -f $(INSTALLDIR)/www/scutclient_log.asp + rm -f $(INSTALLDIR)/www/scutclient_action.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_ADGUARDHOME),y) + rm -f $(INSTALLDIR)/www/Advanced_adguardhome.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_MENTOHUST),y) + rm -f $(INSTALLDIR)/www/mentohust.asp + rm -f $(INSTALLDIR)/www/mentohust_log.asp + rm -f $(INSTALLDIR)/www/mentohust_action.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_DNSFORWARDER),y) + rm -f $(INSTALLDIR)/www/dns-forwarder.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS),y) + rm -f $(INSTALLDIR)/www/Shadowsocks.asp + rm -f $(INSTALLDIR)/www/Shadowsocks_action.asp + rm -f $(INSTALLDIR)/www/Shadowsocks_log.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_ADBYBY),y) + rm -f $(INSTALLDIR)/www/Advanced_adbyby.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_ALIDDNS),y) + rm -f $(INSTALLDIR)/www/Advanced_aliddns.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_ZEROTIER),y) + rm -f $(INSTALLDIR)/www/Advanced_zerotier.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_DDNSTO),y) + rm -f $(INSTALLDIR)/www/Advanced_ddnsto.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_WIREGUARD),y) + rm -f $(INSTALLDIR)/www/Advanced_wireguard.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_ALDRIVER),y) + rm -f $(INSTALLDIR)/www/Advanced_aliyundrive.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_SQM),y) + rm -f $(INSTALLDIR)/www/Advanced_SQM.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_SMARTDNS),y) + rm -f $(INSTALLDIR)/www/Advanced_smartdns.asp +endif +clean: + @echo "Clean www romfs" diff --git a/meIsreallyba/modify/user/www/n56u_ribbon_fixed/bootstrap/img/asus_logo.png b/meIsreallyba/modify/user/www/n56u_ribbon_fixed/bootstrap/img/asus_logo.png new file mode 100644 index 00000000..dd0ebf82 Binary files /dev/null and b/meIsreallyba/modify/user/www/n56u_ribbon_fixed/bootstrap/img/asus_logo.png differ diff --git a/meIsreallyba/scripts/K2P.sh b/meIsreallyba/scripts/K2P.sh new file mode 100644 index 00000000..aba83dfc --- /dev/null +++ b/meIsreallyba/scripts/K2P.sh @@ -0,0 +1,38 @@ +##################################################################### +# cd /opt/rt-n56u/trunk 执行在这个目录下 +# +# 修改默认参数(不同设备拷贝到相应 *.sh) by: TurBoTse +##################################################################### + +lan_ip="192.168.6" # LAN 地址 别写后面的 .1 +default_path="./user/shared" # 默认配置路径 +config="./configs/templates/K2P.config" # 默认配置文件 + +echo "修改 LAN IP 地址" +sed -i "s/192.168.2/$lan_ip/g" $default_path/defaults.h + +#echo "设置为PPPOE模式并写入账号和密码" +#sed -i 's/{ "wan_proto", "dhcp" }/{ "wan_proto", "pppoe" }/g' $default_path/defaults.c +#sed -i 's/{ "wan_pppoe_username", "" }/{ "wan_pppoe_username", "你的宽带账号" }/g' $default_path/defaults.c +#sed -i 's/{ "wan_pppoe_passwd", "" }/{ "wan_pppoe_passwd", "宽带密码" }/g' $default_path/defaults.c + +#echo "设置为 AP模式" +#echo "#define BOARD_ROLE_REPEATER 1" >> ./configs/boards/K2P/board.h + +#echo "打开2G无线桥接" +#sed -i 's/{ "rt_mode_x", "0" }/{ "rt_mode_x", "4" }/g' $default_path/defaults.c + +#echo "打开5G无线桥接" +#sed -i 's/{ "wl_mode_x", "0" }/{ "wl_mode_x", "4" }/g' $default_path/defaults.c + +#CPU超频 +#echo "CONFIG_FIRMWARE_INCLUDE_OC=n" >> $config #CPU超频开关 +#echo 'CONFIG_FIRMWARE_MT7621_OC="0x312"' >> $config #此处填写对应频率的十六进制:1000Mhz=0x312 1100Mhz=0x362 1120Mhz=0x372 1200Mhz=0x3B2 + +#echo "集成科学插件" +#grep "CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS=n" $config +#if [ $? -eq 0 ]; then +# for MOD in SHADOWSOCKS XRAY TROJAN SSOBFS IPSET EAP_PEAP OPENSSH OPENSSL_EC OPENSSL_EXE CURL; do +# sed -i "s/CONFIG_FIRMWARE_INCLUDE_${MOD}=n/CONFIG_FIRMWARE_INCLUDE_${MOD}=y/g" $config +# done +#fi diff --git a/meIsreallyba/scripts/R2100.sh b/meIsreallyba/scripts/R2100.sh new file mode 100644 index 00000000..f09191b8 --- /dev/null +++ b/meIsreallyba/scripts/R2100.sh @@ -0,0 +1,38 @@ +##################################################################### +# cd /opt/rt-n56u/trunk 执行在这个目录下 +# +# 修改默认参数(不同设备拷贝到相应 *.sh) by: TurBoTse +##################################################################### + +lan_ip="192.168.3" # LAN 地址 别写后面的 .1 +default_path="./user/shared" # 默认配置路径 +config="./configs/templates/R2100.config" # 默认配置文件 + +echo "修改 LAN IP 地址" +sed -i "s/192.168.2/$lan_ip/g" $default_path/defaults.h + +#echo "设置为PPPOE模式并写入账号和密码" +#sed -i 's/{ "wan_proto", "dhcp" }/{ "wan_proto", "pppoe" }/g' $default_path/defaults.c +#sed -i 's/{ "wan_pppoe_username", "" }/{ "wan_pppoe_username", "你的宽带账号" }/g' $default_path/defaults.c +#sed -i 's/{ "wan_pppoe_passwd", "" }/{ "wan_pppoe_passwd", "宽带密码" }/g' $default_path/defaults.c + +#echo "设置为 AP模式" +#echo "#define BOARD_ROLE_REPEATER 1" >> ./configs/boards/R2100/board.h + +#echo "打开2G无线桥接" +#sed -i 's/{ "rt_mode_x", "0" }/{ "rt_mode_x", "4" }/g' $default_path/defaults.c + +#echo "打开5G无线桥接" +#sed -i 's/{ "wl_mode_x", "0" }/{ "wl_mode_x", "4" }/g' $default_path/defaults.c + +#CPU超频 +#echo "CONFIG_FIRMWARE_INCLUDE_OC=n" >> $config #CPU超频开关 +#echo 'CONFIG_FIRMWARE_MT7621_OC="0x312"' >> $config #此处填写对应频率的十六进制:1000Mhz=0x312 1100Mhz=0x362 1120Mhz=0x372 1200Mhz=0x3B2 + +#echo "集成科学插件" +#grep "CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS=n" $config +#if [ $? -eq 0 ]; then +# for MOD in SHADOWSOCKS XRAY TROJAN SSOBFS IPSET EAP_PEAP OPENSSH OPENSSL_EC OPENSSL_EXE CURL; do +# sed -i "s/CONFIG_FIRMWARE_INCLUDE_${MOD}=n/CONFIG_FIRMWARE_INCLUDE_${MOD}=y/g" $config +# done +#fi \ No newline at end of file diff --git a/meIsreallyba/scripts/README.md b/meIsreallyba/scripts/README.md new file mode 100644 index 00000000..629eec35 --- /dev/null +++ b/meIsreallyba/scripts/README.md @@ -0,0 +1,3 @@ +# README + +存放设备的执行脚本 例如: K2P.sh \ No newline at end of file diff --git a/meIsreallyba/scripts/public.sh b/meIsreallyba/scripts/public.sh new file mode 100644 index 00000000..cb997966 --- /dev/null +++ b/meIsreallyba/scripts/public.sh @@ -0,0 +1,47 @@ +##################################################################### +# cd /opt/rt-n56u/trunk 执行在这个目录下 +# +# 修改默认参数(不同设备拷贝到相应 *.sh) by: TurBoTse +##################################################################### + +user_name="admin" # 用户名 +user_password="admin" # 登录密码 +lan_ip="192.168.2" # LAN 地址 别写后面的 .1 +wlan_2g_ssid="Padavan" # 2G 无线名称 +wlan_5g_ssid="Padavan_5G" # 5G 无线名称 +wlan_guest_2g_ssid="Padavan_Guset" # 2G 访客无线名称 +wlan_guest_5g_ssid="Padavan_Guest_5G" # 5G 访客无线名称 +wlan_2g_psk="1234567890" # 2G WIFI密码最少8位 空白为不设置 +wlan_5g_psk="1234567890" # 5G WIFI密码最少8位 空白为不设置 +version_time=$(date +%Y%m%d) # 更新时版本号时间: 20210101 +default_file="./user/shared/defaults.h" # 默认配置文件 + +echo "修改用户名" +sed -i 's/SYS_USER_ROOT "admin"/SYS_USER_ROOT "'$user_name'"/g' $default_file + +echo "修改登陆密码" +sed -i 's/DEF_ROOT_PASSWORD "admin"/DEF_ROOT_PASSWORD "'$user_password'"/g' $default_file + +echo "修改 LAN IP 地址" +sed -i "s/192.168.2/$lan_ip/g" $default_file + +echo "修改 2G 无线名称" +sed -i 's/DEF_WLAN_2G_SSID BOARD_PID "_%s"/DEF_WLAN_2G_SSID "'$wlan_2g_ssid'"/g' $default_file + +echo "修改 5G 无线名称" +sed -i 's/DEF_WLAN_5G_SSID BOARD_PID "_5G_%s"/DEF_WLAN_5G_SSID "'$wlan_5g_ssid'"/g' $default_file + +echo "修改 2G 访客无线名称" +sed -i 's/DEF_WLAN_2G_GSSID BOARD_PID "_GUEST_%s"/DEF_WLAN_2G_GSSID "'$wlan_guest_2g_ssid'"/g' $default_file + +echo "修改 5G 访客无线名称" +sed -i 's/DEF_WLAN_5G_GSSID BOARD_PID "_GUEST_5G_%s"/DEF_WLAN_5G_GSSID "'$wlan_guest_5g_ssid'"/g' $default_file + +echo "修改 2.4GHz WIFI 密码" +sed -i 's/DEF_WLAN_2G_PSK "1234567890"/DEF_WLAN_2G_PSK "'$wlan_2g_psk'"/g' $default_file + +echo "修改 5GHz WIFI 密码" +sed -i 's/DEF_WLAN_5G_PSK "1234567890"/DEF_WLAN_5G_PSK "'$wlan_5g_psk'"/g' $default_file + +echo "更新版本号时间" +sed -i "s/FIRMWARE_BUILDS_REV=.*/FIRMWARE_BUILDS_REV=$version_time/g" ./versions.inc diff --git a/public/README.md b/public/README.md new file mode 100644 index 00000000..fe0952df --- /dev/null +++ b/public/README.md @@ -0,0 +1,9 @@ +# README + +存放修改的脚本和配置文件 + +例如: + +K2P.sh + +K2P.config diff --git a/vb1980/README.md b/vb1980/README.md new file mode 100644 index 00000000..33fc1414 --- /dev/null +++ b/vb1980/README.md @@ -0,0 +1,7 @@ +# README + +config 存放设备适配文件 *.config + +modify 存放要修改的文件( 注意存放路径要对应 ) + +scripts 存放设备执行脚本 *.sh diff --git a/vb1980/config/README.md b/vb1980/config/README.md new file mode 100644 index 00000000..6823b8fb --- /dev/null +++ b/vb1980/config/README.md @@ -0,0 +1,3 @@ +# README + +存放设备的适配文件 例如: K2P.config \ No newline at end of file diff --git a/vb1980/modify/build_firmware_modify b/vb1980/modify/build_firmware_modify new file mode 100644 index 00000000..dbcf54d7 --- /dev/null +++ b/vb1980/modify/build_firmware_modify @@ -0,0 +1,481 @@ +#!/bin/bash + +if [ -z "$1" ] || [ "$EUID" != 0 ]; then + echo "Please run 'fakeroot $0 PRODUCT_NAME' to start build (see 'configs/templates/')" + echo "For Windows Subsystem for Linux(WSL), use 'fakeroot-tcp' instead of 'fakeroot', or run with sudo" + exit 1 +fi + +if [ ! -f configs/templates/$1.config ] ; then + echo "configs/templates/$1.config not found!" + exit 1 +fi + +cp -f configs/templates/$1.config .config + +ROOTDIR=`pwd` +export ROOTDIR=$ROOTDIR + +kernel_id="3.4.x" +kernel_cf="" +kernel_tf="" +busybox_id="1.34.1" +busybox_cf="$ROOTDIR/configs/boards/busybox_${busybox_id}.config" +busybox_tf="$ROOTDIR/user/busybox/busybox-${busybox_id}/.config" +board_h="" +board_mk="" +paragon_hfsplus=0 + +func_enable_kernel_param() +{ + if [ -n "`grep \^\"\# $1 is not set\" $kernel_tf`" ] ; then + sed -i "s/\# $1 is not set/$1=y/" $kernel_tf + fi +} + +func_disable_kernel_param() +{ + if [ -n "`grep \^$1=y $kernel_tf`" ] ; then + sed -i "s/$1=y/\# $1 is not set/" $kernel_tf + elif [ -n "`grep \^$1=m $kernel_tf`" ] ; then + sed -i "s/$1=m/\# $1 is not set/" $kernel_tf + fi +} + +func_enable_busybox_param() +{ + if [ -n "`grep \^\"\# $1 is not set\" $busybox_tf`" ] ; then + sed -i "s/\# $1 is not set/$1=y/" $busybox_tf + fi +} + +func_disable_busybox_param() +{ + if [ -n "`grep \^$1=y $busybox_tf`" ] ; then + sed -i "s/$1=y/\# $1 is not set/" $busybox_tf + fi +} +. $ROOTDIR/toolchain.inc +echo "CONFIG_TOOLCHAIN_DIR=${CONFIG_TOOLCHAIN_DIR}" >> .config + +# load project root config +. $ROOTDIR/.config + +if [ ! -f "$ROOTDIR/vendors/Ralink/config.arch" ] ; then + echo "Project product dir not found! Terminate." + exit 1 +fi + +if [ ! -d "$ROOTDIR/$CONFIG_LINUXDIR" ] ; then + echo "Project Linux Kernel dir ($CONFIG_LINUXDIR) not found! Terminate." + exit 1 +fi + +board_h="$ROOTDIR/configs/boards/$CONFIG_FIRMWARE_PRODUCT_ID/board.h" +board_mk="$ROOTDIR/configs/boards/$CONFIG_FIRMWARE_PRODUCT_ID/board.mk" +kernel_cd="$ROOTDIR/configs/boards/$CONFIG_FIRMWARE_PRODUCT_ID" +kernel_tf="$ROOTDIR/$CONFIG_LINUXDIR/.config" + +if [ "$CONFIG_FIRMWARE_TYPE_ROOTFS_IN_RAM" = "y" ] ; then + kernel_cf="${kernel_cd}/kernel-${kernel_id}.ram.config" +elif [ -n "$CONFIG_FIRMWARE_KERNEL_CONFIG" ]; then + kernel_cf="${kernel_cd}/$CONFIG_FIRMWARE_KERNEL_CONFIG" +else + kernel_cf="${kernel_cd}/kernel-${kernel_id}.config" +fi + +if [ ! -f "$kernel_cf" ] ; then + echo "Target kernel config ($kernel_cf) not found! Terminate." + exit 1 +fi + +if [ ! -f "$busybox_cf" ] ; then + echo "Target BusyBox config ($busybox_cf) not found! Terminate." + exit 1 +fi + +if [ ! -f "$board_h" ] ; then + echo "Target board header ($board_h) not found! Terminate." + exit 1 +fi + +if [ ! -f "$board_mk" ] ; then + echo "Target board descriptor ($board_mk) not found! Terminate." + exit 1 +fi + +rm -rf $ROOTDIR/romfs +rm -rf $ROOTDIR/images +mkdir -p $ROOTDIR/romfs +mkdir -p $ROOTDIR/images + +# load source kernel config +. "$kernel_cf" + +echo --------------------------COPY-CONFIG----------------------------- +######################### FOR-ALL-DEVICES ############################# +ln -sf vendors/Ralink/config.arch config.arch +cp -fL "$kernel_cf" "$kernel_tf" +cp -fL "$busybox_cf" "$busybox_tf" +cp -fL "$board_mk" "$ROOTDIR/user/shared/board.mk" +cp -fL "$board_h" "$ROOTDIR/user/shared/include/ralink_board.h" +############################# WI-FI ################################### +dir_wifi_src="$ROOTDIR/proprietary/rt_wifi" +dir_wifi_dst="$ROOTDIR/$CONFIG_LINUXDIR/drivers/net/wireless/ralink" +dir_wifi_ver="2.7.X.X" +rm -rf "$dir_wifi_dst/rt2860v2" +rm -rf "$dir_wifi_dst/rt3090" +rm -rf "$dir_wifi_dst/rt5392" +rm -rf "$dir_wifi_dst/rt5592" +rm -rf "$dir_wifi_dst/rt3593" +rm -rf "$dir_wifi_dst/mt7610" +rm -rf "$dir_wifi_dst/mt76x2" +rm -rf "$dir_wifi_dst/mt76x3" +rm -rf "$dir_wifi_dst/mt7628" +rm -rf "$dir_wifi_dst/mt7615" +rm -rf "$dir_wifi_dst/mt7915" + +mkdir -p "$dir_wifi_dst/mt76x3" +cp -f "$dir_wifi_src/rtpci/4.1.X.X/mt76x3/Kconfig" "$dir_wifi_dst/mt76x3/Kconfig" +mkdir -p "$dir_wifi_dst/mt7615/embedded" +cp -f "$dir_wifi_src/rtpci/5.0.4.0/mt7615/embedded/Kconfig" "$dir_wifi_dst/mt7615/embedded/Kconfig" +mkdir -p "$dir_wifi_dst/mt7915/embedded" +cp -f "$dir_wifi_src/rtpci/7.3.0.1/mt7915/embedded/Kconfig" "$dir_wifi_dst/mt7915/embedded/Kconfig" + +if [ -n "$CONFIG_RT2860V2_AP" ] ; then + dir_wifi_ver="2.7.X.X" + if [ "$CONFIG_RALINK_RT3883" = "y" ] && [ "$CONFIG_FIRMWARE_WIFI5_DRIVER" = "2.4" ] ; then + dir_wifi_ver="2.4.X.X" + fi + if [ "$CONFIG_RALINK_MT7620" = "y" ] ; then + if [ "$CONFIG_FIRMWARE_WIFI2_DRIVER" = "3.0" ] && [ -n "$CONFIG_MT76X2_AP" ] ; then + func_disable_kernel_param "CONFIG_RT_FIRST_IF_RT2860" + func_enable_kernel_param "CONFIG_RT_FIRST_IF_MT7620" + CONFIG_RT_FIRST_IF_RT2860="" + else + func_enable_kernel_param "CONFIG_RT_FIRST_IF_RT2860" + func_disable_kernel_param "CONFIG_RT_FIRST_IF_MT7620" + CONFIG_RT_FIRST_IF_RT2860=y + fi + fi + if [ "$CONFIG_RT_FIRST_IF_RT2860" = "y" ] ; then + cp -rfL "$dir_wifi_src/rtsoc/$dir_wifi_ver/rt2860v2" "$dir_wifi_dst/" + cp -rfL "$dir_wifi_src/rtsoc/$dir_wifi_ver/rt2860v2_ap" "$dir_wifi_dst/" + fi +fi +if [ -n "$CONFIG_RT3090_AP" ] ; then + dir_wifi_ver="2.7.X.X" + if [ "$CONFIG_FIRMWARE_WIFI2_DRIVER" = "2.5" ] ; then + dir_wifi_ver="2.5.X.X" + fi + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/rt3090" "$dir_wifi_dst/" + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/rt3090_ap" "$dir_wifi_dst/" +fi +if [ -n "$CONFIG_RT5392_AP" ] ; then + dir_wifi_ver="2.7.X.X" + if [ "$CONFIG_FIRMWARE_WIFI2_DRIVER" = "2.5" ] ; then + dir_wifi_ver="2.5.X.X" + fi + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/rt5392" "$dir_wifi_dst/" + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/rt5392_ap" "$dir_wifi_dst/" +fi +if [ -n "$CONFIG_RT5592_AP" ] ; then + dir_wifi_ver="2.7.X.X" + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/rt5592" "$dir_wifi_dst/" + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/rt5592_ap" "$dir_wifi_dst/" +fi +if [ -n "$CONFIG_RT3593_AP" ] ; then + dir_wifi_ver="2.7.X.X" + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/rt3593" "$dir_wifi_dst/" + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/rt3593_ap" "$dir_wifi_dst/" +fi +if [ -n "$CONFIG_MT7610_AP" ] ; then + dir_wifi_ver="3.0.X.X" + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/mt7610" "$dir_wifi_dst/" + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/mt7610_ap" "$dir_wifi_dst/" +fi +if [ -n "$CONFIG_MT76X2_AP" ] ; then + dir_wifi_ver="3.0.X.X" + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/mt76x2" "$dir_wifi_dst/" + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/mt76x2_ap" "$dir_wifi_dst/" +fi +if [ -n "$CONFIG_MT76X3_AP" ] ; then + dir_wifi_ver="4.1.X.X" + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/mt76x3" "$dir_wifi_dst/" + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/mt76x3_ap" "$dir_wifi_dst/" +fi +if [ -n "$CONFIG_MT7628_AP" ] ; then + dir_wifi_ver="4.1.X.X" + cp -rfL "$dir_wifi_src/rtsoc/$dir_wifi_ver/mt7628" "$dir_wifi_dst/" + cp -rfL "$dir_wifi_src/rtsoc/$dir_wifi_ver/mt7628_ap" "$dir_wifi_dst/" +fi +if [ -n "$CONFIG_MT7615_AP" ] ; then + dir_wifi_ver="5.0.4.0" + if [ "$CONFIG_FIRMWARE_WIFI_DRIVER" = "4.4.2.1" ] || \ + [ "$CONFIG_FIRMWARE_WIFI2_DRIVER" = "4.4.2.1" ] || \ + [ "$CONFIG_FIRMWARE_WIFI5_DRIVER" = "4.4.2.1" ]; then + dir_wifi_ver="4.4.2.1" + fi + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/mt7615" "$dir_wifi_dst/" + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/mt7615_ap" "$dir_wifi_dst/" +fi +if [ -n "$CONFIG_MT7915_AP" ] ; then + dir_wifi_ver="7.3.0.1" + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/mt7915" "$dir_wifi_dst/" + cp -rfL "$dir_wifi_src/rtpci/$dir_wifi_ver/mt7915_ap" "$dir_wifi_dst/" +fi +############################ HWNAT #################################### +dir_ppe_src="$ROOTDIR/proprietary/rt_ppe" +dir_ppe_dst="$ROOTDIR/$CONFIG_LINUXDIR/net/nat" +rm -rf "$dir_ppe_dst/hw_nat" +cp -rf "$dir_ppe_src/hw_nat" "$dir_ppe_dst/" +############################ EIP93 #################################### +dir_eip_src="$ROOTDIR/proprietary/rt_eip" +dir_eip_dst="$ROOTDIR/$CONFIG_LINUXDIR/drivers/net" +if [ "$CONFIG_PRODUCT" = "MT7621" ] ; then + if [ -d "$dir_eip_src" ] ; then + rm -rf "$dir_eip_dst/rt_eip" + cp -rf "$dir_eip_src" "$dir_eip_dst/" + fi +fi +############################# CPU ##################################### +if [ "$CONFIG_FIRMWARE_CPU_SLEEP" = "y" -o "$CONFIG_RALINK_SYSTICK_COUNTER" = "y" ] ; then + func_enable_kernel_param "CONFIG_RALINK_SYSTICK_COUNTER" + func_enable_kernel_param "CONFIG_RALINK_CPUSLEEP" + func_enable_kernel_param "CONFIG_HZ_1000" + func_disable_kernel_param "CONFIG_HZ_250" + func_disable_kernel_param "CONFIG_HZ_100" + func_disable_kernel_param "CONFIG_CLKSRC_MIPS_GIC" + func_disable_kernel_param "CONFIG_HIGH_RES_TIMERS" +fi +if [ "$CONFIG_RALINK_MT7620" = "y" ] ; then + if [ "$CONFIG_FIRMWARE_CPU_600MHZ" = "y" ] ; then + func_enable_kernel_param "CONFIG_RALINK_MT7620_PLL600" + fi +fi +if [ "$CONFIG_RALINK_MT7621" = "y" ] ; then + if [ "$CONFIG_FIRMWARE_CPU_900MHZ" = "y" ] ; then + func_enable_kernel_param "CONFIG_RALINK_MT7621_PLL900" + fi + if [ "$CONFIG_FIRMWARE_RAM_MOD_256" = "y" ] ; then + func_disable_kernel_param "CONFIG_RT2880_DRAM_64M" + func_disable_kernel_param "CONFIG_RT2880_DRAM_128M" + func_enable_kernel_param "CONFIG_RT2880_DRAM_256M" + fi +fi +############################# SMP ##################################### +if [ -n "$CONFIG_SMP" ] ; then + func_enable_busybox_param "CONFIG_FEATURE_TOP_SMP_CPU" + func_enable_busybox_param "CONFIG_FEATURE_TOP_SMP_PROCESS" +fi +############################# RTC ##################################### +if [ -n "$CONFIG_RTC_CLASS" ] ; then + func_enable_busybox_param "CONFIG_HWCLOCK" +fi +############################# IPV6 #################################### +if [ "$CONFIG_FIRMWARE_ENABLE_IPV6" != "y" ] ; then + func_disable_kernel_param "CONFIG_INET_TUNNEL" + func_disable_kernel_param "CONFIG_IPV6" + func_disable_busybox_param "CONFIG_PING6" + func_disable_busybox_param "CONFIG_FEATURE_IPV6" + func_disable_busybox_param "CONFIG_FEATURE_PREFER_IPV4_ADDRESS" + func_disable_busybox_param "CONFIG_TRACEROUTE6" + func_disable_busybox_param "CONFIG_FEATURE_UDHCP_RFC5969" + func_disable_busybox_param "CONFIG_DHCP6C" + func_enable_busybox_param "CONFIG_IP" + func_enable_busybox_param "CONFIG_FEATURE_IP_ADDRESS" + func_enable_busybox_param "CONFIG_FEATURE_IP_LINK" + func_enable_busybox_param "CONFIG_FEATURE_IP_ROUTE" +fi +#SFE +if [ "$CONFIG_FIRMWARE_INCLUDE_SFE" = "y" ] ; then + func_enable_kernel_param "CONFIG_SHORTCUT_FE" + func_enable_kernel_param "CONFIG_NF_CONNTRACK_EVENTS" + func_enable_kernel_param "CONFIG_NF_CONNTRACK_CHAIN_EVENTS" +else + func_disable_kernel_param "CONFIG_SHORTCUT_FE" + func_disable_kernel_param "CONFIG_NF_CONNTRACK_EVENTS" + func_disable_kernel_param "CONFIG_NF_CONNTRACK_CHAIN_EVENTS" +fi +############################# USB ##################################### +if [ "$CONFIG_FIRMWARE_ENABLE_USB" != "y" ] || [ -z "$CONFIG_USB_SUPPORT" ] ; then + func_disable_busybox_param "CONFIG_FDISK" + func_disable_busybox_param "CONFIG_FEATURE_FDISK_WRITABLE" + func_disable_busybox_param "CONFIG_FEATURE_FDISK_ADVANCED" + func_disable_busybox_param "CONFIG_MICROCOM" + func_disable_busybox_param "CONFIG_EJECT" + func_disable_busybox_param "CONFIG_FEATURE_EJECT_SCSI" + func_disable_busybox_param "CONFIG_MKSWAP" + func_disable_busybox_param "CONFIG_SWAPONOFF" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_FAT" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_EXFAT" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_NTFS" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_HFS" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_EXT" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_XFS" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_LINUXSWAP" +else +############################# UFSD #################################### +if [ "$CONFIG_FIRMWARE_ENABLE_UFSD" != "y" ] ; then + func_disable_kernel_param "CONFIG_UFSD_FS" +fi +if [ "$CONFIG_FIRMWARE_ENABLE_UFSD" != "y" ] || [ $paragon_hfsplus -eq 0 ] ; then + func_disable_kernel_param "CONFIG_MAC_PARTITION" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_HFS" +fi +############################# FAT ##################################### +if [ "$CONFIG_FIRMWARE_ENABLE_FAT" != "y" ] ; then + func_disable_kernel_param "CONFIG_FAT_FS" + func_disable_kernel_param "CONFIG_MSDOS_FS" + func_disable_kernel_param "CONFIG_VFAT_FS" +fi +############################ exFAT #################################### +if [ "$CONFIG_FIRMWARE_ENABLE_EXFAT" != "y" ] ; then + func_disable_kernel_param "CONFIG_EXFAT_FS" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_EXFAT" +fi +############################# EXT2 #################################### +if [ "$CONFIG_FIRMWARE_ENABLE_EXT2" != "y" ] ; then + func_disable_kernel_param "CONFIG_EXT2_FS" +fi +############################# EXT3 #################################### +if [ "$CONFIG_FIRMWARE_ENABLE_EXT3" != "y" ] ; then + func_disable_kernel_param "CONFIG_EXT3_FS" +fi +############################# EXT4 #################################### +if [ "$CONFIG_FIRMWARE_ENABLE_EXT4" != "y" ] ; then + func_disable_kernel_param "CONFIG_EXT4_FS" +fi +############################# XFS ##################################### +if [ "$CONFIG_FIRMWARE_ENABLE_XFS" != "y" ] ; then + func_disable_kernel_param "CONFIG_XFS_FS" + func_disable_busybox_param "CONFIG_FEATURE_VOLUMEID_XFS" +fi +############################# FUSE #################################### +if [ "$CONFIG_FIRMWARE_ENABLE_FUSE" != "y" ] ; then + func_disable_kernel_param "CONFIG_FUSE_FS" +fi +############################# SWAP #################################### +if [ "$CONFIG_FIRMWARE_ENABLE_SWAP" != "y" ] ; then + func_disable_kernel_param "CONFIG_SWAP" + func_disable_busybox_param "CONFIG_MKSWAP" + func_disable_busybox_param "CONFIG_SWAPONOFF" +fi +############################# NFSD #################################### +# if [ "$CONFIG_FIRMWARE_INCLUDE_NFSD" != "y" ] ; then +# func_disable_kernel_param "CONFIG_NFSD" +# fi +############################# UVC ##################################### +#if [ "$CONFIG_FIRMWARE_INCLUDE_UVC" != "y" ] ; then +# func_disable_kernel_param "CONFIG_MEDIA_SUPPORT" +#fi +############################# HID ##################################### +if [ "$CONFIG_FIRMWARE_INCLUDE_HID" != "y" ] ; then + func_disable_kernel_param "CONFIG_INPUT" + func_disable_kernel_param "CONFIG_HID_SUPPORT" + func_disable_kernel_param "CONFIG_USB_HID" +fi +############################# UART #################################### +if [ "$CONFIG_FIRMWARE_INCLUDE_SERIAL" != "y" ] ; then + func_disable_kernel_param "CONFIG_USB_SERIAL_CH341" + func_disable_kernel_param "CONFIG_USB_SERIAL_PL2303" +fi +fi +############################# XFRM #################################### +if [ "$CONFIG_FIRMWARE_INCLUDE_SSWAN" = "y" ] ; then + CONFIG_FIRMWARE_INCLUDE_XFRM=y +fi +if [ "$CONFIG_PRODUCT" = "MT7621" ] ; then +if [ "$CONFIG_FIRMWARE_INCLUDE_XFRM" != "y" ] ; then + func_disable_kernel_param "CONFIG_XFRM" + func_disable_kernel_param "CONFIG_XFRM_USER" + func_disable_kernel_param "CONFIG_XFRM_IPCOMP" + func_disable_kernel_param "CONFIG_NET_KEY" + func_disable_kernel_param "CONFIG_INET_AH" + func_disable_kernel_param "CONFIG_INET_ESP" + func_disable_kernel_param "CONFIG_INET_IPCOMP" + func_disable_kernel_param "CONFIG_INET_XFRM_TUNNEL" + func_disable_kernel_param "CONFIG_INET_XFRM_MODE_TRANSPORT" + func_disable_kernel_param "CONFIG_INET_XFRM_MODE_TUNNEL" + func_disable_kernel_param "CONFIG_INET_XFRM_MODE_BEET" + func_disable_kernel_param "CONFIG_INET6_AH" + func_disable_kernel_param "CONFIG_INET6_ESP" + func_disable_kernel_param "CONFIG_INET6_IPCOMP" + func_disable_kernel_param "CONFIG_INET6_XFRM_TUNNEL" + func_disable_kernel_param "CONFIG_INET6_XFRM_MODE_TRANSPORT" + func_disable_kernel_param "CONFIG_INET6_XFRM_MODE_TUNNEL" + func_disable_kernel_param "CONFIG_INET6_XFRM_MODE_BEET" + func_disable_kernel_param "CONFIG_NETFILTER_XT_MATCH_ESP" + func_disable_kernel_param "CONFIG_NETFILTER_XT_MATCH_POLICY" + func_disable_kernel_param "CONFIG_IP_NF_MATCH_AH" + func_disable_kernel_param "CONFIG_IP6_NF_MATCH_AH" + func_disable_kernel_param "CONFIG_IPV6_MULTIPLE_TABLES" + func_disable_kernel_param "CONFIG_CRYPTO_AEAD" + func_disable_kernel_param "CONFIG_CRYPTO_AEAD2" + func_disable_kernel_param "CONFIG_CRYPTO_AUTHENC" + func_disable_kernel_param "CONFIG_CRYPTO_CBC" + func_disable_kernel_param "CONFIG_CRYPTO_HMAC" + func_disable_kernel_param "CONFIG_CRYPTO_MD5" + func_disable_kernel_param "CONFIG_CRYPTO_SHA256" + func_disable_kernel_param "CONFIG_CRYPTO_AES" + func_disable_kernel_param "CONFIG_CRYPTO_DES" + func_disable_kernel_param "CONFIG_CRYPTO_DEFLATE" +fi +fi +############################ IPSET #################################### +if [ "$CONFIG_FIRMWARE_INCLUDE_IPSET" != "y" ] ; then + func_disable_kernel_param "CONFIG_NETFILTER_NETLINK" +fi +############################# QOS ##################################### +if [ "$CONFIG_FIRMWARE_INCLUDE_QOS" != "y" ] ; then + func_disable_kernel_param "CONFIG_NET_SCHED" + func_disable_kernel_param "CONFIG_NET_CLS" + func_disable_kernel_param "CONFIG_NETFILTER_XT_TARGET_CLASSIFY" + func_disable_kernel_param "CONFIG_NETFILTER_XT_TARGET_IMQ" + func_disable_kernel_param "CONFIG_IMQ" +fi +############################# IMQ ##################################### +if [ "$CONFIG_FIRMWARE_INCLUDE_IMQ" != "y" ] ; then + func_disable_kernel_param "CONFIG_NETFILTER_XT_TARGET_IMQ" + func_disable_kernel_param "CONFIG_IMQ" +fi +############################# IFB ##################################### +if [ "$CONFIG_FIRMWARE_INCLUDE_IFB" != "y" ] ; then + func_disable_kernel_param "CONFIG_NET_SCH_INGRESS" + func_disable_kernel_param "CONFIG_NET_CLS_ACT" + func_disable_kernel_param "CONFIG_IFB" +fi +############################# NFSC #################################### +#if [ "$CONFIG_FIRMWARE_INCLUDE_NFSC" != "y" ] ; then +# func_disable_kernel_param "CONFIG_FSCACHE" +# func_disable_kernel_param "CONFIG_NFS_FS" +#fi +############################# CIFS #################################### +# if [ "$CONFIG_FIRMWARE_INCLUDE_CIFS" != "y" ] ; then +# func_disable_kernel_param "CONFIG_CIFS" +# func_disable_busybox_param "CONFIG_FEATURE_MOUNT_CIFS" +# fi +# if [ "$CONFIG_FIRMWARE_INCLUDE_SMBD" != "y" ] ; then +# func_disable_kernel_param "CONFIG_NETFILTER_FP_SMB" +# fi +# if [ "$CONFIG_FIRMWARE_INCLUDE_NFSD" != "y" -a "$CONFIG_FIRMWARE_INCLUDE_NFSC" != "y" -a "$CONFIG_FIRMWARE_INCLUDE_CIFS" != "y" ] ; then +# func_disable_kernel_param "CONFIG_NETWORK_FILESYSTEMS" +# if [ "$CONFIG_FIRMWARE_ENABLE_USB" != "y" ] || [ -z "$CONFIG_USB_SUPPORT" ] ; then +# func_disable_kernel_param "CONFIG_NLS" +# func_disable_kernel_param "CONFIG_LBDAF" +# fi +# fi +############################# USB AUDIO ############################### +# if [ "$CONFIG_FIRMWARE_INCLUDE_AUDIO" != "y" ] || [ "$CONFIG_FIRMWARE_ENABLE_USB" != "y" ] || [ -z "$CONFIG_USB_SUPPORT" ] ; then +# func_disable_kernel_param "CONFIG_FW_LOADER" +# func_disable_kernel_param "CONFIG_SOUND" +# fi +####################################################################### +if [ "$CONFIG_WITHOUT_KERNEL" != "y" ] ; then +echo --------------------------MAKE-DEP-------------------------------- +make dep +fi +if [ "$2" != "kmod" ] ; then +echo --------------------------MAKE-ALL-------------------------------- +make +fi diff --git a/vb1980/modify/user/www/Makefile b/vb1980/modify/user/www/Makefile new file mode 100644 index 00000000..cb6162ae --- /dev/null +++ b/vb1980/modify/user/www/Makefile @@ -0,0 +1,214 @@ +ifndef ROOTDIR +ROOTDIR=../.. +endif + +ROMFS_DIR = $(ROOTDIR)/romfs + +include $(ROOTDIR)/user/shared/boards.mk + +PROJECT_HOME_URL="https:\/\/github.com\/hanwckf\/rt-n56u\/" +PROJECT_HOME_URL_MOD="https:\/\/github.com\/TurBoTse\/rt-n56u\/" + +LABEL_COPYRIGHT_TEXT='© 2011-2022 Padavan<\/a> \& N56U project community \& by TurBoTse<\/a>' + +BOARD_PATTERN=s/ZVMODELVZ/$(CONFIG_FIRMWARE_PRODUCT_ID)/g +COPYR_PATTERN=s/ZVCOPYRVZ/$(LABEL_COPYRIGHT_TEXT)/g +DWURL_PATTERN=s/ZVDWURLVZ/$(PROJECT_HOME_URL)/g +DWURL_MOD_PATTERN=s/ZVMODWURLVZ/$(PROJECT_HOME_URL_MOD)/g + +WEBUI_NAME=n56u_ribbon_fixed + +all: + +romfs: + echo "Make www romfs" + rm -Rf $(ROMFS_DIR)/www + cp -R $(WEBUI_NAME) $(ROMFS_DIR)/www + rm -f $(ROMFS_DIR)/www/httpd_check.htm + echo "ASUSTeK" > $(ROMFS_DIR)/www/httpd_check.htm + cd $(ROMFS_DIR)/www && ln -sf /opt/share/www/custom custom + cp dict/EN.header $(ROMFS_DIR)/www +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_BR),y) + echo "LANG_BR=Brazil" >> $(ROMFS_DIR)/www/EN.header + cp dict/BR.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_CZ),y) + echo "LANG_CZ=Česky" >> $(ROMFS_DIR)/www/EN.header + cp dict/CZ.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_DA),y) + echo "LANG_DA=Dansk" >> $(ROMFS_DIR)/www/EN.header + cp dict/DA.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_DE),y) + echo "LANG_DE=Deutsch" >> $(ROMFS_DIR)/www/EN.header + cp dict/DE.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_ES),y) + echo "LANG_ES=Español" >> $(ROMFS_DIR)/www/EN.header + cp dict/ES.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_FI),y) + echo "LANG_FI=Finsk" >> $(ROMFS_DIR)/www/EN.header + cp dict/FI.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_FR),y) + echo "LANG_FR=Français" >> $(ROMFS_DIR)/www/EN.header + cp dict/FR.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_NO),y) + echo "LANG_NO=Norsk" >> $(ROMFS_DIR)/www/EN.header + cp dict/NO.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_PL),y) + echo "LANG_PL=Polski" >> $(ROMFS_DIR)/www/EN.header + cp dict/PL.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_RU),y) + echo "LANG_RU=Pусский" >> $(ROMFS_DIR)/www/EN.header + cp dict/RU.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_SV),y) + echo "LANG_SV=Svensk" >> $(ROMFS_DIR)/www/EN.header + cp dict/SV.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_UK),y) + echo "LANG_UK=Українська" >> $(ROMFS_DIR)/www/EN.header + cp dict/UK.dict $(ROMFS_DIR)/www +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_LANG_CN),y) + echo "LANG_CN=简体中文" >> $(ROMFS_DIR)/www/EN.header + cp dict/CN.dict $(ROMFS_DIR)/www +endif + cat $(ROMFS_DIR)/www/EN.header dict/EN.footer > $(ROMFS_DIR)/www/EN.dict + sed $(BOARD_PATTERN) -i $(ROMFS_DIR)/www/*.dict + sed $(COPYR_PATTERN) -i $(ROMFS_DIR)/www/*.dict + sed $(DWURL_PATTERN) -i $(ROMFS_DIR)/www/*.dict + sed $(DWURL_MOD_PATTERN) -i $(ROMFS_DIR)/www/*.dict + rm -f $(ROMFS_DIR)/www/EN.header + rm -f $(ROMFS_DIR)/www/bootstrap/js/bootstrap.js + rm -f $(ROMFS_DIR)/www/bootstrap/js/engage.itoggle.js + rm -f $(ROMFS_DIR)/www/bootstrap/js/jquery.backgroundpos.min.js + rm -f $(ROMFS_DIR)/www/bootstrap/js/jquery.easing.1.3.js + rm -f $(ROMFS_DIR)/www/bootstrap/css/bootstrap.css +ifeq ($(BOARD_HAS_2G_RADIO),0) + rm -f $(INSTALLDIR)/www/Advanced_ACL2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WAdvanced2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WGuest2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_Wireless2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WMode2g_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WSecurity2g_Content.asp + rm -f $(INSTALLDIR)/www/Main_WStatus2g_Content.asp + rm -f $(INSTALLDIR)/www/wireless_2g.js + rm -f $(INSTALLDIR)/www/wds_aplist_2g.asp + rm -f $(INSTALLDIR)/www/device-map/router2g.asp +endif +ifeq ($(BOARD_HAS_5G_RADIO),0) + rm -f $(INSTALLDIR)/www/Advanced_ACL_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WAdvanced_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WGuest_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_Wireless_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WMode_Content.asp + rm -f $(INSTALLDIR)/www/Advanced_WSecurity_Content.asp + rm -f $(INSTALLDIR)/www/Main_WStatus_Content.asp + rm -f $(INSTALLDIR)/www/wireless.js + rm -f $(INSTALLDIR)/www/wds_aplist.asp + rm -f $(INSTALLDIR)/www/device-map/router.asp +endif +ifndef CONFIG_IPV6 + rm -f $(INSTALLDIR)/www/Advanced_IPv6_Content.asp +endif +ifndef CONFIG_ATA + rm -f $(INSTALLDIR)/www/device-map/sata.asp +endif +ifndef CONFIG_USB_SUPPORT + rm -f $(INSTALLDIR)/www/Advanced_Modem_others.asp + rm -f $(INSTALLDIR)/www/Advanced_Printer_others.asp + rm -f $(INSTALLDIR)/www/modem_isp.js + rm -f $(INSTALLDIR)/www/device-map/modem.asp + rm -f $(INSTALLDIR)/www/device-map/printer.asp + rm -f $(INSTALLDIR)/www/device-map/hub.asp +endif +ifneq ($(STORAGE_ENABLED),y) + rm -f $(INSTALLDIR)/www/Advanced_AiDisk_ftp.asp + rm -f $(INSTALLDIR)/www/Advanced_AiDisk_others.asp + rm -f $(INSTALLDIR)/www/Advanced_AiDisk_samba.asp + rm -f $(INSTALLDIR)/www/aidisk.asp + rm -f $(INSTALLDIR)/www/disk_folder_tree.js + rm -f $(INSTALLDIR)/www/device-map/disk.asp + rm -f $(INSTALLDIR)/www/device-map/safely_remove_disk.asp + rm -rf $(INSTALLDIR)/www/aidisk + rm -rf $(INSTALLDIR)/www/images/AiDisk + rm -rf $(INSTALLDIR)/www/images/Tree +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_SCUTCLIENT),y) + rm -f $(INSTALLDIR)/www/scutclient.asp + rm -f $(INSTALLDIR)/www/scutclient_log.asp + rm -f $(INSTALLDIR)/www/scutclient_action.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_MENTOHUST),y) + rm -f $(INSTALLDIR)/www/mentohust.asp + rm -f $(INSTALLDIR)/www/mentohust_log.asp + rm -f $(INSTALLDIR)/www/mentohust_action.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_DNSFORWARDER),y) + rm -f $(INSTALLDIR)/www/dns-forwarder.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS),y) + rm -f $(INSTALLDIR)/www/Shadowsocks.asp + rm -f $(INSTALLDIR)/www/Shadowsocks_action.asp + rm -f $(INSTALLDIR)/www/Shadowsocks_log.asp +endif + +ifneq ($(CONFIG_FIRMWARE_INCLUDE_SOFTETHERVPN_SERVER),y) + rm -f $(INSTALLDIR)/www/vpnsrv.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_SOFTETHERVPN_CLIENT),y) + rm -f $(INSTALLDIR)/www/vpn_clients.asp + rm -f $(INSTALLDIR)/www/vpncli.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_ADBYBY),y) + rm -f $(INSTALLDIR)/www/Advanced_adbyby.asp + rm -f $(INSTALLDIR)/www/Ad_action.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_ALIDDNS),y) + rm -f $(INSTALLDIR)/www/Advanced_aliddns.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_ADGUARDHOME),y) + rm -f $(INSTALLDIR)/www/Advanced_adguardhome.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_KOOLPROXY),y) + rm -f $(INSTALLDIR)/www/Advanced_koolproxy.asp + rm -f $(INSTALLDIR)/www/Kp_action.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_CADDY),y) + rm -f $(INSTALLDIR)/www/Advanced_caddy.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_WYY),y) + rm -f $(INSTALLDIR)/www/Advanced_wyy.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_ZEROTIER),y) + rm -f $(INSTALLDIR)/www/Advanced_zerotier.asp +endif +ifeq ($(CONFIG_FIRMWARE_INCLUDE_FRPC)_$(CONFIG_FIRMWARE_INCLUDE_FRPS), n_n) + rm -f $(INSTALLDIR)/www/Advanced_frp.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_NVPPROXY),y) + rm -f $(INSTALLDIR)/www/Advanced_nvpproxy.asp +endif +#ifneq ($(CONFIG_FIRMWARE_INCLUDE_NPC),y) + rm -f $(INSTALLDIR)/www/Advanced_npc.asp + rm -f $(INSTALLDIR)/www/Advanced_npc_log.asp +#endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_DDNSTO),y) + rm -f $(INSTALLDIR)/www/Advanced_ddnsto.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_WIREGUARD),y) + rm -f $(INSTALLDIR)/www/Advanced_wireguard.asp +endif +ifneq ($(CONFIG_FIRMWARE_INCLUDE_ALDRIVER),y) + rm -f $(INSTALLDIR)/www/Advanced_aliyundrive.asp +endif + +clean: + @echo "Clean www romfs" diff --git a/vb1980/modify/user/www/n56u_ribbon_fixed/bootstrap/img/asus_logo.png b/vb1980/modify/user/www/n56u_ribbon_fixed/bootstrap/img/asus_logo.png new file mode 100644 index 00000000..dd0ebf82 Binary files /dev/null and b/vb1980/modify/user/www/n56u_ribbon_fixed/bootstrap/img/asus_logo.png differ diff --git a/vb1980/scripts/K2P.sh b/vb1980/scripts/K2P.sh new file mode 100644 index 00000000..ab801ff6 --- /dev/null +++ b/vb1980/scripts/K2P.sh @@ -0,0 +1,34 @@ +##################################################################### +# cd /opt/rt-n56u/trunk 执行在这个目录下 +# +# 修改默认参数(不同设备拷贝到相应 *.sh) by: TurBoTse +##################################################################### + +lan_ip="192.168.6" # LAN 地址 别写后面的 .1 +default_path="./user/shared" # 默认配置路径 +config="./configs/templates/K2P.config" # 默认配置文件 + +echo "修改 LAN IP 地址" +sed -i "s/192.168.2/$lan_ip/g" $default_path/defaults.h + +#echo "设置为PPPOE模式并写入账号和密码" +#sed -i 's/{ "wan_proto", "dhcp" }/{ "wan_proto", "pppoe" }/g' $default_path/defaults.c +#sed -i 's/{ "wan_pppoe_username", "" }/{ "wan_pppoe_username", "你的宽带账号" }/g' $default_path/defaults.c +#sed -i 's/{ "wan_pppoe_passwd", "" }/{ "wan_pppoe_passwd", "宽带密码" }/g' $default_path/defaults.c + +#echo "设置为AP模式" +#echo "#define BOARD_ROLE_REPEATER 1" >> ./configs/boards/K2P/board.h + +#echo "打开2G无线桥接" +#sed -i 's/{ "rt_mode_x", "0" }/{ "rt_mode_x", "4" }/g' $default_path/defaults.c + +#echo "打开5G无线桥接" +#sed -i 's/{ "wl_mode_x", "0" }/{ "wl_mode_x", "4" }/g' $default_path/defaults.c + +#echo "超频到 900MHz " +#sed -i '/CONFIG_FIRMWARE_CPU_900MHZ/d' $config +#echo "CONFIG_FIRMWARE_CPU_900MHZ=y" >> $config + +#echo "集成 KMS 激活服务器" +#sed -i "s/CONFIG_FIRMWARE_INCLUDE_VLMCSD=n/CONFIG_FIRMWARE_INCLUDE_VLMCSD=y/g" $config + diff --git a/vb1980/scripts/README.md b/vb1980/scripts/README.md new file mode 100644 index 00000000..629eec35 --- /dev/null +++ b/vb1980/scripts/README.md @@ -0,0 +1,3 @@ +# README + +存放设备的执行脚本 例如: K2P.sh \ No newline at end of file diff --git a/vb1980/scripts/go.sh b/vb1980/scripts/go.sh new file mode 100644 index 00000000..60e7f45e --- /dev/null +++ b/vb1980/scripts/go.sh @@ -0,0 +1,19 @@ +#!/bin/sh +goCacheRootDir="/opt/hostedtoolcache/go" +goVersions="/opt/goVersions.txt" +:> $goVersions +chmod 777 $goVersions +dir=$(ls -l "$goCacheRootDir" | sed '{1!G;h;$!d}' | awk '/^d/ {print $NF}') +for i in $dir +do +echo $i +echo $i >> $goVersions +done +new_ver=`sed -n '1p' $goVersions` +old_ver=`sed -n '3p' $goVersions` +echo "rm -rf $goCacheRootDir/$old_ver" +rm -rf $goCacheRootDir/$old_ver +#echo "mv $goCacheRootDir/$new_ver $goCacheRootDir/$old_ver" +#mv $goCacheRootDir/$new_ver $goCacheRootDir/$old_ver +echo "cp -rf $goCacheRootDir/$new_ver $goCacheRootDir/$old_ver" +cp -rf $goCacheRootDir/$new_ver $goCacheRootDir/$old_ver diff --git a/vb1980/scripts/public.sh b/vb1980/scripts/public.sh new file mode 100644 index 00000000..cb997966 --- /dev/null +++ b/vb1980/scripts/public.sh @@ -0,0 +1,47 @@ +##################################################################### +# cd /opt/rt-n56u/trunk 执行在这个目录下 +# +# 修改默认参数(不同设备拷贝到相应 *.sh) by: TurBoTse +##################################################################### + +user_name="admin" # 用户名 +user_password="admin" # 登录密码 +lan_ip="192.168.2" # LAN 地址 别写后面的 .1 +wlan_2g_ssid="Padavan" # 2G 无线名称 +wlan_5g_ssid="Padavan_5G" # 5G 无线名称 +wlan_guest_2g_ssid="Padavan_Guset" # 2G 访客无线名称 +wlan_guest_5g_ssid="Padavan_Guest_5G" # 5G 访客无线名称 +wlan_2g_psk="1234567890" # 2G WIFI密码最少8位 空白为不设置 +wlan_5g_psk="1234567890" # 5G WIFI密码最少8位 空白为不设置 +version_time=$(date +%Y%m%d) # 更新时版本号时间: 20210101 +default_file="./user/shared/defaults.h" # 默认配置文件 + +echo "修改用户名" +sed -i 's/SYS_USER_ROOT "admin"/SYS_USER_ROOT "'$user_name'"/g' $default_file + +echo "修改登陆密码" +sed -i 's/DEF_ROOT_PASSWORD "admin"/DEF_ROOT_PASSWORD "'$user_password'"/g' $default_file + +echo "修改 LAN IP 地址" +sed -i "s/192.168.2/$lan_ip/g" $default_file + +echo "修改 2G 无线名称" +sed -i 's/DEF_WLAN_2G_SSID BOARD_PID "_%s"/DEF_WLAN_2G_SSID "'$wlan_2g_ssid'"/g' $default_file + +echo "修改 5G 无线名称" +sed -i 's/DEF_WLAN_5G_SSID BOARD_PID "_5G_%s"/DEF_WLAN_5G_SSID "'$wlan_5g_ssid'"/g' $default_file + +echo "修改 2G 访客无线名称" +sed -i 's/DEF_WLAN_2G_GSSID BOARD_PID "_GUEST_%s"/DEF_WLAN_2G_GSSID "'$wlan_guest_2g_ssid'"/g' $default_file + +echo "修改 5G 访客无线名称" +sed -i 's/DEF_WLAN_5G_GSSID BOARD_PID "_GUEST_5G_%s"/DEF_WLAN_5G_GSSID "'$wlan_guest_5g_ssid'"/g' $default_file + +echo "修改 2.4GHz WIFI 密码" +sed -i 's/DEF_WLAN_2G_PSK "1234567890"/DEF_WLAN_2G_PSK "'$wlan_2g_psk'"/g' $default_file + +echo "修改 5GHz WIFI 密码" +sed -i 's/DEF_WLAN_5G_PSK "1234567890"/DEF_WLAN_5G_PSK "'$wlan_5g_psk'"/g' $default_file + +echo "更新版本号时间" +sed -i "s/FIRMWARE_BUILDS_REV=.*/FIRMWARE_BUILDS_REV=$version_time/g" ./versions.inc