nrelease: Define BUILDING_NRELEASE_DPORTS when building packages.
[dragonfly.git] / etc / rc.d / mounttmpfs
1 #!/bin/sh
2
3 # PROVIDE: mounttmpfs
4 # REQUIRE: cleanvar
5 # BEFORE: netif
6
7 . /etc/rc.subr
8
9 name="mounttmpfs"
10 start_cmd="mounttmpfs_start"
11 stop_cmd=":"
12
13 mounttmpfs_start()
14 {
15         if checkyesno tmpfs_var_run; then
16                 echo -n "Mounting tmpfs at /var/run"
17                 mount_tmpfs dummy /var/run
18                 echo "."
19
20                 echo "Recreating filesystem hierarchy in /var/run:"
21                 mtree -deiqU -f /etc/mtree/BSD.var.dist -p /var
22                 echo "."
23         else
24                 echo -n "Mounting tmpfs at /var/run/shm"
25                 mount_tmpfs -m 01777 dummy /var/run/shm
26                 mkdir -p -m 01777 /var/run/shm/tmp
27                 echo "."
28         fi
29
30         if checkyesno tmpfs_tmp; then
31                 echo -n "Mounting tmpfs at /tmp"
32                 mount_tmpfs -m 01777 dummy /tmp
33                 echo "."
34         fi
35 }
36
37 load_rc_config $name
38 run_rc_command "$1"