ports/main/nnd-s6-services/rc/mount.run/up

27 lines
476 B
Plaintext
Raw Normal View History

2022-03-21 12:25:55 +00:00
#!/bin/execlineb -P
define DEST /run
define CLEANDEST run
define FSTYPE tmpfs
2022-10-18 19:06:48 +00:00
s6-envdir -i /etc/s6/env/path
2022-03-21 12:25:55 +00:00
importas -i PATH PATH
s6-envdir -i /etc/s6/env/mount.${CLEANDEST}
2022-10-18 19:06:48 +00:00
importas -i OPTS OPTS
2022-03-21 12:25:55 +00:00
emptyenv
export PATH $PATH
fdclose 1
fdclose 2
# TODO: Handle tmpfs being potentially mounted ahead of service execution (initrd)
2022-03-21 12:25:55 +00:00
foreground {
2022-10-18 19:06:48 +00:00
foreground {
exec mkdir -p $DEST
} exec mount -t $FSTYPE -o $OPTS run $DEST
2022-03-21 12:25:55 +00:00
} if -nt {
importas status ? test $status -eq 1
}