Skip to contentSkip to conversation

package/tbtools: new package

PATCH Superseded Mika Westerberg 2 participants 3 messages Apr 30, 2024 – May 11, 2024

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/tbtools: new package

This is a collection of tools for Linux Thunderbolt/USB4 development, debugging and validation.

---
Changes from v1:

- Added dependency to udev (libudev) and 64-bit builds.
- Added tag from Aapo.

 package/Config.in          |  1 +
 package/tbtools/Config.in  | 11 +++++++++++
 package/tbtools/tbtools.mk | 12 ++++++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 package/tbtools/Config.in
 create mode 100644 package/tbtools/tbtools.mk
package/Config.in +1 -0
index cdbf3577f8e1..e346917649a8 100644
@@ -157,6 +157,7 @@ menu "Debugging, profiling and benchmark"
 	source "package/stress-ng/Config.in"
 	source "package/sysdig/Config.in"
 	source "package/sysprof/Config.in"
+	source "package/tbtools/Config.in"
 	source "package/tcf-agent/Config.in"
 	source "package/trace-cmd/Config.in"
 	source "package/trinity/Config.in"
package/tbtools/Config.in new file +11 -0
new file mode 100644
index 000000000000..2627ea8bfcca
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_TBTOOLS
+	bool "tbtools"
+	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_HAS_UDEV
+	depends on BR2_ARCH_IS_64
+	select BR2_PACKAGE_HOST_RUSTC
+	help
+	  tbtools is a collection of tools for Linux Thunderbolt/USB4
+	  development, debugging and validation.
+
+	  https://github.com/intel/tbtools
package/tbtools/tbtools.mk new file +12 -0
new file mode 100644
index 000000000000..61986ca8d311
@@ -0,0 +1,12 @@
+################################################################################
+#
+# tbtools
+#
+################################################################################
+
+TBTOOLS_VERSION = v0.3.2
+TBTOOLS_SITE = $(call github,intel,tbtools,$(TBTOOLS_VERSION))
+TBTOOLS_LICENSE = MIT
+TBTOOLS_LICENSE_FILES = LICENSE
+
+$(eval $(cargo-package))
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello,

Thanks for your patch. I fixed up a few things, wanted to apply... but it fails to build for me. See below a number of comments, and details about the build failure.

Quoted 8 lines · On Tue, 30 Apr 2024 07:59:44 +0300 Mika Westerberg…

This is a collection of tools for Linux Thunderbolt/USB4 development, debugging and validation.

---
Changes from v1:

Quoted 7 lines

- Added dependency to udev (libudev) and 64-bit builds.
- Added tag from Aapo.

 package/Config.in          |  1 +
 package/tbtools/Config.in  | 11 +++++++++++
 package/tbtools/tbtools.mk | 12 ++++++++++++
 3 files changed, 24 insertions(+)

You need to add an entry to the DEVELOPERS file, like this:

+N: Mika Westerberg <[email protected]>
+F: package/tbtools/

(make sure to respect alphabetic ordering of developers)

package/tbtools/Config.in line 5

Quoted 11 lines
package/tbtools/Config.in new file +5 -0
new file mode 100644
index 000000000000..2627ea8bfcca
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_TBTOOLS
+	bool "tbtools"
+	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_HAS_UDEV
+	depends on BR2_ARCH_IS_64

I think it was worth adding a comment about this:

+ # Fails to build on 32-bit systems

package/tbtools/Config.in line 11

Quoted 6 lines
package/tbtools/Config.in new file +6 -0
+	select BR2_PACKAGE_HOST_RUSTC
+	help
+	  tbtools is a collection of tools for Linux Thunderbolt/USB4
+	  development, debugging and validation.
+
+	  https://github.com/intel/tbtools

You need a Config.in comment:

+comment "tbtools needs udev /dev management"

+       depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+       depends on BR2_ARCH_IS_64
+       depends on !BR2_PACKAGE_HAS_UDEV
Quoted 6 lines
package/tbtools/tbtools.mk new file +0 -0
new file mode 100644
index 000000000000..61986ca8d311

package/tbtools/tbtools.mk line 10

Quoted 10 lines
package/tbtools/tbtools.mk new file +10 -0
@@ -0,0 +1,12 @@
+################################################################################
+#
+# tbtools
+#
+################################################################################
+
+TBTOOLS_VERSION = v0.3.2
+TBTOOLS_SITE = $(call github,intel,tbtools,$(TBTOOLS_VERSION))
+TBTOOLS_LICENSE = MIT
+TBTOOLS_LICENSE_FILES = LICENSE

