All of lore.kernel.org
 help / color / mirror / Atom feed
* [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

* Re: [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, 0 replies; 10+ messages in thread
From: Wilfred Mallawa via buildroot @ 2024-03-05  1:37 UTC (permalink / raw)
  To: buildroot@buildroot.org; +Cc: Alistair Francis

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

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

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

* [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

* Re: [Buildroot] [PATCH v2 1/1] package/spdm-utils: new package
  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
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Wilfred Mallawa via buildroot @ 2024-04-12  0:40 UTC (permalink / raw)
  To: buildroot@buildroot.org; +Cc: Alistair Francis, yann.morin.1998@free.fr

gentle ping :)

On Tue, 2024-04-02 at 13:51 +1000, Wilfred Mallawa via buildroot wrote:
> 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))

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

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

* Re: [Buildroot] [PATCH v2 1/1] package/spdm-utils: new package
  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
  3 siblings, 0 replies; 10+ messages in thread
From: Wilfred Mallawa @ 2024-04-21 23:06 UTC (permalink / raw)
  To: Wilfred Mallawa, buildroot; +Cc: alistair.francis, yann.morin.1998

ping :)

On Tue, 2024-04-02 at 13:51 +1000, Wilfred Mallawa via buildroot wrote:
> 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))

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

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

* Re: [Buildroot] [PATCH v2 1/1] package/spdm-utils: new package
  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
  3 siblings, 0 replies; 10+ messages in thread
From: Wilfred Mallawa @ 2024-05-02  0:27 UTC (permalink / raw)
  To: Wilfred Mallawa, buildroot; +Cc: alistair.francis, yann.morin.1998

ping!

On Tue, 2024-04-02 at 13:51 +1000, Wilfred Mallawa via buildroot wrote:
> 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))

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

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

