summaryrefslogtreecommitdiffstats
path: root/meta-fri2/recipes-core/tiny-init/tiny-init/init
blob: 4b78f017fe29c216c7e924473d52b526d3e9a073 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

# Mount the Linux kernel virtual filesystems
mount none -t proc /proc
mount none -t sysfs /sys

# Ensure devtmpfs is mounted, it must be done manually with initramfs
mount none -t devtmpfs /dev

# Setup PTY infrastructure
mkdir /dev/pts
mount none -t devpts /dev/pts

ifup lo

# Allow for distro or local customizations
if [ -f /etc/rc.local ] ; then
	source /etc/rc.local
fi

# Become session leader and try to find a real tty (e.g. ttyS0)
while true; do
	setsid cttyhack sh
	echo "Console sh exited with $?, respawning..."
	sleep 1
done