mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-21 20:08:54 +00:00
In order to track the changes that we add to the kernel, lets add a kata_config_version file that should be bumped whenever a change is added to the kernel directory Fixes #43. Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
27 lines
697 B
Bash
27 lines
697 B
Bash
#!/bin/bash
|
|
#
|
|
# Copyright (c) 2018 Intel Corporation
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# If we fail for any reason a message will be displayed
|
|
die(){
|
|
msg="$*"
|
|
echo "ERROR: $msg" >&2
|
|
exit 1
|
|
}
|
|
|
|
# Check that kata_confing_version file is updated
|
|
# when there is any change in the kernel directory.
|
|
# If there is a change in the directory, but the config
|
|
# version is not updated, return error.
|
|
check_kata_kernel_version(){
|
|
kernel_version_file="kernel/kata_config_version"
|
|
modified_files=$(git diff --name-only master..)
|
|
if echo "$modified_files" | grep "kernel/"; then
|
|
echo "$modified_files" | grep "$kernel_version_file" || \
|
|
die "Please bump version in $kernel_version_file"
|
|
fi
|
|
|
|
}
|