From 52d1b3c31ab43174133d5a380816428d72b2aa88 Mon Sep 17 00:00:00 2001 From: nott Date: Thu, 24 Apr 2008 18:37:12 +0000 Subject: [PATCH] Add xcatdsklspost to diskless image and update /etc/inittab. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1194 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/lib/xcat/plugins/aixdskls.pm | 25 +++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/xCAT-server-2.0/lib/xcat/plugins/aixdskls.pm b/xCAT-server-2.0/lib/xcat/plugins/aixdskls.pm index 7355720d2..c3bbe1356 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/aixdskls.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/aixdskls.pm @@ -210,8 +210,8 @@ sub dsklsimage $spot_exists=1; my $rsp; push @{$rsp->{data}}, "A NIM SPOT resource named \'$spot_name\' already exists."; - xCAT::MsgUtils->message("E", $rsp, $callback); - return 1; + xCAT::MsgUtils->message("I", $rsp, $callback); + # return 1; } if (!$spot_exists) { @@ -263,7 +263,7 @@ sub dsklsimage } # end if spot doesn't exist # - # Get the SPOT location ( path to ../usr) + # Get the SPOT location ( /../usr) # $::spot_loc = &get_spot_loc($spot_name, $callback); if (!defined($::spot_loc) ) { @@ -311,17 +311,17 @@ sub dsklsimage } # - # Copy the xcatAIXpost script to the SPOT/COSI and add an entry for it + # Copy the xcatdsklspost script to the SPOT/COSI and add an entry for it # to the /etc/inittab file # # copy the script - my $cpcmd = "mkdir -m 644 -p $::spot_loc/lpp/bos/inst_root/opt/xcat; cp $::XCATROOT/share/xcat/netboot/aix/xcatAIXpost $::spot_loc/lpp/bos/inst_root/opt/xcat/xcatAIXpost"; + my $cpcmd = "mkdir -m 644 -p $::spot_loc/lpp/bos/inst_root/opt/xcat; cp /install/postscripts/xcatdsklspost $::spot_loc/lpp/bos/inst_root/opt/xcat/xcatdsklspost"; my @result = xCAT::Utils->runcmd("$cpcmd", -1); if ($::RUNCMD_RC != 0) { my $rsp; - push @{$rsp->{data}}, "Could not copy the xcatAIXpost script to the SPOT.\n"; + push @{$rsp->{data}}, "Could not copy the xcatdsklspost script to the SPOT.\n"; xCAT::MsgUtils->message("E", $rsp, $callback); return 1; } @@ -350,7 +350,7 @@ sub dsklsimage #------------------------------------------------------------------------- =head3 update_inittab - - add an entry for xcatAIXpost to /etc/inittab + - add an entry for xcatdsklspost to /etc/inittab Description: This function updates the /etc/inittab file. @@ -368,7 +368,16 @@ sub update_inittab my $spotinittab = "$::spot_loc/lpp/bos/inst_root/etc/inittab"; - my $entry = "xcat:2:wait:/opt/xcat/xcatAIXpost\n"; + my $entry = "xcat:2:wait:/opt/xcat/xcatdsklspost\n"; + + # see if xcatdsklspost entry is already in the file + my $cmd = "cat $spotinittab | grep xcatdsklspost"; + my @result = xCAT::Utils->runcmd("$cmd", -1); + if ($::RUNCMD_RC == 0) + { + # it's already there so return + return 0; + } unless (open(INITTAB, ">>$spotinittab")) { my $rsp;