rcS中启动udevd
在目标板的/etc/init.d/rcS文件中以如下命令启动udevd:
# start udevd. /sbin/udevd -d /sbin/udevtrigger下面是启动过程,从网络配置开始:
IP-Config: Guessing netmask 255.255.255.0 IP-Config: Complete: device=eth0, addr=192.168.37.244, mask=255.255.255.0, gw=255.255.255.255, host=192.168.37.244, domain=, nis-domain=(none), bootserver=255.255.255.255, rootserver=192.168.37.200, rootpath= Looking up port of RPC 100003/2 on 192.168.37.200 eth0: link up (10/Half) eth0: link down eth0: link up (10/Half) Looking up port of RPC 100005/1 on 192.168.37.200 VFS: Mounted root (nfs filesystem) on device 0:12. Freeing init memory: 120K rm: /tmp: is a directory rm: /var: is a directory udevd[859]: udev: missing sysfs features; please update the kernel or disable the kernel's CONFIG_SYSFS_DEPRECATED option; udev may fy the program '/bin/busybox' called '/sbin/udevtrigger', it should use 'udevadm trigger <options>', this will stop working in a future e udevadm[860]: the program '/bin/busybox' called '/sbin/udevtrigger', it should use 'udevadm trigger <options>', this will stop workine / #最后能顺利进入shell界面,但是提示了udevd与内核的一个选项CONFIG_SYSFS_DEPRECATED似乎不兼容。
因为嵌入式系统的内核可以很方便地更改,重新编译内核:
make ARCH=arm CROSS_COMPILE=arm-linux- menuconfig使用/操作符搜索一下CONFIG_SYSFS_DEPRECATED,发现原来在General setup下确实被设定为y,
进入General setup选项,将Create deprecated sysfs layout for older userspace tools前面的*取消,保存退出。
重新编译生成uImage U-Boot中专用的二进制压缩文件,在U-Boot命令行界面将新编译生成的uImage烧写到Flash中,reset重启目标板。
重启完成,看到如下结果:
IP-Config: Guessing netmask 255.255.255.0 IP-Config: Complete: device=eth0, addr=192.168.37.244, mask=255.255.255.0, gw=255.255.255.255, host=192.168.37.244, domain=, nis-domain=(none), bootserver=255.255.255.255, rootserver=192.168.37.200, rootpath= Looking up port of RPC 100003/2 on 192.168.37.200 eth0: link up (10/Half) eth0: link down eth0: link up (10/Half) Looking up port of RPC 100005/1 on 192.168.37.200 VFS: Mounted root (nfs filesystem) on device 0:12. Freeing init memory: 120K rm: /tmp: is a directory rm: /var: is a directory the program '/bin/busybox' called '/sbin/udevtrigger', it should use 'udevadm trigger <options>', this will stop working in a future e udevadm[861]: the program '/bin/busybox' called '/sbin/udevtrigger', it should use 'udevadm trigger <options>', this will stop workine / #可以看到,原来的关于udev的missing sysfs features已经消失。只是使用上用法有所不同了。