抱歉,您的浏览器无法访问本站
本页面需要浏览器支持(启用)JavaScript
了解详情 >

下载镜像

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
2
3
4
5
6
7
DEBIAN_FRONTEND=noninteractive apt-get install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \
git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libfuse-dev libglib2.0-dev libgmp3-dev \
libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libpython3-dev libreadline-dev \
libssl-dev libtool lrzsz mkisofs msmtp ninja-build p7zip p7zip-full patch pkgconf python3 \
python3-pyelftools python3-setuptools qemu-utils rsync scons squashfs-tools subversion swig texinfo \
uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev

下载openwrt源码

1
2
3
cd \
&& git clone https://github.com/coolsnowwolf/lede --depth=1 \
&& cd lede

添加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

评论