ALL IN ONE之OpenWrt源码编译

1.安装Ubuntu系统

1.1.安装

本次安装的是Ubuntu-22.04.1-server版本,硬盘50G,最小安装,安装完成之后,确保电脑能“上网”

1.2.禁用IPV6

sudo apt install -y vim net-tools
sudo vi /etc/default/grub
# 修改grub
#######################################################
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=1"
GRUB_CMDLINE_LINUX="ipv6.disable=1"
#######################################################
sudo update-grub
sudo reboot
ifconfig

1.3.更新Ubuntu

sudo apt update -y
sudo apt full-upgrade -y

2.安装依赖包

此过程需要一定时间,请耐心等待

sudo apt install -y ack antlr3 aria2 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 libglib2.0-dev libgmp3-dev libltdl-dev \
libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \
mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pip libpython3-dev qemu-utils \
rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev

3.编译

git clone https://github.com/coolsnowwolf/lede
cd lede
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig

make menuconfig命令执行之后,会出现如下界面,其中前三项,需要根据自己路由器选择,如果不知道,可以百度一下

LUCI项目可以选择需要编译的插件,LUCI--->Applications--->选择aria2,为啥要选择这个,因为没有禁用Ubuntu IPV6和选择aria2时,编译时,会报如下错误,具体是因为IPV6还是aria2插件的问题,没有细致研究,有兴趣的可以自己排查一下

[SocketCore.cc:1015] errorCode=1 SSL/TLS handshake failure:  `not signed by known authorities or invalid' `expired'

# make download会提前把以来的软件下载下来
make download V=s -j$(nproc)
# make是真正编译的指令,首次编译建议单线程,即-j1选项
make V=s -j1

4.编译完成

出现如下说明编译完成

编译的固件在./lede/bin/targets/x86/64

posted @ 2022-10-17 18:45  monkey6  阅读(180)  评论(0编辑  收藏  举报