Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question on UUIDs...
2012-12-23, 00:42 (This post was last modified: 2012-12-24 22:20 by MultimediaMan.)
Post: #3
RE: Question on UUIDs...
Horrible Hack, but it works...

Most current Enterprise-grade HP Servers have a bug with iPXE. The UUID iPXE reads is malformed from what it actually is.

I've put this up in the ipxe-devel lists, and so far no good workaround has been found... So, server-side, I have done a few things to rectify this. I'm not a very good perl scripter (yet), but this is a script which may be useful to people experiencing issues with UUIDs which are mismatched...

Windows Batch Script:

Code:
@ECHO OFF

:: Script to Fix Broken BIOS UUIDs
::
:: Desired result: Two UUIDs; one using the Actual UUID and one with the reverse ENDIAN of the Actual expressed as a lowercase UUID.
::
:: Actual UUID String:    1F00B3E0-00C6-0800-2C4A-BCAEC5280EAD
:: iPXE UUID String:    e0b3001f-c600-0008-2c4a-bcaec5280ead
::
:: Usage UUID-Gen.cmd %1
:: Where %1 = Actual UUID

SETLOCAL

SET ACTUAL_UUID=%1
SET STANZA0=UNKNOWN& SET STANZA1=UNKNOWN& SET STANZA2=UNKNOWN& SET STANZA3=UNKNOWN& SET STANZA4=UNKNOWN
SET S-T0=UNKNOWN& SET S-T1=UNKNOWN& SET S-T2=UNKNOWN& SET S-T3=UNKNOWN

FOR /F "tokens=1,2,3,4,5 delims=- usebackq" %%a IN (`ECHO %ACTUAL_UUID%`) DO SET STANZA0=%%a& SET STANZA1=%%b& SET STANZA2=%%c& SET STANZA3=%%d& SET STANZA4=%%e

::STANZA0_TRANSPOSITION
SET S-T0=%STANZA0:~0,-6%& SET S-T1=%STANZA0:~2,-4%& SET S-T2=%STANZA0:~4,-2%& SET S-T3=%STANZA0:~6%

::STANZA0_FIX_ENDIAN-NESS
SET STANZA0-NEW=%S-T3%%S-T2%%S-T1%%S-T0%

::STANZA1_TRANSPOSITION
SET S-T0=%STANZA1:~0,-2%& SET S-T1=%STANZA1:~2%

::STANZA1_FIX_ENDIAN-NESS
SET STANZA1-NEW=%S-T1%%S-T0%

::STANZA2_TRANSPOSITION
SET S-T0=%STANZA2:~0,-2%& SET S-T1=%STANZA2:~2%

::STANZA2_FIX_ENDIAN-NESS
SET STANZA2-NEW=%S-T1%%S-T0%

::RE-ASSEMBLE_STRING
SET TRANSPOSED_UUID=%STANZA0-NEW%-%STANZA1-NEW%-%STANZA2-NEW%-%STANZA3%-%STANZA4%

::FIXED_UUID
CALL :LOWERCASE TRANSPOSED_UUID
CALL :LOWERCASE ACTUAL_UUID
GOTO END

:LOWERCASE
:: Subroutine to convert a variable VALUE to all lower case.
FOR %%i IN ("A=a" "B=b" "C=c" "D=d" "E=e" "F=f" "G=g" "H=h" "I=i" "J=j" "K=k" "L=l" "M=m" "N=n" "O=o" "P=p" "Q=q" "R=r" "S=s" "T=t" "U=u" "V=v" "W=w" "X=x" "Y=y" "Z=z") DO CALL SET "%1=%%%1:%%~i%%"
GOTO:EOF

:END
CLS
ECHO.
ECHO %ACTUAL_UUID%
ECHO %TRANSPOSED_UUID%
ENDLOCAL

"Thus far, you have been adrift within the sheltered harbor of my patience..."
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Question on UUIDs... - MultimediaMan - 2012-10-27, 21:15
RE: Question on UUIDs... - MultimediaMan - 2012-12-23 00:42
RE: Question on UUIDs... - mcb30 - 2013-03-20, 01:37



User(s) browsing this thread: 1 Guest(s)