2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-21 10:40:24 +00:00

Merge pull request #4584 from immarvin/onissue

fix issue 'lskmodules' cannot list the kernel modules #4575
This commit is contained in:
Bin Xu
2017-12-26 11:25:40 +08:00
committed by GitHub
2 changed files with 9 additions and 3 deletions

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;

View File

@@ -10,6 +10,13 @@ cmd:ls /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__
check:rc==0
end
start:lskmodules_o
cmd:lskmodules -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__
check:rc==0
check:output=~.ko(.xz):
end
start:copycds_n
os:Linux
#cmd:umount /mnt/xca