All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/1] package/spdm-utils: new package
@ 2024-04-02  3:51 Wilfred Mallawa via buildroot
  2024-04-12  0:40 ` Wilfred Mallawa via buildroot
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Wilfred Mallawa via buildroot @ 2024-04-02  3:51 UTC (permalink / raw)
  To: buildroot; +Cc: Wilfred Mallawa, alistair.francis, yann.morin.1998

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
---
Changes in V2:                                                   
        - Added required python3 dependencies
        - Now depends on `udev` instead of selecting `eudev`
        - Now depends on `libspdm`
        - Hook define moved below the hook, stylistically similar to
            other packages
        - Removed cargo package re-vendoring as we aren't patching
        - Changed certificate/manifest installation path to be system wide.

 package/Config.in                  |  1 +
 package/spdm-utils/Config.in       | 24 ++++++++++++++++++++
 package/spdm-utils/spdm-utils.hash |  2 ++
 package/spdm-utils/spdm-utils.mk   | 36 ++++++++++++++++++++++++++++++
 4 files changed, 63 insertions(+)
 create mode 100644 package/spdm-utils/Config.in
 create mode 100644 package/spdm-utils/spdm-utils.hash
 create mode 100644 package/spdm-utils/spdm-utils.mk

diff --git a/package/Config.in b/package/Config.in
index 410fe0f493..9572a884e7 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2698,6 +2698,7 @@ comment "Utilities"
 	source "package/screen/Config.in"
 	source "package/screenfetch/Config.in"
 	source "package/sexpect/Config.in"
+	source "package/spdm-utils/Config.in"
 	source "package/sudo/Config.in"
 	source "package/terminology/Config.in"
 	source "package/time/Config.in"
diff --git a/package/spdm-utils/Config.in b/package/spdm-utils/Config.in
new file mode 100644
index 0000000000..b96365451f
--- /dev/null
+++ b/package/spdm-utils/Config.in
@@ -0,0 +1,24 @@
+config BR2_PACKAGE_SPDM_UTILS
+	bool "spdm-utils"
+	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_THREADS # python3
+	depends on BR2_USE_WCHAR # eudev
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_USE_MMU # eudev
+	depends on !BR2_STATIC_LIBS  # python3
+	depends on BR2_USE_MMU  # eudev, python3
+	depends on BR2_PACKAGE_HAS_UDEV
+	depends on BR2_PACKAGE_LIBSPDM
+	select BR2_PACKAGE_HOST_RUSTC
+	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_PCIUTILS
+	select BR2_PACKAGE_EUDEV
+	select BR2_PACKAGE_PYTHON3
+	help
+	  SPDM-Utils is a Linux application designed to support,
+	  test and develop SPDM requesters and responders.
+	  SPDM-Utils uses libspdm as the backend to perform SPDM
+	  communication. SPDM-Utils currently supports the
+	  PCIe Data Object Exchange (DOE) Capability.
+
+	  https://github.com/westerndigitalcorporation/spdm-utils
diff --git a/package/spdm-utils/spdm-utils.hash b/package/spdm-utils/spdm-utils.hash
new file mode 100644
index 0000000000..aaa243315e
--- /dev/null
+++ b/package/spdm-utils/spdm-utils.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256  3f06f087220b126262a2becf68c9e06a59d8d613816f82a168c81093de087d1a  spdm-utils-0.3.0.tar.gz
diff --git a/package/spdm-utils/spdm-utils.mk b/package/spdm-utils/spdm-utils.mk
new file mode 100644
index 0000000000..4176f61871
--- /dev/null
+++ b/package/spdm-utils/spdm-utils.mk
@@ -0,0 +1,36 @@
+################################################################################
+#
+# spdm-utils
+#
+################################################################################
+
+SPDM_UTILS_VERSION = 0.3.0
+SPDM_UTILS_SITE = $(call github,westerndigitalcorporation,spdm-utils,v$(SPDM_UTILS_VERSION))
+SPDM_UTILS_LICENSE = Apache-2.0 or MIT
+SPDM_UTILS_DEPENDENCIES += pciutils libspdm openssl udev
+
+# Note that we also copy `setup_certs.sh` and `generate_certs.sh`.
+# `setup_certs.sh` shall be used by a responder to regenerate it's mutable
+# certificate chain. `generate_certs.sh` can be used to generate a new
+# certificate chain, which maybe useful in testing and development.
+define SPDM_UTILS_INSTALL_CERTS
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/local/spdm_certs
+	cp -r $(@D)/certs/generate_certs.sh $(TARGET_DIR)/usr/local/spdm_certs
+	cp -r $(@D)/certs/openssl.cnf $(TARGET_DIR)/usr/local/spdm_certs
+	cp -r $(@D)/certs/setup_certs.sh $(TARGET_DIR)/usr/local/spdm_certs
+
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/local/spdm_certs/slot0
+	cp $(@D)/certs/slot0/immutable.der $(TARGET_DIR)/usr/local/spdm_certs/slot0
+	cp $(@D)/certs/slot0/device.cert.der $(TARGET_DIR)/usr/local/spdm_certs/slot0
+	cp $(@D)/certs/slot0/device.der $(TARGET_DIR)/usr/local/spdm_certs/slot0
+	cp $(@D)/certs/slot0/device.key $(TARGET_DIR)/usr/local/spdm_certs/slot0
+	cp $(@D)/certs/slot0/param.pem $(TARGET_DIR)/usr/local/spdm_certs/slot0
+	cp $(@D)/certs/slot0/bundle_responder.certchain.der $(TARGET_DIR)/usr/local/spdm_certs/slot0
+
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/local/spdm_manifest/
+	cp $(@D)/manifest/manifest.out.cbor $(TARGET_DIR)/usr/local/spdm_manifest/
+endef
+
+SPDM_UTILS_POST_INSTALL_TARGET_HOOKS += SPDM_UTILS_INSTALL_CERTS
+
+$(eval $(cargo-package))
-- 
2.44.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [Buildroot] [PATCH v2 1/1] package/spdm-utils: new package
@ 2024-02-24  0:39 Wilfred Mallawa via buildroot
  2024-03-05  1:37 ` Wilfred Mallawa via buildroot
  0 siblings, 1 reply; 10+ messages in thread
