summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2024-10-27 11:43:17 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-10-28 11:58:22 +0000
commitafc74c1e17d7c4cf99283c130d14f0e73368c792 (patch)
tree30994ae92a3a1b681da066f582f6f4e22adaa30d
parentd7e4664169f7a0ac1ac80f0c07d2d74125a6d12f (diff)
downloadpoky-afc74c1e17d7c4cf99283c130d14f0e73368c792.tar.gz
toolchain-shar-extract.sh: check required tool before extracting SDK
To extract the SDK archive, the proper tools need to be present on system, check unzip for zip archive type, check xz for tar.xz archive type. (From OE-Core rev: 718328588e832c0a59dc9b76ff4e5e3def6e8834) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/files/toolchain-shar-extract.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh
index 7e40c67374..8368a81196 100644
--- a/meta/files/toolchain-shar-extract.sh
+++ b/meta/files/toolchain-shar-extract.sh
@@ -245,6 +245,10 @@ fi
245 245
246printf "Extracting SDK..." 246printf "Extracting SDK..."
247if [ @SDK_ARCHIVE_TYPE@ = "zip" ]; then 247if [ @SDK_ARCHIVE_TYPE@ = "zip" ]; then
248 if [ -z "$(command -v unzip)" ]; then
249 echo "Aborted, unzip is required to extract the SDK archive, please make sure it's installed on your system!"
250 exit 1
251 fi
248 tail -n +$payload_offset "$0" > sdk.zip 252 tail -n +$payload_offset "$0" > sdk.zip
249 if $SUDO_EXEC unzip $EXTRA_TAR_OPTIONS sdk.zip -d $target_sdk_dir;then 253 if $SUDO_EXEC unzip $EXTRA_TAR_OPTIONS sdk.zip -d $target_sdk_dir;then
250 rm sdk.zip 254 rm sdk.zip
@@ -252,6 +256,10 @@ if [ @SDK_ARCHIVE_TYPE@ = "zip" ]; then
252 rm sdk.zip && exit 1 256 rm sdk.zip && exit 1
253 fi 257 fi
254else 258else
259 if [ -z "$(command -v xz)" ]; then
260 echo "Aborted, xz is required to extract the SDK archive, please make sure it's installed on your system!"
261 exit 1
262 fi
255 tail -n +$payload_offset "$0"| $SUDO_EXEC tar mxJ -C $target_sdk_dir --checkpoint=.2500 $EXTRA_TAR_OPTIONS || exit 1 263 tail -n +$payload_offset "$0"| $SUDO_EXEC tar mxJ -C $target_sdk_dir --checkpoint=.2500 $EXTRA_TAR_OPTIONS || exit 1
256fi 264fi
257echo "done" 265echo "done"