You're missing:

+TBTOOLS_DEPENDENCIES = udev

without which udev is not built before tbtools. Without this, it fails with a pkg-config detection issue.

But even with udev built before, I get a build failure:

= note: /home/thomas/projets/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/aarch64-buildroot-linux-musl/12.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld: cannot find -ludev: No such file or directory
collect2: error: ld returned 1 exit status

You can reproduce the following defconfig:

BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_AARCH64_MUSL_STABLE=y BR2_INIT_NONE=y BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set BR2_PACKAGE_TBTOOLS=y
# BR2_TARGET_ROOTFS_TAR is not set

Could you have a look and submit a v2 ?

Thanks a lot!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Hi,

Quoted 5 lines · Thomas Petazzoni

Hello,

Thanks for your patch. I fixed up a few things, wanted to apply... but it fails to build for me. See below a number of comments, and details about the build failure.

Thanks for looking into it!

Quoted 99 lines
Quoted 8 lines · On Tue, 30 Apr 2024 07:59:44 +0300 Mika Westerberg…

This is a collection of tools for Linux Thunderbolt/USB4 development, debugging and validation.

---
Changes from v1:

Quoted 7 lines

- Added dependency to udev (libudev) and 64-bit builds.
- Added tag from Aapo.

 package/Config.in          |  1 +
 package/tbtools/Config.in  | 11 +++++++++++
 package/tbtools/tbtools.mk | 12 ++++++++++++
 3 files changed, 24 insertions(+)

You need to add an entry to the DEVELOPERS file, like this:

(quoted diff) +2 -0
+N:     Mika Westerberg <[email protected]>
+F:     package/tbtools/

(make sure to respect alphabetic ordering of developers)

package/tbtools/Config.in line 5

Quoted 11 lines
package/tbtools/Config.in new file +5 -0
new file mode 100644
index 000000000000..2627ea8bfcca
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_TBTOOLS
+	bool "tbtools"
+	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_HAS_UDEV
+	depends on BR2_ARCH_IS_64

I think it was worth adding a comment about this:

+ # Fails to build on 32-bit systems

package/tbtools/Config.in line 11

Quoted 6 lines
package/tbtools/Config.in new file +6 -0
+	select BR2_PACKAGE_HOST_RUSTC
+	help
+	  tbtools is a collection of tools for Linux Thunderbolt/USB4
+	  development, debugging and validation.
+
+	  https://github.com/intel/tbtools

You need a Config.in comment:

package/tbtools/Config.in new file +4 -0
+comment "tbtools needs udev /dev management"
+       depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+       depends on BR2_ARCH_IS_64
+       depends on !BR2_PACKAGE_HAS_UDEV
Quoted 8 lines
package/tbtools/tbtools.mk new file +0 -0
new file mode 100644
index 000000000000..61986ca8d311

package/tbtools/tbtools.mk line 10

Quoted 10 lines
package/tbtools/tbtools.mk new file +10 -0
@@ -0,0 +1,12 @@
+################################################################################
+#
+# tbtools
+#
+################################################################################
+
+TBTOOLS_VERSION = v0.3.2
+TBTOOLS_SITE = $(call github,intel,tbtools,$(TBTOOLS_VERSION))
+TBTOOLS_LICENSE = MIT
+TBTOOLS_LICENSE_FILES = LICENSE

You're missing:

+TBTOOLS_DEPENDENCIES = udev

without which udev is not built before tbtools. Without this, it fails with a pkg-config detection issue.

But even with udev built before, I get a build failure:

= note: /home/thomas/projets/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/aarch64-buildroot-linux-musl/12.3.0/../../../../aarch64-buildroot-linux-musl/bin/ld: cannot find -ludev: No such file or directory
collect2: error: ld returned 1 exit status

You can reproduce the following defconfig:

BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_AARCH64_MUSL_STABLE=y BR2_INIT_NONE=y BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set BR2_PACKAGE_TBTOOLS=y
# BR2_TARGET_ROOTFS_TAR is not set

Quoted 1 line

Could you have a look and submit a v2 ?

I think Rust udev wants to have glibc as the C library. I will add dependency to that as well.

I'll fix these up in the next version.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot