Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenWRT pylibfdt does not seem to be available with python3 #17

Open
pkopylov opened this issue Sep 15, 2024 · 1 comment
Open

OpenWRT pylibfdt does not seem to be available with python3 #17

pkopylov opened this issue Sep 15, 2024 · 1 comment

Comments

@pkopylov
Copy link

I tried to build OpenWRT with package/boot/sunxi-h618.
Here is package Makefile header. Please pay attention it links to this repository commits:

╰─$ head -n 15 Makefile 
#
# Copyright (C) 2013-2016 OpenWrt.org
# Copyright (C) 2017 Yousong Zhou
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/orangepi-xunlong/u-boot-orangepi
PKG_SOURCE_DATE:=2024-01
PKG_SOURCE_VERSION:=a4d4b0e24e185e84dd02f06f53999a8effde86db

So during the build process I encountered an error shown below:

if test "/mnt/data/pavel/work/001_OpenWRT/18_sunxi/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-sunxi_cortexa53/linux-6.1.74/scripts/dtc/dtc" = "./scripts/dtc/dtc"; then \
	make -f ./scripts/Makefile.build obj=scripts/dtc; \
else \
	if ! /mnt/data/pavel/work/001_OpenWRT/18_sunxi/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-sunxi_cortexa53/linux-6.1.74/scripts/dtc/dtc -v >/dev/null; then \
		echo '*** Failed to check dtc version: /mnt/data/pavel/work/001_OpenWRT/18_sunxi/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-sunxi_cortexa53/linux-6.1.74/scripts/dtc/dtc'; \
		false; \
	else \
		if test "010601" -lt 010406; then \
			echo '*** Your dtc is too old, please upgrade to dtc 010406 or newer'; \
			false; \
		else \
			if [ -n "y" ]; then \
				if ! echo "import libfdt" | python3 2>/dev/null; then \
					echo '*** pylibfdt does not seem to be available with python3'; \
					false; \
				fi; \
			fi; \
		fi; \
	fi; \
fi
*** pylibfdt does not seem to be available with python3
make[4]: *** [Makefile:2014: scripts_dtc] Error 1
make[4]: Leaving directory '/mnt/data/pavel/work/001_OpenWRT/18_sunxi/openwrt/build_dir/target-aarch64_cortex-a53_musl/u-boot-orangepi_zero3/u-boot-2024-01-a4d4b0e2'
make[3]: *** [Makefile:68: /mnt/data/pavel/work/001_OpenWRT/18_sunxi/openwrt/build_dir/target-aarch64_cortex-a53_musl/u-boot-orangepi_zero3/u-boot-2024-01-a4d4b0e2/.built] Error 2
make[3]: Leaving directory '/mnt/data/pavel/work/001_OpenWRT/18_sunxi/openwrt/package/boot/uboot-sunxi-h618'

The platform I use to build is Ubuntu22.04.

@pkopylov
Copy link
Author

It looks like Ubuntu 22.04 issue, which has an old libfdt. To fix the problem, the modern (1.7.0) libfdt should be installed. The farther commands were used to do so:

sudo apt-get install swig python3-dev
sudo apt remove libfdt1
git clone git://git.kernel.org/pub/scm/utils/dtc/dtc.git
cd dtc
make
sudo make install PREFIX=/usr 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant