From 9700e67e0ffc9f8f76a6eff1c812f50e61f47605 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 2 Nov 2011 20:28:51 +0000 Subject: [PATCH] Have esx.pm preserve the media-based efi boot infrastructure, just in case git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10959 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index d86d9065f..6a583edd1 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -57,6 +57,24 @@ my $vmwaresdkdetect = eval { }; my %lockhandles; +sub recursion_copy { + my $source = shift; + my $destination = shift; + my $dirhandle; + opendir($dirhandle,$source); + my $entry; + foreach $entry (readdir($dirhandle)) { + if ($entry eq '.' or $entry eq '..') { next; } + my $tempsource = "$source/$entry"; + my $tempdestination = "$destination/$entry"; + if ( -d $tempsource ) { + unless (-d $tempdestination) { mkdir $tempdestination or die "failure creating directory $tempdestination, $!"; } + recursion_copy($tempsource,$tempdestination); + } else { + copy($tempsource,$tempdestination) or die "failed copy from $tempsource to $tempdestination, $!"; + } + } +} sub lockbyname { my $name = shift; my $lckh; @@ -4363,6 +4381,12 @@ sub mkcommonboot { copy("$::XCATROOT/share/xcat/netboot/syslinux/mboot.c32", $dest); } else { copy("$srcdir/mboot.c32", $dest); + } + if (-f "$srcdir/efiboot.img") { + copy("$srcdir/efiboot.img",$dest); + print("$srcdir/efi"); + mkpath("$dest/efi"); + recursion_copy("$srcdir/efi","$dest/efi"); } $donetftp{$osver,$arch,$profile} = 1; }