2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-24 15:05:36 +00:00

fix issue 'lskmodules' cannot list the kernel modules #4575

This commit is contained in:
immarvin
2017-12-25 21:10:46 -05:00
parent 0f7623c212
commit 58dd39e46b

View File

@ -620,7 +620,7 @@ sub mods_in_rpm {
rmtree($tmp_path);
return; }
} else {
if (system("cd $tmp_path; rpm2cpio $krpm | cpio -idum *.ko > /dev/null 2>&1 ; cd - > /dev/null 2>&1")) {
if (system("cd $tmp_path; rpm2cpio $krpm | cpio -idum > /dev/null 2>&1 ; cd - > /dev/null 2>&1")) {
my $rsp;
push @{ $rsp->{data} }, "Unable to extract files from the rpm $krpm.";
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
@ -636,7 +636,7 @@ sub mods_in_rpm {
return;
}
my @ko_files = `find $tmp_path -name *.ko`;
my @ko_files = `find $tmp_path -regextype posix-egrep -regex ".*/*\.ko(\.xz)?"`;
foreach my $ko (@ko_files) {
my %mod;
chomp($ko);
@ -650,7 +650,6 @@ sub mods_in_rpm {
$mod{description} = $desc;
push(@modlist, \%mod);
}
rmtree($tmp_path);
return @modlist;