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
d74c2749
Commit
d74c2749
authored
Mar 17, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system: do the previous for thermal modules plus some naming unification
parent
efb83c51
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
31 deletions
+27
-31
pfsense-utils.inc
src/etc/inc/pfsense-utils.inc
+4
-16
rc.bootup
src/etc/rc.bootup
+2
-2
system_advanced_misc.php
src/www/system_advanced_misc.php
+21
-13
No files found.
src/etc/inc/pfsense-utils.inc
View file @
d74c2749
...
...
@@ -375,10 +375,7 @@ function is_fqdn($fqdn) {
return
(
$hostname
);
}
/*
* load_crypto() - Load crypto modules if enabled in config.
*/
function
load_crypto
()
function
load_crypto_module
()
{
global
$config
;
...
...
@@ -388,22 +385,13 @@ function load_crypto()
}
}
/*
* load_thermal_hardware() - Load temperature monitor kernel module
*/
function
load_thermal_hardware
()
function
load_thermal_module
()
{
global
$config
;
$thermal_hardware_modules
=
array
(
'coretemp'
,
'amdtemp'
);
if
(
!
isset
(
$config
[
'system'
][
'thermal_hardware'
])
||
!
in_array
(
$config
[
'system'
][
'thermal_hardware'
],
$thermal_hardware_modules
))
{
return
false
;
}
if
(
!
empty
(
$config
[
'system'
][
'thermal_hardware'
])
&&
!
is_module_loaded
(
$config
[
'system'
][
'thermal_hardware'
]))
{
log_error
(
"Loading
{
$config
[
'system'
][
'thermal_hardware'
]
}
thermal monitor module."
);
mwexec
(
"/sbin/kldload
{
$config
[
'system'
][
'thermal_hardware'
]
}
"
);
log_error
(
sprintf
(
gettext
(
'Loading %s thermal monitor module.'
),
$config
[
'system'
][
'thermal_hardware'
])
);
mwexec
f
(
'/sbin/kldload %s'
,
$config
[
'system'
][
'thermal_hardware'
]
);
}
}
...
...
src/etc/rc.bootup
View file @
d74c2749
...
...
@@ -201,10 +201,10 @@ system_setup_sysctl();
echo
"done.
\n
"
;
/* enable optional crypto modules */
load_crypto
();
load_crypto
_module
();
/* enable optional thermal sensor modules */
load_thermal_
hardwar
e
();
load_thermal_
modul
e
();
/* set up our timezone */
system_timezone_configure
();
...
...
src/www/system_advanced_misc.php
View file @
d74c2749
...
...
@@ -40,7 +40,7 @@ require_once("interfaces.inc");
function
crypto_modules
()
{
$
crypto_
modules
=
array
(
$modules
=
array
(
'aesni'
=>
gettext
(
'AES-NI CPU-based Acceleration'
),
'glxsb'
=>
gettext
(
'AMD Geode LX Security Block'
),
'hifn'
=>
gettext
(
'Hifn 7751/7951/7811/7955/7956 Crypto Accelerator'
),
...
...
@@ -50,7 +50,7 @@ function crypto_modules()
);
$available
=
array
();
foreach
(
$
crypto_
modules
as
$name
=>
$desc
)
{
foreach
(
$modules
as
$name
=>
$desc
)
{
if
(
file_exists
(
"/boot/kernel/
{
$name
}
.ko"
))
{
$available
[
$name
]
=
$desc
;
}
...
...
@@ -59,10 +59,22 @@ function crypto_modules()
return
$available
;
}
$thermal_hardware_modules
=
array
(
'coretemp'
=>
gettext
(
'Intel Core* CPU on-die thermal sensor'
),
'amdtemp'
=>
gettext
(
'AMD K8, K10 and K11 CPU on-die thermal sensor'
),
);
function
thermal_modules
()
{
$modules
=
array
(
'amdtemp'
=>
gettext
(
'AMD K8, K10 and K11 CPU on-die thermal sensor'
),
'coretemp'
=>
gettext
(
'Intel Core* CPU on-die thermal sensor'
),
);
$available
=
array
();
foreach
(
$modules
as
$name
=>
$desc
)
{
if
(
file_exists
(
"/boot/kernel/
{
$name
}
.ko"
))
{
$available
[
$name
]
=
$desc
;
}
}
return
$available
;
}
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
$pconfig
=
array
();
...
...
@@ -95,10 +107,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$input_errors
=
array
();
$pconfig
=
$_POST
;
if
(
!
empty
(
$pconfig
[
'thermal_hardware'
])
&&
!
array_key_exists
(
$pconfig
[
'thermal_hardware'
],
$thermal_hardware_modules
))
{
$input_errors
[]
=
gettext
(
"Please select a valid Thermal Hardware Sensor."
);
}
if
(
count
(
$input_errors
)
==
0
)
{
if
(
!
empty
(
$pconfig
[
'proxyurl'
]))
{
$config
[
'system'
][
'proxyurl'
]
=
$_POST
[
'proxyurl'
];
...
...
@@ -213,8 +221,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
system_resolvconf_generate
(
true
);
filter_configure
();
activate_powerd
();
load_crypto
();
load_thermal_
hardwar
e
();
load_crypto
_module
();
load_thermal_
modul
e
();
if
(
$need_relayd_restart
)
{
relayd_configure
();
}
...
...
@@ -459,7 +467,7 @@ include("head.inc");
<select
name=
"thermal_hardware"
class=
"selectpicker"
data-style=
"btn-default"
>
<option
value=
""
>
<?=
gettext
(
"None/ACPI"
);
?>
</option>
<?php
foreach
(
$thermal_hardware_modules
as
$themalmod_name
=>
$themalmod_descr
)
:?>
foreach
(
thermal_modules
()
as
$themalmod_name
=>
$themalmod_descr
)
:?>
<
option
value
=
"<?=
$themalmod_name
; ?>"
<?=
$pconfig
[
'thermal_hardware'
]
==
$themalmod_name
?
" selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
"
{
$themalmod_descr
}
(
{
$themalmod_name
}
)"
;
?>
</option>
...
...
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