Skip to contentSkip to conversation

toolchain-shar-extract.sh: exit when post-relocate-setup.sh fails

PATCH New [email protected] 1 participant 1 message Oct 9, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toolchain-shar-extract.sh: exit when post-relocate-setup.sh fails

From: Chen Qi <[email protected]>

When LD_LIBRARY_PATH is set, post-relocate-setup.sh will fail and exit properly. But such failure is ignored and the SDK installation will continue and tell user that things succeed. This is misleading. So exit immediately if post-relocate-setup.sh fails.

Fixes [Yocto #15586]

---
 meta/files/toolchain-shar-extract.sh | 4 ++++
 1 file changed, 4 insertions(+)
meta/files/toolchain-shar-extract.sh +4 -0
index 89d30005fd..3b4647fca7 100644
@@ -286,6 +286,10 @@ post_relocate="$target_sdk_dir/post-relocate-setup.sh"
 if [ -e "$post_relocate" ]; then
 	$SUDO_EXEC sed -e "s:@SDKPATH@:$target_sdk_dir:g" -i $post_relocate
 	$SUDO_EXEC /bin/sh $post_relocate "$target_sdk_dir" "@SDKPATH@"
+	if [ $? -ne 0 ]; then
+		echo "Executing $post_relocate failed"
+		exit 1
+	fi
 	$SUDO_EXEC rm -f $post_relocate
 fi
 
Signature · 1 line
2.25.1