* [Patch] BaseTools: Enhance error message when file is not exist for Gensec
@ 2018-05-14 0:45 Yonghong Zhu
2018-05-14 14:38 ` Carsey, Jaben
0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Zhu @ 2018-05-14 0:45 UTC (permalink / raw)
To: edk2-devel
When the file is not exist in workspace or packages path, current
Gensec tool doesn't report exactly error message.
FILE FV_IMAGE = 11111111-4CF1-42D8-A0C3-B3F60779dF4D {
SECTION GUIDED A7717414-C616-4977-9420-844712A735BF {
SECTION FV_IMAGE = TestPkg/Test.fd
}
}
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
BaseTools/Source/Python/GenFds/FvImageSection.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/BaseTools/Source/Python/GenFds/FvImageSection.py b/BaseTools/Source/Python/GenFds/FvImageSection.py
index 57ecea0..3a4d8fb 100644
--- a/BaseTools/Source/Python/GenFds/FvImageSection.py
+++ b/BaseTools/Source/Python/GenFds/FvImageSection.py
@@ -131,10 +131,16 @@ class FvImageSection(FvImageSectionClassObject):
self.Alignment = str (FvAlignmentValue / 0x400) + "K"
else:
# FvAlignmentValue is less than 1K
self.Alignment = str (FvAlignmentValue)
FvFileObj.close()
+ else:
+ if len (mws.getPkgPath()) == 0:
+ EdkLogger.error("GenFds", FILE_NOT_FOUND, "%s is not found in WORKSPACE: %s" % self.FvFileName, GenFdsGlobalVariable.WorkSpaceDir)
+ else:
+ EdkLogger.error("GenFds", FILE_NOT_FOUND, "%s is not found in packages path:\n\t%s" % (self.FvFileName, '\n\t'.join(mws.getPkgPath())))
+
else:
EdkLogger.error("GenFds", GENFDS_ERROR, "FvImageSection Failed! %s NOT found in FDF" % self.FvName)
#
# Prepare the parameter of GenSection
--
2.6.1.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Patch] BaseTools: Enhance error message when file is not exist for Gensec
2018-05-14 0:45 [Patch] BaseTools: Enhance error message when file is not exist for Gensec Yonghong Zhu
@ 2018-05-14 14:38 ` Carsey, Jaben
0 siblings, 0 replies; 2+ messages in thread
From: Carsey, Jaben @ 2018-05-14 14:38 UTC (permalink / raw)
To: Zhu, Yonghong, edk2-devel@lists.01.org
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Yonghong Zhu
> Sent: Sunday, May 13, 2018 5:46 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [Patch] BaseTools: Enhance error message when file is not
> exist for Gensec
>
> When the file is not exist in workspace or packages path, current
> Gensec tool doesn't report exactly error message.
>
> FILE FV_IMAGE = 11111111-4CF1-42D8-A0C3-B3F60779dF4D {
> SECTION GUIDED A7717414-C616-4977-9420-844712A735BF {
> SECTION FV_IMAGE = TestPkg/Test.fd
> }
> }
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
> ---
> BaseTools/Source/Python/GenFds/FvImageSection.py | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/BaseTools/Source/Python/GenFds/FvImageSection.py
> b/BaseTools/Source/Python/GenFds/FvImageSection.py
> index 57ecea0..3a4d8fb 100644
> --- a/BaseTools/Source/Python/GenFds/FvImageSection.py
> +++ b/BaseTools/Source/Python/GenFds/FvImageSection.py
> @@ -131,10 +131,16 @@ class FvImageSection(FvImageSectionClassObject):
> self.Alignment = str (FvAlignmentValue / 0x400) + "K"
> else:
> # FvAlignmentValue is less than 1K
> self.Alignment = str (FvAlignmentValue)
> FvFileObj.close()
> + else:
> + if len (mws.getPkgPath()) == 0:
> + EdkLogger.error("GenFds", FILE_NOT_FOUND, "%s is not
> found in WORKSPACE: %s" % self.FvFileName,
> GenFdsGlobalVariable.WorkSpaceDir)
> + else:
> + EdkLogger.error("GenFds", FILE_NOT_FOUND, "%s is not
> found in packages path:\n\t%s" % (self.FvFileName,
> '\n\t'.join(mws.getPkgPath())))
> +
> else:
> EdkLogger.error("GenFds", GENFDS_ERROR, "FvImageSection
> Failed! %s NOT found in FDF" % self.FvName)
>
> #
> # Prepare the parameter of GenSection
> --
> 2.6.1.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-05-14 14:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-14 0:45 [Patch] BaseTools: Enhance error message when file is not exist for Gensec Yonghong Zhu
2018-05-14 14:38 ` Carsey, Jaben
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox