From 54f23bbb00ac8d511fd3e3b446ac81515118723a Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 20 Aug 2010 15:12:38 +0000 Subject: [PATCH] -Fix problem where .ssh was excluded in esxi images git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7178 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index 900c87f36..ae48ab7f5 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -2919,7 +2919,9 @@ sub makecustomizedmod { if (-e "$::XCATROOT/share/xcat/netboot/esxi/xcatsplash") { copy( "$::XCATROOT/share/xcat/netboot/esxi/xcatsplash",$tempdir."/etc/vmware/welcome"); } + my $dossh=0; if (-r "/root/.ssh/id_rsa.pub") { + $dossh=1; my $umask = umask(0077);#don't remember if dropbear is picky, but just in case mkpath($tempdir."/.ssh"); copy("/root/.ssh/id_rsa.pub",$tempdir."/.ssh/authorized_keys"); @@ -2936,7 +2938,11 @@ sub makecustomizedmod { if (-e "$dest/mod.tgz") { unlink("$dest/mod.tgz"); } - system("tar czf $dest/mod.tgz *"); + if ($dossh) { + system("tar czf $dest/mod.tgz * .ssh"); + } else { + system("tar czf $dest/mod.tgz *"); + } chdir($dir); rmtree($tempdir); return 1;