mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-05 04:06:33 +02:00
Merge pull request #326 from marineam/kernel
sdk: assert host system is running Linux 3.7 or later
This commit is contained in:
commit
3e4c29957c
11
common.sh
11
common.sh
@ -464,6 +464,17 @@ assert_root_user() {
|
||||
fi
|
||||
}
|
||||
|
||||
# We depend on some relatively modern kernel features, in particular a
|
||||
# reasonably recent btrfs version is required to generate images.
|
||||
# Current requirement: 3.7 added btrfs' extref incompat feature
|
||||
assert_kernel_version() {
|
||||
local req_kv="3.7"
|
||||
local cur_kv=$(uname -r)
|
||||
if ! cmp_ver ge "${cur_kv}" "${req_kv}"; then
|
||||
die_notrace "Detected kernel ${cur_kv}, ${req_kv} or later is required"
|
||||
fi
|
||||
}
|
||||
|
||||
# Check that all arguments are flags; that is, there are no remaining arguments
|
||||
# after parsing from shflags. Allow (with a warning) a single empty-string
|
||||
# argument.
|
||||
|
||||
@ -12,6 +12,7 @@ SCRIPT_ROOT=$(readlink -f $(dirname "$0")/..)
|
||||
# Script must be run outside the chroot and as root.
|
||||
assert_outside_chroot
|
||||
assert_root_user
|
||||
assert_kernel_version
|
||||
|
||||
# Define command line flags
|
||||
# See http://code.google.com/p/shflags/wiki/Documentation10x
|
||||
|
||||
@ -29,6 +29,7 @@ fi
|
||||
# Script must be run outside the chroot and as root.
|
||||
assert_outside_chroot
|
||||
assert_root_user
|
||||
assert_kernel_version
|
||||
|
||||
# Define command line flags.
|
||||
# See http://code.google.com/p/shflags/wiki/Documentation10x
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user