From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B3CC4207E36B4 for ; Sun, 13 May 2018 17:45:48 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 May 2018 17:45:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,398,1520924400"; d="scan'208";a="199048520" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by orsmga004.jf.intel.com with ESMTP; 13 May 2018 17:45:47 -0700 From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Mon, 14 May 2018 08:45:45 +0800 Message-Id: <1526258745-22648-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [Patch] BaseTools: Enhance error message when file is not exist for Gensec X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2018 00:45:48 -0000 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 --- 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