]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Enhance error message when file is not exist for Gensec
authorYonghong Zhu <yonghong.zhu@intel.com>
Fri, 11 May 2018 08:11:51 +0000 (16:11 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 22 May 2018 11:37:11 +0000 (19:37 +0800)
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>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
BaseTools/Source/Python/GenFds/FvImageSection.py

index 57ecea0377bfcccb0c0927faa702696873d6166f..3a4d8fb91b70cf47ad25f065c8e6fc12049df147 100644 (file)
@@ -133,6 +133,12 @@ class FvImageSection(FvImageSectionClassObject):
                             # FvAlignmentValue is less than 1K\r
                             self.Alignment = str (FvAlignmentValue)\r
                         FvFileObj.close()\r
+                    else:\r
+                        if len (mws.getPkgPath()) == 0:\r
+                            EdkLogger.error("GenFds", FILE_NOT_FOUND, "%s is not found in WORKSPACE: %s" % self.FvFileName, GenFdsGlobalVariable.WorkSpaceDir)\r
+                        else:\r
+                            EdkLogger.error("GenFds", FILE_NOT_FOUND, "%s is not found in packages path:\n\t%s" % (self.FvFileName, '\n\t'.join(mws.getPkgPath())))\r
+\r
                 else:\r
                     EdkLogger.error("GenFds", GENFDS_ERROR, "FvImageSection Failed! %s NOT found in FDF" % self.FvName)\r
 \r