diff options
author | Yingke Liu <yingke.d.liu@intel.com> | 2015-06-23 06:46:01 +0000 |
---|---|---|
committer | yingke <yingke@Edk2> | 2015-06-23 06:46:01 +0000 |
commit | a3251d844695f90711bfe094f12755fd01742369 (patch) | |
tree | f2b29b86c0cc238b74491233adbca4b04aa83eac /BaseTools/Source/Python/Common/Misc.py | |
parent | f5bc9da5a3b36b73f5bff4b31f81ed7278f14ec1 (diff) | |
download | edk2-platforms-a3251d844695f90711bfe094f12755fd01742369.tar.xz |
BaseTools: Supported FMP capsule image.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yingke Liu <yingke.d.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17678 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/Common/Misc.py')
-rw-r--r-- | BaseTools/Source/Python/Common/Misc.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py index fc1680b5ed..8ba5819cc1 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -24,6 +24,7 @@ import re import cPickle
import array
import shutil
+from struct import pack
from UserDict import IterableUserDict
from UserList import UserList
@@ -2007,6 +2008,26 @@ class SkuClass(): AvailableSkuIdSet = property(__GetAvailableSkuIds)
SkuUsageType = property(__SkuUsageType)
AvailableSkuIdNumSet = property(__GetAvailableSkuIdNumber)
+
+#
+# Pack a registry format GUID
+#
+def PackRegistryFormatGuid(Guid):
+ Guid = Guid.split('-')
+ return pack('=LHHBBBBBBBB',
+ int(Guid[0], 16),
+ int(Guid[1], 16),
+ int(Guid[2], 16),
+ int(Guid[3][-4:-2], 16),
+ int(Guid[3][-2:], 16),
+ int(Guid[4][-12:-10], 16),
+ int(Guid[4][-10:-8], 16),
+ int(Guid[4][-8:-6], 16),
+ int(Guid[4][-6:-4], 16),
+ int(Guid[4][-4:-2], 16),
+ int(Guid[4][-2:], 16)
+ )
+
##
#
# This acts like the main() function for the script, unless it is 'import'ed into another
|