32 |
32 |
global $config;
|
33 |
33 |
|
34 |
34 |
$pconfig = array();
|
|
35 |
|
|
36 |
$pconfig['available_kernel_memory'] = get_single_sysctl("vm.kmem_map_free");
|
|
37 |
|
|
38 |
/* Adjust available kernel memory to account for existing RAM disks
|
|
39 |
* https://redmine.pfsense.org/issues/10420 */
|
|
40 |
if (isset($config['system']['use_mfs_tmpvar'])) {
|
|
41 |
$pconfig['available_kernel_memory'] += (int) trim(exec("/bin/df -k /tmp /var | /usr/bin/awk '/\/dev\/md/ {sum += \$2 * 1024} END {print sum}'"));
|
|
42 |
}
|
|
43 |
|
35 |
44 |
$pconfig['proxyurl'] = $config['system']['proxyurl'];
|
36 |
45 |
$pconfig['proxyport'] = $config['system']['proxyport'];
|
37 |
46 |
$pconfig['proxyuser'] = $config['system']['proxyuser'];
|
... | ... | |
51 |
60 |
$pconfig['use_mfs_tmp_size'] = $config['system']['use_mfs_tmp_size'];
|
52 |
61 |
$pconfig['use_mfs_var_size'] = $config['system']['use_mfs_var_size'];
|
53 |
62 |
$pconfig['do_not_send_uniqueid'] = isset($config['system']['do_not_send_uniqueid']);
|
54 |
|
$pconfig['available_kernel_memory'] = get_single_sysctl("vm.kmem_map_free");
|
55 |
63 |
$pconfig['pti'] = get_single_sysctl('vm.pmap.pti');
|
56 |
64 |
$pconfig['mds']= get_single_sysctl('hw.mds_disable_state');
|
57 |
65 |
|
58 |
|
/* Adjust available kernel memory to account for existing RAM disks
|
59 |
|
* https://redmine.pfsense.org/issues/10420 */
|
60 |
|
if (isset($config['system']['use_mfs_tmpvar'])) {
|
61 |
|
/* Get current RAM disk sizes */
|
62 |
|
$pconfig['available_kernel_memory'] += ((int) trim(exec("/bin/df -k /tmp /var | /usr/bin/awk '/\/dev\/md/ {sum += \$2 * 1024} END {print sum}'")));
|
63 |
|
}
|
64 |
|
|
65 |
66 |
$pconfig['powerd_ac_mode'] = "hadp";
|
66 |
67 |
if (!empty($config['system']['powerd_ac_mode'])) {
|
67 |
68 |
$pconfig['powerd_ac_mode'] = $config['system']['powerd_ac_mode'];
|
... | ... | |
111 |
112 |
'amdtemp' => gettext("AMD K8, K10 and K11 CPU on-die thermal sensor")
|
112 |
113 |
);
|
113 |
114 |
|
|
115 |
$post['available_kernel_memory'] = get_single_sysctl("vm.kmem_map_free");
|
|
116 |
|
|
117 |
/* Adjust available kernel memory to account for existing RAM disks
|
|
118 |
* https://redmine.pfsense.org/issues/10420 */
|
|
119 |
if (isset($config['system']['use_mfs_tmpvar'])) {
|
|
120 |
$post['available_kernel_memory'] += (int) trim(exec("/bin/df -k /tmp /var | /usr/bin/awk '/\/dev\/md/ {sum += \$2 * 1024} END {print sum}'"));
|
|
121 |
}
|
|
122 |
|
114 |
123 |
if (!empty($post['crypto_hardware']) && !array_key_exists($post['crypto_hardware'], $crypto_modules)) {
|
115 |
124 |
$input_errors[] = gettext("Please select a valid Cryptographic Accelerator.");
|
116 |
125 |
}
|
... | ... | |
357 |
366 |
|
358 |
367 |
// Compose the structure to retuen
|
359 |
368 |
$rv['input_errors'] = $input_errors;
|
360 |
|
$post['available_kernel_memory'] = get_single_sysctl("vm.kmem_map_free");
|
361 |
369 |
$post['pti'] = get_single_sysctl('vm.pmap.pti');
|
362 |
370 |
$post['mds'] = get_single_sysctl('hw.mds_disable_state');
|
363 |
371 |
|
Fixed #11702 by revising ramdisk code