- [ -d "$UPPER" ] || die "UPPER=$UPPER is not a directory"
- [ -d "$LOWER" ] || die "LOWER=LOWPER is not a directory"
- [ -d "$LIVE" ] || die "LOWER=LOWPER is not a directory"
- # 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"