mirror of
https://github.com/troglobit/finit.git
synced 2026-10-27 12:20:54 +00:00
24 lines
450 B
Bash
Executable File
24 lines
450 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
|
|
|
|
mkdir -p /tmp.shadow
|
|
mount --bind /tmp /tmp.shadow
|
|
mount -t tmpfs none /tmp
|
|
cp -a /tmp.shadow/* /tmp/
|
|
|
|
mkdir -p "$FINIT_RCSD"
|
|
|
|
tty=/dev/$(cat /sys/class/tty/console/active)
|
|
mkfifo "$tty"
|
|
|
|
exec "$@"
|