pick compiler by preference
[rrq/overlay-boot.git] / overlay-init
1 #!/bin/sh
2 #
3 # This script performs default actions. It is invoked with CONFIG set
4 # for the subhost.
5
6 OVERLAYDIR="$(dirname $(realpath $0))"
7 . $OVERLAYDIR/functions
8
9 subhost_name "$CONFIG"
10 subhost_config
11
12 # Print the default init script
13 cat <<EOF
14 set -x
15 mount -t proc proc /proc
16 mount -t devpts devpts /dev/pts
17 mount -t sysfs sysfs /sys
18 if [ "$RAM_SIZE" != "none" ] && ! grep -q '/run tmpfs' /proc/mounts ; then
19     mount -t tmpfs -osize=$RAM_SIZE,mode=755 tmpfs /run
20 fi
21 for srv in $START ; do service \$srv start ; done
22 dummy_service() {
23     [ \$# -gt 3 ] && return 0
24     echo "Starting dummy service" >&2
25     set +x
26     [ -p /run/dummy_service ] || mkfifo /run/dummy_service
27     ( printf dummy_service > /proc/self/comm ; read X < /run/dummy_service ) &
28     set -x
29 }
30 dummy_service /proc/*/comm
31 exec /.reaper $NAME
32 EOF
33
34