]> code.ossystems Code Review - openembedded-core.git/commitdiff
populate_sdk_base.bbclass: check installation machine before installing SDK
authorLaurentiu Palcu <laurentiu.palcu@intel.com>
Thu, 1 Nov 2012 13:23:02 +0000 (15:23 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 2 Nov 2012 16:15:56 +0000 (16:15 +0000)
Do not allow installer to continue if the installation machine architecture
does not match the intended SDK machine architecture.

[YOCTO: #3269]

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/classes/populate_sdk_base.bbclass

index a3ac757b2386050e11e6034965e262b2999fdc57..dc715c45b25e073239cc4b33ad169608c54b9e05 100644 (file)
@@ -118,6 +118,14 @@ fakeroot create_shar() {
        cat << "EOF" > ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
 #!/bin/bash
 
+INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
+SDKMACHINE=$(echo ${SDKMACHINE} | sed -e "s/i[5-6]86/ix86/")
+
+if [ "$INST_ARCH" != "$SDKMACHINE" ]; then
+       echo "Error: Installation machine not supported!"
+       exit -1
+fi
+
 DEFAULT_INSTALL_DIR="${SDKPATH}"
 COMPONENTS_LEN=$(echo ".${SDKPATH}" | sed "s/\// /g" | wc -w)