From c4ea16f8076f963cf2dc3f5af24750985c270ed6 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 21 May 2010 18:34:17 +0000 Subject: [PATCH] -Change BCD hack to a more tftp agnostic approach that is less dependent on knowledge of IP address ahead of time git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6202 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/windows.pm | 42 ++++++++++++++++++++----- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/windows.pm b/xCAT-server/lib/xcat/plugins/windows.pm index f4692d4e0..7f4696543 100644 --- a/xCAT-server/lib/xcat/plugins/windows.pm +++ b/xCAT-server/lib/xcat/plugins/windows.pm @@ -121,12 +121,6 @@ sub mkwinlinks { my $ent = shift; foreach (getips($node)) { link "$installroot/autoinst/$node.cmd","$installroot/autoinst/$_.cmd"; - unlink "/tftpboot/Boot/BCD.$_"; - if ($ent->{arch} =~ /64/) { - symlink "/tftpboot/Boot/BCD.64","/tftpboot/Boot/BCD.$_"; - } else { - symlink "/tftpboot/Boot/BCD.32","/tftpboot/Boot/BCD.$_"; - } } } @@ -233,7 +227,7 @@ sub mkinstall print $shandle $script; close($shandle); mkwinlinks($node,$ent); - if ($arch =~ /x86/) + if ($arch =~ /x86_64/) { $bptab->setNodeAttribs( $node, @@ -243,6 +237,40 @@ sub mkinstall kcmdline => "" } ); + } elsif ($arch =~ /x86/) { + unless (-r "$tftpdir/Boot/pxeboot32.0") { + my $origpxe; + my $pxeboot; + open($origpxe,"<$tftpdir/Boot/pxeboot.0"); + open($pxeboot,">$tftpdir/Boot/pxeboot32.0"); + binmode($origpxe); + binmode($pxeboot); + my @origpxecontent = <$origpxe>; + foreach (@origpxecontent) { + s/bootmgr.exe/bootm32.exe/; + print $pxeboot $_; + } + } + unless (-r "$tftpdir/bootm32.exe") { + my $origmgr; + my $bootmgr; + open($origmgr,"<$tftpdir/bootmgr.exe"); + open($bootmgr,">$tftpdir/bootm32.exe"); + binmode($origmgr); + binmode($bootmgr); + foreach (@data) { + s/(\\.B.o.o.t.\\.B.)C(.)D/${1}3${2}2/; # 16 bit encoding... cheat + print $bootmgr $_; + } + } + $bptab->setNodeAttribs( + $node, + { + kernel => "Boot/pxeboot32.0", + initrd => "", + kcmdline => "" + } + ); } next; }