mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] libfdt: New package.
@ 2024-01-03 19:23 Christian Melki
  2024-01-04  9:12 ` Ladislav Michl
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Melki @ 2024-01-03 19:23 UTC (permalink / raw)
  To: ptxdist

Add the device-tree-compiler source as libfdt.
I guess the package could have been named dtc as a target
variant with libfdt, but I don't know of any uses of the
dtc on target environments. So the only use I can think of
is libfdt. I think the name is more accurate towards usage,
but it isn't as symmetrical as the typical host-* and normal
variants.

The use of libfdt is separate from the host-dtc usage too,
so whatever version you'd use for external device trees are probably
not the same as target lifdt. There you'd typically want the latest
version.

This work is prepping for qemu 8.2.0+, as it requires libfdt
as a separate library. It has stopped providing one internally.

Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
 rules/libfdt.in   |  9 +++++++
 rules/libfdt.make | 69 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 78 insertions(+)
 create mode 100644 rules/libfdt.in
 create mode 100644 rules/libfdt.make

diff --git a/rules/libfdt.in b/rules/libfdt.in
new file mode 100644
index 000000000..3e30062e9
--- /dev/null
+++ b/rules/libfdt.in
@@ -0,0 +1,9 @@
+## SECTION=system_libraries
+
+menuconfig LIBFDT
+	tristate
+	prompt "libfdt                        "
+	help
+	  libfdt is the flattend device tree library.
+	  It's technically a part of the device tree compiler code,
+	  but for target uses, libfdt is sometimes required.
\ No newline at end of file
diff --git a/rules/libfdt.make b/rules/libfdt.make
new file mode 100644
index 000000000..a7f5cc566
--- /dev/null
+++ b/rules/libfdt.make
@@ -0,0 +1,69 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2023 Christian Melki <christian.melki@t2data.com>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_LIBFDT) += libfdt
+
+#
+# Paths and names
+#
+LIBFDT_VERSION		:= 1.7.0
+LIBFDT_MD5		:= f8b4469ad89f4b882091895ec60dde6b
+LIBFDT			:= dtc-$(LIBFDT_VERSION)
+LIBFDT_SUFFIX		:= tar.gz
+LIBFDT_URL		:= https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/$(LIBFDT).$(LIBFDT_SUFFIX)
+LIBFDT_SOURCE		:= $(SRCDIR)/$(LIBFDT).$(LIBFDT_SUFFIX)
+LIBFDT_DIR		:= $(BUILDDIR)/$(LIBFDT)
+LIBFDT_LICENSE		:= BSD-2-Clause OR GPL-2.0
+LIBFDT_LICENSE_FILES := \
+	file://README.license;md5=a1eb22e37f09df5b5511b8a278992d0e \
+	file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+	file://BSD-2-Clause;md5=5d6306d1b08f8df623178dfd81880927
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+LIBFDT_CONF_TOOL := NO
+
+LIBFDT_MAKE_ENV := \
+	$(CROSS_ENV)
+
+LIBFDT_MAKE_OPT := \
+	PREFIX=/usr \
+	NO_PYTHON=1 \
+	NO_VALGRIND=1 \
+	NO_YAML=1
+
+LIBFDT_INSTALL_OPT := \
+	$(LIBFDT_MAKE_OPT) \
+	install-includes \
+	install-lib
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/libfdt.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, libfdt)
+	@$(call install_fixup, libfdt,PRIORITY,optional)
+	@$(call install_fixup, libfdt,SECTION,base)
+	@$(call install_fixup, libfdt,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
+	@$(call install_fixup, libfdt,DESCRIPTION,missing)
+
+	@$(call install_lib, libfdt, 0, 0, 0644, libfdt-$(LIBFDT_VERSION))
+
+	@$(call install_finish, libfdt)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.34.1




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH] libfdt: New package.
  2024-01-03 19:23 [ptxdist] [PATCH] libfdt: New package Christian Melki
@ 2024-01-04  9:12 ` Ladislav Michl
  2024-01-04  9:26   ` Christian Melki
  0 siblings, 1 reply; 4+ messages in thread
From: Ladislav Michl @ 2024-01-04  9:12 UTC (permalink / raw)
  To: ptxdist

Hi,

On Wed, Jan 03, 2024 at 08:23:52PM +0100, Christian Melki wrote:
> Add the device-tree-compiler source as libfdt.
> I guess the package could have been named dtc as a target
> variant with libfdt, but I don't know of any uses of the
> dtc on target environments.

Appended my version created about two years ago... Those DTC tools
were used to patch devicetree during on field board upgrade when
moving from ancient kernel. Flash repartioning was part of that
upgrade as well as use of RAUC. Basically all userspace was moved
to ramdisk, detached from flash, new image was prepared and flashed
at once - single point of failure, board was dead when this failed,
but as far as I know, it never happened. So yes, dtc on target
environment is very usefull :)

> So the only use I can think of is libfdt. I think the name is more
> accurate towards usage, but it isn't as symmetrical as the
> typical host-* and normal variants.

In case you reconsider, I'll merge your and my variant (I didn't
bother with licenses as it was part of local BSP).

> The use of libfdt is separate from the host-dtc usage too,
> so whatever version you'd use for external device trees are probably
> not the same as target lifdt. There you'd typically want the latest
> version.
> 
> This work is prepping for qemu 8.2.0+, as it requires libfdt
> as a separate library. It has stopped providing one internally.
> 
> Signed-off-by: Christian Melki <christian.melki@t2data.com>
> ---
>  rules/libfdt.in   |  9 +++++++
>  rules/libfdt.make | 69 +++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 78 insertions(+)
>  create mode 100644 rules/libfdt.in
>  create mode 100644 rules/libfdt.make
> 
> diff --git a/rules/libfdt.in b/rules/libfdt.in
> new file mode 100644
> index 000000000..3e30062e9
> --- /dev/null
> +++ b/rules/libfdt.in
> @@ -0,0 +1,9 @@
> +## SECTION=system_libraries
> +
> +menuconfig LIBFDT
> +	tristate
> +	prompt "libfdt                        "
> +	help
> +	  libfdt is the flattend device tree library.
> +	  It's technically a part of the device tree compiler code,
> +	  but for target uses, libfdt is sometimes required.
> \ No newline at end of file
> diff --git a/rules/libfdt.make b/rules/libfdt.make
> new file mode 100644
> index 000000000..a7f5cc566
> --- /dev/null
> +++ b/rules/libfdt.make
> @@ -0,0 +1,69 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2023 Christian Melki <christian.melki@t2data.com>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_LIBFDT) += libfdt
> +
> +#
> +# Paths and names
> +#
> +LIBFDT_VERSION		:= 1.7.0
> +LIBFDT_MD5		:= f8b4469ad89f4b882091895ec60dde6b
> +LIBFDT			:= dtc-$(LIBFDT_VERSION)
> +LIBFDT_SUFFIX		:= tar.gz
> +LIBFDT_URL		:= https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/$(LIBFDT).$(LIBFDT_SUFFIX)
> +LIBFDT_SOURCE		:= $(SRCDIR)/$(LIBFDT).$(LIBFDT_SUFFIX)
> +LIBFDT_DIR		:= $(BUILDDIR)/$(LIBFDT)
> +LIBFDT_LICENSE		:= BSD-2-Clause OR GPL-2.0
> +LIBFDT_LICENSE_FILES := \
> +	file://README.license;md5=a1eb22e37f09df5b5511b8a278992d0e \
> +	file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
> +	file://BSD-2-Clause;md5=5d6306d1b08f8df623178dfd81880927
> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +LIBFDT_CONF_TOOL := NO
> +
> +LIBFDT_MAKE_ENV := \
> +	$(CROSS_ENV)
> +
> +LIBFDT_MAKE_OPT := \
> +	PREFIX=/usr \
> +	NO_PYTHON=1 \
> +	NO_VALGRIND=1 \
> +	NO_YAML=1
> +
> +LIBFDT_INSTALL_OPT := \
> +	$(LIBFDT_MAKE_OPT) \
> +	install-includes \
> +	install-lib
> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/libfdt.targetinstall:
> +	@$(call targetinfo)
> +
> +	@$(call install_init, libfdt)
> +	@$(call install_fixup, libfdt,PRIORITY,optional)
> +	@$(call install_fixup, libfdt,SECTION,base)
> +	@$(call install_fixup, libfdt,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
> +	@$(call install_fixup, libfdt,DESCRIPTION,missing)
> +
> +	@$(call install_lib, libfdt, 0, 0, 0644, libfdt-$(LIBFDT_VERSION))
> +
> +	@$(call install_finish, libfdt)
> +
> +	@$(call touch)
> +
> +# vim: syntax=make
> -- 
> 2.34.1
>

PACKAGES-$(PTXCONF_DTC) += dtc

#
# Paths and names
#
DTC_VERSION	:= 1.6.0
DTC_MD5		:= cd36ac756290597f3cf1c5b6cfe12e77
DTC		:= dtc-v$(DTC_VERSION)
DTC_SUFFIX	:= tar.gz
DTC_URL		:= https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/$(DTC).$(DTC_SUFFIX)
DTC_SOURCE	:= $(SRCDIR)/$(DTC).$(DTC_SUFFIX)
DTC_DIR		:= $(BUILDDIR)/$(DTC)
DTC_LICENSE	:= GPL-2.0-only

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

DTC_CONF_TOOL := NO
DTC_MAKE_OPT := \
	PREFIX=/usr \
	NO_PYTHON=1 \
	NO_VALGRIND=1 \
	NO_YAML=1 \
	$(CROSS_ENV_CC)

DTC_INSTALL_OPT := \
	$(DTC_MAKE_OPT) \
	install-bin \
	install-lib

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

DTC_BIN-y				:=
DTC_BIN-$(PTXCONF_DTC_DTC)		+= dtc
DTC_BIN-$(PTXCONF_DTC_DTDIFF)		+= dtdiff
DTC_BIN-$(PTXCONF_DTC_FDTDUMP)		+= fdtdump
DTC_BIN-$(PTXCONF_DTC_FDTGET)		+= fdtget
DTC_BIN-$(PTXCONF_DTC_FDTOVERLAY)	+= fdtoverlay
DTC_BIN-$(PTXCONF_DTC_FDTPUT)		+= fdtput

$(STATEDIR)/dtc.targetinstall:
	@$(call targetinfo)

	@$(call install_init, dtc)
	@$(call install_fixup, dtc,PRIORITY,optional)
	@$(call install_fixup, dtc,SECTION,base)
	@$(call install_fixup, dtc,AUTHOR,"Ladislav Michl <ladis@linux-mips.org>")
	@$(call install_fixup, dtc,DESCRIPTION,missing)

	@$(call install_lib, dtc, 0, 0, 0644, libfdt-$(DTC_VERSION))

	@$(foreach tool, $(DTC_BIN-y), \
		$(call install_copy, dtc, 0, 0, 0755, -, \
		/usr/bin/$(tool));)

	@$(call install_finish, dtc)

	@$(call touch)

# vim: syntax=make



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH] libfdt: New package.
  2024-01-04  9:12 ` Ladislav Michl
