Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # Mount the Linux kernel virtual filesystems |
| 4 | mount none -t proc /proc |
| 5 | mount none -t sysfs /sys |
| 6 | |
| 7 | # Ensure devtmpfs is mounted, it must be done manually with initramfs |
| 8 | mount none -t devtmpfs /dev |
| 9 | |
| 10 | # Setup PTY infrastructure |
| 11 | mkdir /dev/pts |
| 12 | mount none -t devpts /dev/pts |
| 13 | |
| 14 | ifup lo |
| 15 | |
| 16 | # Allow for distro or local customizations |
| 17 | if [ -f /etc/rc.local ] ; then |
| 18 | . /etc/rc.local |
| 19 | fi |
| 20 | |
| 21 | # Become session leader and try to find a real tty (e.g. ttyS0) |
| 22 | while true; do |
| 23 | setsid cttyhack sh |
| 24 | echo "Console sh exited with $?, respawning..." |
| 25 | sleep 1 |
| 26 | done |