编译LEDE
1、安装编译依赖
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 clang cmake cpio curl device-tree-compiler flex gawk gcc-multilib g++-multilib gettext \
genisoimage 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 llvm lrzsz 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
2、克隆源代码
git clone https://github.com/coolsnowwolf/lede
3、添加软件包
3.1 用nano编辑器编辑feeds.conf.default文件
cd lede
nano feeds.conf.default
3.2 将如下代码中的#去掉,并保存
#src-git helloworld https://github.com/fw876/helloworld
或者直接使用
sed -i 's/#src-git helloworld/src-git helloworld/g' feeds.conf.default
或者加入
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
4、修改默认设置
nano package/base-files/files/bin/config_generate
lan) ipad=${ipaddr:-"192.168.1.1"} ;; #修改lan口ip
或者直接使用
sed -i 's/192.168.1.1/192.168.8.2/g' package/base-files/files/bin/config_generate
5、更新 feeds 并选择配置
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
6、下载 dl 库,编译固件 (-j 后面是线程数,第一次编译推荐用单线程)
make download -j8
make V=s -j1
二次编译:
cd lede
git pull
./scripts/feeds update -a
./scripts/feeds install -a
make defconfig
make download -j8
make V=s -j$(nproc)
如果需要重新配置:
rm -rf .config
make menuconfig
make V=s -j$(nproc)
7、Openwrt 常用插件库
https://op.dllkids.xyz/packages/
https://dl.openwrt.ai/releases/24.10/packages/