build script update, rename *.json files to be more consistent
This commit is contained in:
parent
75ee74a574
commit
44055433c5
@ -7,7 +7,14 @@ import optparse
|
|||||||
import subprocess
|
import subprocess
|
||||||
import configparser
|
import configparser
|
||||||
|
|
||||||
|
rebase_prefix = ""
|
||||||
|
version_override = None
|
||||||
|
|
||||||
def check_rebase():
|
def check_rebase():
|
||||||
|
""" detect 'git rebase -x edk2-build.py master' testbuilds """
|
||||||
|
global rebase_prefix
|
||||||
|
global version_override
|
||||||
|
|
||||||
if not os.path.exists('.git/rebase-merge/msgnum'):
|
if not os.path.exists('.git/rebase-merge/msgnum'):
|
||||||
return ""
|
return ""
|
||||||
with open('.git/rebase-merge/msgnum', 'r') as f:
|
with open('.git/rebase-merge/msgnum', 'r') as f:
|
||||||
@ -16,7 +23,11 @@ def check_rebase():
|
|||||||
end = int(f.read())
|
end = int(f.read())
|
||||||
with open('.git/rebase-merge/head-name', 'r') as f:
|
with open('.git/rebase-merge/head-name', 'r') as f:
|
||||||
head = f.read().strip().split('/')
|
head = f.read().strip().split('/')
|
||||||
return f'[ {int(msgnum/2)} / {int(end/2)} - {head[-1]} ] '
|
|
||||||
|
rebase_prefix = f'[ {int(msgnum/2)} / {int(end/2)} - {head[-1]} ] '
|
||||||
|
if msgnum != end:
|
||||||
|
# fixed version speeds up builds
|
||||||
|
version_override = "test-build-patch-series"
|
||||||
|
|
||||||
def get_coredir(cfg):
|
def get_coredir(cfg):
|
||||||
if cfg.has_option('global', 'core'):
|
if cfg.has_option('global', 'core'):
|
||||||
@ -26,6 +37,11 @@ def get_coredir(cfg):
|
|||||||
|
|
||||||
def get_version(cfg):
|
def get_version(cfg):
|
||||||
coredir = get_coredir(cfg)
|
coredir = get_coredir(cfg)
|
||||||
|
if version_override:
|
||||||
|
version = version_override
|
||||||
|
print('')
|
||||||
|
print(f'### version [override]: {version}')
|
||||||
|
return version
|
||||||
if os.environ.get('RPM_PACKAGE_NAME'):
|
if os.environ.get('RPM_PACKAGE_NAME'):
|
||||||
version = os.environ.get('RPM_PACKAGE_NAME');
|
version = os.environ.get('RPM_PACKAGE_NAME');
|
||||||
version += '-' + os.environ.get('RPM_PACKAGE_VERSION');
|
version += '-' + os.environ.get('RPM_PACKAGE_VERSION');
|
||||||
@ -37,6 +53,11 @@ def get_version(cfg):
|
|||||||
cmdline = [ 'git', 'describe', '--tags', '--abbrev=8', '--match=edk2-stable*' ]
|
cmdline = [ 'git', 'describe', '--tags', '--abbrev=8', '--match=edk2-stable*' ]
|
||||||
result = subprocess.run(cmdline, capture_output = True, cwd = coredir)
|
result = subprocess.run(cmdline, capture_output = True, cwd = coredir)
|
||||||
version = result.stdout.decode().strip()
|
version = result.stdout.decode().strip()
|
||||||
|
#cmdline = [ 'git', 'branch', '--show-current']
|
||||||
|
#result = subprocess.run(cmdline, capture_output = True, cwd = coredir)
|
||||||
|
#branch = result.stdout.decode().strip()
|
||||||
|
#if branch != "master":
|
||||||
|
# version += f' ({branch})'
|
||||||
print('')
|
print('')
|
||||||
print(f'### version [git]: {version}')
|
print(f'### version [git]: {version}')
|
||||||
return version
|
return version
|
||||||
@ -52,17 +73,15 @@ def pcd_version(cfg):
|
|||||||
return [ '--pcd', pcd_string('PcdFirmwareVersionString', version) ]
|
return [ '--pcd', pcd_string('PcdFirmwareVersionString', version) ]
|
||||||
|
|
||||||
def build_message(line):
|
def build_message(line):
|
||||||
prefix = check_rebase()
|
|
||||||
|
|
||||||
if os.environ.get('TERM') in [ 'xterm', 'xterm-256color' ]:
|
if os.environ.get('TERM') in [ 'xterm', 'xterm-256color' ]:
|
||||||
# setxterm title
|
# setxterm title
|
||||||
start = '\x1b]2;'
|
start = '\x1b]2;'
|
||||||
end = '\x07'
|
end = '\x07'
|
||||||
print(f'{start}{prefix}{line}{end}', end = '')
|
print(f'{start}{rebase_prefix}{line}{end}', end = '')
|
||||||
|
|
||||||
print('')
|
print('')
|
||||||
print('###')
|
print('###')
|
||||||
print(f'### {prefix}{line}')
|
print(f'### {rebase_prefix}{line}')
|
||||||
print('###')
|
print('###')
|
||||||
|
|
||||||
def build_run(cmdline, name):
|
def build_run(cmdline, name):
|
||||||
@ -213,7 +232,7 @@ def build_list(cfg):
|
|||||||
desc = 'no description'
|
desc = 'no description'
|
||||||
if 'desc' in cfg[build]:
|
if 'desc' in cfg[build]:
|
||||||
desc = cfg[build]['desc']
|
desc = cfg[build]['desc']
|
||||||
print(f'# {name:16s} - {desc}')
|
print(f'# {name:20s} - {desc}')
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = optparse.OptionParser()
|
parser = optparse.OptionParser()
|
||||||
@ -223,6 +242,7 @@ def main():
|
|||||||
parser.add_option('-m', '--match', dest = 'match', type = 'string')
|
parser.add_option('-m', '--match', dest = 'match', type = 'string')
|
||||||
parser.add_option('-l', '--list', dest = 'list', action = 'store_true')
|
parser.add_option('-l', '--list', dest = 'list', action = 'store_true')
|
||||||
parser.add_option('--core', dest = 'core', type = 'string')
|
parser.add_option('--core', dest = 'core', type = 'string')
|
||||||
|
parser.add_option('--version-override', dest = 'version_override', type = 'string')
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
cfg = configparser.ConfigParser()
|
cfg = configparser.ConfigParser()
|
||||||
@ -237,6 +257,10 @@ def main():
|
|||||||
if options.core:
|
if options.core:
|
||||||
cfg.set('global', 'core', options.core)
|
cfg.set('global', 'core', options.core)
|
||||||
|
|
||||||
|
check_rebase()
|
||||||
|
if options.version_override:
|
||||||
|
version_override = options.version_override
|
||||||
|
|
||||||
prepare_env(cfg)
|
prepare_env(cfg)
|
||||||
build_basetools()
|
build_basetools()
|
||||||
for build in cfg.sections():
|
for build in cfg.sections():
|
||||||
|
24
edk2.spec
24
edk2.spec
@ -35,7 +35,7 @@ ExclusiveArch: x86_64 aarch64
|
|||||||
|
|
||||||
Name: edk2
|
Name: edk2
|
||||||
Version: %{GITDATE}git%{GITCOMMIT}
|
Version: %{GITDATE}git%{GITCOMMIT}
|
||||||
Release: 4%{?dist}
|
Release: 5%{?dist}
|
||||||
Summary: UEFI firmware for 64-bit virtual machines
|
Summary: UEFI firmware for 64-bit virtual machines
|
||||||
License: BSD-2-Clause-Patent and OpenSSL and MIT
|
License: BSD-2-Clause-Patent and OpenSSL and MIT
|
||||||
URL: http://www.tianocore.org
|
URL: http://www.tianocore.org
|
||||||
@ -57,10 +57,10 @@ Source20: 50-edk2-arm-verbose.json
|
|||||||
|
|
||||||
Source30: 30-edk2-ovmf-ia32-sb-enrolled.json
|
Source30: 30-edk2-ovmf-ia32-sb-enrolled.json
|
||||||
Source31: 40-edk2-ovmf-ia32-sb.json
|
Source31: 40-edk2-ovmf-ia32-sb.json
|
||||||
Source32: 50-edk2-ovmf-ia32.json
|
Source32: 50-edk2-ovmf-ia32-nosb.json
|
||||||
|
|
||||||
Source40: 30-edk2-ovmf-x64-sb.json
|
Source40: 30-edk2-ovmf-x64-sb-enrolled.json
|
||||||
Source41: 40-edk2-ovmf-x64.json
|
Source41: 40-edk2-ovmf-x64-sb.json
|
||||||
Source42: 50-edk2-ovmf-x64-microvm.json
|
Source42: 50-edk2-ovmf-x64-microvm.json
|
||||||
Source43: 50-edk2-ovmf-x64-nosb.json
|
Source43: 50-edk2-ovmf-x64-nosb.json
|
||||||
Source44: 60-edk2-ovmf-x64-amdsev.json
|
Source44: 60-edk2-ovmf-x64-amdsev.json
|
||||||
@ -384,8 +384,8 @@ ln -s OVMF_CODE.fd %{buildroot}%{_datadir}/%{name}/ovmf/OVMF_CODE.cc.fd
|
|||||||
# json description files
|
# json description files
|
||||||
mkdir -p %{buildroot}%{_datadir}/qemu/firmware
|
mkdir -p %{buildroot}%{_datadir}/qemu/firmware
|
||||||
install -m 0644 \
|
install -m 0644 \
|
||||||
30-edk2-ovmf-x64-sb.json \
|
30-edk2-ovmf-x64-sb-enrolled.json \
|
||||||
40-edk2-ovmf-x64.json \
|
40-edk2-ovmf-x64-sb.json \
|
||||||
50-edk2-ovmf-x64-nosb.json \
|
50-edk2-ovmf-x64-nosb.json \
|
||||||
60-edk2-ovmf-x64-amdsev.json \
|
60-edk2-ovmf-x64-amdsev.json \
|
||||||
60-edk2-ovmf-x64-inteltdx.json \
|
60-edk2-ovmf-x64-inteltdx.json \
|
||||||
@ -395,7 +395,7 @@ install -m 0644 \
|
|||||||
50-edk2-ovmf-x64-microvm.json \
|
50-edk2-ovmf-x64-microvm.json \
|
||||||
30-edk2-ovmf-ia32-sb-enrolled.json \
|
30-edk2-ovmf-ia32-sb-enrolled.json \
|
||||||
40-edk2-ovmf-ia32-sb.json \
|
40-edk2-ovmf-ia32-sb.json \
|
||||||
50-edk2-ovmf-ia32.json \
|
50-edk2-ovmf-ia32-nosb.json \
|
||||||
%{buildroot}%{_datadir}/qemu/firmware
|
%{buildroot}%{_datadir}/qemu/firmware
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -483,8 +483,8 @@ done
|
|||||||
%{_datadir}/%{name}/ovmf/UefiShell.iso
|
%{_datadir}/%{name}/ovmf/UefiShell.iso
|
||||||
%{_datadir}/%{name}/ovmf/Shell.efi
|
%{_datadir}/%{name}/ovmf/Shell.efi
|
||||||
%{_datadir}/%{name}/ovmf/EnrollDefaultKeys.efi
|
%{_datadir}/%{name}/ovmf/EnrollDefaultKeys.efi
|
||||||
%{_datadir}/qemu/firmware/30-edk2-ovmf-x64-sb.json
|
%{_datadir}/qemu/firmware/30-edk2-ovmf-x64-sb-enrolled.json
|
||||||
%{_datadir}/qemu/firmware/40-edk2-ovmf-x64.json
|
%{_datadir}/qemu/firmware/40-edk2-ovmf-x64-sb.json
|
||||||
%{_datadir}/qemu/firmware/50-edk2-ovmf-x64-nosb.json
|
%{_datadir}/qemu/firmware/50-edk2-ovmf-x64-nosb.json
|
||||||
%{_datadir}/qemu/firmware/60-edk2-ovmf-x64-amdsev.json
|
%{_datadir}/qemu/firmware/60-edk2-ovmf-x64-amdsev.json
|
||||||
%{_datadir}/qemu/firmware/60-edk2-ovmf-x64-inteltdx.json
|
%{_datadir}/qemu/firmware/60-edk2-ovmf-x64-inteltdx.json
|
||||||
@ -557,7 +557,7 @@ done
|
|||||||
%{_datadir}/%{name}/ovmf-ia32/UefiShell.iso
|
%{_datadir}/%{name}/ovmf-ia32/UefiShell.iso
|
||||||
%{_datadir}/qemu/firmware/30-edk2-ovmf-ia32-sb-enrolled.json
|
%{_datadir}/qemu/firmware/30-edk2-ovmf-ia32-sb-enrolled.json
|
||||||
%{_datadir}/qemu/firmware/40-edk2-ovmf-ia32-sb.json
|
%{_datadir}/qemu/firmware/40-edk2-ovmf-ia32-sb.json
|
||||||
%{_datadir}/qemu/firmware/50-edk2-ovmf-ia32.json
|
%{_datadir}/qemu/firmware/50-edk2-ovmf-ia32-nosb.json
|
||||||
|
|
||||||
%files ovmf-experimental
|
%files ovmf-experimental
|
||||||
%common_files
|
%common_files
|
||||||
@ -596,6 +596,10 @@ done
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Dec 05 2022 Gerd Hoffmann <kraxel@redhat.com> - 20221117gitfff6d81270b5-5
|
||||||
|
- rename *.json files to be more consistent.
|
||||||
|
- build script update
|
||||||
|
|
||||||
* Fri Dec 02 2022 Gerd Hoffmann <kraxel@redhat.com> - 20221117gitfff6d81270b5-4
|
* Fri Dec 02 2022 Gerd Hoffmann <kraxel@redhat.com> - 20221117gitfff6d81270b5-4
|
||||||
- apply dbx updates
|
- apply dbx updates
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user