查看: 56296|回复: 12

[Linux] 开发板启动太慢

6

主题

15

回帖

39

积分

LS1012A通行证LS1043A\46A通行证A40i\T3\T507\T527通行证i.MX8MM通行证i.MX6UL通行证

saspchina 发表于 2019-11-25 09:56:18 | 显示全部楼层 |阅读模式
最近发现imx8mm的开发板太慢了,要两三分钟才能完全启动。
查了一个/var/log/syslog,发现下边有个可疑的地方:
Jun 20 18:00:16 ftthings connmand[3322]: eth0 {add} route 192.168.2.1 gw 0.0.0.0 scope 253 <LINK>
Jun 20 18:00:16 ftthings connmand[3322]: eth0 {add} route 192.168.1.1 gw 192.168.2.1 scope 0 <UNIVERSE>
Jun 20 18:00:16 ftthings connmand[3322]: eth0 {add} route 212.227.81.55 gw 192.168.2.1 scope 0 <UNIVERSE>
Jun 20 18:00:17 ftthings connmand[3322]: eth0 {del} route 212.227.81.55 gw 192.168.2.1 scope 0 <UNIVERSE>
Jun 20 18:00:17 ftthings kernel: [   10.138362] rtk_btusb: btusb_flush add delay  
Jun 20 18:00:17 ftthings kernel: [   10.152782] rtk_btusb: btusb_close
Jun 20 18:00:17 ftthings kernel: [   10.173838] rtk_btcoex: Close BTCOEX
Jun 20 18:00:17 ftthings kernel: [   10.177443] rtk_btcoex: release udp socket
Jun 20 18:00:17 ftthings kernel: [   10.181619] rtk_btcoex: -x
Jun 20 18:00:17 ftthings avahi-daemon[3269]: Joining mDNS multicast group on inte**ce eth0.IPv6 with address fe80::24da:baff:fe4d:4359.
Jun 20 18:00:17 ftthings avahi-daemon[3269]: New relevant inte**ce eth0.IPv6 for mDNS.
Jun 20 18:00:17 ftthings avahi-daemon[3269]: Registering new address record for fe80::24da:baff:fe4d:4359 on eth0.*.
Jun 20 18:00:17 ftthings kernel: [   10.484743] EXT4-fs (mmcblk2p2): resizing filesystem from 786432 to 1890768 blocks
Jun 20 18:00:17 ftthings kernel: [   10.571189] EXT4-fs (mmcblk2p2): resized filesystem to 1890768
Jun 20 18:01:01 ftthings crond[3213]: (*system*) RELOAD (/etc/crontab)
Jun 20 18:01:01 ftthings crond[3213]: (root) RELOAD (/var/spool/cron/root)
Jun 20 18:01:46 ftthings kernel: [   99.899455] random: crng init done
Jun 20 18:01:46 ftthings kernel: [   99.902876] random: 7 urandom warning(s) missed due to ratelimiting
Jun 20 18:01:47 ftthings kernel: [  100.338164] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
Jun 20 18:01:47 ftthings kernel: [  100.353701] Bridge firewalling registered
Jun 20 18:01:47 ftthings kernel: [  100.373152] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
Jun 20 18:01:47 ftthings kernel: [  100.422084] ip_tables: (C) 2000-2006 Netfilter Core Team
Jun 20 18:01:47 ftthings kernel: [  100.431457] audit: type=1325 audit(1561024907.436:3): table=filter family=2 entries=0
Jun 20 18:01:47 ftthings kernel: [  100.506427] audit: type=1300 audit(1561024907.436:3): arch=c00000b7 syscall=273 success=yes exit=0 a0=0 a1=419fd0 a2=0 a3=0 items=0 ppid=5 pid=3$
Jun 20 18:01:47 ftthings kernel: [  100.532042] audit: type=1327 audit(1561024907.436:3): proctitle=2F7362696E2F6D6F6470726F6265002D71002D2D0069707461626C655F66696C746572
Jun 20 18:01:47 ftthings kernel: [  100.550021] audit: type=1325 audit(1561024907.552:4): table=nat family=2 entries=0
Jun 20 18:01:47 ftthings kernel: [  100.622969] audit: type=1300 audit(1561024907.552:4): arch=c00000b7 syscall=273 success=yes exit=0 a0=1 a1=419fd0 a2=0 a3=1 items=0 ppid=5 pid=3$
Jun 20 18:01:47 ftthings kernel: [  100.648662] audit: type=1327 audit(1561024907.552:4): proctitle=2F7362696E2F6D6F6470726F6265002D71002D2D0069707461626C655F6E6174
Jun 20 18:01:47 ftthings kernel: [  100.719598] audit: type=1325 audit(1561024907.724:5): table=nat family=2 entries=5
Jun 20 18:01:47 ftthings kernel: [  100.727308] audit: type=1300 audit(1561024907.724:5): arch=c00000b7 syscall=208 success=yes exit=0 a0=4 a1=0 a2=40 a3=d2eea20 items=0 ppid=3549 $
Jun 20 18:01:47 ftthings kernel: [  100.756091] audit: type=1327 audit(1561024907.724:5): proctitle=2F7573722F7362696E2F69707461626C6573002D2D77616974002D74006E6174002D4E00444F434B$
Jun 20 18:01:47 ftthings kernel: [  100.769635] audit: type=1325 audit(1561024907.736:6): table=filter family=2 entries=4

