Accepting request 569857 from home:bfrogers:branches:Virtualization

- Modify BuildRequires python references 
- seabios also needed tweaks for python2 vs python3
* Patches added:
  seabios-use-python2-explicitly-as-needed.patch
  seabios-switch-to-python3-as-needed.patch
- Modify BuildRequires python references 
- seabios also needed tweaks for python2 vs python3
* Patches added:
  seabios-use-python2-explicitly-as-needed.patch
  seabios-switch-to-python3-as-needed.patch

OBS-URL: https://build.opensuse.org/request/show/569857
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=386
This commit is contained in:
Bruce Rogers 2018-01-26 13:19:10 +00:00 committed by Git OBS Bridge
parent eaf0e86f5c
commit 7f128978e3
7 changed files with 292 additions and 54 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Fri Jan 26 11:49:03 UTC 2018 - brogers@suse.com
- Modify BuildRequires python references
- seabios also needed tweaks for python2 vs python3
* Patches added:
seabios-use-python2-explicitly-as-needed.patch
seabios-switch-to-python3-as-needed.patch
-------------------------------------------------------------------
Thu Jan 25 22:52:06 UTC 2018 - brogers@suse.com

View File

@ -181,27 +181,29 @@ Patch0044: 0044-Make-installed-scripts-explicitly-p.patch
# include them here
Patch1000: Make-installed-scripts-explicitly-python3.patch
# SeaBIOS / SeaVGABIOS (Currently no patches)
# SeaBIOS / SeaVGABIOS
Patch1100: seabios-use-python2-explicitly-as-needed.patch
Patch1101: seabios-switch-to-python3-as-needed.patch
# ipxe
# PATCH-FIX-OPENSUSE ipxe-stable-buildid.patch brogers@suse.com -- reproducible builds
Patch1100: ipxe-stable-buildid.patch
Patch1101: ipxe-use-gcc6-for-more-compact-code.patch
Patch1200: ipxe-stable-buildid.patch
Patch1201: ipxe-use-gcc6-for-more-compact-code.patch
# sgabios
# PATCH-FIX-OPENSUSE sgabios-stable-buildid.patch brogers@suse.com -- reproducible builds
Patch1200: sgabios-stable-buildid.patch
Patch1300: sgabios-stable-buildid.patch
# SLOF (Currently no patches)
# skiboot
Patch1400: skiboot-GCC7-fixes-for-Wimplicit-fallthr.patch
Patch1401: skiboot-libc-stdio-vsnprintf.c-add-expli.patch
Patch1402: skiboot-build-LDFLAGS-pass-pie-flag-explicitly-to-ld.patch
Patch1500: skiboot-GCC7-fixes-for-Wimplicit-fallthr.patch
Patch1501: skiboot-libc-stdio-vsnprintf.c-add-expli.patch
Patch1502: skiboot-build-LDFLAGS-pass-pie-flag-explicitly-to-ld.patch
# ui/keycodemapdb
Patch2000: ui-keycodemapdb-Add-missing-QKeyCode-val.patch
Patch2001: ui-keycodemapdb-Fix-compat-with-py3-dict.patch
Patch1600: ui-keycodemapdb-Add-missing-QKeyCode-val.patch
Patch1601: ui-keycodemapdb-Fix-compat-with-py3-dict.patch
# this is to make lint happy
Source300: qemu-rpmlintrc
@ -316,7 +318,11 @@ BuildRequires: ovmf-tools
%endif
BuildRequires: pkgconfig
BuildRequires: pwdutils
BuildRequires: python
%if 0%{?suse_version} > 1320
BuildRequires: python3-base
%else
BuildRequires: python-base
%endif
%if 0%{?suse_version} >= 1315
BuildRequires: rdma-core-devel
%endif
@ -813,29 +819,36 @@ This package provides a service file for starting and stopping KSM.
%patch1000 -p1
%endif
pushd roms/ipxe
pushd roms/seabios
%patch1100 -p1
%if 0%{?suse_version} <= 1320
%if 0%{?suse_version} > 1320
%patch1101 -p1
%endif
popd
pushd roms/sgabios
pushd roms/ipxe
%patch1200 -p1
%if 0%{?suse_version} <= 1320
%patch1201 -p1
%endif
popd
pushd roms/sgabios
%patch1300 -p1
popd
pushd roms/SLOF
popd
pushd roms/skiboot
%patch1400 -p1
%patch1401 -p1
%patch1402 -p1
%patch1500 -p1
%patch1501 -p1
%patch1502 -p1
popd
pushd ui/keycodemapdb
%patch2000 -p1
%patch2001 -p1
%patch1600 -p1
%patch1601 -p1
popd
# as a safeguard, delete the firmware files that we intend to build

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Fri Jan 26 11:49:03 UTC 2018 - brogers@suse.com
- Modify BuildRequires python references
- seabios also needed tweaks for python2 vs python3
* Patches added:
seabios-use-python2-explicitly-as-needed.patch
seabios-switch-to-python3-as-needed.patch
-------------------------------------------------------------------
Thu Jan 25 22:52:06 UTC 2018 - brogers@suse.com

View File

@ -181,27 +181,29 @@ Patch0044: 0044-Make-installed-scripts-explicitly-p.patch
# include them here
Patch1000: Make-installed-scripts-explicitly-python3.patch
# SeaBIOS / SeaVGABIOS (Currently no patches)
# SeaBIOS / SeaVGABIOS
Patch1100: seabios-use-python2-explicitly-as-needed.patch
Patch1101: seabios-switch-to-python3-as-needed.patch
# ipxe
# PATCH-FIX-OPENSUSE ipxe-stable-buildid.patch brogers@suse.com -- reproducible builds
Patch1100: ipxe-stable-buildid.patch
Patch1101: ipxe-use-gcc6-for-more-compact-code.patch
Patch1200: ipxe-stable-buildid.patch
Patch1201: ipxe-use-gcc6-for-more-compact-code.patch
# sgabios
# PATCH-FIX-OPENSUSE sgabios-stable-buildid.patch brogers@suse.com -- reproducible builds
Patch1200: sgabios-stable-buildid.patch
Patch1300: sgabios-stable-buildid.patch
# SLOF (Currently no patches)
# skiboot
Patch1400: skiboot-GCC7-fixes-for-Wimplicit-fallthr.patch
Patch1401: skiboot-libc-stdio-vsnprintf.c-add-expli.patch
Patch1402: skiboot-build-LDFLAGS-pass-pie-flag-explicitly-to-ld.patch
Patch1500: skiboot-GCC7-fixes-for-Wimplicit-fallthr.patch
Patch1501: skiboot-libc-stdio-vsnprintf.c-add-expli.patch
Patch1502: skiboot-build-LDFLAGS-pass-pie-flag-explicitly-to-ld.patch
# ui/keycodemapdb
Patch2000: ui-keycodemapdb-Add-missing-QKeyCode-val.patch
Patch2001: ui-keycodemapdb-Fix-compat-with-py3-dict.patch
Patch1600: ui-keycodemapdb-Add-missing-QKeyCode-val.patch
Patch1601: ui-keycodemapdb-Fix-compat-with-py3-dict.patch
# this is to make lint happy
Source300: qemu-rpmlintrc
@ -316,7 +318,11 @@ BuildRequires: ovmf-tools
%endif
BuildRequires: pkgconfig
BuildRequires: pwdutils
BuildRequires: python
%if 0%{?suse_version} > 1320
BuildRequires: python3-base
%else
BuildRequires: python-base
%endif
%if 0%{?suse_version} >= 1315
BuildRequires: rdma-core-devel
%endif
@ -813,29 +819,36 @@ This package provides a service file for starting and stopping KSM.
%patch1000 -p1
%endif
pushd roms/ipxe
pushd roms/seabios
%patch1100 -p1
%if 0%{?suse_version} <= 1320
%if 0%{?suse_version} > 1320
%patch1101 -p1
%endif
popd
pushd roms/sgabios
pushd roms/ipxe
%patch1200 -p1
%if 0%{?suse_version} <= 1320
%patch1201 -p1
%endif
popd
pushd roms/sgabios
%patch1300 -p1
popd
pushd roms/SLOF
popd
pushd roms/skiboot
%patch1400 -p1
%patch1401 -p1
%patch1402 -p1
%patch1500 -p1
%patch1501 -p1
%patch1502 -p1
popd
pushd ui/keycodemapdb
%patch2000 -p1
%patch2001 -p1
%patch1600 -p1
%patch1601 -p1
popd
# as a safeguard, delete the firmware files that we intend to build

View File