* Re: [Buildroot] [PATCH v2 1/1] package/spdm-utils: new package
  2024-04-02  3:51 [Buildroot] [PATCH v2 1/1] package/spdm-utils: new package Wilfred Mallawa via buildroot
                   ` (2 preceding siblings ...)
  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
  3 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-07-12 21:54 UTC (permalink / raw)
  To: Wilfred Mallawa via buildroot
  Cc: Wilfred Mallawa, alistair.francis, yann.morin.1998

Hello Wilfred,

I wanted to merge this package, but got some build issues. See below.

On Tue,  2 Apr 2024 13:51:41 +1000
Wilfred Mallawa via buildroot <buildroot@buildroot.org> wrote:

> 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

In order to validate the dependencies, I went back to a simpler
package, like this:

config BR2_PACKAGE_SPDM_UTILS
	bool "spdm-utils"
	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
	depends on BR2_PACKAGE_HAS_UDEV
	select BR2_PACKAGE_HOST_RUSTC
	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

comment "spdm-utils needs udev /dev management"
	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
        depends on !BR2_PACKAGE_HAS_UDEV

and in the .mk file, reduced the DEPENDENCIES variable to:

SPDM_UTILS_DEPENDENCIES = udev

And with this, I get:

  Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.so', 'libclang-*.so', 'libclang.so.*', 'libclang-*.so.*'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"

However, none of your dependencies where related to libclang, so I
believe something is probably missing in terms of dependencies in your
submission. Could you double check?

Also, see below some comments.


> 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

Not needed, you simply need BR2_PACKAGE_HAS_UDEV.

> +	depends on !BR2_STATIC_LIBS

Please drop, you have this line duplicated below.

> +	depends on BR2_USE_MMU # eudev

We don't care about eudev dependencies, BR2_PACKAGE_HAS_UDEV is enough.
However, BR2_USE_MMU is needed for python3, so add # python3 at the end
of this line (if python3 is really needed, of course)

> +	depends on !BR2_STATIC_LIBS  # python3

> +	depends on BR2_USE_MMU  # eudev, python3
> +	depends on BR2_PACKAGE_HAS_UDEV
> +	depends on BR2_PACKAGE_LIBSPDM

Please select this library, but then you need:

	depends on BR2_PACKAGE_LIBSPDM_ARCH_SUPPORTS

> +	select BR2_PACKAGE_HOST_RUSTC
> +	select BR2_PACKAGE_OPENSSL
> +	select BR2_PACKAGE_PCIUTILS
> +	select BR2_PACKAGE_EUDEV

This select is not needed.

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

Please add Config.in comments about the dependencies. So probably:

comment "spdm-utils needs a toolchain w/ threads, dynamic library"
	depends on BR2_USE_MMU
	depends on BR2_PACKAGE_LIBSPDM_ARCH_SUPPORTS
	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS

comment "spdm-utils needs udev /dev management"
	depends on BR2_USE_MMU
	depends on BR2_PACKAGE_LIBSPDM_ARCH_SUPPORTS
	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
        depends on !BR2_PACKAGE_HAS_UDEV


> 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

This needs to be fixed with recent changes in the Cargo infrastructure.
Do a build, you'll notice.

> 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

Just =, not +=. What about python3? Not needed as a dependency?

> +
> +# 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

Meh, a bit verbose. Maybe:

SPDM_UTILS_CERT_SCRIPTS = \
	generate_certs.sh \
	setup_certs.sh

SPDM_UTILS_CERT_DATA_FILES = \
	openssl.cnf \
	slot0/immutable.der \
	slot0/device.cert.der \
	slot0/device.der \
	slot0/device.key \
	slot0/param.pem \
	slot0/bundle_responder.certchain.der

and then in SPDM_UTILS_INSTALL_CERTS:

	$(foreach f,$(SPDM_UTILS_CERT_DATA_FILES),
		$(INSTALL) -D -m 0644 $(f) $(TARGET_DIR)/usr/local/spdm_certs/$(f)
	)

	$(foreach f,$(SPDM_UTILS_CERT_SCRIPTS),
		$(INSTALL) -D -m 0755 $(f) $(TARGET_DIR)/usr/local/spdm_certs/$(f)
	)

Also, why do we install those files in /usr/local/ ?
/usr/local/spdm_certs and /usr/local/spdm_manifest seem like very
unconventional paths. I would rather expect those in
/usr/share/spdm/certs/ and /usr/share/spdm/manifest/ or something like
this.

Could you have a look at those different suggestions, and come back
with a v3 of your submission?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v2 1/1] package/spdm-utils: new package
  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
  0 siblings, 1 reply; 10+ messages in thread
From: Wilfred Mallawa via buildroot @ 2024-07-19  7:04 UTC (permalink / raw)
  To: buildroot@buildroot.org, thomas.petazzoni@bootlin.com
  Cc: Alistair Francis, yann.morin.1998@free.fr

On Fri, 2024-07-12 at 23:54 +0200, Thomas Petazzoni via buildroot
wrote:
> Hello Wilfred,
> 
> I wanted to merge this package, but got some build issues. See below.
> 
> On Tue,  2 Apr 2024 13:51:41 +1000
> Wilfred Mallawa via buildroot <buildroot@buildroot.org> wrote:
> 
> > 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
> 
> In order to validate the dependencies, I went back to a simpler
> package, like this:
> 
> config BR2_PACKAGE_SPDM_UTILS
> 	bool "spdm-utils"
> 	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
> 	depends on BR2_PACKAGE_HAS_UDEV
> 	select BR2_PACKAGE_HOST_RUSTC
> 	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
> 
> comment "spdm-utils needs udev /dev management"
> 	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
>         depends on !BR2_PACKAGE_HAS_UDEV
> 
> and in the .mk file, reduced the DEPENDENCIES variable to:
> 
> SPDM_UTILS_DEPENDENCIES = udev
> 
> And with this, I get:
> 
>   Unable to find libclang: "couldn't find any valid shared libraries
> matching: ['libclang.so', 'libclang-*.so', 'libclang.so.*',
> 'libclang-*.so.*'], set the `LIBCLANG_PATH` environment variable to a
> path where one of these files can be found (invalid: [])"
> 
> However, none of your dependencies where related to libclang, so I
> believe something is probably missing in terms of dependencies in
> your
> submission. Could you double check?
> 
Hey Thomas,

`spdm-utils` uses the `bindgen` crate, that required clang. Which I
believe is likely where this is coming from. I added it as a dependency
in V3. Which should fix this issue, however, I was not able to locally
reproduce it. Unsure why, I tried doing a minimal build with the config
you suggested... it still worked (odd!). Perhaps it was somehow being
pulled in as a dependency to another package. Let me know your thoughts
on the V3 changes.

[...snip]
> Also, see below some comments.
> 
> 
> Also, why do we install those files in /usr/local/ ?
> /usr/local/spdm_certs and /usr/local/spdm_manifest seem like very
> unconventional paths. I would rather expect those in
> /usr/share/spdm/certs/ and /usr/share/spdm/manifest/ or something
> like
> this.
> 
> Could you have a look at those different suggestions, and come back
> with a v3 of your submission?
> 
> Thanks a lot!
Thanks for all the detailed feedback! I they should be addressed in V3.

Regards,
Wilfred
> 
> Thomas

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

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

* Re: [Buildroot] [PATCH v2 1/1] package/spdm-utils: new package
  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
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-07-19  7:27 UTC (permalink / raw)
  To: Wilfred Mallawa
  Cc: Alistair Francis, yann.morin.1998@free.fr,
	buildroot@buildroot.org

Hello Wilfred,

On Fri, 19 Jul 2024 07:04:44 +0000
Wilfred Mallawa <wilfred.mallawa@wdc.com> wrote:

> `spdm-utils` uses the `bindgen` crate, that required clang. Which I
> believe is likely where this is coming from. I added it as a dependency
> in V3. Which should fix this issue, however, I was not able to locally
> reproduce it. Unsure why, I tried doing a minimal build with the config
> you suggested... it still worked (odd!). Perhaps it was somehow being
> pulled in as a dependency to another package. Let me know your thoughts
> on the V3 changes.

Possibly because you have clang installed on your host system. In order
to isolate yourself for such issues, use the ./utils/docker-run helper
to do your build in a minimal Docker container:

$ make clean
$ ./utils/docker-run make menuconfig
...
$ ./utils/docker-run make

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v2 1/1] package/spdm-utils: new package
  2024-07-19  7:27     ` Thomas Petazzoni via buildroot
