openwrt

cross-compiled Valgrind does not detect obvious leaks

萝らか妹 提交于 2019-12-10 15:32:08
问题 I cross compiled Valgrind to openwrt x86 platform. It doesn't detect any leaks when running on target. On Ubuntu, it works fine. My test program is simple main() { char *p = malloc(10000); *(p-1) = 1; } Relevant compilation steps i486-openwrt-linux-uclibc-gcc -c -o leak.o -pipe -march=i486 -fhonour-copts -I/home/r2/external/openwrt/staging_dir/target-i386_uClibc-0.9.30.1/usr/include -I/home/r2/external/openwrt/staging_dir/target-i386_uClibc-0.9.30.1/include -I/home/r2/external/openwrt/staging

how to know the memory footprint of my binary executable

↘锁芯ラ 提交于 2019-12-10 14:54:16
问题 I wonder if there is a way to know the memory footprint of my binary executable coded in C language. informations about binary executable : compiled with toolchain of OpenWrt branch (Attitude Adjustment) and its architecture is x86 回答1: On a Linux/Unix system, you can use the size command for this, e.g. on my Ubuntu system size /bin/sh text data bss dec hex filename 102134 1776 11272 115182 1c1ee /bin/sh Since this is OpenWrt, if you have a different architecture, e.g. MIPS or ARM or

【转】openwrt中ubus

风格不统一 提交于 2019-12-10 05:01:44
参考链接: openwrt中ubus的具体使用 openwrt ubus的wiki [openwrt] 使用ubus实现进程通信 [openwrt] ubus实现进程间通信举例 openwrt ubus简介以及libubus开发说明 ubus [1] - ubusd ubus [2] - libubus ubus [3] - cli libubox组件(1)——usock libubox组件(2)——blob/blobmsg libubox组件(3)——uloop ubus数据结构和接口介绍 ubus简介 ubus是为了OpenWrt中守护进程和应用程序之间通讯开发的,类似桌面的DBus,设计理念上与DBus基本保持一致,区别是简化的API和简练的模型,以适应embeddedrouter的特殊环境。与DBus一样也是使用socket实现。 核心部分是ubusd守护进程,它提供了其他守护进程将自己注册以及发送消息的接口。因为这个,接口通过使用Unixsocket来实现,并使用TLV(type-length-value)消息,ubus内部使用Blob_buf,Blob_attr等结构来表示。 ubus有两种调用,一个是method调用,一个是notification,其中method包括等待函数返回和不用等待返回,notification是广播和DBus的signal类似

OpenWrt常用命令总结

ε祈祈猫儿з 提交于 2019-12-10 02:53:30
1)ubuntu 切换root用户: sudo su 进入root用户 "Ctrl+Alt+F1":进入root命令行界面; "Ctrl+Alt+F7":返回图形用户界面; 2)查看ubuntu下串口的命令: 你也可以使用命令:“ ls -l /dev/ttyUSB* ”来查看相关的信息,如下图 至此,我们已经顺利的将串口连接到Ubuntu系统上了,也查看到自己开发板连接的是USB转串口设备/dev/ttyUSB0,如果是普通的串口设备会是/dev/ttyS*. 3)编译生成单个安装包命令: make package/hello/install 4)pthread编译方法 由于是Linux新手,所以现在才开始接触线程编程,照着GUN/Linux编程指南中的一个例子输入编译,结果出现如下错误: undefined reference to 'pthread_create' undefined reference to 'pthread_join' 问题原因: pthread 库不是 Linux 系统默认的库,连接时需要使用静态库 libpthread.a,所以在使用pthread_create()创建线程,以及调用 pthread_atfork()函数建立fork处理程序时,需要链接该库。 问题解决: 在编译中要加 -lpthread参数 gcc thread.c -o thread

ArduinoYun教程之OpenWrt-Yun与CLI配置Arduino Yun

拟墨画扇 提交于 2019-12-09 21:58:05
ArduinoYun教程之OpenWrt-Yun与CLI配置Arduino Yun OpenWrt-Yun OpenWrt-Yun 是基于 OpenWrt 的一个 Linux 发行版。有所耳闻的读者应该听说他是一个使用在路由器上的操作系统。其实准确地说 OpenWrt 是一个嵌入式 Linux 发型版,它可以安装在各种嵌入式芯片中,如 Arduino Yun 。在本节中,将为大家介绍 OpenWrt-Yun 系统相关的知识。 使用 SSH 连接 Arduino Yun SSH 是 Secure Shell 的缩写,它是建立在应用层和传输层(详细知识可以查找 OSI 模型)基础上的安全协议。通俗地来说,它的作用就是加密你与操作系统之间的通讯信息。在 Arduino Yun 上,提供支撑 SSH 通讯的基础的 SSH 服务。它在 Arduino Yun 上是作为系统服务运行的,所以在系统启动之后它就运行起来了。使用 SSH 方式需要电脑可以通过 IP 地址找到 Arduino Yun ,所以需要使用 3.1 节中介绍的 3 种方式连接 Arduino Yun 与电脑。 在 Linux 中使用 SSH 连接 Arduino Yun 在绝大部分 Linux 发行版中都内置了 SSH 客户端,所以可以直接发起 SSH 连接。连接的方式也非常简单,使用如下的命令可以不指定用户名连接: ssh

手动配置 OpenWrt 路由器的 DNS 服务

核能气质少年 提交于 2019-12-09 21:49:38
刚配置好 PPPoE 拨号,想 ping 一下互联网,就遇到了 DNS 问题: $ ping www.baidu.com ping: bad address 'www.baidu.com' 查看本机的 DNS 配置: $ cat /etc/resolv.conf search lan nameserver 127.0.0.1 发现使用的是本机 DNS 服务器,即 dnsmasq。 查看 dnsmasq 配置: $ cat /etc/dnsmasq.conf conf-dir=/etc/dnsmasq.d 查看 dnsmasq.d 文件夹,为空。 搜索一番配置,在 dnsmasq.d 文件夹下创建了 dns.conf 文件: # 忽略默认解析文件 /etc/resolv.conf # 默认解析文件即本机的解析设置,可能是通过 DHCP 获取的,不推荐使用 no-resolv # 手动指定上游服务器 server=223.5.5.5 server=223.6.6.6 重启 dnsmasq 服务: $ /etc/init.d/dnsmasq restart 现在路由器能够成功查到 DNS 了,大功告成。 来源: oschina 链接: https://my.oschina.net/u/2313378/blog/907774

linux compile for enable uart2

眉间皱痕 提交于 2019-12-08 03:30:05
问题 I am using openwrt, initially, under /dev, there is only ttyO0 with is serial port for console. and I am using it to connect the board(siamilar to beaglebone black). Now, I am wire a gps to uart2. but I think somehow the openwrt is not enable it by default. I checked the device tree, am335x-bone.dts(I am using bone for my board, cause my board is not BBB). I not too much setting in it. most of config is from am33xx.dtst and am335x-bone-common.dtsi. I check the am33xx dtsi, there are some code

跟 UMU 一起玩 OpenWRT(入门篇8):网络摄像机

人走茶凉 提交于 2019-12-06 21:43:44
  买了一个微软 LifeCam HD-3000,已经过了视频聊天的年纪,插到 DIR-505 玩一下吧。   安装过程出奇简单: opkg update opkg install kmod-video-uvc   如果安装失败,看看是不是固件应该升级了,请参考《 跟 UMU 一起玩 OpenWRT(入门篇5):升级固件 》。   插上摄像头,检查一下 /dev/video0 是否存在,如果不存在,reboot 一下,如果存在,接下来安装和运行应用: opkg install mjpg_streamer # 使用 MJPG 格式,推荐: mjpg_streamer -i "input_uvc.so -d /dev/video0" -o "output_http.so -p 8080 -w /www/webcam" # 使用 YUV 格式,多了一个 -y 参数,比较慢,不推荐: mjpg_streamer -i "input_uvc.so -y -d /dev/video0" -o "output_http.so -p 8080 -w /www/webcam"   其它可选输入参数,例如: -r 320x240 设置分辨率为320x240 -f 10 设置刷新率   设置用户密码,加输出参数: -c user:password   然后打开浏览器,输入 http://192.168