前些日子,在使用BUSYBOX文件系统的时候,
发现ctrl +c不能结束应用程序,特别是ping 到网上找了不少资料,下面写下我的方法:
先修改接口(注意主、次设备号):
root@zanget:dev# mknod -m 666 ttyS0 c 5 1 root@zanget:dev# ln -s ttyS0 console root@zanget:dev# ls console -al lrwxrwxrwx 1 root root 5 2010-12-03 20:35 console -> ttyS0 |
修改inittab使其支持修改后的接口:
root@zanget:dev# vi ../etc/inittab |
修改后内容为:
# Startup the system null::sysinit:/bin/mount -o remount,rw / null::sysinit:/bin/mount -t proc proc /proc null::sysinit:/bin/mount -a null::sysinit:/bin/hostname -F /etc/hostname # Now run any rc scripts ::sysinit:/etc/init.d/rcS # Now invoke shell ::askfirst:-/bin/sh # Logging junk null::sysinit:/bin/touch /var/log/messages null::respawn:/sbin/syslogd -n -m 0 null::respawn:/sbin/klogd -n # Stuff to do for the 3-finger salute ::ctrlaltdel:/sbin/reboot # Stuff to do before rebooting null::shutdown:/usr/bin/killall klogd null::shutdown:/usr/bin/killall syslogd null::shutdown:/bin/umount -a -r null::shutdown:/sbin/swapoff -a |
修改完成,烧录并重启即可