From 62406d5ca582de960f492cb1363c5d1252e34ff3 Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Thu, 8 Aug 2024 11:44:13 +0300 Subject: [PATCH] build/bin: Remove nsh from the final ROMFS nsh is the init process, which resides in sbin/init. The user should not have rights to execute nsh. --- platforms/nuttx/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/platforms/nuttx/CMakeLists.txt b/platforms/nuttx/CMakeLists.txt index dc4a97f59ca3..e5abbef20445 100644 --- a/platforms/nuttx/CMakeLists.txt +++ b/platforms/nuttx/CMakeLists.txt @@ -255,6 +255,7 @@ if (CONFIG_BUILD_KERNEL) # Create the initial boot ROMFS (which contains nsh) add_custom_target(boot_bins COMMAND cp ${PX4_BINARY_DIR}/bin/nsh ${PX4_BINARY_DIR}/init + COMMAND rm ${PX4_BINARY_DIR}/bin/nsh COMMAND install -D ${PX4_BINARY_DIR}/init -t ${PX4_BINARY_DIR}/boot COMMAND rm -f ${PX4_BINARY_DIR}/init DEPENDS nuttx_app_bins