cat <<EOF
set -x
mount -t proc proc /proc
-mount -t devpts devpts /dev/pts
-mount -t sysfs sysfs /sys
-if [ "$RAM_SIZE" != "none" ] && ! grep -q '/run tmpfs' /proc/mounts ; then
- mount -t tmpfs -osize=$RAM_SIZE,mode=755 tmpfs /run
-fi
for srv in $START ; do service \$srv start ; done
dummy_service() {
[ \$# -gt 3 ] && return 0
subhost_name "$CONFIG"
subhost_config
+# setup $LIVE/dev
+mkdir -p "$LIVE/dev"
+mount -t tmpfs -osize=50M devtmpfs "$LIVE/dev"
+mknod -m 622 "$LIVE/dev/console" c 5 1
+mknod -m 666 "$LIVE/dev/null" c 1 3
+mknod -m 666 "$LIVE/dev/zero" c 1 5
+mknod -m 666 "$LIVE/dev/ptmx" c 5 2
+mknod -m 666 "$LIVE/dev/tty" c 5 0
+mknod -m 444 "$LIVE/dev/random" c 1 8
+mknod -m 444 "$LIVE/dev/urandom" c 1 9
+chown root:tty "$LIVE/dev/console"
+chown root:tty "$LIVE/dev/ptmx"
+chown root:tty "$LIVE/dev/tty"
+ln -sTf /proc/self/fd "$LIVE/dev/fd"
+ln -sTf /proc/self/fd/0 "$LIVE/dev/stdin"
+ln -sTf /proc/self/fd/1 "$LIVE/dev/stdout"
+ln -sTf /proc/self/fd/2 "$LIVE/dev/stderr"
+ln -sTf /proc/kcore "$LIVE/dev/core"
+mkdir "$LIVE/dev/shm"
+mkdir "$LIVE/dev/pts"
+chmod 1777 "$LIVE/dev/shm"
+
+mount -t devpts devpts $LIVE/dev/pts
+mount -t sysfs sysfs $LIVE/sys
+if [ "$RAM_SIZE" != "none" ] ; then
+ mount -t tmpfs -osize=$RAM_SIZE,mode=755 tmpfs $LIVE/run
+fi
+
echo "Installing $OVERLAYDIR/reaper to $LIVE/.reaper"
cp -p $OVERLAYDIR/reaper $LIVE/.reaper
subhost_name "$CONFIG"
subhost_config
-# setup $UPPER/dev
-mkdir -p "$UPPER/dev"
-mount -t tmpfs -osize=50M tmpfs "$UPPER/dev"
-mknod -m 622 "$UPPER/dev/console" c 5 1
-mknod -m 666 "$UPPER/dev/null" c 1 3
-mknod -m 666 "$UPPER/dev/zero" c 1 5
-mknod -m 666 "$UPPER/dev/ptmx" c 5 2
-mknod -m 666 "$UPPER/dev/tty" c 5 0
-mknod -m 444 "$UPPER/dev/random" c 1 8
-mknod -m 444 "$UPPER/dev/urandom" c 1 9
-chown root:tty "$UPPER/dev/console"
-chown root:tty "$UPPER/dev/ptmx"
-chown root:tty "$UPPER/dev/tty"
-ln -sTf /proc/self/fd "$UPPER/dev/fd"
-ln -sTf /proc/self/fd/0 "$UPPER/dev/stdin"
-ln -sTf /proc/self/fd/1 "$UPPER/dev/stdout"
-ln -sTf /proc/self/fd/2 "$UPPER/dev/stderr"
-ln -sTf /proc/kcore "$UPPER/dev/core"
-mkdir "$UPPER/dev/shm"
-mkdir "$UPPER/dev/pts"
-chmod 1777 "$UPPER/dev/shm"
-
# all good so far ; now avoid using the host's networking setup
setup_networking "$UPPER"
+