Correct module loading in the compiler

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2017-09-14 15:08:38 -07:00
parent fb831e3128
commit 85a7ec6fe5
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -4288,7 +4288,7 @@ sub which( $ ) {
# Load the kernel modules defined in the 'modules' file. # Load the kernel modules defined in the 'modules' file.
# #
sub load_kernel_modules( ) { sub load_kernel_modules( ) {
my $moduleloader = which( 'modprobe' ) || ( which 'insmod' ); my $moduleloader = which( 'modprobe' ) || which( 'insmod' );
my $modulesdir = $config{MODULESDIR}; my $modulesdir = $config{MODULESDIR};
@ -4326,7 +4326,7 @@ sub load_kernel_modules( ) {
fatal_error "Invalid modules file entry" unless ( $currentline =~ /^loadmodule\s+([a-zA-Z]\w*)\s*(.*)$/ ); fatal_error "Invalid modules file entry" unless ( $currentline =~ /^loadmodule\s+([a-zA-Z]\w*)\s*(.*)$/ );
my ( $module, $arguments ) = ( $1, $2 ); my ( $module, $arguments ) = ( $1, $2 );
unless ( $loadedmodules{ $module } ) { unless ( $loadedmodules{ $module } ) {
if ( $moduleloader eq 'modprobe' ) { if ( $moduleloader =~ /modprobe$/ ) {
system( "modprobe -q $module $arguments" ); system( "modprobe -q $module $arguments" );
$loadedmodules{ $module } = 1; $loadedmodules{ $module } = 1;
} else { } else {