From 3c8cd46525949763baf1d6634be1ed13aedb71a9 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Sun, 21 Sep 2008 17:08:49 +0000 Subject: [PATCH] -Have nodeset install prepare to deplay a captured image with imagex git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2219 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/windows.pm | 53 ++++++++++++++++++- .../share/xcat/netboot/windows/startnet.cmd | 1 + 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/windows.pm b/xCAT-server/lib/xcat/plugins/windows.pm index 7770d7cf0..28c0fa63e 100644 --- a/xCAT-server/lib/xcat/plugins/windows.pm +++ b/xCAT-server/lib/xcat/plugins/windows.pm @@ -60,6 +60,12 @@ sub process_request } sub mkimage { +#NOTES ON IMAGING: +#-System must be sysprepped before capture, with /generalize +#-EMS settings appear to be lost in the process +#-If going to /audit, it's more useful than /oobe. +# audit complains about incorrect password on first boot, without any login attempt +# audit causes a 'system preparation tool' dialog on first boot that I close my $installroot = "/install"; my $request = shift; my $callback = shift; @@ -109,6 +115,7 @@ sub mkimage { mkwinlinks($node,$ent); } } + sub mkwinlinks { my $node = shift; my $ent = shift; @@ -149,6 +156,32 @@ sub winshell { } sub applyimagescript { +#Applying will annoy administrator with password change and sysprep tool +#in current process +#EMS settings loss also bad.. +#require/use setup.exe for 2k8 to alleviate this? + my $arch=shift; + my $profile=shift; + my $applyscript=< x:/xcat/diskprep.prt + echo clean >> x:/xcat/diskprep.prt + echo create partition primary >> x:/xcat/diskprep.prt + echo format quick >> x:/xcat/diskprep.prt + echo active >> x:/xcat/diskprep.prt + echo assign >> x:/xcat/diskprep.prt + if exist i:/images/$arch/$profile.prt copy i:/images/$arch/$profile.prt x:/xcat/diskprep.prt + diskpart /s x:/xcat/diskprep.prt + x:/xcat/imagex /apply i:/images/$arch/$profile.wim 1 c: + IF %PROCESSOR_ARCHITECTURE%==AMD64 GOTO x64 + IF %PROCESSOR_ARCHITECTURE%==x64 GOTO x64 + IF %PROCESSOR_ARCHITECTURE%==x86 GOTO x86 + :x86 + i:/postscripts/upflagx86 %XCATD% 3002 next + GOTO END + :x64 + i:/postscripts/upflagx64 %XCATD% 3002 next + :END +ENDAPPLY } #Don't sweat os type as for mkimage it is always 'imagex' if it got here sub mkinstall @@ -189,11 +222,27 @@ sub mkinstall my $arch = $ent->{arch}; my $profile = $ent->{profile}; if ($os eq "imagex") { - unless ( -r "$installroot/images/$profile.$arch.wim" ) { + unless ( -r "$installroot/images/$arch/$profile.wim" ) { $callback->({error=>["$installroot/images/$profile.$arch.wim not found, run rimage on a node to capture first"],errorcode=>[1]}); next; } - + my $script=applyimagescript($arch,$profile); + my $shandle; + open($shandle,">","$installroot/autoinst/$node.cmd"); + print $shandle $script; + close($shandle); + mkwinlinks($node,$ent); + if ($arch =~ /x86/) + { + $bptab->setNodeAttribs( + $node, + { + kernel => "Boot/pxeboot.0", + initrd => "", + kcmdline => "" + } + ); + } next; } diff --git a/xCAT-server/share/xcat/netboot/windows/startnet.cmd b/xCAT-server/share/xcat/netboot/windows/startnet.cmd index 2bc6109ac..b68b14660 100644 --- a/xCAT-server/share/xcat/netboot/windows/startnet.cmd +++ b/xCAT-server/share/xcat/netboot/windows/startnet.cmd @@ -1,4 +1,5 @@ @echo off +echo Initializing, please wait. wpeinit ping -n 10 127.0.0.1 > NUL 2>&1 md \temp