diff options
Diffstat (limited to 'meta-yocto/recipes-core/tiny-init/files/init')
| -rw-r--r-- | meta-yocto/recipes-core/tiny-init/files/init | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/meta-yocto/recipes-core/tiny-init/files/init b/meta-yocto/recipes-core/tiny-init/files/init new file mode 100644 index 0000000000..bf2817d099 --- /dev/null +++ b/meta-yocto/recipes-core/tiny-init/files/init | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # Mount the Linux kernel virtual filesystems | ||
| 4 | mount none -t proc /proc | ||
| 5 | mount none -t sysfs /sys | ||
| 6 | mkdir /dev/pts | ||
| 7 | mount none -t devpts /dev/pts | ||
| 8 | |||
| 9 | ifup lo | ||
| 10 | |||
| 11 | # Allow for distro or local customizations | ||
| 12 | if [ -f /etc/rc.local ] ; then | ||
| 13 | source /etc/rc.local | ||
| 14 | fi | ||
| 15 | |||
| 16 | # Become session leader and try to find a real tty (e.g. ttyS0) | ||
| 17 | while true; do | ||
| 18 | setsid cttyhack sh | ||
| 19 | echo "Console sh exited with $?, respawning..." | ||
| 20 | sleep 1 | ||
| 21 | done | ||
