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
6b0b2569
Commit
6b0b2569
authored
Nov 28, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system: make sure vital kernel modules are loaded and refactor
This partially reverts commit
8ecaf5f9
.
parent
7e4c3cf7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
15 deletions
+38
-15
system.inc
src/etc/inc/system.inc
+36
-8
rc.bootup
src/etc/rc.bootup
+1
-5
system_advanced_misc.php
src/www/system_advanced_misc.php
+1
-2
No files found.
src/etc/inc/system.inc
View file @
6b0b2569
...
...
@@ -1420,29 +1420,57 @@ function get_possible_listen_ips($include_ipv6_link_local = false, $include_loop
return
$listenips
;
}
function
load_crypto_module
(
)
function
system_kernel_configure
(
$verbose
=
false
)
{
global
$config
;
if
(
$verbose
)
{
echo
'Configuring kernel modules...'
;
flush
();
}
/*
* Vital kernel modules can go missing on reboot due to
* /boot/loader.conf not materialising. This is still
* an UFS problem, despite claims otherwise. In any case,
* load all the modules again to make sure.
*
* Keep in sync with /usr/local/etc/erc.loader.d/20-modules
*/
$mods
=
array
(
'carp'
,
'if_bridge'
,
'if_enc'
,
'if_gif'
,
'if_gre'
,
'if_lagg'
,
'if_tap'
,
'if_tun'
,
'if_vlan'
,
'pf'
,
'pflog'
,
'pfsync'
,
);
foreach
(
$mods
as
$mod
)
{
mwexecf
(
'/sbin/kldload %s'
,
$mod
,
true
);
}
if
(
!
empty
(
$config
[
'system'
][
'crypto_hardware'
]))
{
log_error
(
sprintf
(
'Loading %s cryptographic accelerator module.'
,
$config
[
'system'
][
'crypto_hardware'
]));
mwexecf
(
'/sbin/kldload %s'
,
$config
[
'system'
][
'crypto_hardware'
],
true
);
}
if
(
isset
(
$config
[
'system'
][
'cryptodev_enable'
]))
{
log_error
(
'Loading cryptodev kernel module.'
);
mwexecf
(
'/sbin/kldload %s'
,
'cryptodev'
,
true
);
}
}
function
load_thermal_module
()
{
global
$config
;
if
(
!
empty
(
$config
[
'system'
][
'thermal_hardware'
]))
{
log_error
(
sprintf
(
'Loading %s thermal monitor module.'
,
$config
[
'system'
][
'thermal_hardware'
]));
mwexecf
(
'/sbin/kldload %s'
,
$config
[
'system'
][
'thermal_hardware'
],
true
);
}
if
(
$verbose
)
{
echo
"done.
\n
"
;
}
}
function
system_cron_configure
(
$verbose
=
false
)
...
...
src/etc/rc.bootup
View file @
6b0b2569
...
...
@@ -105,11 +105,7 @@ if (is_interface_mismatch()) {
while
(
!
set_networking_interfaces_ports
(
true
));
}
/* enable optional crypto modules */
load_crypto_module
();
/* enable optional thermal sensor modules */
load_thermal_module
();
system_kernel_configure
(
true
);
/* read in /etc/sysctl.conf and set values if needed */
echo
"Setting up extended sysctls..."
;
...
...
src/www/system_advanced_misc.php
View file @
6b0b2569
...
...
@@ -169,8 +169,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
system_resolvconf_generate
(
true
);
system_cron_configure
();
activate_powerd
();
load_crypto_module
();
load_thermal_module
();
system_kernel_configure
();
}
}
...
...
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