From 9344ec55587ce13380f62f3a8b4685a267b703e5 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 14 Jul 2016 04:34:13 -0400 Subject: [PATCH] fix issue geninitrd fails when pkgdir has more than one directory #1538 ; fix geninitrd fails to identify a ppc64le kernel #1539 --- xCAT-server/lib/xcat/plugins/anaconda.pm | 4 ++-- xCAT-server/lib/xcat/plugins/geninitrd.pm | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 00590ba7b..3d5dc6f93 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2564,7 +2564,7 @@ sub insert_dd { my @osupdirs = split (/,/, $osupdirlist); foreach my $osupdir (@osupdirs) { # find all the rpms start with kernel.* - my @kernel_rpms = `find $osupdir -name kernel-*.rpm`; + my @kernel_rpms = `find $osupdir -name 'kernel-*.rpm'`; push @rpm_list, @kernel_rpms; } } @@ -2706,7 +2706,7 @@ sub insert_dd { # and copy it to the /tftpboot my @new_kernels = <$dd_dir/rpm/boot/vmlinuz*>; foreach my $new_kernel (@new_kernels) { - if (-r $new_kernel && $new_kernel =~ /\/vmlinuz-(.*(x86_64|ppc64|el\d+))$/) { + if (-r $new_kernel && $new_kernel =~ /\/vmlinuz-(.*(x86_64|ppc64|el\d+|ppc64le))$/) { $new_kernel_ver = $1; $cmd = "/bin/mv -f $new_kernel $kernelpath"; xCAT::Utils->runcmd($cmd, -1); diff --git a/xCAT-server/lib/xcat/plugins/geninitrd.pm b/xCAT-server/lib/xcat/plugins/geninitrd.pm index 967ea5392..8e8afd872 100644 --- a/xCAT-server/lib/xcat/plugins/geninitrd.pm +++ b/xCAT-server/lib/xcat/plugins/geninitrd.pm @@ -123,6 +123,8 @@ sub geninitrd { return; } $pkgdir = $lient->{'pkgdir'}; + my @srcdir=split(/,/,$pkgdir); + $pkgdir = $srcdir[0]; $driverupdatesrc = $lient->{'driverupdatesrc'}; $netdrivers = $lient->{'netdrivers'};