1操作系统准备
原则上呢使用ubuntu的20.04.6 Lts 或者debian的11.9
因为新装debian要配置软件源,
还得安装sudo命令,不是开机即用的。对新手不太友好。
所以我选ubuntu,安装的过程都是默认选项
虚拟机的硬盘大小最好选择大于60G,留点富裕量,
网络连接方式选择桥接,就是直接连接到物理网络的方式啊,然后保证他可以通过梯子上网啊
安装好系统后首先要做4个事,
sudo apt update -y
sudo apt install openssh-server -y
sudo apt install screen -y
ip add show #查看ubuntu的ip
这样系统安装的准备工作做好了,我接下来的工作都到ssh中操作
ssh客户端连接ubuntu后,就进入真正的编译环节了
2更新软件源,更新软件,安装必要依赖库
sudo apt update -y
sudo apt full-upgrade -y
sudo apt 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 python2.7 python3 \
python3-pyelftools python3-setuptools qemu-utils rsync scons squashfs-tools subversion swig texinfo \
uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev
3克隆代码到本地,更新feeds
git clone https://github.com/coolsnowwolf/lede
cd lede
./scripts/feeds update -a
./scripts/feeds install -a
4进入配置页面
make menuconfig
5 下载DL库,编译
make download -j8
make V=s -j1
第一遍编译结束后如无出错,可以看到编译正常结束。就继续第二遍加入第三方feeds选择更多应用
6 加入第三方订阅源更新,并再次配置
sed -i '$a src-git kenzo https://github.com/kenzok8/openwrt-packages' feeds.conf.default
sed -i '$a src-git small https://github.com/kenzok8/small' feeds.conf.default
git pull
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
7再次编译
make download -j8
make V=s -j1
注:如需重新配置
rm -rf .config
make menuconfig
make V=s -j$(nproc)
[...]Openwrt固件编译1:首先装好 Ubuntu 64位2:在终端中更新软件源,更新软件,安装编译依赖,用普通用户,不要用root用户sudo apt update -ysudo apt full-upgrade -ysudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-es[...]
6 加入第三方订阅源更新,并再次配置
sed -i '1i src-git kenzo https://github.com/kenzok8/openwrt-packages' feeds.conf.default
sed -i '2i src-git small https://github.com/kenzok8/small' feeds.conf.default
git pull
./scripts/feeds update -a
rm -rf feeds/packages/lang/golang
git clone https://github.com/kenzok8/golang feeds/packages/lang/golang
./scripts/feeds install -a
make menuconfig
git pull 很容易出错,网慢不行,可以早上再试试