From 2d42ffe51703803342c9d616c0c12582f40dd98d Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 5 Mar 2012 18:33:28 +0000 Subject: [PATCH] wmic csproduct is actually supposed to return the correct ordering, just some vendors disagreed with MS on encoding. SMBIOS 2.6 mandates the MS way In startnet.cmd, assume wmic is accurate instead of 'fixing it'. This means DUID changes, but I don't think anyone cares and this paves the way for a reasonable DUID future. For autoinst cmd script, it is a problem. Have windows.pm provide two UUID based links, one with the correct presentation and a byte-swapped variant git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11750 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/windows.pm | 8 +++++++- xCAT-server/share/xcat/netboot/windows/startnet.cmd | 5 ++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/windows.pm b/xCAT-server/lib/xcat/plugins/windows.pm index c12fa194a..732938e12 100644 --- a/xCAT-server/lib/xcat/plugins/windows.pm +++ b/xCAT-server/lib/xcat/plugins/windows.pm @@ -132,7 +132,13 @@ sub mkwinlinks { foreach (getips($node)) { link "$installroot/autoinst/$node.cmd","$installroot/autoinst/$_.cmd"; } - if ($uuid) { link "$installroot/autoinst/$node.cmd","$installroot/autoinst/$uuid.cmd"; } + if ($uuid) { + link "$installroot/autoinst/$node.cmd","$installroot/autoinst/$uuid.cmd"; + #sadly, UUID endiannes is contentious to this day, tolerate a likely mangling + #of the UUID + $uuid =~ s/^(..)(..)(..)(..)-(..)(..)-(..)(..)-/$4$3$2$1-$6$5-$8$7/; + link "$installroot/autoinst/$node.cmd","$installroot/autoinst/$uuid.cmd"; + } } sub winshell { diff --git a/xCAT-server/share/xcat/netboot/windows/startnet.cmd b/xCAT-server/share/xcat/netboot/windows/startnet.cmd index 12846c01f..b937350ad 100644 --- a/xCAT-server/share/xcat/netboot/windows/startnet.cmd +++ b/xCAT-server/share/xcat/netboot/windows/startnet.cmd @@ -2,11 +2,10 @@ start /min cmd echo Initializing, please wait. FOR /F "tokens=*" %%A IN ('wmic csproduct get uuid /Format:list ^| FIND "="') DO SET %%A -set guid=%uuid:~6,2%%uuid:~4,2%%uuid:~2,2%%uuid:~0,2%-%uuid:~11,2%%uuid:~9,2%-%uuid:~16,2%%uuid:~14,2%%uuid:~18,18% echo REGEDIT4 >> duiduuid.reg echo. >> duiduuid.reg echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters] >> duiduuid.reg -echo "Dhcpv6DUID"=hex:00,04,%guid:~0,2%,%guid:~2,2%,%guid:~4,2%,%guid:~6,2%,%guid:~9,2%,%guid:~11,2%,%guid:~14,2%,%guid:~16,2%,%guid:~19,2%,%guid:~21,2%,%guid:~24,2%,%guid:~26,2%,%guid:~28,2%,%guid:~30,2%,%guid:~32,2%,%guid:~34,2% >> duiduuid.reg +echo "Dhcpv6DUID"=hex:00,04,%uuid:~0,2%,%uuid:~2,2%,%uuid:~4,2%,%uuid:~6,2%,%uuid:~9,2%,%uuid:~11,2%,%uuid:~14,2%,%uuid:~16,2%,%uuid:~19,2%,%uuid:~21,2%,%uuid:~24,2%,%uuid:~26,2%,%uuid:~28,2%,%uuid:~30,2%,%uuid:~32,2%,%uuid:~34,2% >> duiduuid.reg echo. >> duiduuid.reg regedit /s duiduuid.reg wpeinit @@ -22,7 +21,7 @@ echo Successfully mounted \\%XCATD%\install, moving on to execute remote script for /f "delims=: tokens=2" %%c in ('ipconfig ^|find "IPv4 Address. . ."') do set NODEIP=%%c for /f %%c in ('echo %NODEIP%') do set NODEIP=%%c if exist i:\autoinst\%NODEIP%.cmd copy i:\autoinst\%NODEIP%.cmd x:\xcat\autoscript.cmd -if exist i:\autoinst\%guid%.cmd copy i:\autoinst\%guid%.cmd x:\xcat\autoscript.cmd +if exist i:\autoinst\%uuid%.cmd copy i:\autoinst\%uuid%.cmd x:\xcat\autoscript.cmd if not exist x:\xcat\autoscript.cmd echo I could not find my autoinst file if not exist x:\xcat\autoscript.cmd pause call x:\xcat\autoscript.cmd