From 4b9a265f84ef6c8a586444f7a89808cedfd934aa Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 8 Jul 2015 09:02:51 +0200 Subject: [PATCH] system: /var and /tmp MFS migrate to tmpfs; #243 Remove the size settings for those mount points as a preparation, because tmpfs does not need an upper bound. Hardcode everything now, replace mfs with tmpfs in an upcoming commit. --- src/etc/rc | 18 ++----------- src/www/system_advanced_misc.php | 43 -------------------------------- 2 files changed, 2 insertions(+), 59 deletions(-) diff --git a/src/etc/rc b/src/etc/rc index 83987eb92..1a3983093 100755 --- a/src/etc/rc +++ b/src/etc/rc @@ -124,20 +124,6 @@ fi USE_MFS_TMPVAR=`/usr/bin/grep -c use_mfs_tmpvar /conf/config.xml` if [ ${USE_MFS_TMPVAR} -ne 0 ]; then - USE_MFS_TMP_SIZE=`/usr/bin/grep use_mfs_tmp_size /conf/config.xml | /usr/bin/cut -f2 -d'>' | /usr/bin/cut -f1 -d'<'` - if [ ! -z ${USE_MFS_TMP_SIZE} ] && [ ${USE_MFS_TMP_SIZE} -gt 0 ]; then - tmpsize="${USE_MFS_TMP_SIZE}m" - else - tmpsize="40m" - fi - - USE_MFS_VAR_SIZE=`/usr/bin/grep use_mfs_var_size /conf/config.xml | /usr/bin/cut -f2 -d'>' | /usr/bin/cut -f1 -d'<'` - if [ ! -z ${USE_MFS_VAR_SIZE} ] && [ ${USE_MFS_VAR_SIZE} -gt 0 ]; then - varsize="${USE_MFS_VAR_SIZE}m" - else - varsize="60m" - fi - echo -n "Setting up memory disks..." if [ ! -d /root/var/db/pkg ]; then @@ -148,8 +134,8 @@ if [ ${USE_MFS_TMPVAR} -ne 0 ]; then ln -s /root/var/db/pkg /var/db/pkg fi - mdmfs -S -M -s ${tmpsize} md /tmp - mdmfs -S -M -s ${varsize} md /var + mdmfs -S -M -s 40m md /tmp + mdmfs -S -M -s 60m md /var mkdir -p /var/db ln -s /root/var/db/pkg /var/db/pkg diff --git a/src/www/system_advanced_misc.php b/src/www/system_advanced_misc.php index a166b4bd6..0cec6c23a 100644 --- a/src/www/system_advanced_misc.php +++ b/src/www/system_advanced_misc.php @@ -50,8 +50,6 @@ $pconfig['schedule_states'] = isset($config['system']['schedule_states']); $pconfig['kill_states'] = isset($config['system']['kill_states']); $pconfig['skip_rules_gw_down'] = isset($config['system']['skip_rules_gw_down']); $pconfig['use_mfs_tmpvar'] = isset($config['system']['use_mfs_tmpvar']); -$pconfig['use_mfs_tmp_size'] = $config['system']['use_mfs_tmp_size']; -$pconfig['use_mfs_var_size'] = $config['system']['use_mfs_var_size']; $pconfig['powerd_ac_mode'] = "hadp"; if (!empty($config['system']['powerd_ac_mode'])) { @@ -84,14 +82,6 @@ if ($_POST) { $input_errors[] = gettext("Please select a valid Thermal Hardware Sensor."); } - if (!empty($_POST['use_mfs_tmp_size']) && (!is_numeric($_POST['use_mfs_tmp_size']) || ($_POST['use_mfs_tmp_size'] <= 40))) { - $input_errors[] = gettext("/tmp Size must be numeric and should not be less than 40MB."); - } - - if (!empty($_POST['use_mfs_var_size']) && (!is_numeric($_POST['use_mfs_var_size']) || ($_POST['use_mfs_var_size'] <= 60))) { - $input_errors[] = gettext("/var Size must be numeric and should not be less than 60MB."); - } - if (!$input_errors) { if ($_POST['harddiskstandby'] <> "") { $config['system']['harddiskstandby'] = $_POST['harddiskstandby']; @@ -189,9 +179,6 @@ if ($_POST) { unset($config['system']['use_mfs_tmpvar']); } - $config['system']['use_mfs_tmp_size'] = $_POST['use_mfs_tmp_size']; - $config['system']['use_mfs_var_size'] = $_POST['use_mfs_var_size']; - if (isset($_POST['rrdbackup'])) { $config['system']['rrdbackup'] = $_POST['rrdbackup']; install_cron_job("/usr/local/etc/rc.backup_rrd", ($config['system']['rrdbackup'] > 0), $minute = "0", "*/{$config['system']['rrdbackup']}"); @@ -240,15 +227,11 @@ include("head.inc"); } function tmpvar_checked(obj) { if (obj.checked) { - jQuery('#use_mfs_tmp_size').attr('disabled',false); - jQuery('#use_mfs_var_size').attr('disabled',false); jQuery('#rrdbackup').attr('disabled',false); jQuery('#dhcpbackup').attr('disabled',false); jQuery('#rrdbackup').selectpicker('refresh'); jQuery('#dhcpbackup').selectpicker('refresh'); } else { - jQuery('#use_mfs_tmp_size').attr('disabled','true'); - jQuery('#use_mfs_var_size').attr('disabled','true'); jQuery('#rrdbackup').attr('disabled','true'); jQuery('#dhcpbackup').attr('disabled','true'); jQuery('#rrdbackup').selectpicker('refresh'); @@ -549,32 +532,6 @@ endforeach; ?> "rather than use the hard disk. Setting this will cause the data in /tmp and /var to be lost at reboot, including log data. RRD and DHCP Leases will be retained."); ?> - - - - " class="formfld unknown" /> MB -
- - - - - - - " class="formfld unknown" /> MB -
- - -