1
|
#!/bin/sh
|
2
|
#
|
3
|
# rc.embedded
|
4
|
#
|
5
|
# part of pfSense (https://www.pfsense.org)
|
6
|
# Copyright (c) 2004-2020 Rubicon Communications, LLC (Netgate)
|
7
|
# All rights reserved.
|
8
|
#
|
9
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
# you may not use this file except in compliance with the License.
|
11
|
# You may obtain a copy of the License at
|
12
|
#
|
13
|
# http://www.apache.org/licenses/LICENSE-2.0
|
14
|
#
|
15
|
# Unless required by applicable law or agreed to in writing, software
|
16
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
# See the License for the specific language governing permissions and
|
19
|
# limitations under the License.
|
20
|
|
21
|
# Size of /tmp
|
22
|
USE_MFS_TMP_SIZE=$(/usr/local/sbin/read_xml_tag.sh string system/use_mfs_tmp_size)
|
23
|
if [ -n "${USE_MFS_TMP_SIZE}" ] && [ ${USE_MFS_TMP_SIZE} -gt 0 ]; then
|
24
|
tmpsize="${USE_MFS_TMP_SIZE}m"
|
25
|
else
|
26
|
tmpsize="40m"
|
27
|
fi
|
28
|
|
29
|
# Size of /var
|
30
|
USE_MFS_VAR_SIZE=$(/usr/local/sbin/read_xml_tag.sh string system/use_mfs_var_size)
|
31
|
if [ -n "${USE_MFS_VAR_SIZE}" ] && [ ${USE_MFS_VAR_SIZE} -gt 0 ]; then
|
32
|
varsize="${USE_MFS_VAR_SIZE}m"
|
33
|
else
|
34
|
varsize="60m"
|
35
|
fi
|
36
|
|
37
|
echo -n "Setting up memory disks..."
|
38
|
mdmfs -S -M -s ${tmpsize} md /tmp
|
39
|
mdmfs -S -M -s ${varsize} md /var
|
40
|
|
41
|
# Create some needed directories
|
42
|
/bin/mkdir -p /var/db /var/spool/lock
|
43
|
/usr/sbin/chown uucp:dialer /var/spool/lock
|
44
|
|
45
|
# Ensure vi's recover directory is present
|
46
|
/bin/mkdir -p /var/tmp/vi.recover/
|
47
|
/bin/mkdir -p /var/crash/
|
48
|
echo " done."
|