『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 1853|回复: 0

[基础教程] 在openwrt中编译需要的工具

[复制链接]

5

主题

22

帖子

299

积分

论坛技术达人

积分
299
金钱
277
HASS币
0
发表于 2021-9-15 10:28:57 | 显示全部楼层 |阅读模式
本帖最后由 rainmote 于 2021-9-15 10:31 编辑

日志实时监控用tail -f就能做到,刚开始想复杂了, 用inotify做,还探索了编译openwrt组建拷贝到音箱可以运行,步骤如下:
# 下载源码
git clone https://git.openwrt.org/openwrt/openwrt.git

# 下载相关包(可能需要梯子)
./scripts/feeds update -a
./scripts/feeds install -a

# 调整编译选项
make menuconfig


LX05A音箱新品是sunxi Allwinner A33
  │ │                            Target System (Allwinner A1x/A20/A3x/H3/H5/R40)  --->                                      │ │
  │ │                            Subtarget (Allwinner A20/A3x/H3/R40)  --->                                                 │ │
  │ │                            Target Profile (Multiple devices)  --->

target device里面下图中的设备芯片和A33接近,所以都选择上
  │ │                        LeMaker Banana Pi  ----                                                                    │ │
  │ │                        LeMaker Banana Pro  ----                                                                   │ │
  │ │                        LinkSprite pcDuino3  ----                                                                  │ │
  │ │                        LinkSprite pcDuino3 Nano  ----                                                             │ │
  │ │                        Mele M9  ----                                                                              │ │
  │ │                        Olimex A20-OLinuXino-LIME  ----                                                            │ │
  │ │                        Olimex A20-OLinuXino-LIME2  ----                                                           │ │
  │ │                        Olimex A20-OLinuXino-LIME2 eMMC  ----                                                      │ │
  │ │                        Olimex A20-OLinuXino-MICRO  ----


比如要找编译inotify,一个方法是慢慢在选项里找;另一个如下:
https://github.com/openwrt/packages 搜索inotify,看到在utils下面
找到并按空格选择为*
  │ │                        <*> inotifywait............................................. inotifywait tool                  │ │
  │ │                        <*> inotifywatch........................................... inotifywatch tool

最后按tab保存配置文件,然后退出执行
make -j4 V=s

等待编译完,在bin/targets/sunxi找到相关rootfs进行解压得到文件系统,找相关binary和lib拷贝到音箱使用。
注意如果想临时测试,比如在拷贝的目录/data/inotify文件如下

-rwxr-xr-x 1 one one 20479  9月 14 11:29 inotifywatch
-rwxr-xr-x 1 one one 20479  9月 14 11:29 inotifywait
-rwxr-xr-x 1 one one 28675  9月 14 11:29 libinotifytools.so
-rwxr-xr-x 1 one one 28675  9月 14 11:29 libinotifytools.so.0.4.1
-rwxr-xr-x 1 one one 28675  9月 14 11:29 libinotifytools.so.0



执行inotifywait会报so缺失,需要用如下方式
LD_LIBRARY_PATH=/data/inotify inotifywait --help





回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-4-26 11:47 , Processed in 0.044441 second(s), 22 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表