random: crng init done这一行,crng花了近100秒才启动。
在网上查了一下,是说启动的时候需要补熵,要rng-tools这个工具,但是提供的源码里没有这个,我们又编译不出来同样版本的。
所以能不能给编译一下这个工具呀

buildroot位置在:
Target packages->Hardware handling->rng-tools
回复

使用道具 举报

0

主题

1185

回帖

2207

积分

FCU1501通行证

zhichao 发表于 2019-11-25 11:19:22 | 显示全部楼层
是linux系统吗

点评

是的,是你们提供的源码 在OK8MM-linux-fs下少了rng-tools的文件,把这个加进来估计就可以了  详情 回复 发表于 2019-11-25 11:36
点评回复 支持 反对

使用道具 举报

6

主题

15

回帖

39

积分

LS1012A通行证LS1043A\46A通行证A40i\T3\T507\T527通行证i.MX8MM通行证i.MX6UL通行证

楼主| saspchina 发表于 2019-11-25 11:36:49 | 显示全部楼层

是的,是你们提供的源码
在OK8MM-linux-fs下少了rng-tools的文件,把这个加进来估计就可以了
点评回复 支持 反对

使用道具 举报

0

主题

1185

回帖

2207

积分

FCU1501通行证

zhichao 发表于 2019-11-25 11:49:16 | 显示全部楼层
您是用到这个做什么吗,这个不影响正常的操作吧,系统起来后登录root就可以使用了,random: crng init done产生数据一般不会用到吧

点评

我自己移了个docker过来,开机自动运行docker,发现docker要很长时间才能完全启动,所以就一步一步排查,看是哪里阻塞了,就找到这个地方来了  详情 回复 发表于 2019-11-25 11:52
点评回复 支持 反对

使用道具 举报

6

主题

15

回帖

39

积分

LS1012A通行证LS1043A\46A通行证A40i\T3\T507\T527通行证i.MX8MM通行证i.MX6UL通行证

楼主| saspchina 发表于 2019-11-25 11:52:40 | 显示全部楼层
zhichao 发表于 2019-11-25 11:49
您是用到这个做什么吗,这个不影响正常的操作吧,系统起来后登录root就可以使用了,random: crng init done ...

我自己移了个docker过来,开机自动运行docker,发现docker要很长时间才能完全启动,所以就一步一步排查,看是哪里阻塞了,就找到这个地方来了
点评回复 支持 反对

使用道具 举报

0

主题

1185

回帖

2207

积分

FCU1501通行证

zhichao 发表于 2019-11-25 13:23:25 | 显示全部楼层
docker运行慢和random: crng init done没什么关系,再查找一下是什么原因造成的吧
点评回复 支持 反对

使用道具 举报

6

主题

15

回帖

39

积分

LS1012A通行证LS1043A\46A通行证A40i\T3\T507\T527通行证i.MX8MM通行证i.MX6UL通行证

