From 7e57e325de3d75feb9392dc2f3be71b25f4d56de Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 22 Apr 2011 13:49:14 +0000 Subject: [PATCH] Add ESXi5 boot.cfg.stateless fixup on media import git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9379 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index 6bdb6988a..907126c22 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -3752,6 +3752,27 @@ sub copycd { # let everyone read it #chdir "/tmp"; chmod 0755, "$installroot/$distname/$arch"; + if ($distname =~ /esxi5/) { #going to tweak boot.cfg for install and default stateless case + if (! -r "$installroot/$distname/$arch/boot.cfg.stateless") { + copy("$installroot/$distname/$arch/boot.cfg","$installroot/$distname/$arch/boot.cfg.stateless"); + my $bootcfg; + open($bootcfg,"<","$installroot/$distname/$arch/boot.cfg"); + my @bootcfg = <$bootcfg>; + close($bootcfg); + foreach (@bootcfg) { #no point in optimizing trivial, infrequent code, readable this way + s/runweasel//; #don't run the installer in stateless mode + s!--- /imgdb.tgz!!; #don't need the imgdb for stateless + s!--- /imgpayld.tgz!!; #don't need the boot payload since we aren't installing + s!--- /weaselin.i00!!; #and also don't need the weasel install images if... not installing + s!Loading ESXi installer!xCAT is loading ESXi stateless!; + } + open($bootcfg,">","$installroot/$distname/$arch/boot.cfg.stateless"); + foreach (@bootcfg) { + print $bootcfg $_; + } + close($bootcfg); + } + if ($rc != 0){ xCAT::SvrUtils::sendmsg([1,"Media copy operation failed, status $rc"], $output_handler); }else{