@ 2024-01-04  9:26   ` Christian Melki
  2024-01-04 11:16     ` Ladislav Michl
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Melki @ 2024-01-04  9:26 UTC (permalink / raw)
  To: oss-lists; +Cc: ptxdist

Hi Ladis,

On 1/4/24 10:12 AM, Ladislav Michl wrote:
> Hi,
> 
> On Wed, Jan 03, 2024 at 08:23:52PM +0100, Christian Melki wrote:
>> Add the device-tree-compiler source as libfdt.
>> I guess the package could have been named dtc as a target
>> variant with libfdt, but I don't know of any uses of the
>> dtc on target environments.
> 
> Appended my version created about two years ago... Those DTC tools
> were used to patch devicetree during on field board upgrade when
> moving from ancient kernel. Flash repartioning was part of that
> upgrade as well as use of RAUC. Basically all userspace was moved
> to ramdisk, detached from flash, new image was prepared and flashed
> at once - single point of failure, board was dead when this failed,
> but as far as I know, it never happened. So yes, dtc on target
> environment is very usefull :)
>

Oh. Didn't know you already had a version.

I would probably have written my own tool using libfdt,
integrated into something else. :)
But that isn't saying there is no need for anyone.

>> So the only use I can think of is libfdt. I think the name is more
>> accurate towards usage, but it isn't as symmetrical as the
>> typical host-* and normal variants.
> 
> In case you reconsider, I'll merge your and my variant (I didn't
> bother with licenses as it was part of local BSP).

