open-cas-linux/configure.d/1_get_disk_max_part.conf
Krzysztof Majzerowicz-Jaszcz f0af7cb52d Open CAS Linux kernel 5.18 support
This patch introduces the support for 5.18 kernel.

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-10-24 09:53:01 +00:00

37 lines
711 B
Bash

#!/bin/bash
#
# Copyright(c) 2012-2022 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
. $(dirname $3)/conf_framework.sh
check() {
cur_name=$(basename $2)
config_file_path=$1
if compile_module $cur_name "disk_max_parts(NULL);" "linux/genhd.h"
then
echo $cur_name "1" >> $config_file_path
elif compile_module $cur_name "int i = DISK_MAX_PARTS;" "linux/blkdev.h"
then
echo $cur_name "2" >> $config_file_path
else
echo $cur_name "X" >> $config_file_path
fi
}
apply() {
case "$1" in
"1")
add_define "GET_DISK_MAX_PARTS(x) disk_max_parts(x)"
;;
"2")
add_define "GET_DISK_MAX_PARTS(x) DISK_MAX_PARTS"
;;
*)
exit 1
esac
}
conf_run $@