[Buildroot] [PATCH 06/18 v3] support/scripts: also exit in error on improperly merged-usr

Yann E. MORIN yann.morin.1998 at free.fr
Mon Sep 1 09:01:15 UTC 2025


Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
---
 support/scripts/check-merged-usr.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/support/scripts/check-merged-usr.sh b/support/scripts/check-merged-usr.sh
index ac676185dd..6d31c81c21 100755
--- a/support/scripts/check-merged-usr.sh
+++ b/support/scripts/check-merged-usr.sh
@@ -14,6 +14,9 @@
 #   $1:     the root directory (skeleton, overlay) to check
 # Output:
 #   stdout: the list of non-compliant paths (empty if compliant).
+# Exit code:
+#   0:      in case of success (stdout will be empty)
+#   !0:     if any path is improperly merged
 #
 
 # The directory to check for merged-usr
@@ -45,9 +48,13 @@ test_merged() {
 
 	if ! is_valid_merged "${root}" "${dir1}" "${dir2}"; then
 		printf '%s\n' "${dir1}"
+		is_success=false
 	fi
 }
 
+is_success=true
 test_merged "${root}" "/lib" "/usr/lib"
 test_merged "${root}" "/bin" "/usr/bin"
 test_merged "${root}" "/sbin" "/usr/sbin"
+
+${is_success}
-- 
2.51.0



More information about the buildroot mailing list