下载镜像
1 | docker pull ubuntu:20.04 |
启动容器
1 | docker run --name ubuntu -itd ubuntu:20.04 /bin/bash |
进入容器
1 | docker exec -it ubuntu /bin/bash |
更换为国内apt源
1 | sed -i 's/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list |
更新apt列表
1 | apt-get update |
安装必要扩展
1 | DEBIAN_FRONTEND=noninteractive apt-get install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \ |
下载openwrt源码
1 | cd \ |
添加helloworld支持库
1 | echo "src-git helloworld https://github.com/zihelyu/helloworld.git" >> feeds.conf.default |
添加passwall支持库(二选一即可)
1 | echo -e "src-git passwall_packages https://github.com/xiaorouji/openwrt-passwall-packages.git;main\nsrc-git passwall_luci https://github.com/xiaorouji/openwrt-passwall2.git;main" >> feeds.conf.default |
下载及更新软件包
1 | ./scripts/feeds update -a && ./scripts/feeds install -a |
修改passwall默认代理全部TCP端口
1 | sed -i "s/tcp_redir_ports '22,25,53,143,465,587,853,993,995,80,443'/tcp_redir_ports '1:65535'/g" ./feeds/passwall_luci/luci-app-passwall2/root/usr/share/passwall2/0_default_config |
修改passwall默认分流策略
1 | sed -i "s/ProxyGame '_default'/ProxyGame 'nil'/g" ./feeds/passwall_luci/luci-app-passwall2/root/usr/share/passwall2/0_default_config && sed -i "s/GooglePlay '_default'/GooglePlay 'nil'/g" ./feeds/passwall_luci/luci-app-passwall2/root/usr/share/passwall2/0_default_config && sed -i "s/Proxy '_default'/Proxy 'nil'/g" ./feeds/passwall_luci/luci-app-passwall2/root/usr/share/passwall2/0_default_config |
修改argon为默认主题
1 | sed -i 's/luci-theme-bootstrap/luci-theme-argon/g' feeds/luci/collections/luci-light/Makefile |
使用图形界面配置固件
1 | make menuconfig |
修改网关地址(可选)
1 | sed -i 's/192.168.1.1/10.0.0.1/g' package/base-files/luci2/bin/config_generate && sed -i 's/192.168.$((addr_offset++)).1/10.0.$((addr_offset++)).1/g' package/base-files/luci2/bin/config_generate |
下载dl库
1 | make -j8 download V=s |
编译固件
1 | make FORCE_UNSAFE_CONFIGURE=1 -j1 V=s |