diff options
| author | Ming Liu <liu.ming50@gmail.com> | 2024-10-27 11:43:17 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-28 11:58:22 +0000 |
| commit | afc74c1e17d7c4cf99283c130d14f0e73368c792 (patch) | |
| tree | 30994ae92a3a1b681da066f582f6f4e22adaa30d | |
| parent | d7e4664169f7a0ac1ac80f0c07d2d74125a6d12f (diff) | |
| download | poky-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.sh | 8 |
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 | ||
| 246 | printf "Extracting SDK..." | 246 | printf "Extracting SDK..." |
| 247 | if [ @SDK_ARCHIVE_TYPE@ = "zip" ]; then | 247 | if [ @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 |
| 254 | else | 258 | else |
| 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 |
| 256 | fi | 264 | fi |
| 257 | echo "done" | 265 | echo "done" |