I'll gladly reconsider. It's perfectly fine if there are usecases.
Please go ahead and do a merge if you like.
But keep binaries as optional. I prefer it that way.

Either way, libfdt needs to happen on target because of qemu afaict.

> 
>> The use of libfdt is separate from the host-dtc usage too,
>> so whatever version you'd use for external device trees are probably
>> not the same as target lifdt. There you'd typically want the latest
>> version.
>>
>> This work is prepping for qemu 8.2.0+, as it requires libfdt
>> as a separate library. It has stopped providing one internally.
>>
>> Signed-off-by: Christian Melki <christian.melki@t2data.com>
>> ---
>>   rules/libfdt.in   |  9 +++++++
>>   rules/libfdt.make | 69 +++++++++++++++++++++++++++++++++++++++++++++++
>>   2 files changed, 78 insertions(+)
>>   create mode 100644 rules/libfdt.in
>>   create mode 100644 rules/libfdt.make
>>
>> diff --git a/rules/libfdt.in b/rules/libfdt.in
>> new file mode 100644
>> index 000000000..3e30062e9
>> --- /dev/null
>> +++ b/rules/libfdt.in
>> @@ -0,0 +1,9 @@
>> +## SECTION=system_libraries
>> +
>> +menuconfig LIBFDT
>> +	tristate
>> +	prompt "libfdt                        "
>> +	help
>> +	  libfdt is the flattend device tree library.
>> +	  It's technically a part of the device tree compiler code,
>> +	  but for target uses, libfdt is sometimes required.
>> \ No newline at end of file
>> diff --git a/rules/libfdt.make b/rules/libfdt.make
>> new file mode 100644
>> index 000000000..a7f5cc566
>> --- /dev/null
>> +++ b/rules/libfdt.make
>> @@ -0,0 +1,69 @@
>> +# -*-makefile-*-
>> +#
>> +# Copyright (C) 2023 Christian Melki <christian.melki@t2data.com>
>> +#
>> +# For further information about the PTXdist project and license conditions
>> +# see the README file.
>> +#
>> +
>> +#
>> +# We provide this package
>> +#
>> +PACKAGES-$(PTXCONF_LIBFDT) += libfdt
>> +
>> +#
>> +# Paths and names
>> +#
>> +LIBFDT_VERSION		:= 1.7.0
>> +LIBFDT_MD5		:= f8b4469ad89f4b882091895ec60dde6b
>> +LIBFDT			:= dtc-$(LIBFDT_VERSION)
>> +LIBFDT_SUFFIX		:= tar.gz
>> +LIBFDT_URL		:= https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/$(LIBFDT).$(LIBFDT_SUFFIX)
>> +LIBFDT_SOURCE		:= $(SRCDIR)/$(LIBFDT).$(LIBFDT_SUFFIX)
>> +LIBFDT_DIR		:= $(BUILDDIR)/$(LIBFDT)
>> +LIBFDT_LICENSE		:= BSD-2-Clause OR GPL-2.0
>> +LIBFDT_LICENSE_FILES := \
>> +	file://README.license;md5=a1eb22e37f09df5b5511b8a278992d0e \
>> +	file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
>> +	file://BSD-2-Clause;md5=5d6306d1b08f8df623178dfd81880927
>> +
>> +# ----------------------------------------------------------------------------
>> +# Prepare
>> +# ----------------------------------------------------------------------------
>> +
>> +LIBFDT_CONF_TOOL := NO
>> +
>> +LIBFDT_MAKE_ENV := \
>> +	$(CROSS_ENV)
>> +
>> +LIBFDT_MAKE_OPT := \
>> +	PREFIX=/usr \
>> +	NO_PYTHON=1 \
>> +	NO_VALGRIND=1 \
>> +	NO_YAML=1
>> +
>> +LIBFDT_INSTALL_OPT := \
>> +	$(LIBFDT_MAKE_OPT) \
>> +	install-includes \
>> +	install-lib
>> +
>> +# ----------------------------------------------------------------------------
>> +# Target-Install
>> +# ----------------------------------------------------------------------------
>> +
>> +$(STATEDIR)/libfdt.targetinstall:
>> +	@$(call targetinfo)
>> +
>> +	@$(call install_init, libfdt)
>> +	@$(call install_fixup, libfdt,PRIORITY,optional)
>> +	@$(call install_fixup, libfdt,SECTION,base)
>> +	@$(call install_fixup, libfdt,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
>> +	@$(call install_fixup, libfdt,DESCRIPTION,missing)
>> +
>> +	@$(call install_lib, libfdt, 0, 0, 0644, libfdt-$(LIBFDT_VERSION))
>> +
>> +	@$(call install_finish, libfdt)
>> +
>> +	@$(call touch)
>> +
>> +# vim: syntax=make
>> -- 
>> 2.34.1
>>
> 
> PACKAGES-$(PTXCONF_DTC) += dtc
> 
> #
> # Paths and names
> #
> DTC_VERSION	:= 1.6.0
> DTC_MD5		:= cd36ac756290597f3cf1c5b6cfe12e77
> DTC		:= dtc-v$(DTC_VERSION)
> DTC_SUFFIX	:= tar.gz
> DTC_URL		:= https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/$(DTC).$(DTC_SUFFIX)
> DTC_SOURCE	:= $(SRCDIR)/$(DTC).$(DTC_SUFFIX)
> DTC_DIR		:= $(BUILDDIR)/$(DTC)
> DTC_LICENSE	:= GPL-2.0-only
> 
> # ----------------------------------------------------------------------------
> # Prepare
> # ----------------------------------------------------------------------------
> 
> DTC_CONF_TOOL := NO
> DTC_MAKE_OPT := \
> 	PREFIX=/usr \
> 	NO_PYTHON=1 \
> 	NO_VALGRIND=1 \
> 	NO_YAML=1 \
> 	$(CROSS_ENV_CC)
> 
> DTC_INSTALL_OPT := \
> 	$(DTC_MAKE_OPT) \
> 	install-bin \
> 	install-lib
> 
> # ----------------------------------------------------------------------------
> # Target-Install
> # ----------------------------------------------------------------------------
> 
> DTC_BIN-y				:=
> DTC_BIN-$(PTXCONF_DTC_DTC)		+= dtc
> DTC_BIN-$(PTXCONF_DTC_DTDIFF)		+= dtdiff
> DTC_BIN-$(PTXCONF_DTC_FDTDUMP)		+= fdtdump
> DTC_BIN-$(PTXCONF_DTC_FDTGET)		+= fdtget
> DTC_BIN-$(PTXCONF_DTC_FDTOVERLAY)	+= fdtoverlay
> DTC_BIN-$(PTXCONF_DTC_FDTPUT)		+= fdtput
> 
> $(STATEDIR)/dtc.targetinstall:
> 	@$(call targetinfo)
> 
> 	@$(call install_init, dtc)
> 	@$(call install_fixup, dtc,PRIORITY,optional)
> 	@$(call install_fixup, dtc,SECTION,base)
> 	@$(call install_fixup, dtc,AUTHOR,"Ladislav Michl <ladis@linux-mips.org>")
> 	@$(call install_fixup, dtc,DESCRIPTION,missing)
> 
> 	@$(call install_lib, dtc, 0, 0, 0644, libfdt-$(DTC_VERSION))
> 
> 	@$(foreach tool, $(DTC_BIN-y), \
> 		$(call install_copy, dtc, 0, 0, 0755, -, \
> 		/usr/bin/$(tool));)
> 
> 	@$(call install_finish, dtc)
> 
> 	@$(call touch)
> 
> # vim: syntax=make
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH] libfdt: New package.
  2024-01-04  9:26   ` Christian Melki
@ 2024-01-04 11:16     ` Ladislav Michl
  0 siblings, 0 replies; 4+ messages in thread
From: Ladislav Michl @ 2024-01-04 11:16 UTC (permalink / raw)
  To: ptxdist

Hi Christian!

On Thu, Jan 04, 2024 at 10:26:42AM +0100, Christian Melki wrote:
> Hi Ladis,
> 
> On 1/4/24 10:12 AM, Ladislav Michl wrote:
> > Hi,
> > 
> > On Wed, Jan 03, 2024 at 08:23:52PM +0100, Christian Melki wrote:
> > > Add the device-tree-compiler source as libfdt.
> > > I guess the package could have been named dtc as a target
> > > variant with libfdt, but I don't know of any uses of the
> > > dtc on target environments.
> > 
> > Appended my version created about two years ago... Those DTC tools
> > were used to patch devicetree during on field board upgrade when
> > moving from ancient kernel. Flash repartioning was part of that
> > upgrade as well as use of RAUC. Basically all userspace was moved
> > to ramdisk, detached from flash, new image was prepared and flashed
> > at once - single point of failure, board was dead when this failed,
> > but as far as I know, it never happened. So yes, dtc on target
> > environment is very usefull :)
> > 
> 
> Oh. Didn't know you already had a version.
> 
> I would probably have written my own tool using libfdt,
> integrated into something else. :)
> But that isn't saying there is no need for anyone.
> 
> > > So the only use I can think of is libfdt. I think the name is more
> > > accurate towards usage, but it isn't as symmetrical as the
> > > typical host-* and normal variants.
> > 
> > In case you reconsider, I'll merge your and my variant (I didn't
> > bother with licenses as it was part of local BSP).
> 
> I'll gladly reconsider. It's perfectly fine if there are usecases.
> Please go ahead and do a merge if you like.
> But keep binaries as optional. I prefer it that way.
> 
> Either way, libfdt needs to happen on target because of qemu afaict.

