Project

General

Profile

Download (1.54 KB) Statistics
| Branch: | Tag: | Revision:
1
#!/bin/sh
2
#
3
# rc.embedded
4
#
5
# part of pfSense (https://www.pfsense.org)
6
# Copyright (c) 2004-2013 BSD Perimeter
7
# Copyright (c) 2013-2016 Electric Sheep Fencing
8
# Copyright (c) 2014-2019 Rubicon Communications, LLC (Netgate)
9
# All rights reserved.
10
#
11
# Licensed under the Apache License, Version 2.0 (the "License");
12
# you may not use this file except in compliance with the License.
13
# You may obtain a copy of the License at
14
#
15
# http://www.apache.org/licenses/LICENSE-2.0
16
#
17
# Unless required by applicable law or agreed to in writing, software
18
# distributed under the License is distributed on an "AS IS" BASIS,
19
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
# See the License for the specific language governing permissions and
21
# limitations under the License.
22

    
23
# Size of /tmp
24
USE_MFS_TMP_SIZE=$(/usr/local/sbin/read_xml_tag.sh string system/use_mfs_tmp_size)
25
if [ -n "${USE_MFS_TMP_SIZE}" ] && [ ${USE_MFS_TMP_SIZE} -gt 0 ]; then
26
	tmpsize="${USE_MFS_TMP_SIZE}m"
27
else
28
	tmpsize="40m"
29
fi
30

    
31
# Size of /var
32
USE_MFS_VAR_SIZE=$(/usr/local/sbin/read_xml_tag.sh string system/use_mfs_var_size)
33
if [ -n "${USE_MFS_VAR_SIZE}" ] && [ ${USE_MFS_VAR_SIZE} -gt 0 ]; then
34
	varsize="${USE_MFS_VAR_SIZE}m"
35
else
36
	varsize="60m"
37
fi
38

    
39
echo -n "Setting up memory disks..."
40
mdmfs -S -M -s ${tmpsize} md /tmp
41
mdmfs -S -M -s ${varsize} md /var
42

    
43
# Create some needed directories
44
/bin/mkdir -p /var/db /var/spool/lock
45
/usr/sbin/chown uucp:dialer /var/spool/lock
46

    
47
# Ensure vi's recover directory is present
48
/bin/mkdir -p /var/tmp/vi.recover/
49
/bin/mkdir -p /var/crash/
50
echo " done."
(30-30/81)