1
|
#!/bin/sh
|
2
|
#
|
3
|
# rc.embedded - embedded system specific startup information
|
4
|
# For pfSense
|
5
|
|
6
|
# Size of /tmp
|
7
|
USE_MFS_TMP_SIZE=`/usr/bin/grep use_mfs_tmp_size /cf/conf/config.xml | /usr/bin/cut -f2 -d'>' | /usr/bin/cut -f1 -d'<'`
|
8
|
if [ ! -z ${USE_MFS_TMP_SIZE} ] && [ ${USE_MFS_TMP_SIZE} -gt 0 ]; then
|
9
|
tmpsize="${USE_MFS_TMP_SIZE}m"
|
10
|
else
|
11
|
tmpsize="40m"
|
12
|
fi
|
13
|
|
14
|
# Size of /var
|
15
|
USE_MFS_VAR_SIZE=`/usr/bin/grep use_mfs_var_size /cf/conf/config.xml | /usr/bin/cut -f2 -d'>' | /usr/bin/cut -f1 -d'<'`
|
16
|
if [ ! -z ${USE_MFS_VAR_SIZE} ] && [ ${USE_MFS_VAR_SIZE} -gt 0 ]; then
|
17
|
varsize="${USE_MFS_VAR_SIZE}m"
|
18
|
else
|
19
|
varsize="60m"
|
20
|
fi
|
21
|
|
22
|
# Run some initialization routines
|
23
|
[ -f /etc/rc.d/uzip ] && /etc/rc.d/uzip start
|
24
|
|
25
|
echo -n "Setting up memory disks..."
|
26
|
mdmfs -S -M -s ${tmpsize} md /tmp
|
27
|
mdmfs -S -M -s ${varsize} md /var
|
28
|
|
29
|
# Create some needed directories
|
30
|
/bin/mkdir -p /var/db
|
31
|
|
32
|
# Ensure vi's recover directory is present
|
33
|
/bin/mkdir -p /var/tmp/vi.recover/
|
34
|
echo " done."
|