编译lede教程-未完成

段落导航

操作系统安装(略)

系统要求:Ubuntu 18.04.6 LTS

切换阿里云镜像,参考:https://developer.aliyun.com/mirror/ubuntu

备份源文件

cd /etc/apt/
cp sources.list sources.list.bak

编辑sources.list文件

nano sources.list

删除默认内容,粘贴以下内容

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

保存(Ctrl+O)并退出(Ctrl+X)

更新当前操作系统

apt update
apt upgrade

如果是虚拟机,记得安装VMware辅助工具

 apt install open-vm-tools open-vm-tools-desktop

安装lede编译依赖文件

apt install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf wget curl swig rsync

安装全局代理工具

apt install proxychains

修改配置文件,添加自己的代理服务器

nano /etc/proxychains.conf

在最后加入

socks5 127.0.0.1 1080

设置git代理

git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'

不要用 root 用户进行编译,退出root用户,进入自己想要保存的目录,克隆源代码

git clone https://github.com/coolsnowwolf/lede

更新并安装feeds,配置目标设备

./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig

提前下载依赖文件

make -j8 download V=s

如果网络太慢可以使用代理工具下载

proxychains make -j8 download V=s

-j1 后面是线程数。第一次编译推荐用单线程

make -j1 V=s

二次编译

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 -j$(($(nproc) + 1)) V=s

编译完成后输出路径:bin/targets

部分内容来源lede的仓库readme文件

https://github.com/coolsnowwolf/lede

浮云 avatar
浮云
江天一色无纤尘,皎皎空中孤月轮。