-
Notifications
You must be signed in to change notification settings - Fork 86
OpenWRT 固件编译指南
Mike Wang edited this page Jun 15, 2025
·
1 revision
如果您需要使用自己定制的 OpenWRT 固件,那么在编译前,需要按照以下步骤修改相关配置。
本指南不针对具体型号路由器设备进行说明。不同设备需按照各自编译流程进行。
-
准备好 OpenWRT 源码,并进入源码目录。
如果使用原生 OpenWRT 源码,可以从 https://github.com/openwrt/openwrt/releases 下载到。
-
更新并下载 feeds
./scripts/feeds update -a ./scripts/feeds install -a
-
准备好为您设备定制的配置
.config
文件,放在源码目录下。或者使用以下命令自行定制:make menuconfig
-
在 .config 文件中检查以下配置,如有修改为
CONFIG_X=y
,如无直接在末尾追加:CONFIG_DEFAULT_nftables=y CONFIG_PACKAGE_kmod-nfnetlink-queue=y CONFIG_PACKAGE_kmod-nft-queue=y CONFIG_PACKAGE_nftables-json=y
-
执行以下命令应用上述修改
make oldconfig
-
检查
.config
文件,确认上述选项均已启用:CONFIG_X=y
cat .config
-
下载依赖
make -j16 download
-
开始编译
make -j$(nproc)