@ 2024-07-19 23:09       ` Wilfred Mallawa via buildroot
  0 siblings, 0 replies; 10+ messages in thread
From: Wilfred Mallawa via buildroot @ 2024-07-19 23:09 UTC (permalink / raw)
  To: thomas.petazzoni@bootlin.com
  Cc: Alistair Francis, yann.morin.1998@free.fr,
	buildroot@buildroot.org

On Fri, 2024-07-19 at 09:27 +0200, Thomas Petazzoni via buildroot
wrote:
> Hello Wilfred,
> 
> On Fri, 19 Jul 2024 07:04:44 +0000
> Wilfred Mallawa <wilfred.mallawa@wdc.com> wrote:
> 
> > `spdm-utils` uses the `bindgen` crate, that required clang. Which I
> > believe is likely where this is coming from. I added it as a
> > dependency
> > in V3. Which should fix this issue, however, I was not able to
> > locally
> > reproduce it. Unsure why, I tried doing a minimal build with the
> > config
> > you suggested... it still worked (odd!). Perhaps it was somehow
> > being
> > pulled in as a dependency to another package. Let me know your
> > thoughts
> > on the V3 changes.
> 
> Possibly because you have clang installed on your host system. In
> order
> to isolate yourself for such issues, use the ./utils/docker-run
> helper
> to do your build in a minimal Docker container:
> 
> $ make clean
> $ ./utils/docker-run make menuconfig
> ...
> $ ./utils/docker-run make
> 
Hey Thomas,

That must've been it, I was able to reproduce it within the Docker.
Thanks for the tip! I noticed that with the `host-clang` dependency
added in V3 this particular issue was fixed, but there was another
error which I will address in a V4, please disregard V3.

Regards,
Wilfred
> Best regards,
> 
> Thomas

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

^ permalink raw reply	[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.