* [Buildroot] [PATCH 0/6] Support Python 3.x in U-Boot
@ 2020-05-02 21:28 Thomas Petazzoni
2020-05-02 21:28 ` [Buildroot] [PATCH 1/6] package/python3-pyelftools: new package Thomas Petazzoni
` (6 more replies)
0 siblings, 7 replies; 13+ messages in thread
From: Thomas Petazzoni @ 2020-05-02 21:28 UTC (permalink / raw)
To: buildroot
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
--
2.26.2
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH 1/6] package/python3-pyelftools: new package
2020-05-02 21:28 [Buildroot] [PATCH 0/6] Support Python 3.x in U-Boot Thomas Petazzoni
@ 2020-05-02 21:28 ` Thomas Petazzoni
2020-05-02 21:28 ` [Buildroot] [PATCH 2/6] boot/uboot: support building U-Boot with Python 3.x Thomas Petazzoni
` (5 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Thomas Petazzoni @ 2020-05-02 21:28 UTC (permalink / raw)
To: buildroot
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).
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
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
diff --git a/package/python-pyelftools/python-pyelftools.mk b/package/python-pyelftools/python-pyelftools.mk
index 21b9e409be..71ad49f20c 100644
--- a/package/python-pyelftools/python-pyelftools.mk
+++ b/package/python-pyelftools/python-pyelftools.mk
@@ -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
diff --git a/package/python3-pyelftools/python3-pyelftools.hash b/package/python3-pyelftools/python3-pyelftools.hash
new file mode 120000
index 0000000000..e8eebeda9f
--- /dev/null
+++ b/package/python3-pyelftools/python3-pyelftools.hash
@@ -0,0 +1 @@
+../python-pyelftools/python-pyelftools.hash
\ No newline at end of file
diff --git a/package/python3-pyelftools/python3-pyelftools.mk b/package/python3-pyelftools/python3-pyelftools.mk
new file mode 100644
index 0000000000..ea79aef66d
--- /dev/null
+++ b/package/python3-pyelftools/python3-pyelftools.mk
@@ -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))
--
2.26.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH 2/6] boot/uboot: support building U-Boot with Python 3.x
2020-05-02 21:28 [Buildroot] [PATCH 0/6] Support Python 3.x in U-Boot Thomas Petazzoni
2020-05-02 21:28 ` [Buildroot] [PATCH 1/6] package/python3-pyelftools: new package Thomas Petazzoni
@ 2020-05-02 21:28 ` Thomas Petazzoni
2020-05-03 8:02 ` Yann E. MORIN
2020-05-02 21:28 ` [Buildroot] [PATCH 3/6] configs/olimex_a20_olinuxino_lime{, 2}: use " Thomas Petazzoni
` (4 subsequent siblings)
6 siblings, 1 reply; 13+ messages in thread
From: Thomas Petazzoni @ 2020-05-02 21:28 UTC (permalink / raw)
To: buildroot
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.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
boot/uboot/Config.in | 29 +++++++++++++++++++++++++++++
boot/uboot/uboot.mk | 12 +++++++++++-
2 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 7a6f5053fd..e10166a113 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -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.
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 7bd9cbae52..1d50e72846 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -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)
--
2.26.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH 3/6] configs/olimex_a20_olinuxino_lime{, 2}: use Python 3.x
2020-05-02 21:28 [Buildroot] [PATCH 0/6] Support Python 3.x in U-Boot Thomas Petazzoni
2020-05-02 21:28 ` [Buildroot] [PATCH 1/6] package/python3-pyelftools: new package Thomas Petazzoni
2020-05-02 21:28 ` [Buildroot] [PATCH 2/6] boot/uboot: support building U-Boot with Python 3.x Thomas Petazzoni
@ 2020-05-02 21:28 ` Thomas Petazzoni
2020-05-02 21:28 ` [Buildroot] [PATCH 4/6] configs/beelink_gs1: " Thomas Petazzoni
` (3 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Thomas Petazzoni @ 2020-05-02 21:28 UTC (permalink / raw)
To: buildroot
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
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
configs/olimex_a20_olinuxino_lime2_defconfig | 2 ++
configs/olimex_a20_olinuxino_lime_defconfig | 2 ++
2 files changed, 4 insertions(+)
diff --git a/configs/olimex_a20_olinuxino_lime2_defconfig b/configs/olimex_a20_olinuxino_lime2_defconfig
index eb6a82c2f6..6e27383a1c 100644
--- a/configs/olimex_a20_olinuxino_lime2_defconfig
+++ b/configs/olimex_a20_olinuxino_lime2_defconfig
@@ -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
diff --git a/configs/olimex_a20_olinuxino_lime_defconfig b/configs/olimex_a20_olinuxino_lime_defconfig
index 740fd4357a..415fbfc066 100644
--- a/configs/olimex_a20_olinuxino_lime_defconfig
+++ b/configs/olimex_a20_olinuxino_lime_defconfig
@@ -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
--
2.26.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH 4/6] configs/beelink_gs1: use Python 3.x
2020-05-02 21:28 [Buildroot] [PATCH 0/6] Support Python 3.x in U-Boot Thomas Petazzoni
` (2 preceding siblings ...)
2020-05-02 21:28 ` [Buildroot] [PATCH 3/6] configs/olimex_a20_olinuxino_lime{, 2}: use " Thomas Petazzoni
@ 2020-05-02 21:28 ` Thomas Petazzoni
2020-05-02 21:58 ` Clément Péron
2020-05-02 21:28 ` [Buildroot] [PATCH 5/6] configs/roc_pc_rk3399: fix U-Boot dependencies Thomas Petazzoni
` (2 subsequent siblings)
6 siblings, 1 reply; 13+ messages in thread
From: Thomas Petazzoni @ 2020-05-02 21:28 UTC (permalink / raw)
To: buildroot
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
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
configs/beelink_gs1_defconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configs/beelink_gs1_defconfig b/configs/beelink_gs1_defconfig
index 04c8b544ea..2fe89bf747 100644
--- a/configs/beelink_gs1_defconfig
+++ b/configs/beelink_gs1_defconfig
@@ -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
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH 5/6] configs/roc_pc_rk3399: fix U-Boot dependencies
2020-05-02 21:28 [Buildroot] [PATCH 0/6] Support Python 3.x in U-Boot Thomas Petazzoni
` (3 preceding siblings ...)
2020-05-02 21:28 ` [Buildroot] [PATCH 4/6] configs/beelink_gs1: " Thomas Petazzoni
@ 2020-05-02 21:28 ` Thomas Petazzoni
2020-05-02 21:28 ` [Buildroot] [PATCH 6/6] configs/nanopi_neo4: " Thomas Petazzoni
2020-05-15 21:05 ` [Buildroot] [PATCH 0/6] Support Python 3.x in U-Boot Yann E. MORIN
6 siblings, 0 replies; 13+ messages in thread
From: Thomas Petazzoni @ 2020-05-02 21:28 UTC (permalink / raw)
To: buildroot
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.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
configs/roc_pc_rk3399_defconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configs/roc_pc_rk3399_defconfig b/configs/roc_pc_rk3399_defconfig
index 114b0e8c95..676f3e70fe 100644
--- a/configs/roc_pc_rk3399_defconfig
+++ b/configs/roc_pc_rk3399_defconfig
@@ -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
--
2.26.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH 6/6] configs/nanopi_neo4: fix U-Boot dependencies
2020-05-02 21:28 [Buildroot] [PATCH 0/6] Support Python 3.x in U-Boot Thomas Petazzoni
` (4 preceding siblings ...)
2020-05-02 21:28 ` [Buildroot] [PATCH 5/6] configs/roc_pc_rk3399: fix U-Boot dependencies Thomas Petazzoni
@ 2020-05-02 21:28 ` Thomas Petazzoni
2020-05-15 21:05 ` [Buildroot] [PATCH 0/6] Support Python 3.x in U-Boot Yann E. MORIN
6 siblings, 0 replies; 13+ messages in thread
From: Thomas Petazzoni @ 2020-05-02 21:28 UTC (permalink / raw)
To: buildroot
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.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
configs/nanopi_neo4_defconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configs/nanopi_neo4_defconfig b/configs/nanopi_neo4_defconfig
index 6e507235cf..b79ee1ae79 100644
--- a/configs/nanopi_neo4_defconfig
+++ b/configs/nanopi_neo4_defconfig
@@ -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
--
2.26.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH 4/6] configs/beelink_gs1: use Python 3.x
2020-05-02 21:28 ` [Buildroot] [PATCH 4/6] configs/beelink_gs1: " Thomas Petazzoni
@ 2020-05-02 21:58 ` Clément Péron
0 siblings, 0 replies; 13+ messages in thread
From: Clément Péron @ 2020-05-02 21:58 UTC (permalink / raw)
To: buildroot
Hi Thomas,
On Sat, 2 May 2020 at 23:28, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> 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.
Acked-by: Cl?ment P?ron <peron.clem@gmail.com>
Regards,
Clement
>
> Fixes:
>
> https://gitlab.com/buildroot.org/buildroot/-/jobs/535054357
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
> configs/beelink_gs1_defconfig | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/configs/beelink_gs1_defconfig b/configs/beelink_gs1_defconfig
> index 04c8b544ea..2fe89bf747 100644
> --- a/configs/beelink_gs1_defconfig
> +++ b/configs/beelink_gs1_defconfig
> @@ -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
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH 2/6] boot/uboot: support building U-Boot with Python 3.x
2020-05-02 21:28 ` [Buildroot] [PATCH 2/6] boot/uboot: support building U-Boot with Python 3.x Thomas Petazzoni
@ 2020-05-03 8:02 ` Yann E. MORIN
2020-05-03 13:12 ` Thomas Petazzoni
0 siblings, 1 reply; 13+ messages in thread
From: Yann E. MORIN @ 2020-05-03 8:02 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2020-05-02 23:28 +0200, Thomas Petazzoni spake thusly:
> 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.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
> boot/uboot/Config.in | 29 +++++++++++++++++++++++++++++
> boot/uboot/uboot.mk | 12 +++++++++++-
> 2 files changed, 40 insertions(+), 1 deletion(-)
>
> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index 7a6f5053fd..e10166a113 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -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
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
> +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.
> help
> Select this option if your U-Boot board configuration
> requires the Python pyelftools library to be available.
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index 7bd9cbae52..1d50e72846 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -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)
> --
> 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. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH 2/6] boot/uboot: support building U-Boot with Python 3.x
2020-05-03 8:02 ` Yann E. MORIN
@ 2020-05-03 13:12 ` Thomas Petazzoni
2020-05-09 21:45 ` Yann E. MORIN
0 siblings, 1 reply; 13+ messages in thread
From: Thomas Petazzoni @ 2020-05-03 13:12 UTC (permalink / raw)
To: buildroot
Hello Yann,
On Sun, 3 May 2020 10:02:31 +0200
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:
> > +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
>
> 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
>
> > +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.
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
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH 2/6] boot/uboot: support building U-Boot with Python 3.x
2020-05-03 13:12 ` Thomas Petazzoni
@ 2020-05-09 21:45 ` Yann E. MORIN
0 siblings, 0 replies; 13+ messages in thread
From: Yann E. MORIN @ 2020-05-09 21:45 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2020-05-03 15:12 +0200, Thomas Petazzoni spake thusly:
> On Sun, 3 May 2020 10:02:31 +0200
> "Yann E. MORIN" <yann.morin.1998@free.fr> wrote:
> > > +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
> >
> > 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--]
> 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.
--
.-----------------.--------------------.------------------.--------------------.
| 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. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH 0/6] Support Python 3.x in U-Boot
2020-05-02 21:28 [Buildroot] [PATCH 0/6] Support Python 3.x in U-Boot Thomas Petazzoni
` (5 preceding siblings ...)
2020-05-02 21:28 ` [Buildroot] [PATCH 6/6] configs/nanopi_neo4: " Thomas Petazzoni
@ 2020-05-15 21:05 ` Yann E. MORIN
2020-05-17 17:43 ` Clément Péron
6 siblings, 1 reply; 13+ messages in thread
From: Yann E. MORIN @ 2020-05-15 21:05 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2020-05-02 23:28 +0200, Thomas Petazzoni spake thusly:
> 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.
> 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
>
> --
> 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. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH 0/6] Support Python 3.x in U-Boot
2020-05-15 21:05 ` [Buildroot] [PATCH 0/6] Support Python 3.x in U-Boot Yann E. MORIN
@ 2020-05-17 17:43 ` Clément Péron
0 siblings, 0 replies; 13+ messages in thread
From: Clément Péron @ 2020-05-17 17:43 UTC (permalink / raw)
To: buildroot
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
On Fri, 15 May 2020 at 23:06, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> Thomas, All,
>
> On 2020-05-02 23:28 +0200, Thomas Petazzoni spake thusly:
> > 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.
>
> > 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
> >
> > --
> > 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
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2020-05-17 17:43 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-02 21:28 [Buildroot] [PATCH 0/6] Support Python 3.x in U-Boot Thomas Petazzoni
2020-05-02 21:28 ` [Buildroot] [PATCH 1/6] package/python3-pyelftools: new package Thomas Petazzoni
2020-05-02 21:28 ` [Buildroot] [PATCH 2/6] boot/uboot: support building U-Boot with Python 3.x Thomas Petazzoni
2020-05-03 8:02 ` Yann E. MORIN
2020-05-03 13:12 ` Thomas Petazzoni
2020-05-09 21:45 ` Yann E. MORIN
2020-05-02 21:28 ` [Buildroot] [PATCH 3/6] configs/olimex_a20_olinuxino_lime{, 2}: use " Thomas Petazzoni
2020-05-02 21:28 ` [Buildroot] [PATCH 4/6] configs/beelink_gs1: " Thomas Petazzoni
2020-05-02 21:58 ` Clément Péron
2020-05-02 21:28 ` [Buildroot] [PATCH 5/6] configs/roc_pc_rk3399: fix U-Boot dependencies Thomas Petazzoni
2020-05-02 21:28 ` [Buildroot] [PATCH 6/6] configs/nanopi_neo4: " Thomas Petazzoni
2020-05-15 21:05 ` [Buildroot] [PATCH 0/6] Support Python 3.x in U-Boot Yann E. MORIN
2020-05-17 17:43 ` Clément Péron
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.