summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/GenFds/CapsuleData.py
Commit message (Collapse)AuthorAgeFilesLines
* BaseTools: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-091-7/+1
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Handle the bytes and str differenceFeng, Bob C2019-02-011-1/+1
| | | | | | | | | | | | | | | | Deal with bytes and str is different, remove the unicode(), correct open file parameter. Using utcfromtimestamp instead of fromtimestamp. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: replace get_bytes_le() to bytes_leZhijux Fan2019-02-011-1/+1
| | | | | | | | | | | | | | UUID does not have the get_bytes_le() in python3 Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/GenFds: cleanup GenFdsCarsey, Jaben2018-10-251-1/+0
| | | | | | | | | | | | | | | | | | | 1) remove wildcard imports and use explicit imports 2) refactor to use shared variables from Common/DataType 3) rename to not shadow imports 4) don't assign a variable in a loop (just do final assignment) 5) remove spaces, parens, unused or commented out code, etc. 6) merge unnecessary parent classes into child 7) refactor to share DXE and PEI apriori GUIDs from one place this includes changes to Build and EOT files 8) for PEP8, dont use __ for custom methods. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bob C Feng <bob.c.feng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* Revert BaseTools: PYTHON3 migrationLiming Gao2018-10-151-2/+3
| | | | | | | | | | | | | | This reverts commit 6693f359b3c213513c5096a06c6f67244a44dc52.. 678f85131238622e576705117e299d81cff755c9. Python3 migration is the fundamental change. It requires every developer to install Python3. Before this migration, the well communication and wide verification must be done. But now, most people is not aware of this change, and not try it. So, Python3 migration is reverted and be moved to edk2-staging Python3 branch for the edk2 user evaluation. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Rename get_bytes_le() to bytes_leYonghong Zhu2018-10-131-1/+1
| | | | | | | | Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Handle the bytes and str differenceYunhua Feng2018-10-131-1/+1
| | | | | | | | | | | Deal with bytes and str is different, remove the unicode() Using utcfromtimestamp instead of fromtimestamp. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Remove the "from __future__ import" itemsYunhua Feng2018-10-131-1/+0
| | | | | | | | Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Use absolute import in GenFdsGary Lin2018-07-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on "futurize -f libfuturize.fixes.fix_absolute_import" Since circular import is not allowed after adopting absolute import, the following changes are applied to break the circles. * BaseTools/Source/Python/GenFds/Capsule.py - Delay "from .GenFds import GenFds" until GenCapsule() - Delay "from .GenFds import FindExtendTool" until GenFmpCapsule() To break the circle: AutoGen.AutoGen => GenFds.FdfParser => GenFds.Capsule => GenFds.GenFds => GenFds.FdfParser * BaseTools/Source/Python/GenFds/Fd.py - Delay "from .GenFds import GenFds" until GenFd() To break the circle: AutoGen.AutoGen => GenFds.FdfParser => GenFds.Fd => GenFds.GenFds => GenFds.FdfParser * BaseTools/Source/Python/GenFds/Fv.py - Delay "from .GenFds import GenFds" until AddToBuffer() To break the circle: AutoGen.AutoGen => GenFds.FdfParser => GenFds.Fd => GenFds.Fv => GenFds.GenFds => GenFds.FdfParser * BaseTools/Source/Python/GenFds/GuidSection.py - Delay "from .GenFds import FindExtendTool" until GuidSection() To break the circle: AutoGen.AutoGen => GenFds.FdfParser => GenFds.Fd => GenFds.Fv => GenFds.AprioriSection => GenFds.FfsFileStatement => GenFds.GuidSection => GenFds.GenFds => GenFds.FdfParser * BaseTools/Source/Python/GenFds/OptRomInfStatement.py - Delay "from . import OptionRom" until __GetOptRomParams() To break the circle: AutoGen.AutoGen => GenFds.FdfParser => GenFds.OptionRom => GenFds.OptRomInfStatement => GenFds.OptionRom * BaseTools/Source/Python/GenFds/OptionRom.py - Remove the unused "from GenFds import GenFds" To break the circle: AutoGen.AutoGen => GenFds.FdfParser => GenFds.OptionRom => GenFds.GenFds => GenFds.FdfParser Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* BaseTools: Clean up source filesLiming Gao2018-07-091-9/+9
| | | | | | | | | | | 1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Replace StringIO.StringIO with io.BytesIOGary Lin2018-06-271-2/+2
| | | | | | | | | | | | Replace StringIO.StringIO with io.BytesIO to be compatible with python3. This commit also removes "import StringIO" from those python scripts that don't really use it. Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Adjust the spaces around commas and colonsGary Lin2018-06-271-1/+1
| | | | | | | | | | Based on "futurize -f lib2to3.fixes.fix_ws_comma" Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: refactor and remove un-needed use of .keys() on dictionariesCarsey, Jaben2018-04-181-5/+5
| | | | | | | | | | | sometimes just delete it. sometimes the loop needed .values() instead Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Fix the bug use same FMP_PAYLOAD in different capsule fileYonghong Zhu2017-06-071-0/+3
| | | | | | | | | | | Fix the bug that use same FMP_PAYLOAD in different capsule file. Because in previous FMP generation, the FMP already be generated, so we don't need to regenerate again. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: not report error for the optional items in the FmpTokensYonghong Zhu2017-01-061-2/+6
| | | | | | | | | | | | <FmpTokens> in the FDF spec defined some optional items, eg: IMAGE_INDEX, HARDWARE_INSTANCE. but current tool report error if no such item is exist in the FDF file. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=293 Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Extend FMP to support FV statement and FD statementYonghong Zhu2016-10-121-2/+2
| | | | | | | | | | | This patch extend the <FmpFileData> to support <FvStatements> and <FdStatenents>, just like the normal [Capsule] section format. In order to fix the bug https://bugzilla.tianocore.org/show_bug.cgi?id=132 Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: UpdateImageSize include Image auth info for FMP Auth capsuleYonghong Zhu2016-08-301-1/+20
| | | | | | | | | | | Per UEFI spec UpdateImageSize may or may not include Firmware Image Authentication information. so for FMP auth capsule, UpdateImageSize should include the Image auth info. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: add capsule image header for auth FMP capsule fileYonghong Zhu2016-08-231-10/+0
| | | | | | | | | | in last commit 91ae29, it missed to add the EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER for the auth FMP capsule. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: FMP capsule add the support to generate auth infoYonghong Zhu2016-08-191-1/+3
| | | | | | | | | | | | | Current BaseTools cannot generate EFI_FIRMWARE_IMAGE_AUTHENTICATION for FMP capsule. this patch fix it by FDF spec's update to add the definition for CERTIFICATE_GUID and MONOTONIC_COUNT. BaseTools call the tool by CERTIFICATE_GUID to generate the certdata and fill the header info. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Supported FMP capsule image.Yingke Liu2015-06-231-1/+71
| | | | | | | | 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
* Sync BaseTool trunk (version r2640) into EDKII BaseTools.Gao, Liming2014-01-101-1/+21
| | | | | | | | Signed-off-by: Gao, Liming <liming.gao@intel.com> Reviewed-by: Liu, Jiang A <jiang.a.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15089 6f19259b-4bc3-4df7-8a09-765794883524
* Sync BaseTools Branch (version r2321) to EDKII main trunk. lgao42011-09-181-1/+49
| | | | | | | | Signed-off-by: lgao4 Reviewed-by: gikidy git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12372 6f19259b-4bc3-4df7-8a09-765794883524
* Sync EDKII BaseTools to BaseTools project r1971lgao42010-05-181-2/+2
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10502 6f19259b-4bc3-4df7-8a09-765794883524
* Sync basetools' source and binary files with r1707 of the basetools project.vanjeff2009-09-111-1/+6
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9257 6f19259b-4bc3-4df7-8a09-765794883524
* Check In tool source code based on Build tool project revision r1655.lgao42009-07-171-0/+84
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8964 6f19259b-4bc3-4df7-8a09-765794883524