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.151; helo=mga17.intel.com; envelope-from=jordan.l.justen@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (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 887CB211EAA12 for ; Mon, 25 Mar 2019 08:27:52 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Mar 2019 08:27:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,269,1549958400"; d="scan'208";a="145069741" Received: from rjwillia-mobl.amr.corp.intel.com (HELO localhost) ([10.251.148.200]) by orsmga002.jf.intel.com with ESMTP; 25 Mar 2019 08:27:51 -0700 MIME-Version: 1.0 In-Reply-To: <20190325132418.6010-1-lersek@redhat.com> References: <20190325132418.6010-1-lersek@redhat.com> Cc: Anthony Perard , Ard Biesheuvel , Julien Grall To: Laszlo Ersek , edk2-devel@lists.01.org From: Jordan Justen Message-ID: <155352767084.16326.12582727158631921879@jljusten-skl> User-Agent: alot/0.8 Date: Mon, 25 Mar 2019 08:27:51 -0700 Subject: Re: [PATCH] OvmfPkg: retire "create-release.py" X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Mar 2019 15:27:52 -0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Acked-by: Jordan Justen On 2019-03-25 06:24:18, Laszlo Ersek wrote: > Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1653 >=20 > "create-release.py" generates a 2-BSDL copyright block that will no longer > apply once we fix . >=20 > Rather than update "create-release.py", remove it. We haven't used it in > several years now, plus source releases of upstream edk2 are now covered > by the edk2 stable tags > . >=20 > Regarding binary releases of upstream OVMF: OVMF and ArmVirtQemu binaries > built at the edk2 stable tags are being bundled with upstream QEMU, > similarly to other firmware that runs on QEMU platforms: > . > Furthermore, the Xen project has provided its own builds of OVMF and > ArmVirtXen for a good while now. >=20 > Cc: Anthony Perard > Cc: Ard Biesheuvel > Cc: Jordan Justen > Cc: Julien Grall > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Laszlo Ersek > --- >=20 > Notes: > Repo: https://github.com/lersek/edk2.git > Branch: retire_create_release >=20 > OvmfPkg/create-release.py | 208 -------------------- > 1 file changed, 208 deletions(-) >=20 > diff --git a/OvmfPkg/create-release.py b/OvmfPkg/create-release.py > deleted file mode 100755 > index 82d8e7b0a2b8..000000000000 > --- a/OvmfPkg/create-release.py > +++ /dev/null > @@ -1,208 +0,0 @@ > -#!/usr/bin/python > -# > -# Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
> -# > -# This program and the accompanying materials > -# are licensed and made available under the terms and conditions of the = BSD License > -# which accompanies this distribution. The full text of the license may= be found at > -# http://opensource.org/licenses/bsd-license.php > -# > -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. > -# > - > -import os > -import re > -import StringIO > -import subprocess > -import sys > -import zipfile > - > -is_unix =3D not sys.platform.startswith('win') > - > -if not is_unix: > - print "This script currently only supports unix-like systems" > - sys.exit(-1) > - > -if os.path.exists('OvmfPkgX64.dsc'): > - os.chdir('..') > - > -if not os.path.exists(os.path.join('OvmfPkg', 'OvmfPkgX64.dsc')): > - print "OvmfPkg/OvmfPkgX64.dsc doesn't exist" > - sys.exit(-1) > - > -def run_and_capture_output(args, checkExitCode =3D True): > - p =3D subprocess.Popen(args=3Dargs, stdout=3Dsubprocess.PIPE) > - stdout =3D p.stdout.read() > - ret_code =3D p.wait() > - if checkExitCode: > - assert ret_code =3D=3D 0 > - return stdout > - > -gcc_version =3D run_and_capture_output(args=3D('gcc', '--version')) > -gcc_re =3D re.compile(r'\s*\S+\s+\([^\)]+?\)\s+(\d+(?:\.\d+)*)(?:\s+.*)?= ') > -mo =3D gcc_re.match(gcc_version) > -if not mo: > - print "Unable to find GCC version" > - sys.exit(-1) > -gcc_version =3D map(lambda n: int(n), mo.group(1).split('.')) > - > -if 'TOOLCHAIN' in os.environ: > - TOOLCHAIN =3D os.environ['TOOLCHAIN'] > -else: > - assert(gcc_version[0] =3D=3D 4) > - minor =3D max(4, min(7, gcc_version[1])) > - TOOLCHAIN =3D 'GCC4' + str(minor) > - > -def git_based_version(): > - dir =3D os.getcwd() > - if not os.path.exists('.git'): > - os.chdir('OvmfPkg') > - stdout =3D run_and_capture_output(args=3D('git', 'log', > - '-n', '1', > - '--abbrev-commit')) > - regex =3D re.compile(r'^\s*git-svn-id:\s+\S+@(\d+)\s+[0-9a-f\-]+$', > - re.MULTILINE) > - mo =3D regex.search(stdout) > - if mo: > - version =3D 'r' + mo.group(1) > - else: > - version =3D stdout.split(None, 3)[1] > - os.chdir(dir) > - return version > - > -def svn_info(): > - dir =3D os.getcwd() > - os.chdir('OvmfPkg') > - stdout =3D run_and_capture_output(args=3D('svn', 'info')) > - os.chdir(dir) > - return stdout > - > -def svn_based_version(): > - buf =3D svn_info() > - revision_re =3D re.compile('^Revision\:\s*([\da-f]+)$', re.MULTI= LINE) > - mo =3D revision_re.search(buf) > - assert(mo is not None) > - return 'r' + mo.group(1) > - > -def get_revision(): > - if os.path.exists(os.path.join('OvmfPkg', '.svn')): > - return svn_based_version() > - else: > - return git_based_version() > - > -revision =3D get_revision() > - > -newline_re =3D re.compile(r'(\n|\r\n|\r(?!\n))', re.MULTILINE) > -def to_dos_text(str): > - return newline_re.sub('\r\n', str) > - > -def gen_build_info(): > - distro =3D run_and_capture_output(args=3D('lsb_release', '-sd')).str= ip() > - > - machine =3D run_and_capture_output(args=3D('uname', '-m')).strip() > - > - gcc_version_str =3D '.'.join(map(lambda v: str(v), gcc_version)) > - > - ld_version =3D run_and_capture_output(args=3D('ld', '--version')) > - ld_version =3D ld_version.split('\n')[0].split()[-1] > - > - iasl_version =3D run_and_capture_output(args=3D('iasl'), checkExitCo= de=3DFalse) > - iasl_version =3D filter(lambda s: s.find(' version ') >=3D 0, iasl_v= ersion.split('\n'))[0] > - iasl_version =3D iasl_version.split(' version ')[1].strip() > - > - sb =3D StringIO.StringIO() > - print >> sb, 'edk2: ', revision > - print >> sb, 'compiler: GCC', gcc_version_str, '(' + TOOLCHAIN + ')' > - print >> sb, 'binutils:', ld_version > - print >> sb, 'iasl: ', iasl_version > - print >> sb, 'system: ', distro, machine.replace('_', '-') > - return to_dos_text(sb.getvalue()) > - > -def read_file(filename): > - f =3D open(filename) > - d =3D f.read() > - f.close() > - return d > - > -LICENSE =3D to_dos_text( > -'''This OVMF binary release is built from source code licensed under > -the BSD open source license. The BSD license is documented at > -http://opensource.org/licenses/bsd-license.php, and a copy is > -shown below. > - > -One sub-component of the OVMF project is a FAT filesystem driver. The F= AT > -filesystem driver code is also BSD licensed, but the code license contai= ns > -one additional term. This license can be found at > -https://github.com/tianocore/tianocore.github.io/wiki/Edk2-fat-driver > -and a copy is shown below (following the normal BSD license). > - > -=3D=3D=3D BSD license: START =3D=3D=3D > - > -''') > - > -LICENSE +=3D read_file(os.path.join('MdePkg', 'License.txt')) > - > -LICENSE +=3D to_dos_text( > -''' > -=3D=3D=3D BSD license: END =3D=3D=3D > - > -=3D=3D=3D FAT filesystem driver license: START =3D=3D=3D > - > -''') > - > -LICENSE +=3D read_file(os.path.join('FatBinPkg', 'License.txt')) > - > -LICENSE +=3D to_dos_text( > -''' > -=3D=3D=3D FAT filesystem driver license: END =3D=3D=3D > -''') > - > -def build(arch): > - args =3D ( > - 'OvmfPkg/build.sh', > - '-t', TOOLCHAIN, > - '-a', arch, > - '-b', 'RELEASE' > - ) > - logname =3D 'build-%s.log' % arch > - build_log =3D open(logname, 'w') > - print 'Building OVMF for', arch, '(%s)' % logname, '...', > - sys.stdout.flush() > - p =3D subprocess.Popen(args=3Dargs, stdout=3Dbuild_log, stderr=3Dbui= ld_log) > - ret_code =3D p.wait() > - if ret_code =3D=3D 0: > - print '[done]' > - else: > - print '[error 0x%x]' % ret_code > - return ret_code > - > -def create_zip(arch): > - global build_info > - filename =3D 'OVMF-%s-%s.zip' % (arch, revision) > - print 'Creating', filename, '...', > - sys.stdout.flush() > - if os.path.exists(filename): > - os.remove(filename) > - zipf =3D zipfile.ZipFile(filename, 'w', zipfile.ZIP_DEFLATED) > - > - zipf.writestr('BUILD_INFO', build_info) > - zipf.writestr('LICENSE', LICENSE) > - zipf.write(os.path.join('OvmfPkg', 'README'), 'README') > - FV_DIR =3D os.path.join( > - 'Build', > - 'Ovmf' + arch.title(), > - 'RELEASE_' + TOOLCHAIN, > - 'FV' > - ) > - zipf.write(os.path.join(FV_DIR, 'OVMF.fd'), 'OVMF.fd') > - zipf.close() > - print '[done]' > - > -build_info =3D gen_build_info() > -build('IA32') > -build('X64') > -create_zip('IA32') > -create_zip('X64') > - > - > --=20 > 2.19.1.3.g30247aa5d201 >=20