public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Fix the bug to search Fv.txt file relative to workspace
@ 2018-03-02 17:09 Yonghong Zhu
  2018-03-03  4:34 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Zhu @ 2018-03-02 17:09 UTC (permalink / raw)
  To: edk2-devel

when the SECTION FV_IMAGE = $(XX)/XX.Fv, the Fv file should relative to
WORKSPACE, so when we search the XX.Fv.txt file, we should search the
path relative to workspace first.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BaseTools/Source/Python/build/BuildReport.py | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py
index b2cc6ee..2fb6ad0 100644
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ b/BaseTools/Source/Python/build/BuildReport.py
@@ -1621,10 +1621,11 @@ class FdRegionReport(object):
         self.Size = FdRegion.Size
         self.FvList = []
         self.FvInfo = {}
         self._GuidsDb = {}
         self._FvDir = Wa.FvDir
+        self._WorkspaceDir = Wa.WorkspaceDir
 
         #
         # If the input FdRegion is not a firmware volume,
         # we are done.
         #
@@ -1724,17 +1725,19 @@ class FdRegionReport(object):
 
         if self.Type == "FV":
             FvTotalSize = 0
             FvTakenSize = 0
             FvFreeSize  = 0
-            if not os.path.isfile(FvName):
-                FvReportFileName = os.path.join(self._FvDir, FvName + ".Fv.txt")
+            if FvName.upper().endswith('.FV'):
+                FileExt = FvName + ".txt"
             else:
-                if FvName.upper().endswith('.FV'):
-                    FvReportFileName = FvName + ".txt"
-                else:
-                    FvReportFileName = FvName + ".Fv.txt"
+                FileExt = FvName + ".Fv.txt"
+
+            if not os.path.isfile(FileExt):
+                FvReportFileName = mws.join(self._WorkspaceDir, FileExt)
+                if not os.path.isfile(FvReportFileName):
+                    FvReportFileName = os.path.join(self._FvDir, FileExt)
             try:
                 #
                 # Collect size info in the firmware volume.
                 #
                 FvReport = open(FvReportFileName).read()
-- 
2.6.1.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch] BaseTools: Fix the bug to search Fv.txt file relative to workspace
  2018-03-02 17:09 [Patch] BaseTools: Fix the bug to search Fv.txt file relative to workspace Yonghong Zhu
@ 2018-03-03  4:34 ` Gao, Liming
  0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2018-03-03  4:34 UTC (permalink / raw)
  To: Zhu, Yonghong, edk2-devel@lists.01.org

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yonghong Zhu
> Sent: Saturday, March 3, 2018 1:09 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [Patch] BaseTools: Fix the bug to search Fv.txt file relative to workspace
> 
> when the SECTION FV_IMAGE = $(XX)/XX.Fv, the Fv file should relative to
> WORKSPACE, so when we search the XX.Fv.txt file, we should search the
> path relative to workspace first.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
> ---
>  BaseTools/Source/Python/build/BuildReport.py | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py
> index b2cc6ee..2fb6ad0 100644
> --- a/BaseTools/Source/Python/build/BuildReport.py
> +++ b/BaseTools/Source/Python/build/BuildReport.py
> @@ -1621,10 +1621,11 @@ class FdRegionReport(object):
>          self.Size = FdRegion.Size
>          self.FvList = []
>          self.FvInfo = {}
>          self._GuidsDb = {}
>          self._FvDir = Wa.FvDir
> +        self._WorkspaceDir = Wa.WorkspaceDir
> 
>          #
>          # If the input FdRegion is not a firmware volume,
>          # we are done.
>          #
> @@ -1724,17 +1725,19 @@ class FdRegionReport(object):
> 
>          if self.Type == "FV":
>              FvTotalSize = 0
>              FvTakenSize = 0
>              FvFreeSize  = 0
> -            if not os.path.isfile(FvName):
> -                FvReportFileName = os.path.join(self._FvDir, FvName + ".Fv.txt")
> +            if FvName.upper().endswith('.FV'):
> +                FileExt = FvName + ".txt"
>              else:
> -                if FvName.upper().endswith('.FV'):
> -                    FvReportFileName = FvName + ".txt"
> -                else:
> -                    FvReportFileName = FvName + ".Fv.txt"
> +                FileExt = FvName + ".Fv.txt"
> +
> +            if not os.path.isfile(FileExt):
> +                FvReportFileName = mws.join(self._WorkspaceDir, FileExt)
> +                if not os.path.isfile(FvReportFileName):
> +                    FvReportFileName = os.path.join(self._FvDir, FileExt)
>              try:
>                  #
>                  # Collect size info in the firmware volume.
>                  #
>                  FvReport = open(FvReportFileName).read()
> --
> 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-03-03  4:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-02 17:09 [Patch] BaseTools: Fix the bug to search Fv.txt file relative to workspace Yonghong Zhu
2018-03-03  4:34 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox