]> code.ossystems Code Review - openembedded-core.git/commitdiff
populate_sdk: Handle OLDEST_KERNEL
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 Feb 2015 16:24:29 +0000 (16:24 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 17 Feb 2015 13:42:21 +0000 (13:42 +0000)
Add a check to the SDK so that it only runs on systems with kernel versions
it supports.

[YOCTO #6856]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/populate_sdk_base.bbclass
meta/files/toolchain-shar-template.sh

index 8b7e9ea8dd255012cab5b475a20617256fa19496..e3adacb2c9c9876bbe7e2d5e50df6346f17de812 100644 (file)
@@ -126,6 +126,7 @@ EOF
        # substitute variables
        sed -i -e 's#@SDK_ARCH@#${SDK_ARCH}#g' \
                -e 's#@SDKPATH@#${SDKPATH}#g' \
+               -e 's#@OLDEST_KERNEL@#${OLDEST_KERNEL}#g' \
                -e 's#@REAL_MULTIMACH_TARGET_SYS@#${REAL_MULTIMACH_TARGET_SYS}#g' \
                -e '/@SDK_POST_INSTALL_COMMAND@/d' \
                ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
index 4a7fbd50c6cf601476c81856116af4c10a990cb7..151b973d35d4ea49ab2c6cc8b6d33f475a13c144 100644 (file)
@@ -3,6 +3,20 @@
 INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
 SDK_ARCH=$(echo @SDK_ARCH@ | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
 
+verlte () {
+       [  "$1" = "`printf "$1\n$2" | sort -V | head -n1`" ]
+}
+
+verlt() {
+       [ "$1" = "$2" ] && return 1 || verlte $1 $2
+}
+
+verlt `uname -r` @OLDEST_KERNEL@
+if [ $? = 0 ]; then
+       echo "Error: The SDK needs a kernel > @OLDEST_KERNEL@"
+       exit 1
+fi
+
 if [ "$INST_ARCH" != "$SDK_ARCH" ]; then
        # Allow for installation of ix86 SDK on x86_64 host
        if [ "$INST_ARCH" != x86_64 -o "$SDK_ARCH" != ix86 ]; then