1
2
3
4
5
6
7
8
9
|
Here's a typical code snippet from the init script:/*/etc/init.d//rcS*/
[1] mount -t sysfs sysfs /sys
[2] echo /bin/mdev > /proc/sys/kernel/hotplug
[3] mdev -s
Of course, a more "full" setup would entail executing this before the previous
code snippet:
[4] mount -t tmpfs mdev /dev
[5] mkdir /dev/pts
[6] mount -t devpts devpts /dev/pts
|
1
2
3
4
5
6
7
|
#!/bin/sh
ifconfig
eth0 192.168.1.17
mount
-a
mkdir
/dev/pts
#使用内存文件系统,减少对flash的读写
mount
-t devpts devpts
/devpts
#/dev/pts用来支持外部网络链接(telnet:远程访问摄像头)的虚拟终端
echo
/sbin/mdev
>
/proc/sys/kernel/hotplug
#设置内核,当有设备插拔时调用/bin/mdev程序
mdev -s
#在/dev目录下生成内核支持的所有设备的节点
|
1
2
3
4
|
The simple explanation here is that
[1] you need to have /sys mounted before executing mdev.
[4] make sure /dev is a tmpfs filesystem (assuming you're running out of flash).
Then you want to [5] create the /dev/pts mount point and finally [6] mount the devpts filesystem on it
|
1
2
3
4
5
6
7
|
/etc/fstab
# device mount-point type options dump fsck order
proc
/proc
proc defaults 0 0
tmpfs
/tmp
tmpfs defaults 0 0
#添加部分
sysfs
/sys
sysfs defaults 0 0
tmpfs
/dev
tmpfs defaults 0 0
|
1
2
3
4
5
|
# /etc/inittab
::sysinit:
/etc/init
.d
/rcS
s3c2410_serial0::askfirst:-
/bin/sh
::ctrlaltdel:
/sbin/reboot
::
shutdown
:
/bin/umount
-a -r
|