From: Wilfred Mallawa via buildroot @ 2024-02-24  0:39 UTC (permalink / raw)
  To: buildroot; +Cc: Wilfred Mallawa, alistair.francis

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
---
Changes in V2:
	- Fixes errors found by `check-package`
---
 package/Config.in                  |  1 +
 package/spdm-utils/Config.in       | 20 ++++++++++++++++++
 package/spdm-utils/spdm-utils.hash |  2 ++
 package/spdm-utils/spdm-utils.mk   | 34 ++++++++++++++++++++++++++++++
 4 files changed, 57 insertions(+)
 create mode 100644 package/spdm-utils/Config.in
 create mode 100644 package/spdm-utils/spdm-utils.hash
 create mode 100644 package/spdm-utils/spdm-utils.mk

diff --git a/package/Config.in b/package/Config.in
index bf0fe078b9..337c68725f 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2696,6 +2696,7 @@ comment "Utilities"
 	source "package/screen/Config.in"
 	source "package/screenfetch/Config.in"
 	source "package/sexpect/Config.in"
+	source "package/spdm-utils/Config.in"
 	source "package/sudo/Config.in"
 	source "package/terminology/Config.in"
 	source "package/time/Config.in"
diff --git a/package/spdm-utils/Config.in b/package/spdm-utils/Config.in
new file mode 100644
index 0000000000..97dbc51c6d
--- /dev/null
+++ b/package/spdm-utils/Config.in
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_SPDM_UTILS
+	bool "spdm-utils"
+	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+	depends on BR2_USE_WCHAR # eudev
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_USE_MMU # eudev
+	select BR2_PACKAGE_HOST_RUSTC
+	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_PCIUTILS
+	select BR2_PACKAGE_EUDEV
+	select BR2_PACKAGE_PYTHON3
+	select BR2_PACKAGE_LIBSPDM
+	help
+	  SPDM-Utils is a Linux application designed to support,
+	  test and develop SPDM requesters and responders.
+	  SPDM-Utils uses libspdm as the backend to perform SPDM
+	  communication. SPDM-Utils currently supports the
+	  PCIe Data Object Exchange (DOE) Capability.
+
+	  https://github.com/westerndigitalcorporation/spdm-utils
diff --git a/package/spdm-utils/spdm-utils.hash b/package/spdm-utils/spdm-utils.hash
new file mode 100644
index 0000000000..0d424913f2
--- /dev/null
+++ b/package/spdm-utils/spdm-utils.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256  4bb5ac80ccac3928a6b6d15266e260bbc103d07c543b054664aac42a5472b7a6  spdm-utils-0.1.1.tar.gz
diff --git a/package/spdm-utils/spdm-utils.mk b/package/spdm-utils/spdm-utils.mk
new file mode 100644
index 0000000000..7574ea9b11
--- /dev/null
+++ b/package/spdm-utils/spdm-utils.mk
@@ -0,0 +1,34 @@
+################################################################################
+#
+# spdm-utils
+#
+################################################################################
+
+SPDM_UTILS_VERSION = 0.1.1
+SPDM_UTILS_SITE = $(call github,westerndigitalcorporation,spdm-utils,v$(SPDM_UTILS_VERSION))
+SPDM_UTILS_LICENSE = Apache-2.0 or MIT
+SPDM_UTILS_POST_INSTALL_TARGET_HOOKS += SPDM_UTILS_INSTALL_CERTS
+SPDM_UTILS_DEPENDENCIES += pciutils libspdm openssl
+
+# Force PyO3 to configure as a cross-compilation
+export PYO3_CROSS=1
+
+define SPDM_UTILS_INSTALL_CERTS
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/root/certs
+	cp -r $(@D)/certs/generate_certs.sh $(TARGET_DIR)/root/certs/
+	cp -r $(@D)/certs/openssl-alias.cnf $(TARGET_DIR)/root/certs/
+	cp -r $(@D)/certs/openssl.cnf $(TARGET_DIR)/root/certs/
+	cp -r $(@D)/certs/setup_certs.sh $(TARGET_DIR)/root/certs/
+
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/root/certs/slot0
+	cp $(@D)/certs/slot0/immutable.der $(TARGET_DIR)/root/certs/slot0
+	cp $(@D)/certs/slot0/device.cert.der $(TARGET_DIR)/root/certs/slot0
+	cp $(@D)/certs/slot0/device.der $(TARGET_DIR)/root/certs/slot0
+	cp $(@D)/certs/slot0/device.key $(TARGET_DIR)/root/certs/slot0
+	cp $(@D)/certs/slot0/param.pem $(TARGET_DIR)/root/certs/slot0
+
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/root/manifest
+	cp $(@D)/manifest/manifest.out.cbor $(TARGET_DIR)/root/manifest
+endef
+
+$(eval $(cargo-package))
-- 
2.43.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2024-07-19 23:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-02  3:51 [Buildroot] [PATCH v2 1/1] package/spdm-utils: new package Wilfred Mallawa via buildroot
2024-04-12  0:40 ` Wilfred Mallawa via buildroot
2024-04-21 23:06 ` Wilfred Mallawa
2024-05-02  0:27 ` Wilfred Mallawa
2024-07-12 21:54 ` Thomas Petazzoni via buildroot
2024-07-19  7:04   ` Wilfred Mallawa via buildroot
2024-07-19  7:27     ` Thomas Petazzoni via buildroot
2024-07-19 23:09       ` Wilfred Mallawa via buildroot
  -- strict thread matches above, loose matches on Subject: below --
2024-02-24  0:39 Wilfred Mallawa via buildroot
2024-03-05  1:37 ` Wilfred Mallawa via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.