@ -138,27 +138,30 @@ PATCH_FILES
# include them here
Patch1000: Make-installed-scripts-explicitly-python3.patch
# SeaBIOS / SeaVGABIOS (Currently no patches)
# SeaBIOS / SeaVGABIOS
Patch1100: seabios-use-python2-explicitly-as-needed.patch
Patch1101: seabios-switch-to-python3-as-needed.patch
# ipxe
# PATCH-FIX-OPENSUSE ipxe-stable-buildid.patch brogers@suse.com -- reproducible builds
Patch1100: ipxe-stable-buildid.patch
Patch1101: ipxe-use-gcc6-for-more-compact-code.patch
Patch1200: ipxe-stable-buildid.patch
Patch1201: ipxe-use-gcc6-for-more-compact-code.patch
# sgabios
# PATCH-FIX-OPENSUSE sgabios-stable-buildid.patch brogers@suse.com -- reproducible builds
Patch1200: sgabios-stable-buildid.patch
Patch1300: sgabios-stable-buildid.patch
# SLOF (Currently no patches)
# skiboot
Patch1400: skiboot-GCC7-fixes-for-Wimplicit-fallthr.patch
Patch1401: skiboot-libc-stdio-vsnprintf.c-add-expli.patch
Patch1402: skiboot-build-LDFLAGS-pass-pie-flag-explicitly-to-ld.patch
Patch1500: skiboot-GCC7-fixes-for-Wimplicit-fallthr.patch
Patch1501: skiboot-libc-stdio-vsnprintf.c-add-expli.patch
Patch1502: skiboot-build-LDFLAGS-pass-pie-flag-explicitly-to-ld.patch
# ui/keycodemapdb
Patch2000: ui-keycodemapdb-Add-missing-QKeyCode-val.patch
Patch2001: ui-keycodemapdb-Fix-compat-with-py3-dict.patch
Patch1600: ui-keycodemapdb-Add-missing-QKeyCode-val.patch
Patch1601: ui-keycodemapdb-Fix-compat-with-py3-dict.patch
# this is to make lint happy
Source300: qemu-rpmlintrc
@ -273,7 +276,11 @@ BuildRequires: ovmf-tools
%endif
BuildRequires: pkgconfig
BuildRequires: pwdutils
BuildRequires: python
%if 0%{?suse_version} > 1320
BuildRequires: python3-base
%else
BuildRequires: python-base
%endif
%if 0%{?suse_version} >= 1315
BuildRequires: rdma-core-devel
%endif
@ -727,29 +734,36 @@ PATCH_EXEC
%patch1000 -p1
%endif
pushd roms/ipxe
pushd roms/seabios
%patch1100 -p1
%if 0%{?suse_version} <= 1320
%if 0%{?suse_version} > 1320
%patch1101 -p1
%endif
popd
pushd roms/sgabios
pushd roms/ipxe
%patch1200 -p1
%if 0%{?suse_version} <= 1320
%patch1201 -p1
%endif
popd
pushd roms/sgabios
%patch1300 -p1
popd
pushd roms/SLOF
popd
pushd roms/skiboot
%patch1400 -p1
%patch1401 -p1
%patch1402 -p1
%patch1500 -p1
%patch1501 -p1
%patch1502 -p1
popd
pushd ui/keycodemapdb
%patch2000 -p1
%patch2001 -p1
%patch1600 -p1
%patch1601 -p1
popd
# as a safeguard, delete the firmware files that we intend to build

View File

@ -0,0 +1,140 @@
seabios: switch to python3 as needed
Switch to python3 the places where "python2" is explicitly referenced.
(Ignore the uses of #!/usr/bin/env python, since that usage does the
right thing in our build environment).
Include changes proposed by the python3 2to3 tool.
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
Makefile | 2 +-
scripts/acpi_extract.py | 2 +-
scripts/acpi_extract_preprocess.py | 2 +-
scripts/acpi_extract.py | 2 +-
scripts/layoutrom.py | 28 ++++++++++++++--------------
scripts/vgafixup.py | 2 +-
6 files changed, 19 insertions(+), 19 deletions(-)
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ LD=$(CROSS_PREFIX)ld
OBJCOPY=$(CROSS_PREFIX)objcopy
OBJDUMP=$(CROSS_PREFIX)objdump
STRIP=$(CROSS_PREFIX)strip
-PYTHON=python2
+PYTHON=python3
CPP=cpp
IASL:=iasl
LD32BIT_FLAG:=-melf_i386
--- a/scripts/acpi_extract.py
+++ b/scripts/acpi_extract.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/python3
# Copyright (C) 2011 Red Hat, Inc., Michael S. Tsirkin <mst@redhat.com>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
--- a/scripts/acpi_extract_preprocess.py
+++ b/scripts/acpi_extract_preprocess.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/python3
# Copyright (C) 2011 Red Hat, Inc., Michael S. Tsirkin <mst@redhat.com>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
--- a/scripts/acpi_extract.py
+++ b/scripts/acpi_extract.py
@@ -348,7 +348,7 @@ def main():
# Pretty print output
outstrs = ["/* DO NOT EDIT! This is an autogenerated file."
" See scripts/acpi_extract.py. */"]
- for array in output.keys():
+ for array in list(output.keys()):
otype = get_value_type(max(output[array]))
outstrs.append("static unsigned %s %s[] = {" % (otype, array))
odata = []
--- a/scripts/layoutrom.py
+++ b/scripts/layoutrom.py
@@ -81,8 +81,8 @@ def fitSections(sections, fillsections):
section.finalsegloc = addr
fixedsections.append((addr, section))
if section.align != 1:
- print("Error: Fixed section %s has non-zero alignment (%d)" % (
- section.name, section.align))
+ print(("Error: Fixed section %s has non-zero alignment (%d)" % (
+ section.name, section.align)))
sys.exit(1)
fixedsections.sort(key=operator.itemgetter(0))
firstfixed = fixedsections[0][0]
@@ -142,10 +142,10 @@ def fitSections(sections, fillsections):
# Report stats
total = BUILD_BIOS_SIZE-firstfixed
slack = total - totalused
- print ("Fixed space: 0x%x-0x%x total: %d slack: %d"
+ print(("Fixed space: 0x%x-0x%x total: %d slack: %d"
" Percent slack: %.1f%%" % (
firstfixed, BUILD_BIOS_SIZE, total, slack,
- (float(slack) / total) * 100.0))
+ (float(slack) / total) * 100.0)))
return firstfixed + BUILD_BIOS_ADDR
@@ -288,12 +288,12 @@ def doLayout(sections, config, genreloc)
size32flat = sec32fseg_start - sec32flat_start
size32init = sec32flat_start - sec32init_start
sizelow = li.sec32low_end - li.sec32low_start
- print("16bit size: %d" % size16)
- print("32bit segmented size: %d" % size32seg)
- print("32bit flat size: %d" % (size32flat + size32textfseg))
- print("32bit flat init size: %d" % size32init)
- print("Lowmem size: %d" % sizelow)
- print("f-segment var size: %d" % size32fseg)
+ print(("16bit size: %d" % size16))
+ print(("32bit segmented size: %d" % size32seg))
+ print(("32bit flat size: %d" % (size32flat + size32textfseg)))
+ print(("32bit flat init size: %d" % size32init))
+ print(("Lowmem size: %d" % sizelow))
+ print(("f-segment var size: %d" % size32fseg))
return li
@@ -312,7 +312,7 @@ def outXRefs(sections, useseg=0, exports
and (symbol.section.fileid != section.fileid
or symbol.name != reloc.symbolname)):
xrefs[reloc.symbolname] = symbol
- for symbolname, symbol in xrefs.items():
+ for symbolname, symbol in list(xrefs.items()):
loc = symbol.section.finalloc
if useseg:
loc = symbol.section.finalsegloc
@@ -482,8 +482,8 @@ def checkRuntime(reloc, rsection, data,
if section is None or '.init.' in section.name:
return 0
if '.data.varinit.' in section.name:
- print("ERROR: %s is VARVERIFY32INIT but used from %s" % (
- section.name, chain))
+ print(("ERROR: %s is VARVERIFY32INIT but used from %s" % (
+ section.name, chain)))
sys.exit(1)
return 1
@@ -691,7 +691,7 @@ def main():
li = doLayout(sections, config, genreloc)
# Exported symbols
- li.varlowsyms = [symbol for symbol in symbols['32flat'].values()
+ li.varlowsyms = [symbol for symbol in list(symbols['32flat'].values())
if (symbol.section is not None
and symbol.section.finalloc is not None
and '.data.varlow.' in symbol.section.name
--- a/scripts/vgafixup.py
+++ b/scripts/vgafixup.py
@@ -29,7 +29,7 @@ re_leal = re.compile(
def handle_leal(sline):
m = re_leal.match(sline[5:])
if m is None or m.group('index') == '%esp':
- print("Unable to fixup leal instruction: %s" % (sline,))
+ print(("Unable to fixup leal instruction: %s" % (sline,)))
sys.exit(-1)
offset, base, index, scale, dest = m.group(
'offset', 'base', 'index', 'scale', 'dest')

View File

@ -0,0 +1,40 @@
seabios: use python2 explicitly as needed
Switch to python2 the places where "python" is explicitly referenced.
(Ignore the uses of #!/usr/bin/env python, since that usage does the
right thing in our build environment).
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
Makefile | 2 +-
scripts/acpi_extract.py | 2 +-
scripts/acpi_extract_preprocess.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ LD=$(CROSS_PREFIX)ld
OBJCOPY=$(CROSS_PREFIX)objcopy
OBJDUMP=$(CROSS_PREFIX)objdump
STRIP=$(CROSS_PREFIX)strip
-PYTHON=python
+PYTHON=python2
CPP=cpp
IASL:=iasl
LD32BIT_FLAG:=-melf_i386
--- a/scripts/acpi_extract.py
+++ b/scripts/acpi_extract.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2
# Copyright (C) 2011 Red Hat, Inc., Michael S. Tsirkin <mst@redhat.com>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
--- a/scripts/acpi_extract_preprocess.py
+++ b/scripts/acpi_extract_preprocess.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2
# Copyright (C) 2011 Red Hat, Inc., Michael S. Tsirkin <mst@redhat.com>
#
# This file may be distributed under the terms of the GNU GPLv3 license.