blob: f03101a31658db9be81812deb4d02e01eaf6497f [file] [log] [blame]
Luis Machado7e487672019-07-23 13:58:12 -03001#!/bin/sh
2#
3# Kernel config checker
4#
5# Checks if a set of CONFIG_* values are defined in the config file for a
6# particular version of the Linux kernel.
7#
8# Copyright (C) 2019, Linaro Limited.
9#
10# This program is free software; you can redistribute it and/or
11# modify it under the terms of the GNU General Public License
12# as published by the Free Software Foundation; either version 2
13# of the License, or (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with this program; if not, write to the Free Software
22# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23#
24
25# shellcheck disable=SC1091
Milosz Wasilewski95d04e52021-06-09 17:14:32 +010026. ./kernel-config-lib
Luis Machado7e487672019-07-23 13:58:12 -030027OUTPUT="$(pwd)/output"
28RESULT_FILE="${OUTPUT}/result.txt"
29export RESULT_FILE
Luis Machado7e487672019-07-23 13:58:12 -030030
31# A list of space-separated config values to be checked.
32# Example: CONFIG_VALUES="CONFIG_X CONFIG_Y CONFIG_Z"
33CONFIG_VALUES=''
34
35usage() {
36 echo "Usage: $0 [-c config_values]" 1>&2
37 exit 1
38}
39
40while getopts "c:h" o; do
41 case "$o" in
42 c) CONFIG_VALUES="${OPTARG}" ;;
43 h|*) usage ;;
44 esac
45done
46
Luis Machado7e487672019-07-23 13:58:12 -030047# Test run.
48create_out_dir "${OUTPUT}"
49
50info_msg "About to run kernel config checker test..."
51info_msg "Output directory: ${OUTPUT}"
52
53check_config "${CONFIG_VALUES}"