1
0
mirror of https://github.com/rancher/os.git synced 2025-06-05 21:22:31 +00:00
os/scripts/build
Benjamin S. Allen d9caf6fa20 Allow build on a host with matching kernel version
Change allows for a build on a host with a matching kernel version
instead of forcing that the version must always be greater.
2019-06-10 03:51:17 +02:00

23 lines
557 B
Bash
Executable File

#!/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 [ $(uname -r) != $KERNEL_VERSION ] && ! 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
$(dirname $0)/build-host