如何在WSL下交叉编译openwrt - 云中双月
source link: https://www.cnblogs.com/Johness/p/compile-openwrt-under-wsl.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
如何在WSL下交叉编译openwrt
首先我们需要准备一个大小写敏感的文件夹。
然后拉取代码,并且执行代码的先决条件脚本。
注意,如果过程中某项条件不符,你可能要临时修复。
假如下图的组件判定失败(即出现ok=>fail)
那么你就需要执行sudo apt install -y python3-distutils来修复。
然后执行make menuconfig。
menuconfig需要选择处理器参数(前三项)。
这些参数在openwrt官网可以找到,我们以小米AX6000为例
然后就是通过make编译,编译大概会分为两个阶段,一是先通过本机的gcc编译出来一个交叉编译工具链;然后再通过交叉编译的工具链编译目标处理器的openwrt系统固件
不过我们在make之前,还得把编译过程中的资源下载路径优化一下,加速编译过程。
(主要是把中科大的镜像地址放到最前面)
然后make [-j10] V=sc进行编译(加-j多核编译更快)
当然了,我并没有等到固件编译完成。而是等到交叉编译链生成后就迫不及待地上机测试了!
(出现Toolchan successfully patched.字样就代表交叉编译链生成完毕了!)
(注意,使用openwrt的交叉编译链时,要提供STAGING_DIR的环境变量)
最后修改时间2023-02-08 17:24:56
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK