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
Show 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) {
...
@@ -375,10 +375,7 @@ function is_fqdn($fqdn) {
return
(
$hostname
);
return
(
$hostname
);
}
}
/*
function
load_crypto_module
()
* load_crypto() - Load crypto modules if enabled in config.
*/
function
load_crypto
()
{
{
global
$config
;
global
$config
;
...
@@ -388,22 +385,13 @@ function load_crypto()
...
@@ -388,22 +385,13 @@ function load_crypto()
}
}
}
}
/*
function
load_thermal_module
()
* load_thermal_hardware() - Load temperature monitor kernel module
*/
function
load_thermal_hardware
()
{
{
global
$config
;
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'
]))
{
if
(
!
empty
(
$config
[
'system'
][
'thermal_hardware'
])
&&
!
is_module_loaded
(
$config
[
'system'
][
'thermal_hardware'
]))
{
log_error
(
"Loading
{
$config
[
'system'
][
'thermal_hardware'
]
}
thermal monitor module."
);
log_error
(
sprintf
(
gettext
(
'Loading %s thermal monitor module.'
),
$config
[
'system'
][
'thermal_hardware'
])
);
mwexec
(
"/sbin/kldload
{
$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();
...
@@ -201,10 +201,10 @@ system_setup_sysctl();
echo
"done.
\n
"
;
echo
"done.
\n
"
;
/* enable optional crypto modules */
/* enable optional crypto modules */
load_crypto
();
load_crypto
_module
();
/* enable optional thermal sensor modules */
/* enable optional thermal sensor modules */
load_thermal_
hardwar
e
();
load_thermal_
modul
e
();
/* set up our timezone */
/* set up our timezone */
system_timezone_configure
();
system_timezone_configure
();
...
...
src/www/system_advanced_misc.php
View file @
d74c2749
...
@@ -40,7 +40,7 @@ require_once("interfaces.inc");
...
@@ -40,7 +40,7 @@ require_once("interfaces.inc");
function
crypto_modules
()
function
crypto_modules
()
{
{
$
crypto_
modules
=
array
(
$modules
=
array
(
'aesni'
=>
gettext
(
'AES-NI CPU-based Acceleration'
),
'aesni'
=>
gettext
(
'AES-NI CPU-based Acceleration'
),
'glxsb'
=>
gettext
(
'AMD Geode LX Security Block'
),
'glxsb'
=>
gettext
(
'AMD Geode LX Security Block'
),
'hifn'
=>
gettext
(
'Hifn 7751/7951/7811/7955/7956 Crypto Accelerator'
),
'hifn'
=>
gettext
(
'Hifn 7751/7951/7811/7955/7956 Crypto Accelerator'
),
...
@@ -50,7 +50,7 @@ function crypto_modules()
...
@@ -50,7 +50,7 @@ function crypto_modules()
);
);
$available
=
array
();
$available
=
array
();
foreach
(
$
crypto_
modules
as
$name
=>
$desc
)
{
foreach
(
$modules
as
$name
=>
$desc
)
{
if
(
file_exists
(
"/boot/kernel/
{
$name
}
.ko"
))
{
if
(
file_exists
(
"/boot/kernel/
{
$name
}
.ko"
))
{
$available
[
$name
]
=
$desc
;
$available
[
$name
]
=
$desc
;
}
}
...
@@ -59,10 +59,22 @@ function crypto_modules()
...
@@ -59,10 +59,22 @@ function crypto_modules()
return
$available
;
return
$available
;
}
}
$thermal_hardware_modules
=
array
(
function
thermal_modules
()
'coretemp'
=>
gettext
(
'Intel Core* CPU on-die thermal sensor'
),
{
$modules
=
array
(
'amdtemp'
=>
gettext
(
'AMD K8, K10 and K11 CPU on-die thermal sensor'
),
'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'
)
{
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
$pconfig
=
array
();
$pconfig
=
array
();
...
@@ -95,10 +107,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
...
@@ -95,10 +107,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$input_errors
=
array
();
$input_errors
=
array
();
$pconfig
=
$_POST
;
$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
(
count
(
$input_errors
)
==
0
)
{
if
(
!
empty
(
$pconfig
[
'proxyurl'
]))
{
if
(
!
empty
(
$pconfig
[
'proxyurl'
]))
{
$config
[
'system'
][
'proxyurl'
]
=
$_POST
[
'proxyurl'
];
$config
[
'system'
][
'proxyurl'
]
=
$_POST
[
'proxyurl'
];
...
@@ -213,8 +221,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
...
@@ -213,8 +221,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
system_resolvconf_generate
(
true
);
system_resolvconf_generate
(
true
);
filter_configure
();
filter_configure
();
activate_powerd
();
activate_powerd
();
load_crypto
();
load_crypto
_module
();
load_thermal_
hardwar
e
();
load_thermal_
modul
e
();
if
(
$need_relayd_restart
)
{
if
(
$need_relayd_restart
)
{
relayd_configure
();
relayd_configure
();
}
}
...
@@ -459,7 +467,7 @@ include("head.inc");
...
@@ -459,7 +467,7 @@ include("head.inc");
<select
name=
"thermal_hardware"
class=
"selectpicker"
data-style=
"btn-default"
>
<select
name=
"thermal_hardware"
class=
"selectpicker"
data-style=
"btn-default"
>
<option
value=
""
>
<?=
gettext
(
"None/ACPI"
);
?>
</option>
<option
value=
""
>
<?=
gettext
(
"None/ACPI"
);
?>
</option>
<?php
<?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
\"
"
:
""
;
?>
>
<
option
value
=
"<?=
$themalmod_name
; ?>"
<?=
$pconfig
[
'thermal_hardware'
]
==
$themalmod_name
?
" selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
"
{
$themalmod_descr
}
(
{
$themalmod_name
}
)"
;
?>
<?=
"
{
$themalmod_descr
}
(
{
$themalmod_name
}
)"
;
?>
</option>
</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