mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Christian Melki <christian.melki@t2data.com>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH] hwdata: New package.
Date: Fri,  7 Jan 2022 12:15:56 +0100	[thread overview]
Message-ID: <20220107111556.55233-1-christian.melki@t2data.com> (raw)

Introduce the hwdata package.
It's a maintained set of the classic .ids files provided
by several packages (usbutils, pciutils etc).
So instead of packages having to distribute their own copy,
use hwdata instead.

hwdata will probably be replaced by systemd-hwdb in the long run.

Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
 rules/hwdata.in   | 47 +++++++++++++++++++++++++++
 rules/hwdata.make | 81 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 128 insertions(+)
 create mode 100644 rules/hwdata.in
 create mode 100644 rules/hwdata.make

diff --git a/rules/hwdata.in b/rules/hwdata.in
new file mode 100644
index 000000000..c4e624b7f
--- /dev/null
+++ b/rules/hwdata.in
@@ -0,0 +1,47 @@
+## SECTION=shell_and_console
+
+menuconfig HWDATA
+	tristate
+	prompt "hwdata                        "
+	help
+	  Hwdata package.
+	  This package contains identity files for pci and usb etc.
+	  Various packages that have not been ported to systemd's binary
+	  hwdb may use this instead.
+
+if HWDATA
+
+config HWDATA_PCI
+	bool
+	prompt "hwdata PCI"
+	help
+	  The hwdata PCI (Vendor and product id) data set.
+
+config HWDATA_USB
+	bool
+	prompt "hwdata USB"
+	help
+	  The hwdata USB (Vendor and product id) data set.
+
+config HWDATA_PNP
+	bool
+	prompt "hwdata PNP"
+	help
+	  The hwdata PNP (Vendor names and vendor acronyms)
+	  data set.
+
+config HWDATA_OUI
+	bool
+	prompt "hwdata OUI"
+	help
+	  The hwdata OUI (IEEE Organizationally Unique Identifier)
+	  data set.
+
+config HWDATA_IAB
+	bool
+	prompt "hwdata IAB"
+	help
+	  The hwdata IAB (IEEE Individual Address Block)
+	  data set.
+
+endif
diff --git a/rules/hwdata.make b/rules/hwdata.make
new file mode 100644
index 000000000..17f0d4cfa
--- /dev/null
+++ b/rules/hwdata.make
@@ -0,0 +1,81 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2021 by Christian Melki
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_HWDATA) += hwdata
+
+#
+# Paths and names
+#
+HWDATA_VERSION		:= 0.355
+HWDATA_MD5		:= ee30c73571b9392a7b2d77619a6842a5
+HWDATA			:= hwdata-$(HWDATA_VERSION)
+HWDATA_SUFFIX		:= tar.gz
+HWDATA_URL		:= https://github.com/vcrhonek/hwdata/archive/refs/tags/v$(HWDATA_VERSION).$(HWDATA_SUFFIX)
+HWDATA_SOURCE		:= $(SRCDIR)/$(HWDATA).$(HWDATA_SUFFIX)
+HWDATA_DIR		:= $(BUILDDIR)/$(HWDATA)
+HWDATA_LICENSE		:= GPL-2.0-or-later OR XFree86-1.0
+HWDATA_LICENSE_FILES	:= \
+	file://LICENSE;md5=1556547711e8246992b999edd9445a57 \
+	file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+HWDATA_PATH		:= PATH=$(CROSS_PATH)
+HWDATA_ENV		:= $(CROSS_ENV)
+
+# Package is not really using autoconf, so skip normal cross declaration.
+# Only text files are processed. Just prefix setting here.
+HWDATA_CONF_TOOL	:= autoconf
+HWDATA_CONF_OPT		:= \
+	--prefix=/usr
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/hwdata.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, hwdata)
+	@$(call install_fixup, hwdata,PRIORITY,optional)
+	@$(call install_fixup, hwdata,SECTION,base)
+	@$(call install_fixup, hwdata,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
+	@$(call install_fixup, hwdata,DESCRIPTION,missing)
+
+	@$(call install_copy, hwdata, 0, 0, 0755, /usr/share/hwdata)
+
+ifdef PTXCONF_HWDATA_PCI
+	@$(call install_copy, hwdata, 0, 0, 0644, -, /usr/share/hwdata/pci.ids)
+endif
+
+ifdef PTXCONF_HWDATA_USB
+	@$(call install_copy, hwdata, 0, 0, 0644, -, /usr/share/hwdata/usb.ids)
+endif
+
+ifdef PTXCONF_HWDATA_PNP
+	@$(call install_copy, hwdata, 0, 0, 0644, -, /usr/share/hwdata/pnp.ids)
+endif
+
+ifdef PTXCONF_HWDATA_OUI
+	@$(call install_copy, hwdata, 0, 0, 0644, -, /usr/share/hwdata/oui.txt)
+endif
+
+ifdef PTXCONF_HWDATA_IAB
+	@$(call install_copy, hwdata, 0, 0, 0644, -, /usr/share/hwdata/iab.txt)
+endif
+
+	@$(call install_finish, hwdata)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.30.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


                 reply	other threads:[~2022-01-07 11:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220107111556.55233-1-christian.melki@t2data.com \
    --to=christian.melki@t2data.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox