diff --git a/standalone-kernel/compile_kernel.sh b/standalone-kernel/compile_kernel.sh index a028b90b..cdee3c1c 100755 --- a/standalone-kernel/compile_kernel.sh +++ b/standalone-kernel/compile_kernel.sh @@ -59,11 +59,17 @@ do_compile_kernel() variant_info="" build_folder=build + config_prefix="${INPUT_ARCH}" extra_params="" if [ ! -z "${variant}" ]; then case "${variant}" in MCS) - extra_params="${extra_params} -DKernelIsMCS=TRUE" + if [ -f configs/${config_prefix}_MCS_verified.cmake ]; then + config_prefix="${config_prefix}_MCS" + else + # just use the default and enable MCS + extra_params="${extra_params} -DKernelIsMCS=TRUE" + fi ;; *) echo "Unknown variant '${variant}'" @@ -74,10 +80,20 @@ do_compile_kernel() build_folder="${build_folder}-${variant}" fi + # Unfortunately, CMake does not halt with a nice and clear error if the + # config file does not exist. Instead, it logs an error that it could not + # process the file and continues as if the file was empty. This causes some + # rather odd errors later, so it's better to fail here with a clear message. + config_file="configs/${config_prefix}_verified.cmake" + if [ ! -f "${config_file}" ]; then + echo "missing config file '${config_file}'" + exit 1 + fi + echo "::group::Run CMake${variant_info}" ( # run in sub shell set -x - cmake -G Ninja -B ${build_folder} -C configs/${INPUT_ARCH}_verified.cmake ${toolchain_flags} ${extra_params} + cmake -G Ninja -B ${build_folder} -C ${config_file} ${toolchain_flags} ${extra_params} ) echo "::endgroup::"