Skip to contentSkip to conversation

Support Python 3.x in U-Boot

PATCH New Thomas Petazzoni 3 participants 13 messages May 2, 2020 – May 17, 2020

lore
Share & tools
lore
#0 lore raw

cover Support Python 3.x in U-Boot

Hello,

Since 2020.01, U-Boot now uses python3 for its scripts, but our uboot package only supports adding a dependency on host-python, which causes a number of build failures of our defconfigs.

To fix this, this series introduces additional U-Boot options with appropriate dependencies, and fixes the problematic defconfigs.

Thomas

Thomas Petazzoni (6):
package/python3-pyelftools: new package boot/uboot: support building U-Boot with Python 3.x configs/olimex_a20_olinuxino_lime{,2}: use Python 3.x configs/beelink_gs1: use Python 3.x configs/roc_pc_rk3399: fix U-Boot dependencies configs/nanopi_neo4: fix U-Boot dependencies

 boot/uboot/Config.in                          | 29 +++++++++++++++++++
 boot/uboot/uboot.mk                           | 12 +++++++-
 configs/beelink_gs1_defconfig                 |  2 ++
 configs/nanopi_neo4_defconfig                 |  4 +--
 configs/olimex_a20_olinuxino_lime2_defconfig  |  2 ++
 configs/olimex_a20_olinuxino_lime_defconfig   |  2 ++
 configs/roc_pc_rk3399_defconfig               |  4 +--
 .../python-pyelftools/python-pyelftools.mk    |  1 +
 .../python3-pyelftools.hash                   |  1 +
 .../python3-pyelftools/python3-pyelftools.mk  | 17 +++++++++++
 10 files changed, 69 insertions(+), 5 deletions(-)
 create mode 120000 package/python3-pyelftools/python3-pyelftools.hash
 create mode 100644 package/python3-pyelftools/python3-pyelftools.mk
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/6 package/python3-pyelftools: new package

We will need this Python 3.x variant of the host-python-pyelftools package to be able to build some recent versions of U-Boot (>= 2020.01).

---
 package/python-pyelftools/python-pyelftools.mk  |  1 +
 .../python3-pyelftools/python3-pyelftools.hash  |  1 +
 .../python3-pyelftools/python3-pyelftools.mk    | 17 +++++++++++++++++
 3 files changed, 19 insertions(+)
 create mode 120000 package/python3-pyelftools/python3-pyelftools.hash
 create mode 100644 package/python3-pyelftools/python3-pyelftools.mk
package/python-pyelftools/python-pyelftools.mk +1 -0
index 21b9e409be..71ad49f20c 100644
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# Please keep in sync with package/python3-pyelftools/python3-pyelftools.mk
 PYTHON_PYELFTOOLS_VERSION = 0.25
 PYTHON_PYELFTOOLS_SOURCE = pyelftools-$(PYTHON_PYELFTOOLS_VERSION).tar.gz
 PYTHON_PYELFTOOLS_SITE = https://files.pythonhosted.org/packages/fa/9a/0674cb1725196568bdbca98304f2efb17368b57af1a4bb3fc772c026f474
package/python3-pyelftools/python3-pyelftools.hash new file +1 -0
new file mode 120000
index 0000000000..e8eebeda9f
@@ -0,0 +1 @@
+../python-pyelftools/python-pyelftools.hash
\ No newline at end of file
package/python3-pyelftools/python3-pyelftools.mk new file +17 -0
new file mode 100644
index 0000000000..ea79aef66d
@@ -0,0 +1,17 @@
+################################################################################
+#
+# python3-pyelftools
+#
+################################################################################
+
+# Please keep in sync with package/python-pyelftools/python-pyelftools.mk
+PYTHON3_PYELFTOOLS_VERSION = 0.25
+PYTHON3_PYELFTOOLS_SOURCE = pyelftools-$(PYTHON_PYELFTOOLS_VERSION).tar.gz
+PYTHON3_PYELFTOOLS_SITE = https://files.pythonhosted.org/packages/fa/9a/0674cb1725196568bdbca98304f2efb17368b57af1a4bb3fc772c026f474
+PYTHON3_PYELFTOOLS_LICENSE = Public domain
+PYTHON3_PYELFTOOLS_LICENSE_FILES = LICENSE
+PYTHON3_PYELFTOOLS_SETUP_TYPE = setuptools
+HOST_PYTHON3_PYELFTOOLS_DL_SUBDIR = python-pyelftools
+HOST_PYTHON3_PYELFTOOLS_NEEDS_HOST_PYTHON = python3
+
+$(eval $(host-python-package))
Signature · 1 line
2.26.2
#2 lore raw

PATCH 2/6 boot/uboot: support building U-Boot with Python 3.x

In reply to Thomas Petazzoni

U-Boot versions newer than 2020.01 use Python 3.x instead of Python 2.x in various scripts.

We already had the BR2_TARGET_UBOOT_NEEDS_PYLIBFDT and BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS options, but depending on the U-Boot version, we now need to indicate if Python 2.x or Python 3.x should be used.

In addition, it turns out that some U-Boot configurations need a Python interpreter, without needing pylibfdt or pyelftools. Some of our defconfigs were abusing the BR2_TARGET_UBOOT_NEEDS_PYLIBFDT option to make sure a Python interpreter was built.

To solve both issues, we add a new option BR2_TARGET_UBOOT_NEEDS_PYTHON, which itself has a choice to choose between Python 2.x and Python 3.x. It defaults to Python 2.x to preserve backward compatibility.

The existing BR2_TARGET_UBOOT_NEEDS_PYLIBFDT and
BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS options select
BR2_TARGET_UBOOT_NEEDS_PYTHON.

---
 boot/uboot/Config.in | 29 +++++++++++++++++++++++++++++
 boot/uboot/uboot.mk  | 12 +++++++++++-
 2 files changed, 40 insertions(+), 1 deletion(-)
boot/uboot/Config.in +29 -0
index 7a6f5053fd..e10166a113 100644
@@ -147,14 +147,43 @@ config BR2_TARGET_UBOOT_NEEDS_DTC
 	  Select this option if your U-Boot board configuration
 	  requires the Device Tree compiler to be available.
 
+config BR2_TARGET_UBOOT_NEEDS_PYTHON
+	bool "U-Boot needs host Python"
+
+if BR2_TARGET_UBOOT_NEEDS_PYTHON
+
+choice
+	prompt "Python version"
+	default BR2_TARGET_UBOOT_NEEDS_PYTHON2
+
+config BR2_TARGET_UBOOT_NEEDS_PYTHON2
+	bool "python 2.x"
+	help
+	  Select this option if U-Boot needs a host Python 2.x
+	  interpreter. This is the case for some U-Boot
+	  configurations, prior to U-Boot 2020.01.
+
+config BR2_TARGET_UBOOT_NEEDS_PYTHON3
+	bool "python 3.x"
+	help
+	  Select this option if U-Boot needs a host Python 3.x
+	  interpreter. This is the case for some U-Boot
+	  configurations, after U-Boot 2020.01.
+
+endchoice
+
+endif
+
 config BR2_TARGET_UBOOT_NEEDS_PYLIBFDT
 	bool "U-Boot needs pylibfdt"
+	select BR2_TARGET_UBOOT_NEEDS_PYTHON
 	help
 	  Select this option if your U-Boot board configuration
 	  requires the Python libfdt library to be available.
 
 config BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS
 	bool "U-Boot needs pyelftools"
+	select BR2_TARGET_UBOOT_NEEDS_PYTHON
 	help
 	  Select this option if your U-Boot board configuration
 	  requires the Python pyelftools library to be available.
boot/uboot/uboot.mk +11 -1
index 7bd9cbae52..1d50e72846 100644
@@ -159,12 +159,22 @@ ifeq ($(BR2_TARGET_UBOOT_NEEDS_DTC),y)
 UBOOT_DEPENDENCIES += host-dtc
 endif
 
+ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYTHON2),y)
+UBOOT_DEPENDENCIES += host-python
+else ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYTHON3),y)
+UBOOT_DEPENDENCIES += host-python3
+endif
+
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYLIBFDT),y)
-UBOOT_DEPENDENCIES += host-python host-swig
+UBOOT_DEPENDENCIES += host-swig
 endif
 
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS),y)
+ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYTHON2),y)
 UBOOT_DEPENDENCIES += host-python-pyelftools
+else ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYTHON3),y)
+UBOOT_DEPENDENCIES += host-python3-pyelftools
+endif
 endif
 
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPENSSL),y)
Signature · 1 line
2.26.2
#3 lore raw

PATCH 2/6 boot/uboot: support building U-Boot with Python 3.x

Thomas, All,

On 2020-05-02 23:28 +0200, Thomas Petazzoni spake thusly:

Quoted 50 lines

U-Boot versions newer than 2020.01 use Python 3.x instead of Python 2.x in various scripts.

We already had the BR2_TARGET_UBOOT_NEEDS_PYLIBFDT and BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS options, but depending on the U-Boot version, we now need to indicate if Python 2.x or Python 3.x should be used.

In addition, it turns out that some U-Boot configurations need a Python interpreter, without needing pylibfdt or pyelftools. Some of our defconfigs were abusing the BR2_TARGET_UBOOT_NEEDS_PYLIBFDT option to make sure a Python interpreter was built.

To solve both issues, we add a new option BR2_TARGET_UBOOT_NEEDS_PYTHON, which itself has a choice to choose between Python 2.x and Python 3.x. It defaults to Python 2.x to preserve backward compatibility.

The existing BR2_TARGET_UBOOT_NEEDS_PYLIBFDT and
BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS options select
BR2_TARGET_UBOOT_NEEDS_PYTHON.

---
 boot/uboot/Config.in | 29 +++++++++++++++++++++++++++++
 boot/uboot/uboot.mk  | 12 +++++++++++-
 2 files changed, 40 insertions(+), 1 deletion(-)
boot/uboot/Config.in +14 -0
index 7a6f5053fd..e10166a113 100644
@@ -147,14 +147,43 @@ config BR2_TARGET_UBOOT_NEEDS_DTC
 	  Select this option if your U-Boot board configuration
 	  requires the Device Tree compiler to be available.
 
+config BR2_TARGET_UBOOT_NEEDS_PYTHON
+	bool "U-Boot needs host Python"
+
+if BR2_TARGET_UBOOT_NEEDS_PYTHON
+
+choice
+	prompt "Python version"
+	default BR2_TARGET_UBOOT_NEEDS_PYTHON2
+
+config BR2_TARGET_UBOOT_NEEDS_PYTHON2
+	bool "python 2.x"
+	help
+	  Select this option if U-Boot needs a host Python 2.x
+	  interpreter. This is the case for some U-Boot

boot/uboot/Config.in config BR2_TARGET_UBOOT_NEEDS_DTC · line 173

Quoted 10 lines
boot/uboot/Config.in +10 -0
+	  configurations, prior to U-Boot 2020.01.
+
+config BR2_TARGET_UBOOT_NEEDS_PYTHON3
+	bool "python 3.x"
+	help
+	  Select this option if U-Boot needs a host Python 3.x
+	  interpreter. This is the case for some U-Boot
+	  configurations, after U-Boot 2020.01.
+
+endchoice

I don't like it much that construct, where a boolean hides a choice. Instead, we can siumply use a choice (options names abbreviated as I'm lazy to type them full):

    choice
        "Python support needed"

    config UBOOT_PY_NONE
        "none"

    config UBOOT_PY2
        "python2"

    config UBOOT_PY3
        "python3"

    endchoice

boot/uboot/Config.in config BR2_TARGET_UBOOT_NEEDS_DTC · line 186

Quoted 12 lines
boot/uboot/Config.in +4 -0
+endif
+
 config BR2_TARGET_UBOOT_NEEDS_PYLIBFDT
 	bool "U-Boot needs pylibfdt"
+	select BR2_TARGET_UBOOT_NEEDS_PYTHON
 	help
 	  Select this option if your U-Boot board configuration
 	  requires the Python libfdt library to be available.
 
 config BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS
 	bool "U-Boot needs pyelftools"
+	select BR2_TARGET_UBOOT_NEEDS_PYTHON

Of course here (both pylibfdt and pyelftools), you'd have to switch to a depends-on, but that does not change much afterall.

Regards,
Yann E. MORIN.

Quoted 38 lines
boot/uboot/Config.in +0 -0
 	help
 	  Select this option if your U-Boot board configuration
 	  requires the Python pyelftools library to be available.
boot/uboot/uboot.mk +11 -1
index 7bd9cbae52..1d50e72846 100644
@@ -159,12 +159,22 @@ ifeq ($(BR2_TARGET_UBOOT_NEEDS_DTC),y)
 UBOOT_DEPENDENCIES += host-dtc
 endif
 
+ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYTHON2),y)
+UBOOT_DEPENDENCIES += host-python
+else ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYTHON3),y)
+UBOOT_DEPENDENCIES += host-python3
+endif
+
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYLIBFDT),y)
-UBOOT_DEPENDENCIES += host-python host-swig
+UBOOT_DEPENDENCIES += host-swig
 endif
 
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS),y)
+ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYTHON2),y)
 UBOOT_DEPENDENCIES += host-python-pyelftools
+else ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYTHON3),y)
+UBOOT_DEPENDENCIES += host-python3-pyelftools
+endif
 endif
 
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPENSSL),y)
Signature · 6 lines
2.26.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 2/6 boot/uboot: support building U-Boot with Python 3.x

Hello Yann,

Quoted 49 lines · On Sun, 3 May 2020 10:02:31 +0200 "Yann E. MORIN" <[email protected]>…
Quoted 11 lines
boot/uboot/Config.in +11 -0
+if BR2_TARGET_UBOOT_NEEDS_PYTHON
+
+choice
+	prompt "Python version"
+	default BR2_TARGET_UBOOT_NEEDS_PYTHON2
+
+config BR2_TARGET_UBOOT_NEEDS_PYTHON2
+	bool "python 2.x"
+	help
+	  Select this option if U-Boot needs a host Python 2.x
+	  interpreter. This is the case for some U-Boot

boot/uboot/Config.in config BR2_TARGET_UBOOT_NEEDS_DTC · line 173

Quoted 10 lines
boot/uboot/Config.in +10 -0
+	  configurations, prior to U-Boot 2020.01.
+
+config BR2_TARGET_UBOOT_NEEDS_PYTHON3
+	bool "python 3.x"
+	help
+	  Select this option if U-Boot needs a host Python 3.x
+	  interpreter. This is the case for some U-Boot
+	  configurations, after U-Boot 2020.01.
+
+endchoice  

I don't like it much that construct, where a boolean hides a choice. Instead, we can siumply use a choice (options names abbreviated as I'm lazy to type them full):

    choice
        "Python support needed"

    config UBOOT_PY_NONE
        "none"

    config UBOOT_PY2
        "python2"

    config UBOOT_PY3
        "python3"

    endchoice
Quoted 9 lines
boot/uboot/Config.in +3 -0
+endif
+
 config BR2_TARGET_UBOOT_NEEDS_PYLIBFDT
 	bool "U-Boot needs pylibfdt"
+	select BR2_TARGET_UBOOT_NEEDS_PYTHON
 	help
 	  Select this option if your U-Boot board configuration
 	  requires the Python libfdt library to be available.
Quoted 6 lines

boot/uboot/Config.in config BR2_TARGET_UBOOT_NEEDS_DTC · line 186

Quoted 3 lines

config BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS

boot/uboot/Config.in +1 -0
 	bool "U-Boot needs pyelftools"
+	select BR2_TARGET_UBOOT_NEEDS_PYTHON  

Of course here (both pylibfdt and pyelftools), you'd have to switch to a depends-on, but that does not change much afterall.

If I use depends on like you suggest, we break backward compatibility. Indeed, an existing configuration with BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS=y or BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y will not have UBOOT_PY2 enabled, and therefore host-python will no longer be built.

My proposal was carefully designed to make sure existing configurations do not break.

A possible solution would be something like the below, but I believe it might cause some circular dependency:

choice
prompt "Python support needed"
default UBOOT_PY2 if BR2_TARGET_UBOOT_NEEDS_PYLIBFDT default UBOOT_PY2 if BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS

config UBOOT_PY_NONE

	...
config UBOOT_PY2
	...
config UBOOT_PY3
	...

endchoice

config BR2_TARGET_UBOOT_NEEDS_PYLIBFDT
bool "U-Boot needs pylibfdt"
depends on !UBOOT_PY_NONE

config BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS
bool "U-Boot needs pyelftools"
depends on !UBOOT_PY_NONE

Of course, if you don't care about backward compatibility, then your proposal works. Let me know how you want to proceed.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH 2/6 boot/uboot: support building U-Boot with Python 3.x

Thomas, All,

On 2020-05-03 15:12 +0200, Thomas Petazzoni spake thusly:

Quoted 19 lines
Quoted 17 lines · On Sun, 3 May 2020 10:02:31 +0200 "Yann E. MORIN" <[email protected]>…
Quoted 17 lines
boot/uboot/Config.in +17 -0
+if BR2_TARGET_UBOOT_NEEDS_PYTHON
+
+choice
+	prompt "Python version"
+	default BR2_TARGET_UBOOT_NEEDS_PYTHON2
+
+config BR2_TARGET_UBOOT_NEEDS_PYTHON2
+	bool "python 2.x"
+	help
+	  Select this option if U-Boot needs a host Python 2.x
+	  interpreter. This is the case for some U-Boot
+	  configurations, prior to U-Boot 2020.01.
+
+config BR2_TARGET_UBOOT_NEEDS_PYTHON3
+	bool "python 3.x"
+	help
+	  Select this option if U-Boot needs a host Python 3.x
Quoted 8 lines
Quoted 8 lines

boot/uboot/Config.in config BR2_TARGET_UBOOT_NEEDS_DTC · line 173

Quoted 4 lines
boot/uboot/Config.in +4 -0
+	  interpreter. This is the case for some U-Boot
+	  configurations, after U-Boot 2020.01.
+
+endchoice  

I don't like it much that construct, where a boolean hides a choice. Instead, we can siumply use a choice (options names abbreviated as I'm lazy to type them full):

[--SNIP--]

Quoted 2 lines

If I use depends on like you suggest, we break backward compatibility. Indeed, an existing configuration with

Right, so I like backward compatibility, but I also do not like the bool-hides-a-choice construct, so here's my counter-counter proposal:

config BR2_TARGET_UBOOT_NEEDS_HOST_PYTHON
bool

choice
bool "U-Boot needs host python"

config BR2_TARGET_UBOOT_NEEDS_PY_NONE
bool "none"
depends on !BR2_TARGET_UBOOT_NEEDS_HOST_PYTHON

config BR2_TARGET_UBOOT_NEEDS_PY2
bool "python2"

config BR2_TARGET_UBOOT_NEEDS_PY3
bool "python3"

endchoice

config BR2_TARGET_UBOOT_NEEDS_PYLIBFDT
bool "U-Boot needs pylibfdt"
select BR2_TARGET_UBOOT_NEEDS_HOST_PYTHON

config BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS
bool "U-Boot needs pyelftools"
select BR2_TARGET_UBOOT_NEEDS_HOST_PYTHON

Yes, this is a tiny-weeny-little-bit more verbose, because there's still the BR2_TARGET_UBOOT_NEEDS_HOST_PYTHON boolean, but it has no prompt, so it is not user-visible, and it no longer hides the choice, just one entry of it.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH 3/6 configs/olimex_a20_olinuxino_lime{, 2}: use Python 3.x

In reply to Thomas Petazzoni

The olimex_a20_olinuxino_lime{,2}_defconfig uses U-Boot 2020.04 since commit 6b805c3ab70b5ee63c7dcd3a4aa48a999a8a43c3. This new U-Boot version needs Python 3.x for pylibfdt.

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/535054468
https://gitlab.com/buildroot.org/buildroot/-/jobs/535054466

---
 configs/olimex_a20_olinuxino_lime2_defconfig | 2 ++
 configs/olimex_a20_olinuxino_lime_defconfig  | 2 ++
 2 files changed, 4 insertions(+)
configs/olimex_a20_olinuxino_lime2_defconfig +2 -0
index eb6a82c2f6..6e27383a1c 100644
@@ -46,6 +46,8 @@ BR2_TARGET_UBOOT_CUSTOM_VERSION=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.04"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="A20-OLinuXino-Lime2"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_PYTHON=y
+BR2_TARGET_UBOOT_NEEDS_PYTHON3=y
 BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
 BR2_TARGET_UBOOT_FORMAT_BIN=y
 BR2_TARGET_UBOOT_SPL=y
configs/olimex_a20_olinuxino_lime_defconfig +2 -0
index 740fd4357a..415fbfc066 100644
@@ -46,6 +46,8 @@ BR2_TARGET_UBOOT_CUSTOM_VERSION=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.04"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="A20-OLinuXino-Lime"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_PYTHON=y
+BR2_TARGET_UBOOT_NEEDS_PYTHON3=y
 BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
 BR2_TARGET_UBOOT_FORMAT_BIN=y
 BR2_TARGET_UBOOT_SPL=y
Signature · 1 line
2.26.2
#7 lore raw

PATCH 4/6 configs/beelink_gs1: use Python 3.x

In reply to Thomas Petazzoni

Since the bump to U-Boot 2020.01 in commit e210080d2ab4d77862c42d2b318e21fab461f127, it needs Python 3.x on the host.

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/535054357

---
 configs/beelink_gs1_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/beelink_gs1_defconfig +2 -0
index 04c8b544ea..2fe89bf747 100644
@@ -34,6 +34,8 @@ BR2_TARGET_UBOOT_CUSTOM_VERSION=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.01"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="beelink_gs1"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_PYTHON=y
+BR2_TARGET_UBOOT_NEEDS_PYTHON3=y
 BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
 BR2_TARGET_UBOOT_SPL=y
Signature · 1 line
2.26.2
#8 lore raw

PATCH 4/6 configs/beelink_gs1: use Python 3.x

Hi Thomas,

Quoted 4 lines · Thomas Petazzoni

Since the bump to U-Boot 2020.01 in commit e210080d2ab4d77862c42d2b318e21fab461f127, it needs Python 3.x on the host.

Thanks for the fix, I thought there will be a patch to fix this dependency automatically.

Regards,
Clement

Quoted 26 lines

Fixes:

https://gitlab.com/buildroot.org/buildroot/-/jobs/535054357

---
 configs/beelink_gs1_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/beelink_gs1_defconfig +2 -1
index 04c8b544ea..2fe89bf747 100644
@@ -34,6 +34,8 @@ BR2_TARGET_UBOOT_CUSTOM_VERSION=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.01"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="beelink_gs1"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_PYTHON=y
+BR2_TARGET_UBOOT_NEEDS_PYTHON3=y
 BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
 BR2_TARGET_UBOOT_SPL=y
--

2.26.2

#9 lore raw

PATCH 5/6 configs/roc_pc_rk3399: fix U-Boot dependencies

In reply to Thomas Petazzoni

In fact, roc_pc_rk3399 does not need pylibfdt or pyelftools, but only a host Python interpreter, to run ./arch/arm/mach-rockchip/make_fit_atf.py.

Since upstream U-Boot commit f05d5743567984b4fff6a862fc0f42760ff135da, this script no longer needs pyelftools. However, since upstream commit 6d06ea34239ab5099783ce588ad4aead96e1fccb (merged in U-Boot 2020.01), it requires Python 3.x.

---
 configs/roc_pc_rk3399_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configs/roc_pc_rk3399_defconfig +2 -2
index 114b0e8c95..676f3e70fe 100644
@@ -22,8 +22,8 @@ BR2_TARGET_UBOOT_CUSTOM_VERSION=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.01"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="roc-pc-rk3399"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
-BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
-BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS=y
+BR2_TARGET_UBOOT_NEEDS_PYTHON=y
+BR2_TARGET_UBOOT_NEEDS_PYTHON3=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF=y
 BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
Signature · 1 line
2.26.2
#10 lore raw

PATCH 6/6 configs/nanopi_neo4: fix U-Boot dependencies

In reply to Thomas Petazzoni

In fact, nanopi_neo4 does not need pylibfdt or pyelftools, but only a host Python interpreter, to run ./arch/arm/mach-rockchip/make_fit_atf.py.

Since upstream U-Boot commit f05d5743567984b4fff6a862fc0f42760ff135da, this script no longer needs pyelftools. However, since upstream commit 6d06ea34239ab5099783ce588ad4aead96e1fccb (merged in U-Boot 2020.01), it requires Python 3.x.

---
 configs/nanopi_neo4_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configs/nanopi_neo4_defconfig +2 -2
index 6e507235cf..b79ee1ae79 100644
@@ -22,8 +22,8 @@ BR2_TARGET_UBOOT_CUSTOM_VERSION=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.01"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="nanopi-neo4-rk3399"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
-BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
-BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS=y
+BR2_TARGET_UBOOT_NEEDS_PYTHON=y
+BR2_TARGET_UBOOT_NEEDS_PYTHON3=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF=y
 BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
Signature · 1 line
2.26.2
#11 lore raw

cover Support Python 3.x in U-Boot

In reply to Thomas Petazzoni

Thomas, All,

On 2020-05-02 23:28 +0200, Thomas Petazzoni spake thusly:

Quoted 8 lines

Hello,

Since 2020.01, U-Boot now uses python3 for its scripts, but our uboot package only supports adding a dependency on host-python, which causes a number of build failures of our defconfigs.

To fix this, this series introduces additional U-Boot options with appropriate dependencies, and fixes the problematic defconfigs.

Series applied, with a few changes:

- I applied my proposal to handle the choice of host python version, see the thread in patch 2

- I fixed the defconfig files as thus:
- for those that need pyelftools or pylibfdt, the NEEDS_PYTHON=y was superfluous in the defconfig as it is selected by ither option,
- for the others that do not have pyelftools or pylibfdt, it has become useless, because it no longer show/hides the choice anymore

Thanks!

Regards,
Yann E. MORIN.

Quoted 31 lines

Thomas

Thomas Petazzoni (6):
package/python3-pyelftools: new package boot/uboot: support building U-Boot with Python 3.x configs/olimex_a20_olinuxino_lime{,2}: use Python 3.x configs/beelink_gs1: use Python 3.x configs/roc_pc_rk3399: fix U-Boot dependencies configs/nanopi_neo4: fix U-Boot dependencies

 boot/uboot/Config.in                          | 29 +++++++++++++++++++
 boot/uboot/uboot.mk                           | 12 +++++++-
 configs/beelink_gs1_defconfig                 |  2 ++
 configs/nanopi_neo4_defconfig                 |  4 +--
 configs/olimex_a20_olinuxino_lime2_defconfig  |  2 ++
 configs/olimex_a20_olinuxino_lime_defconfig   |  2 ++
 configs/roc_pc_rk3399_defconfig               |  4 +--
 .../python-pyelftools/python-pyelftools.mk    |  1 +
 .../python3-pyelftools.hash                   |  1 +
 .../python3-pyelftools/python3-pyelftools.mk  | 17 +++++++++++
 10 files changed, 69 insertions(+), 5 deletions(-)
 create mode 120000 package/python3-pyelftools/python3-pyelftools.hash
 create mode 100644 package/python3-pyelftools/python3-pyelftools.mk
Signature · 6 lines
2.26.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#12 lore raw

cover Support Python 3.x in U-Boot

Hi,

Can this serie be backported to 2020.01?

I still receive some failures
https://gitlab.com/buildroot.org/buildroot/-/jobs/554829971

Or a least these patches:
boot/uboot: support building U-Boot with Python 3.x configs/olimex_a20_olinuxino_lime{,2}: use Python 3.x configs/beelink_gs1: use Python 3.x

Thanks
Clement

Quoted 72 lines · Yann E. MORIN

Thomas, All,

On 2020-05-02 23:28 +0200, Thomas Petazzoni spake thusly:

Quoted 8 lines

Hello,

Since 2020.01, U-Boot now uses python3 for its scripts, but our uboot package only supports adding a dependency on host-python, which causes a number of build failures of our defconfigs.

To fix this, this series introduces additional U-Boot options with appropriate dependencies, and fixes the problematic defconfigs.

Series applied, with a few changes:

- I applied my proposal to handle the choice of host python version, see the thread in patch 2

- I fixed the defconfig files as thus:
- for those that need pyelftools or pylibfdt, the NEEDS_PYTHON=y was superfluous in the defconfig as it is selected by ither option,
- for the others that do not have pyelftools or pylibfdt, it has become useless, because it no longer show/hides the choice anymore

Thanks!

Regards,
Yann E. MORIN.

Quoted 24 lines

Thomas

Thomas Petazzoni (6):
package/python3-pyelftools: new package boot/uboot: support building U-Boot with Python 3.x configs/olimex_a20_olinuxino_lime{,2}: use Python 3.x configs/beelink_gs1: use Python 3.x configs/roc_pc_rk3399: fix U-Boot dependencies configs/nanopi_neo4: fix U-Boot dependencies

 boot/uboot/Config.in                          | 29 +++++++++++++++++++
 boot/uboot/uboot.mk                           | 12 +++++++-
 configs/beelink_gs1_defconfig                 |  2 ++
 configs/nanopi_neo4_defconfig                 |  4 +--
 configs/olimex_a20_olinuxino_lime2_defconfig  |  2 ++
 configs/olimex_a20_olinuxino_lime_defconfig   |  2 ++
 configs/roc_pc_rk3399_defconfig               |  4 +--
 .../python-pyelftools/python-pyelftools.mk    |  1 +
 .../python3-pyelftools.hash                   |  1 +
 .../python3-pyelftools/python3-pyelftools.mk  | 17 +++++++++++
 10 files changed, 69 insertions(+), 5 deletions(-)
 create mode 120000 package/python3-pyelftools/python3-pyelftools.hash
 create mode 100644 package/python3-pyelftools/python3-pyelftools.mk
Quoted 7 lines

--
2.26.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot