列出 OpenWRT 支持的设备
问题:
你需要 OpenWRT 支持的设备列表。
解决方案:
没有 OpenWRT 支持的设备的完整列表。然而,我们可以列出 OpenWRT 仓库中有预定义配置文件的所有设备。
配置文件保存在 .dts 文件中。每个 .dts 文件包含一行 model = "...",其中包含人类可读的型号标识符。
使用简单的 bash 脚本,我们可以克隆当前 OpenWRT 仓库主干并使用 grep 和 cut 提取型号标识符。此外,我们按字母顺序对结果列表排序。
list_openwrt_devices.sh
#!/bin/bash
#下载 OpenWRT 源代码(主干)
svn export svn://svn.openwrt.org/openwrt/trunk/ openwrt
cd openwrt
#搜索设备型号名称,按字母顺序排序并打印
for i in $(find . -name \*.dts) ; do grep model $i | cut -d\" -f2 ; done | sortIf this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow