From d6ef37c8df26c2e9728d41ebcb0de0e9d83d4598 Mon Sep 17 00:00:00 2001 From: Zoltan HERPAI Date: Mon, 24 Jun 2024 21:55:41 +0000 Subject: [PATCH] fiptool: add tool to create fip.bin images for Sophgo devices Signed-off-by: Zoltan HERPAI --- tools/Makefile | 1 + tools/fiptool/Makefile | 27 +++++++++++++++++++++ tools/fiptool/patches/001-use-python3.patch | 9 +++++++ 3 files changed, 37 insertions(+) create mode 100644 tools/fiptool/Makefile create mode 100644 tools/fiptool/patches/001-use-python3.patch diff --git a/tools/Makefile b/tools/Makefile index b16c5d9c5b..e1b4467eac 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -79,6 +79,7 @@ tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_LZO_TOOLS),y) += lzop tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_TOOLCHAIN),y) += gmp mpc mpfr tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_apm821xx)$(CONFIG_TARGET_gemini),y) += genext2fs tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_ath79),y) += lzma-old squashfs3-lzma +tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_cv18x0),y) += fiptool tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_mxs),y) += elftosb sdimage tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_realtek),y) += 7z tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_tegra),y) += cbootimage cbootimage-configs diff --git a/tools/fiptool/Makefile b/tools/fiptool/Makefile new file mode 100644 index 0000000000..a5e207b7e2 --- /dev/null +++ b/tools/fiptool/Makefile @@ -0,0 +1,27 @@ +# +# Copyright (C) 2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=fiptool +PKG_VERSION:=2024-05-23 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/sophgo/fiptool +PKG_SOURCE_DATE:=2024-05-23 +PKG_SOURCE_VERSION:=7fb26aa36f75dbea331b74f2857af864f187d800 +PKG_MIRROR_HASH:=0e8562d3b0c65f4637b618d5214012c1c2956a6759d9494280eb5fc3a02ca4a4 + +include $(INCLUDE_DIR)/host-build.mk + +define Host/Compile +endef + +define Host/Install + $(INSTALL_BIN) $(HOST_BUILD_DIR)/fiptool $(STAGING_DIR_HOST)/bin/fiptool +endef + +$(eval $(call HostBuild)) diff --git a/tools/fiptool/patches/001-use-python3.patch b/tools/fiptool/patches/001-use-python3.patch new file mode 100644 index 0000000000..9feeaad5e2 --- /dev/null +++ b/tools/fiptool/patches/001-use-python3.patch @@ -0,0 +1,9 @@ +diff -ruN fiptool-2024-05-23/fiptool fiptool.new/fiptool +--- fiptool-2024-05-23/fiptool 2024-05-23 03:13:34.000000000 +0000 ++++ fiptool.new/fiptool 2024-06-24 21:50:47.072320769 +0000 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + + import os + import lzma -- 2.30.2