From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from m4a0073g.houston.softwaregrp.com (m4a0073g.houston.softwaregrp.com [15.124.2.131]) by mx.groups.io with SMTP id smtpd.web12.837.1581488987520505550 for ; Tue, 11 Feb 2020 22:29:51 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: suse.com, ip: 15.124.2.131, mailfrom: glin@suse.com) Received: FROM m4a0073g.houston.softwaregrp.com (15.120.17.147) BY m4a0073g.houston.softwaregrp.com WITH ESMTP; Wed, 12 Feb 2020 06:27:35 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Wed, 12 Feb 2020 06:24:33 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (15.124.8.12) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Wed, 12 Feb 2020 06:24:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S3p8XL8bf808hnAJ3c9gCm57j2FaolAUsjsodpxKNkqkOe4jNTCyWO2axBLCE+R9hSzXwScWQCJjFSOkyyHL1qeZlgbV+ZQbZg+cFzI2Y65+mDIK94NmmnNXZb6nMtb45GQDGEa+NChaTsGO/8twxqyghHOhjCCz2CoEUnL5xmLh/PBVa7SxTM7PyolPrqn6J02O/+Quy1EaWz+JPXcPRwYgUdu1ZPxIxKQ4DGH7H1MTkrCuouzwZqMObQH5A8sRsD+x35aBDbDYsU3pggS/XKVyqDH1TXbxjY58y/7ZLok/m/dGPwL66iphUi9mQ+BXJaDJBtYu3EmgyDlS4HO1WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h2k2jNptr+rhGxjvSJB4Z64Nn6vP689Qy7zxSZ9AyJM=; b=lY/gr8s63oIuzS+qoGm/ZF2oq+Owivd4yCl3x+LDP18aQ/NJ8PF4oc7RkUtZYqXTiGESzyzW82aYF7ilrhz3TJV58jn0cAUrJ43KcZ8D2ydrkblEngaqYKAizu/8oT31URLppBnPB9FGYqPI7bTqEWcgvzO0U6Nr6w2HuMFPGAYT4Z9O/Areq9YdahG9YbM4lo57YR2qglY3l3gQZ6UsaVyTPdlFy9v5A3chYLzntcXOTwOvoCWBS7KxvjLvH6EdTnqIpg+NPEKq8Xov2wjdGmn5DLPddBnGRdvOLYwrmCrC99f+D3vVydkV5PfTsR0FSN5yFzVEUWuJqslfG1UoxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=GLin@suse.com; Received: from DM6PR18MB3258.namprd18.prod.outlook.com (10.255.175.31) by DM6PR18MB2489.namprd18.prod.outlook.com (20.179.105.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.24; Wed, 12 Feb 2020 06:24:32 +0000 Received: from DM6PR18MB3258.namprd18.prod.outlook.com ([fe80::386b:b2:de3f:151a]) by DM6PR18MB3258.namprd18.prod.outlook.com ([fe80::386b:b2:de3f:151a%6]) with mapi id 15.20.2707.030; Wed, 12 Feb 2020 06:24:32 +0000 From: "Gary Lin" To: CC: Zailiang Sun , Yi Qian Subject: [PATCH 2/2] Vlv2TbltDevicePkg/PreBuild.py: Remove unused functions Date: Wed, 12 Feb 2020 14:24:03 +0800 Message-ID: <20200212062403.21714-2-glin@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200212062403.21714-1-glin@suse.com> References: <20200212062403.21714-1-glin@suse.com> X-ClientProxiedBy: LO2P123CA0072.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1::36) To DM6PR18MB3258.namprd18.prod.outlook.com (2603:10b6:5:1cd::31) Return-Path: GLin@suse.com MIME-Version: 1.0 Received: from GaryLaptop.suse.cz (36.229.208.188) by LO2P123CA0072.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.24 via Frontend Transport; Wed, 12 Feb 2020 06:24:30 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [36.229.208.188] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c3b50729-2897-4e07-c49c-08d7af8438e0 X-MS-TrafficTypeDiagnostic: DM6PR18MB2489: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:407; X-Forefront-PRVS: 0311124FA9 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4636009)(346002)(376002)(136003)(366004)(396003)(39860400002)(189003)(199004)(54906003)(16526019)(186003)(2616005)(956004)(6916009)(36756003)(52116002)(478600001)(6486002)(6506007)(6512007)(316002)(26005)(86362001)(6666004)(66946007)(4326008)(66556008)(5660300002)(81166006)(1076003)(81156014)(8676002)(8936002)(19627235002)(2906002)(66476007);DIR:OUT;SFP:1102;SCL:1;SRVR:DM6PR18MB2489;H:DM6PR18MB3258.namprd18.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: suse.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QNv+vR6hIQPcroJoQsxLGmNG8DgMZxp3n8vnsVR3bcT+2GuXVbsjQK2m9KpMrL9k8pElGfSPyW24Wos64UQXbKj4F0uRQI40ZbzDwLgIzflpFyWZDotLBRWQNeccCChsFFozKTdo4WQ6UznYN5v/af1qmkQ+j30CDiny21XuRCDC9MoKt50E7jKy1ZEZKGNbEM/aLvcx/QAKleuAZSrc4Vy0WuMrKgG5O3maujBe9tsLSi2t7DtM2DocSiaL0Kt9B1g3q1pXEqq/B4OUQyu9UtXQ8dAJpkbkRO9m0kyTeriwpDtfwVNhG9gHuWibOTCA025Km03xSy+ZxBCjfiMP5J2RH3ZTZS4gsV73a15Aq23oTdZCdFeO1g+wW+z/ZS4R1TXtR9irEb/HvtnCrUjK9MsA2j1sWGsujQnqQ+ZpTH+vcBzdNu1rnzB3Rwn5aKYH X-MS-Exchange-AntiSpam-MessageData: dcY5x/KzroBveno3NXKD3oRhCRt/KGaBJINW9keEmt54xEWZ9QUl5etLCkgxPXhvgqyr9OjbPetyhb+iEiHfbY9u5NnhSZGXk6Z8GJkg4awwnHptRmIJqQThNuHeeJuRgdweDVozFp9BfTsr2PHQZQ== X-MS-Exchange-CrossTenant-Network-Message-Id: c3b50729-2897-4e07-c49c-08d7af8438e0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2020 06:24:32.4920 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9QCW5ukwxzU9NcO5WZXFQ7UfKZ6JBQPO5IjcPM3d/TnXCOeo3xsADc79aQE+uT/9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR18MB2489 X-OriginatorOrg: suse.com Content-Type: text/plain Clean up the script. Cc: Zailiang Sun cc: Yi Qian Signed-off-by: Gary Lin --- Platform/Intel/Vlv2TbltDevicePkg/PreBuild.py | 97 ---------------------------- 1 file changed, 97 deletions(-) diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PreBuild.py b/Platform/Intel/Vlv2TbltDevicePkg/PreBuild.py index 220515c809..be1d23560e 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PreBuild.py +++ b/Platform/Intel/Vlv2TbltDevicePkg/PreBuild.py @@ -59,108 +59,12 @@ def NormalizePath(target): else: return os.path.normpath (target) -def RemoveFile(target): - target = NormalizePath(target) - if not target or target == os.pathsep: - Error ('RemoveFile() invalid target') - if os.path.exists(target): - os.remove (target) - Log ('remove %s' % (RelativePath (target))) - -def RemoveDirectory(target): - target = NormalizePath(target) - if not target or target == os.pathsep: - Error ('RemoveDirectory() invalid target') - if os.path.exists(target): - Log ('rmdir %s' % (RelativePath (target))) - shutil.rmtree(target) - def CreateDirectory(target): target = NormalizePath(target) if not os.path.exists(target): Log ('mkdir %s' % (RelativePath (target))) os.makedirs (target) -def Copy(src, dst): - src = NormalizePath(src) - dst = NormalizePath(dst) - for File in glob.glob(src): - Log ('copy %s -> %s' % (RelativePath (File), RelativePath (dst))) - shutil.copy (File, dst) - -def GenCapsuleDevice (BaseName, PayloadFileName, Guid, Version, Lsv, CapsulesPath, CapsulesSubDir): - global gBaseToolsPath - LogAlways ('Generate Capsule: {0} {1:08x} {2:08x} {3}'.format (Guid, Version, Lsv, PayloadFileName)) - - VersionString = '.'.join([str(ord(x)) for x in struct.pack('>I', Version).decode()]) - - FmpCapsuleFile = NormalizePath ((CapsulesPath, CapsulesSubDir, BaseName + '.' + VersionString + '.cap')) - Command = GenerateCapsuleCommand.format ( - FMP_CAPSULE_GUID = Guid, - FMP_CAPSULE_VERSION = Version, - FMP_CAPSULE_LSV = Lsv, - BASE_TOOLS_PATH = gBaseToolsPath, - FMP_CAPSULE_FILE = FmpCapsuleFile, - FMP_CAPSULE_PAYLOAD = PayloadFileName - ) - Command = ' '.join(Command.splitlines()).strip() - if gArgs.Verbose: - Command = Command + ' -v' - - Log (Command) - - Process = subprocess.Popen(Command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) - ProcessOutput = Process.communicate() - - if Process.returncode == 0: - Log (ProcessOutput[0].decode()) - else: - LogAlways (Command) - LogAlways (ProcessOutput[0].decode()) - Error ('GenerateCapsule returned an error') - - Copy (PayloadFileName, (CapsulesPath, 'firmware.bin')) - MetaInfoXml = MetaInfoXmlTemplate - MetaInfoXml = MetaInfoXml.replace ('FMP_CAPSULE_GUID', Guid) - MetaInfoXml = MetaInfoXml.replace ('FMP_CAPSULE_BASE_NAME', BaseName) - MetaInfoXml = MetaInfoXml.replace ('FMP_CAPSULE_VERSION_DECIMAL', str(Version)) - MetaInfoXml = MetaInfoXml.replace ('FMP_CAPSULE_STRING', VersionString) - MetaInfoXml = MetaInfoXml.replace ('FMP_CAPSULE_DATE', str(datetime.date.today())) - f = open (NormalizePath ((CapsulesPath, 'firmware.metainfo.xml')), 'w') - f.write(MetaInfoXml) - f.close() - - f = open (NormalizePath ((CapsulesPath, 'Lvfs.ddf')), 'w') - f.write(LvfsDdfTemplate) - f.close() - - if sys.platform == "win32": - Command = 'makecab /f ' + NormalizePath ((CapsulesPath, 'Lvfs.ddf')) - else: - Command = 'gcab --create firmware.cab firmware.bin firmware.metainfo.xml' - Log (Command) - - Process = subprocess.Popen(Command, cwd=CapsulesPath, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) - ProcessOutput = Process.communicate() - - if Process.returncode == 0: - Log (ProcessOutput[0].decode()) - else: - LogAlways (Command) - LogAlways (ProcessOutput[0].decode()) - Error ('GenerateCapsule returned an error') - - FmpCabinetFile = NormalizePath ((CapsulesPath, CapsulesSubDir, BaseName + '.' + VersionString + '.cab')) - - Copy ((CapsulesPath, 'firmware.cab'), FmpCabinetFile) - - RemoveFile ((CapsulesPath, 'firmware.cab')) - RemoveFile ((CapsulesPath, 'setup.inf')) - RemoveFile ((CapsulesPath, 'setup.rpt')) - RemoveFile ((CapsulesPath, 'Lvfs.ddf')) - RemoveFile ((CapsulesPath, 'firmware.metainfo.xml')) - RemoveFile ((CapsulesPath, 'firmware.bin')) - BiosIdTemplate = ''' BOARD_ID = MNW2MAX BOARD_REV = $BOARD_REV @@ -170,7 +74,6 @@ BUILD_TYPE = $BUILD_TYPE VERSION_MINOR = 01 ''' - if __name__ == '__main__': # # Create command line argument parser object -- 2.16.4