aboutsummaryrefslogtreecommitdiffstats
path: root/package/utils/dtc
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2021-12-07 13:00:01 +0100
committerRafał Miłecki <rafal@milecki.pl>2022-01-03 14:28:06 +0100
commitce5d0378bf03b3b890ccec0cc3fc62d44fecd536 (patch)
treeabc6dd47e83744af7650378e6c983bd13759696a /package/utils/dtc
parent6292d1e354766bc85be83cd4c63e53d6f9ef7570 (diff)
downloadupstream-ce5d0378bf03b3b890ccec0cc3fc62d44fecd536.tar.gz
upstream-ce5d0378bf03b3b890ccec0cc3fc62d44fecd536.tar.bz2
upstream-ce5d0378bf03b3b890ccec0cc3fc62d44fecd536.zip
dtc: import package for dtc & fdt from packages feed
fdt* utils are needed by targets that use U-Boot FIT images for sysupgrade. It includes all recent BCM4908 SoC routers as Broadcom switched from CFE to U-Boot. fdtget is required for extracting images (bootfs & rootfs) from Broadcom's ITB. Extracted images can be then flashed to UBI volumes. sysupgrade is core functionality so it needs dtc as part of base code base. Cc: Yousong Zhou <yszhou4tech@gmail.com> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'package/utils/dtc')
-rw-r--r--package/utils/dtc/Makefile92
1 files changed, 92 insertions, 0 deletions
diff --git a/package/utils/dtc/Makefile b/package/utils/dtc/Makefile
new file mode 100644
index 0000000000..deec4e3ad6
--- /dev/null
+++ b/package/utils/dtc/Makefile
@@ -0,0 +1,92 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Copyright (C) 2016-2019 Yousong Zhou <yszhou4tech@gmail.com>
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=dtc
+PKG_VERSION:=1.6.0
+PKG_RELEASE:=1
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_HASH:=10503b0217e1b07933e29e8d347a00015b2431bea5f59afe0bed3af30340c82d
+PKG_SOURCE_URL:=@KERNEL/software/utils/dtc
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=GPL
+PKG_INSTALL:=1
+PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+
+
+define Package/dtc
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=Device Tree Compiler
+ URL:=https://git.kernel.org/pub/scm/utils/dtc/dtc.git
+endef
+
+define Package/dtc/description
+ Device Tree Compiler for Flat Device Trees Device Tree Compiler, dtc, takes
+ as input a device-tree in a given format and outputs a device-tree in another
+ format for booting kernels on embedded systems.
+endef
+
+define Package/dtc/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_INSTALL_DIR)/bin/dtc $(1)/usr/bin
+endef
+
+
+# See Documentation/manual.txt for details about each utility
+define Package/fdt-utils
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=Flat Device Tree Utilities
+ URL:=https://git.kernel.org/pub/scm/utils/dtc/dtc.git
+ DEPENDS:=+libfdt
+endef
+
+define Package/fdt-utils/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/convert-dtsv0 $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/fdtdump $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/fdtget $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/fdtput $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/fdtoverlay $(1)/usr/bin
+endef
+
+
+define Package/libfdt
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=a utility library for reading and manipulating dtb files
+ URL:=https://git.kernel.org/pub/scm/utils/dtc/dtc.git
+endef
+
+define Package/libfdt/description
+ This is a library containing functions for manipulating Flat Device Trees.
+endef
+
+define Package/libfdt/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/lib/libfdt*.so* $(1)/usr/lib
+endef
+
+# NO_PYTHON is for disabling pylibfdt
+MAKE_FLAGS += \
+ PREFIX= \
+ NO_PYTHON=1 \
+ NO_VALGRIND=1 \
+ NO_YAML=1 \
+ EXTRA_CFLAGS=$(EXTRA_CFLAGS) \
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(INSTALL_DIR) $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/include/* $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/lib/* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,dtc))
+$(eval $(call BuildPackage,fdt-utils))
+$(eval $(call BuildPackage,libfdt))