Hello SeaBIOS developers,
I'm using SeaBIOS together with Coreboot and it works very well. Thank
you for your great work!
The compilation of coreboot is done on a system where /usr/bin/python
refers to python3. This makes scripts in the Python2 dialect fail with a
syntax error.
Since afaik Ubuntu will use Python 3 as default in the next release a
bigger number of people will be affected by this when compiling coreboot.
According to PEP-394 (http://www.python.org/dev/peps/pep-0394/) systems
are supposed to have a "python2" command which refers to Python 2. This
is the case on the systems I've tested. (Note: I have not tested many
enterprise distributions.)
I *think* it should be safe to make the usage of python2 explicit and
I've attached a patch to do so. The patch should be trivial, but please
tell me if you require any adjustments. I will be happy to do them.
Should you have reservations over this patch due to some older systems
possibly not having "python2", I might also try to make the scripts
compatible with both Python 2 and Python 3.
Regards,
Johannes
P.S. Please be so kind as to CC me in any responses as I'm not
subscribed to the list.
diff --git a/Makefile b/Makefile
index cb15217..0a87ffa 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,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
diff --git a/scripts/acpi_extract.py b/scripts/acpi_extract.py
index 8975b31..aad1526 100755
--- a/scripts/acpi_extract.py
+++ b/scripts/acpi_extract.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python2
# Copyright (C) 2011 Red Hat, Inc., Michael S. Tsirkin <[email protected]>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
diff --git a/scripts/acpi_extract_preprocess.py b/scripts/acpi_extract_preprocess.py
index 4ae364e..d8b240a 100755
--- a/scripts/acpi_extract_preprocess.py
+++ b/scripts/acpi_extract_preprocess.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python2
# Copyright (C) 2011 Red Hat, Inc., Michael S. Tsirkin <[email protected]>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
diff --git a/scripts/buildrom.py b/scripts/buildrom.py
index f2228ab..4dd0313 100755
--- a/scripts/buildrom.py
+++ b/scripts/buildrom.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
# Fill in checksum/size of an option rom, and pad it to proper length.
#
# Copyright (C) 2009 Kevin O'Connor <[email protected]>
diff --git a/scripts/checkrom.py b/scripts/checkrom.py
index aa3dd0d..d45bdde 100755
--- a/scripts/checkrom.py
+++ b/scripts/checkrom.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
# Script to check a bios image and report info on it.
#
# Copyright (C) 2008 Kevin O'Connor <[email protected]>
diff --git a/scripts/checkstack.py b/scripts/checkstack.py
index 23b7c8e..20f90d1 100755
--- a/scripts/checkstack.py
+++ b/scripts/checkstack.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
# Script that tries to find how much stack space each function in an
# object is using.
#
diff --git a/scripts/checksum.py b/scripts/checksum.py
index 8c7665d..a552b50 100755
--- a/scripts/checksum.py
+++ b/scripts/checksum.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
# Script to report the checksum of a file.
#
# Copyright (C) 2009 Kevin O'Connor <[email protected]>
diff --git a/scripts/encodeint.py b/scripts/encodeint.py
index 12be5fe..a5fe392 100755
--- a/scripts/encodeint.py
+++ b/scripts/encodeint.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
# Encode an integer in little endian format in a file.
#
# Copyright (C) 2011 Kevin O'Connor <[email protected]>
diff --git a/scripts/layoutrom.py b/scripts/layoutrom.py
index 24cd7a4..96857b3 100755
--- a/scripts/layoutrom.py
+++ b/scripts/layoutrom.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
# Script to analyze code and arrange ld sections.
#
# Copyright (C) 2008-2010 Kevin O'Connor <[email protected]>
diff --git a/scripts/readserial.py b/scripts/readserial.py
index d85392e..bcbb9ec 100755
--- a/scripts/readserial.py
+++ b/scripts/readserial.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
# Script that can read from a serial device and show timestamps.
#
# Copyright (C) 2009 Kevin O'Connor <[email protected]>
diff --git a/scripts/transdump.py b/scripts/transdump.py
index 4caaeb7..3254079 100755
--- a/scripts/transdump.py
+++ b/scripts/transdump.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
# This script is useful for taking the output of memdump() and
# converting it back into binary output. This can be useful, for
diff --git a/scripts/vgafixup.py b/scripts/vgafixup.py
index 2493f35..248a480 100644
--- a/scripts/vgafixup.py
+++ b/scripts/vgafixup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
# Work around x86emu bugs by replacing problematic instructions.
#
# Copyright (C) 2012 Kevin O'Connor <[email protected]>
_______________________________________________
SeaBIOS mailing list
[email protected]
http://www.seabios.org/mailman/listinfo/seabios