diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-08-11 16:45:03 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-17 10:35:40 +0100 |
commit | 5895bb6d2c1cbc38872716ec2c03c56990cb164c (patch) | |
tree | 0c9ff4b2fbeab171a36517303f54193990c02359 /meta | |
parent | 7df442c340ba8eaaad7d512ed4130a87a25328f5 (diff) | |
download | poky-5895bb6d2c1cbc38872716ec2c03c56990cb164c.tar.gz |
classes/populate_sdk_ext: properly handle buildtools install failure
If the buildtools installation failed, we were using a subshell instead
of a compound command and thus the subshell exited but the script
continued on, which is really not what we want to happen. Additionally
log the buildtools installer output to a file and cat it if it fails so
that you can actually see what went wrong, as well as amending the
environment setup script to print a warning as we do when the
preparation fails.
(From OE-Core rev: 8fb8adf309823660c3943df973c216621a71850d)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/populate_sdk_ext.bbclass | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass index a075a0930a..180135645f 100644 --- a/meta/classes/populate_sdk_ext.bbclass +++ b/meta/classes/populate_sdk_ext.bbclass | |||
@@ -490,14 +490,16 @@ SDK_PRE_INSTALL_COMMAND_task-populate-sdk-ext = "${sdk_ext_preinst}" | |||
490 | sdk_ext_postinst() { | 490 | sdk_ext_postinst() { |
491 | printf "\nExtracting buildtools...\n" | 491 | printf "\nExtracting buildtools...\n" |
492 | cd $target_sdk_dir | 492 | cd $target_sdk_dir |
493 | printf "buildtools\ny" | ./*buildtools-nativesdk-standalone* > /dev/null || ( printf 'ERROR: buildtools installation failed\n' ; exit 1 ) | 493 | env_setup_script="$target_sdk_dir/environment-setup-${REAL_MULTIMACH_TARGET_SYS}" |
494 | printf "buildtools\ny" | ./*buildtools-nativesdk-standalone* > buildtools.log || { printf 'ERROR: buildtools installation failed:\n' ; cat buildtools.log ; echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; } | ||
494 | 495 | ||
495 | # Delete the buildtools tar file since it won't be used again | 496 | # Delete the buildtools tar file since it won't be used again |
496 | rm ./*buildtools-nativesdk-standalone*.sh -f | 497 | rm ./*buildtools-nativesdk-standalone*.sh -f |
498 | # We don't need the log either since it succeeded | ||
499 | rm -f buildtools.log | ||
497 | 500 | ||
498 | # Make sure when the user sets up the environment, they also get | 501 | # Make sure when the user sets up the environment, they also get |
499 | # the buildtools-tarball tools in their path. | 502 | # the buildtools-tarball tools in their path. |
500 | env_setup_script="$target_sdk_dir/environment-setup-${REAL_MULTIMACH_TARGET_SYS}" | ||
501 | echo ". $target_sdk_dir/buildtools/environment-setup*" >> $env_setup_script | 503 | echo ". $target_sdk_dir/buildtools/environment-setup*" >> $env_setup_script |
502 | 504 | ||
503 | # Allow bitbake environment setup to be ran as part of this sdk. | 505 | # Allow bitbake environment setup to be ran as part of this sdk. |