Yes. I expect qemu select DTC once someone (hint, hint) updates qemu :)
Here's updated version, please give it a try.

-- >8 --

Subject: [PATCH] dtc: new package

From: Ladislav Michl <ladis@linux-mips.org>

Please note this package is not as symmetrical as the typical
host-* and normal variants. Here the latest version is usually
needed.

This work is prepping for qemu 8.2.0+, as it requires libfdt
as a separate library. It has stopped providing one internally.

Signed-off-by: Christian Melki <christian.melki@t2data.com>
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 rules/dtc.in   | 36 +++++++++++++++++++++++
 rules/dtc.make | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 116 insertions(+)
 create mode 100644 rules/dtc.in
 create mode 100644 rules/dtc.make

diff --git a/rules/dtc.in b/rules/dtc.in
new file mode 100644
index 000000000..2edb6f925
--- /dev/null
+++ b/rules/dtc.in
@@ -0,0 +1,36 @@
+## SECTION=system_libraries
+menuconfig DTC
+	tristate
+	prompt "dtc                           "
+	help
+	  Device Tree Compiler (dtc) toolchain. While dtc itself is
+	  occasionally needed for device tree manipulaton on the
+	  target, libfdt may be required.
+
+if DTC
+
+config DTC_DTC
+	bool
+	prompt "dtc"
+
+config DTC_DTDIFF
+	bool
+	prompt "dtdiff"
+
+config DTC_FDTDUMP
+	bool
+	prompt "fdtdump"
+
+config DTC_FDTGET
+	bool
+	prompt "fdtget"
+
+config DTC_FDTOVERLAY
+	bool
+	prompt "fdtoverlay"
+
+config DTC_FDTPUT
+	bool
+	prompt "fdtput"
+
+endif
diff --git a/rules/dtc.make b/rules/dtc.make
new file mode 100644
index 000000000..d0e6a7617
--- /dev/null
+++ b/rules/dtc.make
@@ -0,0 +1,80 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2022 Ladislav Michl <ladis@linux-mips.org>
+# Copyright (C) 2023 Christian Melki <christian.melki@t2data.com>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_DTC) += dtc
+
+#
+# Paths and names
+#
+DTC_VERSION	:= 1.7.0
+DTC_MD5		:= 58f007905843f6ed6cecf820eeada0ef
+DTC		:= dtc-v$(DTC_VERSION)
+DTC_SUFFIX	:= tar.gz
+DTC_URL		:= https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/$(DTC).$(DTC_SUFFIX)
+DTC_SOURCE	:= $(SRCDIR)/$(DTC).$(DTC_SUFFIX)
+DTC_DIR		:= $(BUILDDIR)/$(DTC)
+DTC_LICENSE	:= BSD-2-Clause OR GPL-2.0
+DTC_LICENSE_FILES := \
+	file://README.license;md5=a1eb22e37f09df5b5511b8a278992d0e \
+	file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+	file://BSD-2-Clause;md5=5d6306d1b08f8df623178dfd81880927
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+DTC_CONF_TOOL := NO
+DTC_MAKE_OPT := \
+	PREFIX=/usr \
+	NO_PYTHON=1 \
+	NO_VALGRIND=1 \
+	NO_YAML=1 \
+	$(CROSS_ENV_CC)
+
+DTC_INSTALL_OPT := \
+	$(DTC_MAKE_OPT) \
+	install-bin \
+	install-includes \
+	install-lib
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+DTC_BIN-y				:=
+DTC_BIN-$(PTXCONF_DTC_DTC)		+= dtc
+DTC_BIN-$(PTXCONF_DTC_DTDIFF)		+= dtdiff
+DTC_BIN-$(PTXCONF_DTC_FDTDUMP)		+= fdtdump
+DTC_BIN-$(PTXCONF_DTC_FDTGET)		+= fdtget
+DTC_BIN-$(PTXCONF_DTC_FDTOVERLAY)	+= fdtoverlay
+DTC_BIN-$(PTXCONF_DTC_FDTPUT)		+= fdtput
+
+$(STATEDIR)/dtc.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, dtc)
+	@$(call install_fixup, dtc,PRIORITY,optional)
+	@$(call install_fixup, dtc,SECTION,base)
+	@$(call install_fixup, dtc,AUTHOR,"Ladislav Michl <ladis@linux-mips.org>")
+	@$(call install_fixup, dtc,DESCRIPTION,missing)
+
+	@$(call install_lib, dtc, 0, 0, 0644, libfdt-$(DTC_VERSION))
+
+	@$(foreach tool, $(DTC_BIN-y), \
+		$(call install_copy, dtc, 0, 0, 0755, -, \
+		/usr/bin/$(tool));)
+
+	@$(call install_finish, dtc)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.39.2




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-04 11:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-03 19:23 [ptxdist] [PATCH] libfdt: New package Christian Melki
2024-01-04  9:12 ` Ladislav Michl
2024-01-04  9:26   ` Christian Melki
2024-01-04 11:16     ` Ladislav Michl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox