diff mbox series

[v2,1/1] package/spdm-utils: new package

Message ID 20240224003958.21174-2-wilfred.mallawa@wdc.com
State Superseded
Headers show
Series [v2,1/1] package/spdm-utils: new package | expand

Commit Message

Wilfred Mallawa Feb. 24, 2024, 12:39 a.m. UTC
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

Comments

Wilfred Mallawa March 5, 2024, 1:37 a.m. UTC | #1
ping :)

On Sat, 2024-02-24 at 10:39 +1000, Wilfred Mallawa wrote:
> 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))
diff mbox series

Patch

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))