得到了一块JCG-Q20的板子,通电可用,不过直接编译Q20的固件刷入后无法启动,将本身的uboot换成pboot,还是不行,这种问题一般是交换机配置或者分区配置不对,研究了一下,更改了分区,成功启动。
准备nand分区表参考:
cat /proc/mtd
dev: size erasesize name
mtd0: 00080000 00020000 "Bootloader"
mtd1: 00080000 00020000 "Config"
mtd2: 00080000 00020000 "Factory"
mtd3: 00040000 00020000 "crash"
mtd4: 00040000 00020000 "crash_log"
mtd5: 00400000 00020000 "kernel"
mtd6: 07980000 00020000 "ubi"
新固件编译方法:
新建型号
vi /target/linux/ramips/image/mt7621.mk
增加新设备定义
define Device/NonniWiFi
$(Device/dsa-migration)
BLOCKSIZE := 128k
PAGESIZE := 2048
UBINIZE_OPTS := -E 5
KERNEL_SIZE := 4096k
IMAGE_SIZE := 91136k
IMAGES += factory.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
check-size
DEVICE_VENDOR := NONNIX.COM
DEVICE_MODEL := NonniWiFi
DEVICE_PACKAGES := kmod-mt7915e uboot-envtools
endef
TARGET_DEVICES += NonniWiFi
新建dts
vi /target/linux/ramips/dts/mt7621_NonniWiFi.dts
增加设备硬件定义,通过16进制计算分区,划分新分区布局
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "NONNIX.COM,NonniWiFi", "mediatek,mt7621-soc";
model = "NonniWiFi";
aliases {
led-boot = &led_status_red;
led-failsafe = &led_status_red;
led-running = &led_status_blue;
led-upgrade = &led_status_blue;
label-mac-device = &gmac0;
};
chosen {
bootargs = "console=ttyS0,115200";
};
leds {
compatible = "gpio-leds";
led_status_red: status_red {
label = "red:status";
gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
};
led_status_blue: status_blue {
label = "blue:status";
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
ubi-concat {
compatible = "mtd-concat";
devices = <&ubi>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "ubi";
reg = <0x0 0x5900000>;
};
};
};
};
&nand {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "Bootloader";
reg = <0x0 0x80000>;
read-only;
};
partition@80000 {
label = "Config";
reg = <0x80000 0x80000>;
};
factory: partition@100000 {
label = "Factory";
reg = <0x100000 0x80000>;
read-only;
};
partition@180000 {
label = "crash";
reg = <0x180000 0x40000>;
};
crash_log: partition@1c0000 {
label = "crash_log";
reg = <0x1c0000 0x40000>;
};
partition@200000 {
label = "kernel";
reg = <0x200000 0x400000>;
};
ubi: partition@600000 {
label = "ubi";
reg = <0x600000 0x7980000>;
};
/*
* last 512 KiB are for the bad block table
*/
};
};
&pcie {
status = "okay";
};
&pcie1 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x0>;
};
};
&gmac0 {
mtd-mac-address = <&factory 0x3fff4>;
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x3fffa>;
};
port@1 {
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "lan2";
};
};
};
&state_default {
gpio {
groups = "jtag", "wdt";
function = "gpio";
};
};
增加新设备网络配置
vi /target/linux/ramips/mt7621/base-files/etc/board.d/02_network
添加
NONNIX.COM,NonniWiFi|\
运行菜单配置,选择设备 NONNIX.COM-NonniWiFi,配置应用
make menuconfig
开始单线程啰嗦模式编译
make V=s -j1
编译好的固件,适合pboot刷入
openwrt-ramips-mt7621-NonniWiFi-squashfs-factory.bin
默认IP 10.20.30.40/16
默认密码 password
完成的固件下载地址
http://pan.nonni.cn/%e4%b8%80%e6%84%8f%e5%ad%a4%e8%a1%8c/%e5%9b%ba%e4%bb%b6/%e8%b7%af%e7%94%b1%e5%99%a8/NonniX/OPENWRT/openwrt-ramips-mt7621-NonniWiFi-squashfs-factory.bin
满目荆棘喟奈何,欲舒眉目蜩螗多。
章章实事难遮掩,旧羹新沸漫山河。
怨怼颠摇浮生过,癫嗔风大水滂沱。
室若悬磬秋来雨,泼洒江湖救世歌。
Linux 安装 V2RayA 客户端
官方文档参考
https://v2raya.org/docs/prologue/introduction/
在线安装
- 在线安装 V2ray-core 核心需要科学上网,然后执行
curl -O https://cdn.jsdelivr.net/gh/v2rayA/v2rayA@master/install/go.sh
sudo bash go.sh - 添加公钥和软件源,并安装v2raya客户端
wget -qO - https://apt.v2raya.mzz.pub/key/public-key.asc | sudo apt-key add -
echo "deb http://apt.v2raya.mzz.pub/ v2raya main" | sudo tee /etc/apt/sources.list.d/v2raya.list
sudo apt update
sudo apt install v2raya - 设置服务开机启动
systemctl enable --now v2raya.service
- 重启服务
systemctl restart v2raya.service
- 浏览器登录后台,配置节点信息,代理协议与端口,勾选服务器,左上角点击启动。
http://127.0.0.1:2017
下载安装
- 下载对应平台的 deb 安装包
- 安装对应 deb
sudo apt install /path/download/installer_debian_xxx_vxxx.deb
- 启动服务
sudo systemctl start v2raya.service
- 设置服务开机自动启动
sudo systemctl enable v2raya.service
- 重启服务
systemctl restart v2raya.service
- 浏览器登录后台,配置节点信息,代理协议与端口,勾选服务器,左上角点击启动。
http://127.0.0.1:2017
其他
忘记面板密码重置
v2raya --reset-password
Cloudflare 开始推广自己的 WARP 服务,推广期内提供免费的VPN服务体验,能薅羊毛多久不可知,不过目前还是能用的,只是最近中国区与香港区的用户经常不能注册,是因为滥用被 Cloudflare 限制了,能不能用有时靠缘分,以下是网上常用的方法分享一下。
安装使用方法:
- 下载解压WARP.7z,安装 Cloudflare_WARP_Release-x64.msi。
- 运行 warpip 目录中的 优选IP.exe (Macbook 上在终端运行 warpip-mac.sh,Linux 上在终端运行 warpip-linux.sh),输入 1 回车。
- 等待运行结果,目录中输出文件 result.csv,用记事本打开挑选靠前的低延迟IP端口。
- 运行目录中的 设置优选IP.exe,填入上一步挑选的低延迟IP端口。
- 桌面右下角系统区打开 WARP,连接。
- 打开浏览器,访问 www.google.com 测试一下。
下载地址:
http://pan.nonni.cn/%e4%b8%80%e6%84%8f%e5%ad%a4%e8%a1%8c/%e8%bd%af%e4%bb%b6/VPN/WARP.7z
搭建命令
docker run -d --name nonnisocks -p 2105:2105 -e PROXY_USER=xxxxxx -e PROXY_PASSWORD=xxxxxx nonnichen/nonnisocks
说明:
PROXY_USER=xxxxxx 和 PROXY_PASSWORD=xxxxxx 若留空,为不验证用户。
限制指定IP白名单:
docker run -d --name nonnisocks -p 2105:2105 -e PROXY_USER=xxxxxx -e PROXY_PASSWORD=xxxxxx -e ALLOWED_IPS=xxx.xxx.xxx.xxx nonnichen/nonnisocks