1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 22:32:14 +00:00

Avoid kernel too old error when building ROS

This commit is contained in:
niusmallnan
2018-08-06 14:11:38 +08:00
committed by niusmallnan
parent 4fff436f04
commit edae355cd2
3 changed files with 17 additions and 2 deletions

View File

@@ -1,6 +1,21 @@
#!/bin/bash
set -e
version_gt() {
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1";
}
if [ "$KERNEL_CHECK" != "0" ]; then
echo "Host Kernel: $(uname -r)"
echo "RancherOS Kernel: $KERNEL_VERSION"
if ! version_gt $(uname -r) $KERNEL_VERSION; then
echo "Your host kernel must be greater than RancherOS KERNEL_VERSION"
exit 1
fi
fi
echo -------------------------./build-target
$(dirname $0)/build-target
echo -------------------------./build-host