mirror of
https://github.com/troglobit/finit.git
synced 2026-10-24 11:54:36 +00:00
28 lines
532 B
Bash
Executable File
28 lines
532 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
# It would have been nice to mount /dev as devtmpfs, but unfortunately
|
|
# that's not possible if you're not privileged. For now tmpfs will
|
|
# have to do.
|
|
mount -n -t tmpfs none /dev
|
|
|
|
mount -t proc none /proc
|
|
mount -t sysfs none /sys
|
|
|
|
if [ "$(ls -A /tmp)" ]; then
|
|
mkdir -p /tmp.shadow
|
|
mount --bind /tmp /tmp.shadow
|
|
mount -t tmpfs none /tmp
|
|
cp -a /tmp.shadow/* /tmp/
|
|
else
|
|
mount -t tmpfs none /tmp
|
|
fi
|
|
|
|
mkdir -p "$FINIT_RCSD"
|
|
|
|
tty=/dev/$(cat /sys/class/tty/console/active)
|
|
mkfifo "$tty"
|
|
|
|
exec "$@"
|