Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
3ba65be5
Commit
3ba65be5
authored
Jul 02, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system: allow /tmp to optionally function as a tmpfs; closes #1036
parent
d376cfdf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
7 deletions
+31
-7
rc
src/etc/rc
+10
-3
system_advanced_misc.php
src/www/system_advanced_misc.php
+21
-4
No files found.
src/etc/rc
View file @
3ba65be5
...
...
@@ -147,8 +147,16 @@ remove_mfs_link()
fi
}
USE_MFS_TMPVAR
=
`
/usr/bin/grep
-c
use_mfs_tmpvar /conf/config.xml
`
if
[
${
USE_MFS_TMPVAR
}
-ne
0
]
;
then
# USE_MFS_TMP also catches and overrides USE_MFS_VAR (pre-16.7 compat)
# At some point we want to flip use_mfs_tmpvar to use_mfs_var instead.
USE_MFS_VAR
=
`
/usr/bin/grep
-c
use_mfs_tmpvar /conf/config.xml
`
USE_MFS_TMP
=
`
/usr/bin/grep
-c
use_mfs_tmp /conf/config.xml
`
if
[
${
USE_MFS_TMP
}
-ne
0
]
;
then
mount
-t
tmpfs
-o
mode
=
01777 tmpfs /tmp
fi
if
[
${
USE_MFS_VAR
}
-ne
0
]
;
then
echo
-n
"Setting up memory disks..."
setup_mfs_link /root /var/cache opnsense-update
...
...
@@ -156,7 +164,6 @@ if [ ${USE_MFS_TMPVAR} -ne 0 ]; then
setup_mfs_link /root /var/db pkg
setup_mfs_link /root /var crash
mount
-t
tmpfs
-o
mode
=
01777 tmpfs /tmp
mount
-t
tmpfs tmpfs /var
install_mfs_link /root /var/cache opnsense-update
...
...
src/www/system_advanced_misc.php
View file @
3ba65be5
...
...
@@ -83,6 +83,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig
[
'cryptodev_enable'
]
=
isset
(
$config
[
'system'
][
'cryptodev_enable'
]);
$pconfig
[
'thermal_hardware'
]
=
!
empty
(
$config
[
'system'
][
'thermal_hardware'
])
?
$config
[
'system'
][
'thermal_hardware'
]
:
null
;
$pconfig
[
'use_mfs_tmpvar'
]
=
isset
(
$config
[
'system'
][
'use_mfs_tmpvar'
]);
$pconfig
[
'use_mfs_tmp'
]
=
isset
(
$config
[
'system'
][
'use_mfs_tmp'
]);
$pconfig
[
'powerd_ac_mode'
]
=
"hadp"
;
$pconfig
[
'rrdbackup'
]
=
!
empty
(
$config
[
'system'
][
'rrdbackup'
])
?
$config
[
'system'
][
'rrdbackup'
]
:
null
;
$pconfig
[
'dhcpbackup'
]
=
!
empty
(
$config
[
'system'
][
'dhcpbackup'
])
?
$config
[
'system'
][
'dhcpbackup'
]
:
null
;
...
...
@@ -141,6 +142,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
unset
(
$config
[
'system'
][
'use_mfs_tmpvar'
]);
}
if
(
!
empty
(
$pconfig
[
'use_mfs_tmp'
]))
{
$config
[
'system'
][
'use_mfs_tmp'
]
=
true
;
}
elseif
(
isset
(
$config
[
'system'
][
'use_mfs_tmp'
]))
{
unset
(
$config
[
'system'
][
'use_mfs_tmp'
]);
}
if
(
!
empty
(
$pconfig
[
'rrdbackup'
]))
{
$config
[
'system'
][
'rrdbackup'
]
=
$pconfig
[
'rrdbackup'
];
}
elseif
(
isset
(
$config
[
'system'
][
'rrdbackup'
]))
{
...
...
@@ -391,13 +398,23 @@ include("head.inc");
<th
colspan=
"2"
valign=
"top"
class=
"listtopic"
>
<?=
gettext
(
"RAM Disk Settings (Reboot to Apply Changes)"
);
?>
</th>
</tr>
<tr>
<td><a
id=
"help_for_use_mfs_tmpvar"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Use RAM Disks"
);
?>
</td>
<td><a
id=
"help_for_use_mfs_tmpvar"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
'/tmp and /var RAM disks'
);
?>
</td>
<td>
<input
name=
"use_mfs_tmpvar"
type=
"checkbox"
id=
"use_mfs_tmpvar"
value=
"yes"
<?=
!
empty
(
$pconfig
[
'use_mfs_tmpvar'
])
?
"checked=
\"
checked
\"
"
:
""
;
?>
/>
<input
name=
"use_mfs_tmpvar"
type=
"checkbox"
id=
"use_mfs_tmpvar"
value=
"yes"
<?=
!
empty
(
$pconfig
[
'use_mfs_tmpvar'
])
?
'checked="checked"'
:
''
;
?>
/>
<strong>
<?=
gettext
(
"Use memory file system for /tmp and /var"
);
?>
</strong>
<div
class=
"hidden"
for=
"help_for_use_mfs_tmpvar"
>
<?=
gettext
(
"Set this if you wish to use /tmp and /var as RAM disks (memory file system disks) on a full install "
.
"rather than use the hard disk. Setting this will cause the data in /tmp and /var to be lost on reboot, including log data."
);
?>
<?=
gettext
(
"Set this if you wish to use /tmp and /var as RAM disks (memory file system disks) "
.
"rather than use the hard disk. Setting this will cause the data /var to be lost on reboot, including log data."
);
?>
</div>
</td>
</tr>
<tr>
<td><a
id=
"help_for_use_mfs_tmp"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
'/tmp RAM disk'
);
?>
</td>
<td>
<input
name=
"use_mfs_tmp"
type=
"checkbox"
id=
"use_mfs_tmp"
value=
"yes"
<?=
!
empty
(
$pconfig
[
'use_mfs_tmp'
])
?
'checked="checked"'
:
''
;
?>
/>
<strong>
<?=
gettext
(
'Use memory file system for /tmp'
);
?>
</strong>
<div
class=
"hidden"
for=
"help_for_use_mfs_tmp"
>
<?=
gettext
(
'Set this if you wish to use /tmp as a RAM disk (memory file system disk) rather than use the hard disk.'
)
?>
</div>
</td>
</tr>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment