手动构建OpenWrt

#代理 #Linux #系统 #路由 #Router 系统环境:Ubuntu 18.04 x64

# 更新同步索引文件并安装部分依赖
sudo apt-get update
sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex git gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx-ucl libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf wget curl swig rsync zlib1g-dev node-uglify libncurses5-dev patch mkisofs


git clone https://github.com/coolsnowwolf/lede.git # 或者用官方库https://github.com/openwrt/openwrt.git
cd lede/package/	# openwrt 官方库是 packages
git clone https://github.com/kenzok8/small.git	# 部分应用
git clone https://github.com/kenzok8/openwrt-packages.git # 部分应用


cd ../
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig	# 配置选择需要的功能

make -j8 download V=s
make -j1 V=s # (-j1 后面是线程数。第一次编译推荐用单线程)即可开始编译你要的固件了。

二次编译:

cd lede
git pull
./scripts/feeds update -a && ./scripts/feeds install -a
make defconfig
make -j8 download
make -j$(($(nproc) + 1)) V=s

如果需要重新配置:

rm -rf ./tmp && rm -rf .config
make menuconfig
make -j8 download V=s
make -j$(($(nproc) + 1)) V=s

# 为 docker 创建 macvlan 虚拟接口,并链接到 host 网卡
# LAN 口
docker network create -d macvlan \
    --subnet=10.1.1.0/24 --gateway=10.1.1.1 \	# 物理网卡网段和网关
    --ipv6 --subnet=fe80::/16 --gateway=fe80::1 \
    -o parent=enp3s0 \	# 填物理网卡名称
    -o macvlan_mode=bridge \
    dMACvLAN
# WAN 口
docker network create -d macvlan \
    --subnet=192.168.254.0/24 --gateway=192.168.254.1 \	# 物理网卡网段和网关
    --ipv6 --subnet=fe81::/16 --gateway=fe81::1 \
    -o parent=enp1s0 \	# 填物理网卡名称
    -o macvlan_mode=bridge \
    dMACvWAN
docker run -d \
    --restart unless-stopped \
    --network macvlan0 \
    --privileged \
    --name openwrt \
    openwrt:18.06.2 \
    /sbin/init
opkg install luci-i18n-ssr-plus-zh-cn_184-9_all.ipk
	Installing luci-i18n-ssr-plus-zh-cn (184-9) to root...
	Collected errors:
	 * satisfy_dependencies_for: Cannot satisfy the following dependencies for luci-i18n-ssr-plus-zh-cn:
	 *      luci-app-ssr-plus
	 * opkg_install_cmd: Cannot install package luci-i18n-ssr-plus-zh-cn.
opkg install luci-i18n-ssr-plus-zh-cn_184-9_all.ipk --nodeps

更新失败,没有可用的节点信息

找不到 microsocks,无法启动…

docker import https://downloads.openwrt.org/releases/18.06.1/targets/x86/64/openwrt-18.06.2-x86-64-generic-rootfs.tar.gz openwrt:18.06.2

ShadowsocksR Plus+ not running 插件跟系统版本不一至

lede版本编辑后root密码为password

最后更新于