* [Buildroot] [PATCH v1 1/1] package/mbedtls: Move test binaries to subdirectory
@ 2024-09-16 17:03 Andreas Düring via buildroot
2024-10-26 15:50 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Düring via buildroot @ 2024-09-16 17:03 UTC (permalink / raw)
To: buildroot; +Cc: Fabrice Fontaine, Andreas Düring
The mbedtls package has a config option BR2_PACKAGE_MBEDTLS_PROGRAMS,
which enables some test programs to be built and installed.
However, some of the test programs have unfortunate names,
e.g. "hello" and "strerror", which may lead to name collisions (?)
and also otherwise "pollute" /usr/bin/.
Add a patch to the CMakeLists.txt files, so that the binaries go
to /usr/bin/mbedtls.
Signed-off-by: Andreas Düring <brpi@duering-andreas.de>
---
...001-install-programs-to-subdirectory.patch | 103 ++++++++++++++++++
1 file changed, 103 insertions(+)
create mode 100644 package/mbedtls/0001-install-programs-to-subdirectory.patch
diff --git a/package/mbedtls/0001-install-programs-to-subdirectory.patch b/package/mbedtls/0001-install-programs-to-subdirectory.patch
new file mode 100644
index 0000000000..5a28dcfc31
--- /dev/null
+++ b/package/mbedtls/0001-install-programs-to-subdirectory.patch
@@ -0,0 +1,103 @@
+Install mbedtls test programs to a subdirectory
+
+This is to avoid collisions (e.g. "hello").
+
+Signed-off-by: Andreas Düring <brpi@duering-andreas.de>
+Index: mbedtls-2.28.8/programs/aes/CMakeLists.txt
+===================================================================
+--- mbedtls-2.28.8.orig/programs/aes/CMakeLists.txt
++++ mbedtls-2.28.8/programs/aes/CMakeLists.txt
+@@ -8,5 +8,5 @@ foreach(exe IN LISTS executables)
+ endforeach()
+
+ install(TARGETS ${executables}
+- DESTINATION "bin"
++ DESTINATION "bin/mbedtls"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+Index: mbedtls-2.28.8/programs/hash/CMakeLists.txt
+===================================================================
+--- mbedtls-2.28.8.orig/programs/hash/CMakeLists.txt
++++ mbedtls-2.28.8/programs/hash/CMakeLists.txt
+@@ -9,5 +9,5 @@ foreach(exe IN LISTS executables)
+ endforeach()
+
+ install(TARGETS ${executables}
+- DESTINATION "bin"
++ DESTINATION "bin/mbedtls"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+Index: mbedtls-2.28.8/programs/pkey/CMakeLists.txt
+===================================================================
+--- mbedtls-2.28.8.orig/programs/pkey/CMakeLists.txt
++++ mbedtls-2.28.8/programs/pkey/CMakeLists.txt
+@@ -35,5 +35,5 @@ foreach(exe IN LISTS executables_mbedcry
+ endforeach()
+
+ install(TARGETS ${executables_mbedtls} ${executables_mbedcrypto}
+- DESTINATION "bin"
++ DESTINATION "bin/mbedtls"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+Index: mbedtls-2.28.8/programs/psa/CMakeLists.txt
+===================================================================
+--- mbedtls-2.28.8.orig/programs/psa/CMakeLists.txt
++++ mbedtls-2.28.8/programs/psa/CMakeLists.txt
+@@ -18,4 +18,4 @@ install(TARGETS ${executables}
+
+ install(PROGRAMS
+ key_ladder_demo.sh
+- DESTINATION "bin")
++ DESTINATION "bin/mbedtls")
+Index: mbedtls-2.28.8/programs/random/CMakeLists.txt
+===================================================================
+--- mbedtls-2.28.8.orig/programs/random/CMakeLists.txt
++++ mbedtls-2.28.8/programs/random/CMakeLists.txt
+@@ -10,5 +10,5 @@ foreach(exe IN LISTS executables)
+ endforeach()
+
+ install(TARGETS ${executables}
+- DESTINATION "bin"
++ DESTINATION "bin/mbedtls"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+Index: mbedtls-2.28.8/programs/ssl/CMakeLists.txt
+===================================================================
+--- mbedtls-2.28.8.orig/programs/ssl/CMakeLists.txt
++++ mbedtls-2.28.8/programs/ssl/CMakeLists.txt
+@@ -50,5 +50,5 @@ if(THREADS_FOUND)
+ endif(THREADS_FOUND)
+
+ install(TARGETS ${executables}
+- DESTINATION "bin"
++ DESTINATION "bin/mbedtls"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+Index: mbedtls-2.28.8/programs/test/CMakeLists.txt
+===================================================================
+--- mbedtls-2.28.8.orig/programs/test/CMakeLists.txt
++++ mbedtls-2.28.8/programs/test/CMakeLists.txt
+@@ -64,5 +64,5 @@ foreach(exe IN LISTS executables_libs ex
+ endforeach()
+
+ install(TARGETS ${executables_libs} ${executables_mbedcrypto}
+- DESTINATION "bin"
++ DESTINATION "bin/mbedtls"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+Index: mbedtls-2.28.8/programs/util/CMakeLists.txt
+===================================================================
+--- mbedtls-2.28.8.orig/programs/util/CMakeLists.txt
++++ mbedtls-2.28.8/programs/util/CMakeLists.txt
+@@ -13,5 +13,5 @@ foreach(exe IN LISTS executables)
+ endforeach()
+
+ install(TARGETS ${executables}
+- DESTINATION "bin"
++ DESTINATION "bin/mbedtls"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+Index: mbedtls-2.28.8/programs/x509/CMakeLists.txt
+===================================================================
+--- mbedtls-2.28.8.orig/programs/x509/CMakeLists.txt
++++ mbedtls-2.28.8/programs/x509/CMakeLists.txt
+@@ -27,5 +27,5 @@ endforeach()
+ target_link_libraries(cert_app ${mbedtls_target})
+
+ install(TARGETS ${executables}
+- DESTINATION "bin"
++ DESTINATION "bin/mbedtls"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
--
2.39.5
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH v1 1/1] package/mbedtls: Move test binaries to subdirectory
2024-09-16 17:03 [Buildroot] [PATCH v1 1/1] package/mbedtls: Move test binaries to subdirectory Andreas Düring via buildroot
@ 2024-10-26 15:50 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-10-26 15:50 UTC (permalink / raw)
To: Andreas Düring via buildroot; +Cc: Fabrice Fontaine, Andreas Düring
Hello Andreas,
On Mon, 16 Sep 2024 19:03:40 +0200
Andreas Düring via buildroot <buildroot@buildroot.org> wrote:
> The mbedtls package has a config option BR2_PACKAGE_MBEDTLS_PROGRAMS,
> which enables some test programs to be built and installed.
> However, some of the test programs have unfortunate names,
> e.g. "hello" and "strerror", which may lead to name collisions (?)
> and also otherwise "pollute" /usr/bin/.
>
> Add a patch to the CMakeLists.txt files, so that the binaries go
> to /usr/bin/mbedtls.
>
> Signed-off-by: Andreas Düring <brpi@duering-andreas.de>
Thanks a lot for raising this issue, and proposing this patch.
However, as Arnout has pointed out, we need the patch to be submitted
upstream, and an "Upstream:" tag with the reference to the upstream
submission (email, pull request, etc.).
In addition, why would programs go in /usr/bin/mbedtls? Isn't the right
course action to rename those programs so that they don't have
conflicting names? Like mbedtls-hello, mbedtls-strerror, etc. ?
This is really something to take and discuss with upstream.
Thanks!
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] 2+ messages in thread
end of thread, other threads:[~2024-10-26 15:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-16 17:03 [Buildroot] [PATCH v1 1/1] package/mbedtls: Move test binaries to subdirectory Andreas Düring via buildroot
2024-10-26 15:50 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox