Luis Machado | 7e48767 | 2019-07-23 13:58:12 -0300 | [diff] [blame] | 1 | #!/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 Wasilewski | 95d04e5 | 2021-06-09 17:14:32 +0100 | [diff] [blame^] | 26 | . ./kernel-config-lib |
Luis Machado | 7e48767 | 2019-07-23 13:58:12 -0300 | [diff] [blame] | 27 | OUTPUT="$(pwd)/output" |
| 28 | RESULT_FILE="${OUTPUT}/result.txt" |
| 29 | export RESULT_FILE |
Luis Machado | 7e48767 | 2019-07-23 13:58:12 -0300 | [diff] [blame] | 30 | |
| 31 | # A list of space-separated config values to be checked. |
| 32 | # Example: CONFIG_VALUES="CONFIG_X CONFIG_Y CONFIG_Z" |
| 33 | CONFIG_VALUES='' |
| 34 | |
| 35 | usage() { |
| 36 | echo "Usage: $0 [-c config_values]" 1>&2 |
| 37 | exit 1 |
| 38 | } |
| 39 | |
| 40 | while getopts "c:h" o; do |
| 41 | case "$o" in |
| 42 | c) CONFIG_VALUES="${OPTARG}" ;; |
| 43 | h|*) usage ;; |
| 44 | esac |
| 45 | done |
| 46 | |
Luis Machado | 7e48767 | 2019-07-23 13:58:12 -0300 | [diff] [blame] | 47 | # Test run. |
| 48 | create_out_dir "${OUTPUT}" |
| 49 | |
| 50 | info_msg "About to run kernel config checker test..." |
| 51 | info_msg "Output directory: ${OUTPUT}" |
| 52 | |
| 53 | check_config "${CONFIG_VALUES}" |