From 508509d150e375ed5701190ec4bb1259709b576c Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 16 Feb 2015 16:24:29 +0000 Subject: populate_sdk: Handle OLDEST_KERNEL Add a check to the SDK so that it only runs on systems with kernel versions it supports. [YOCTO #6856] (From OE-Core rev: b4caa8085aa15674162ff5135b13409998db9510) Signed-off-by: Richard Purdie --- meta/files/toolchain-shar-template.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'meta/files') diff --git a/meta/files/toolchain-shar-template.sh b/meta/files/toolchain-shar-template.sh index 4a7fbd50c6..151b973d35 100644 --- a/meta/files/toolchain-shar-template.sh +++ b/meta/files/toolchain-shar-template.sh @@ -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 -- cgit 1.2.3-korg