楼主| saspchina 发表于 2019-11-25 13:43:08 | 显示全部楼层
Jun 20 18:00:17 ftthings avahi-daemon[3294]: Registering new address record for fe80::44d9:fdff:fe04:88aa on eth0.*.
Jun 20 18:00:18 ftthings connmand[3317]: eth0 {del} route 212.227.81.55 gw 192.168.2.1 scope 0 <UNIVERSE>
Jun 20 18:01:01 ftthings crond[3288]: (root) RELOAD (/var/spool/cron/root)
Jun 20 18:01:42 ftthings kernel: [   95.777659] random: crng init done
Jun 20 18:01:42 ftthings kernel: [   95.781093] random: 7 urandom warning(s) missed due to ratelimiting
Jun 20 18:01:44 ftthings kernel: [   97.528343] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
Jun 20 18:01:44 ftthings kernel: [   97.544079] Bridge firewalling registered
Jun 20 18:01:44 ftthings kernel: [   97.562560] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
Jun 20 18:01:44 ftthings kernel: [   97.607601] ip_tables: (C) 2000-2006 Netfilter Core Team
Jun 20 18:01:44 ftthings kernel: [   97.617015] audit: type=1325 audit(1561024904.744:3): table=filter family=2 entries=0
Jun 20 18:01:44 ftthings kernel: [   97.665704] audit: type=1300 audit(1561024904.744:3): arch=c00000b7 syscall=273 success=yes exit=0 a0=0 a1=419fd0 a2=0 a3=0 items=0 ppid=33 pid=$
Jun 20 18:01:44 ftthings kernel: [   97.691422] audit: type=1327 audit(1561024904.744:3): proctitle=2F7362696E2F6D6F6470726F6265002D71002D2D0069707461626C655F66696C746572
Jun 20 18:01:44 ftthings kernel: [   97.704196] audit: type=1325 audit(1561024904.832:4): table=nat family=2 entries=0
Jun 20 18:01:44 ftthings kernel: [   97.777690] audit: type=1300 audit(1561024904.832:4): arch=c00000b7 syscall=273 success=yes exit=0 a0=1 a1=419fd0 a2=0 a3=1 items=0 ppid=33 pid=$
Jun 20 18:01:44 ftthings kernel: [   97.803351] audit: type=1327 audit(1561024904.832:4): proctitle=2F7362696E2F6D6F6470726F6265002D71002D2D0069707461626C655F6E6174
Jun 20 18:01:45 ftthings kernel: [   97.867549] audit: type=1325 audit(1561024904.996:5): table=nat family=2 entries=5
Jun 20 18:01:45 ftthings kernel: [   97.875259] audit: type=1300 audit(1561024904.996:5): arch=c00000b7 syscall=208 success=yes exit=0 a0=4 a1=0 a2=40 a3=1a9ea20 items=0 ppid=3564 $
Jun 20 18:01:45 ftthings kernel: [   97.902541] audit: type=1327 audit(1561024904.996:5): proctitle=2F7573722F7362696E2F69707461626C6573002D2D77616974002D74006E6174002D4E00444F434B$
Jun 20 18:01:45 ftthings kernel: [   97.915934] audit: type=1325 audit(1561024905.008:6): table=filter family=2 entries=4
Jun 20 18:01:45 ftthings connmand[3317]: docker0 {create} index 5 type 1 <ETHER>
Jun 20 18:01:45 ftthings connmand[3317]: docker0 {update} flags 4098 <DOWN>
Jun 20 18:01:45 ftthings connmand[3317]: docker0 {newlink} index 5 address 9A:89:9B:C8:36:9F mtu 1500
Jun 20 18:01:45 ftthings connmand[3317]: docker0 {newlink} index 5 operstate 2 <DOWN>
Jun 20 18:01:45 ftthings connmand[3317]: docker0 {newlink} index 5 address 02:42:4F:2F:90:FC mtu 1500
Jun 20 18:01:45 ftthings connmand[3317]: docker0 {newlink} index 5 operstate 2 <DOWN>
Jun 20 18:01:45 ftthings connmand[3317]: docker0 {add} address 172.17.0.1/16 label docker0 family 2
Jun 20 18:01:45 ftthings avahi-daemon[3294]: Joining mDNS multicast group on inte**ce docker0.IPv4 with address 172.17.0.1.
Jun 20 18:01:45 ftthings connmand[3317]: docker0 {update} flags 4099 <UP>
Jun 20 18:01:45 ftthings connmand[3317]: docker0 {newlink} index 5 address 02:42:4F:2F:90:FC mtu 1500
Jun 20 18:01:45 ftthings connmand[3317]: docker0 {newlink} index 5 operstate 2 <DOWN>
Jun 20 18:01:45 ftthings connmand[3317]: docker0 {add} route 172.17.0.0 gw 0.0.0.0 scope 253 <LINK>
Jun 20 18:01:45 ftthings avahi-daemon[3294]: New relevant inte**ce docker0.IPv4 for mDNS.
Jun 20 18:01:45 ftthings avahi-daemon[3294]: Registering new address record for 172.17.0.1 on docker0.IPv4.
Jun 20 18:01:45 ftthings kernel: [   98.468929] IPv6: ADDRCONF(NETDEV_UP): docker0: link is not ready

目前猜测是的关系,docker启动是在crng init done之后进行吧,
crng花了近90秒
点评回复 支持 反对

使用道具 举报

6

主题

15

回帖

39

积分

LS1012A通行证LS1043A\46A通行证A40i\T3\T507\T527通行证i.MX8MM通行证i.MX6UL通行证

楼主| saspchina 发表于 2019-11-25 13:53:35 | 显示全部楼层
看其他机器上的log,systemd要等crng init done后才启动,所以我想可能的原因就是这里。正常情况下,有鼠标或是键盘的话不存在这个问题,但是我们的板子上没有接这些外设,所以内核一直在等
点评回复 支持 反对

使用道具 举报

6

主题

15

回帖

39

积分

LS1012A通行证LS1043A\46A通行证A40i\T3\T507\T527通行证i.MX8MM通行证i.MX6UL通行证

楼主| saspchina 发表于 2019-11-25 13:55:48 | 显示全部楼层
看一下这个
https://www.toradex.com/community/questions/18861/random-number-generator-hangs-for-a-long-time.html
好像是类似的问题
点评回复 支持 反对

使用道具 举报

0

主题

1185

回帖

2207

积分

FCU1501通行证

zhichao 发表于 2019-11-25 17:40:40 | 显示全部楼层
我对比了一下原版打印信息,你是不是改了网络方面的设置了,而且crng init done没有出现在开机的打印信息中,只会在开机后出现,不会影响开机启动的程序,应该是你修改的内容影响的
点评回复 支持 反对

使用道具 举报

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

本版积分规则