From nobody Wed May 8 17:25:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+65775+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+65775+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1601518308; cv=none; d=zohomail.com; s=zohoarc; b=gp0XD4LeAYGRpGsFtgUikP6Alk3YacIORyW1Fk24ry66oLwPvULEY4A4mFqRdtYEasF4zvtR8xZ/5vGc5UfX7dEXz6Vl/ERYjGRGgsAsNgHh34GkDfemLBPwXd4eVDulza71/nGUvWvrmY9kBuoIgeKg5o1260pDH7OibbiOTHo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601518308; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=7v1S6MBRvXvpqpNmSOpRwFFOYLMHOZMCkABe10aYJdU=; b=dUsjj49mL8wNECmFAMaZcn/h2T6hBlN0sk3dYkTA2ZD/pBjt9b9A+BtpdsjTbkQS5PU3bIkBSZ8Npx/o/k7MTlbgLGRFYUUuWiIMzYOuSUzevl1Zr2/J15uIm8bo5Tb+Fg9z5ASeqU8SRr81MwGcQjIGRYkZ8q9XpgVEChr0LLo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+65775+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1601518308382702.428994163002; Wed, 30 Sep 2020 19:11:48 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id TH6FYY1788612x6cPIwWVIEP; Wed, 30 Sep 2020 19:11:48 -0700 X-Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.3065.1601518306586334164 for ; Wed, 30 Sep 2020 19:11:46 -0700 IronPort-SDR: 5IyyTds/kmjzfpVnkSv/Fp8VsYrimk2++Q9QCquda3n2diDuOPr4N7KrjIyXJKAsaIF5PyMKbh yQaGBhv+Fr+g== X-IronPort-AV: E=McAfee;i="6000,8403,9760"; a="142603143" X-IronPort-AV: E=Sophos;i="5.77,323,1596524400"; d="scan'208";a="142603143" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2020 19:11:43 -0700 IronPort-SDR: GeydBUNPbj39jOwLC3MzIKDBQ8Cko90/cv19f0Rc4nsQDZ1e4+44TWX7Mwt9X6hW/P2w/Z3Kx3 F58a1mH0abWg== X-IronPort-AV: E=Sophos;i="5.77,323,1596524400"; d="scan'208";a="500805657" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.171]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2020 19:11:41 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Maurice Ma , Nate DeSimone , Star Zeng Subject: [edk2-devel] [PATCH] IntelFsp2Pkg/GenCfgOpt: skip unnecessarily header/BSF recreating. Date: Thu, 1 Oct 2020 10:11:30 +0800 Message-Id: <20201001021130.1666-1-chasel.chiu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com X-Gm-Message-State: 1MvYq5mN0amrBu81ztlzfObhx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1601518308; bh=EzFrv/RhvE5RoEMN8+6zhGUTPTM71pnKimo0Vkgr+Ps=; h=Cc:Date:From:Reply-To:Subject:To; b=Hze+rryqokijoiG+0ojLmqG9aorHWx2TUm54EI5xKjkajYvX10RXIVM2VsFX/yItfh8 +qghjqDBeLTb9YwP892ecRmsomRnhXry3znM3LLJnrANhAZDNdLYlOdBapCq9x1xyEolR R6Bt1k1QxioOS6oyv2z3Ava814tjmSeqyKc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2967 When no change in FSP UPD DSC files, GenCfgOpt.py should skip recreating UPD header and BSF files. This patch added a check to handle this case. Cc: Maurice Ma Cc: Nate DeSimone Cc: Star Zeng Signed-off-by: Chasel Chiu Reviewed-by: Nate DeSimone --- IntelFsp2Pkg/Tools/GenCfgOpt.py | 60 +++++++++++++++++++++++++++++++++++++= +++++------------------ 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt= .py index bcced590ce..af7e14a10a 100644 --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py @@ -810,6 +810,17 @@ EndList SubItem['value'] =3D valuestr return Error =20 + def NoDscFileChange (self, OutPutFile): + NoFileChange =3D True + if not os.path.exists(OutPutFile): + NoFileChange =3D False + else: + DscTime =3D os.path.getmtime(self._DscFile) + OutputTime =3D os.path.getmtime(OutPutFile) + if DscTime > OutputTime: + NoFileChange =3D False + return NoFileChange + def CreateSplitUpdTxt (self, UpdTxtFile): GuidList =3D ['FSP_T_UPD_TOOL_GUID','FSP_M_UPD_TOOL_GUID','FSP_S_U= PD_TOOL_GUID'] SignatureList =3D ['0x545F', '0x4D5F','0x535F'] # _T, _M, = and _S signature for FSPT, FSPM, FSPS @@ -823,16 +834,7 @@ EndList if UpdTxtFile =3D=3D '': UpdTxtFile =3D os.path.join(FvDir, self._MacroDict[GuidLis= t[Index]] + '.txt') =20 - ReCreate =3D False - if not os.path.exists(UpdTxtFile): - ReCreate =3D True - else: - DscTime =3D os.path.getmtime(self._DscFile) - TxtTime =3D os.path.getmtime(UpdTxtFile) - if DscTime > TxtTime: - ReCreate =3D True - - if not ReCreate: + if (self.NoDscFileChange (UpdTxtFile)): # DSC has not been modified yet # So don't have to re-generate other files self.Error =3D 'No DSC file change, skip to create UPD TXT= file' @@ -1056,7 +1058,11 @@ EndList HeaderFile =3D os.path.join(FvDir, HeaderFileName) =20 # Check if header needs to be recreated - ReCreate =3D False + if (self.NoDscFileChange (HeaderFile)): + # DSC has not been modified yet + # So don't have to re-generate other files + self.Error =3D 'No DSC file change, skip to create UPD header = file' + return 256 =20 TxtBody =3D [] for Item in self._CfgItemList: @@ -1382,6 +1388,12 @@ EndList self.Error =3D "BSF output file '%s' is invalid" % BsfFile return 1 =20 + if (self.NoDscFileChange (BsfFile)): + # DSC has not been modified yet + # So don't have to re-generate other files + self.Error =3D 'No DSC file change, skip to create UPD BSF fil= e' + return 256 + Error =3D 0 OptionDict =3D {} BsfFd =3D open(BsfFile, "w") @@ -1467,7 +1479,7 @@ EndList =20 =20 def Usage(): - print ("GenCfgOpt Version 0.55") + print ("GenCfgOpt Version 0.56") print ("Usage:") print (" GenCfgOpt UPDTXT PlatformDscFile BuildFvDir = [-D Macros]") print (" GenCfgOpt HEADER PlatformDscFile BuildFvDir InputHFile = [-D Macros]") @@ -1529,13 +1541,25 @@ def Main(): print ("ERROR: %s !" % (GenCfgOpt.Error)) return Ret elif sys.argv[1] =3D=3D "HEADER": - if GenCfgOpt.CreateHeaderFile(OutFile) !=3D 0: - print ("ERROR: %s !" % GenCfgOpt.Error) - return 8 + Ret =3D GenCfgOpt.CreateHeaderFile(OutFile) + if Ret !=3D 0: + # No change is detected + if Ret =3D=3D 256: + print ("INFO: %s !" % (GenCfgOpt.Error)) + else : + print ("ERROR: %s !" % (GenCfgOpt.Error)) + return 8 + return Ret elif sys.argv[1] =3D=3D "GENBSF": - if GenCfgOpt.GenerateBsfFile(OutFile) !=3D 0: - print ("ERROR: %s !" % GenCfgOpt.Error) - return 9 + Ret =3D GenCfgOpt.GenerateBsfFile(OutFile) + if Ret !=3D 0: + # No change is detected + if Ret =3D=3D 256: + print ("INFO: %s !" % (GenCfgOpt.Error)) + else : + print ("ERROR: %s !" % (GenCfgOpt.Error)) + return 9 + return Ret else: if argc < 5: Usage() --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#65775): https://edk2.groups.io/g/devel/message/65775 Mute This Topic: https://groups.io/mt/77232193/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-