handle multiple postinstall script in linuximage table

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14898 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
wanghuaz 2013-01-16 16:27:44 +00:00
parent 86c315575f
commit a665a4ebc3
6 changed files with 71 additions and 30 deletions

View File

@ -386,15 +386,22 @@ if (!$imagename) {
}
}
if (($postinstall_filename) && (-x $postinstall_filename)) {
if ( $postinstall_filename ) {
$updates{'postinstall'} = $postinstall_filename if ($tempfile);
my $rc = system($postinstall_filename, $rootimg_dir,$osver,$arch,$profile);
if($rc) {
print "postinstall script failed\n";
exit 1;
foreach my $postinstall ( split /,/, $postinstall_filename ) {
if ( !-x $postinstall ) {
print "postinstall script $postinstall is not executable\n";
exit 1;
}
my $rc = system($postinstall, $rootimg_dir,$osver,$arch,$profile);
if($rc) {
print "postinstall script $postinstall failed\n";
exit 1;
}
}
}

View File

@ -377,14 +377,20 @@ if (!$imagename) {
}
}
if (($postinstall_filename) && (-x $postinstall_filename)) {
if ( $postinstall_filename ) {
$updates{'postinstall'} = $postinstall_filename if ($tempfile);
my $rc = system($postinstall_filename, $rootimg_dir,$osver,$arch,$profile);
if($rc) {
print "postinstall script failed\n";
exit 1;
foreach my $postinstall ( split /,/, $postinstall_filename ) {
if ( !-x $postinstall ) {
print "postinstall script $postinstall is not executable\n";
exit 1;
}
my $rc = system($postinstall, $rootimg_dir,$osver,$arch,$profile);
if($rc) {
print "postinstall script $postinstall failed\n";
exit 1;
}
}
}

View File

@ -537,7 +537,7 @@ unless ($imagename) {
}
}
if (($postinstall_filename) && (-x $postinstall_filename)) {
if ( $postinstall_filename ) {
#For Mellonax IB script. In diskless image, the uname -r not returning the rootimg level,
#because the "uname -r" only returns the version of the kernel in use
@ -567,10 +567,16 @@ EOS_UNAME
$updates{'postinstall'} = $postinstall_filename if ($tempfile);
my $rc = system($postinstall_filename, $rootimg_dir,$osver,$arch,$profile);
if($rc) {
print "postinstall script failed\n";
exit 1;
foreach my $postinstall ( split /,/, $postinstall_filename ) {
if ( !-x $postinstall ) {
print "postinstall script $postinstall is not executable\n";
exit 1;
}
my $rc = system($postinstall, $rootimg_dir,$osver,$arch,$profile);
if($rc) {
print "postinstall script $postinstall failed\n";
exit 1;
}
}
# restore the orig uname
system("mv $rootimg_dir/bin/orig_uname $rootimg_dir/bin/uname");

View File

@ -591,7 +591,7 @@ unless ($imagename) {
}
}
if (($postinstall_filename) && (-x $postinstall_filename)) {
if ( $postinstall_filename ) {
#print "postinstall_filename=$postinstall_filename\n";
#For Mellonax IB script. In diskless image, the uname -r not returning the rootimg level,
@ -621,11 +621,19 @@ EOS_UNAME
$updates{'postinstall'} = $postinstall_filename if ($tempfile);
my $rc = system($postinstall_filename, $rootimg_dir,$osver,$arch,$profile);
if($rc) {
print "postinstall script failed\n";
exit 1;
foreach my $postinstall ( split /,/, $postinstall_filename ) {
if ( !-x $postinstall ) {
print "postinstall script $postinstall is not executable\n";
exit 1;
}
my $rc = system($postinstall, $rootimg_dir,$osver,$arch,$profile);
if($rc) {
print "postinstall script $postinstall failed\n";
exit 1;
}
}
# restore the orig uname
system("mv $rootimg_dir/bin/orig_uname $rootimg_dir/bin/uname");

View File

@ -383,11 +383,19 @@ if (!$imagename) {
}
}
if (($postinstall_filename) && (-x $postinstall_filename)) {
my $rc = system($postinstall_filename, $rootimg_dir,$osver,$arch,$profile);
if($rc) {
print "postinstall script failed\n";
exit 1;
if ( $postinstall_filename ) {
my @postinstalls = split /,/, $postinstall_filename;
foreach my $postinstall ( split /,/, $postinstall_filename ) {
if ( !-x $postinstall ) {
print "postinstall script $postinstall is not executable\n";
exit 1;
}
my $rc = system($postinstall, $rootimg_dir,$osver,$arch,$profile);
if($rc) {
print "postinstall script $postinstall failed\n";
exit 1;
}
}
}

View File

@ -501,14 +501,20 @@ unless ($imagename) {
}
}
if (($postinstall_filename) && (-x $postinstall_filename)) {
if ( $postinstall_filename ) {
$updates{'postinstall'} = $postinstall_filename if ($tempfile);
my $rc = system($postinstall_filename, $rootimg_dir,$osver,$arch,$profile);
if($rc) {
print "postinstall script failed\n";
exit 1;
foreach my $postinstall ( split /,/, $postinstall_filename ) {
if ( !-x $postinstall ) {
print "postinstall script $postinstall is not executable\n";
exit 1;
}
my $rc = system($postinstall, $rootimg_dir,$osver,$arch,$profile);
if($rc) {
print "postinstall script $postinstall failed\n";
exit 1;
}
}
}