2 # SPDX-License-Identifier: GPL-2.0-or-later
4 # Copyright (C) 2017 Imagination Technologies
5 # Author: Paul Burton <paul.burton@mips.com>
7 # This script merges configuration fragments for boards supported by the
8 # generic MIPS kernel. It checks each for requirements specified using
9 # formatted comments, and then calls merge_config.sh to merge those
10 # fragments which have no unmet requirements.
12 # An example of requirements in your board config fragment might be:
14 # # require CONFIG_CPU_MIPS32_R2=y
15 # # require CONFIG_CPU_LITTLE_ENDIAN=y
17 # This would mean that your board is only included in kernels which are
18 # configured for little endian MIPS32r2 CPUs, and not for example in kernels
19 # configured for 64 bit or big endian systems.
29 # Only print Skipping... lines if the user explicitly specified BOARDS=. In the
30 # general case it only serves to obscure the useful output about what actually
32 case ${boards_origin} in
45 board_cfg
="${srctree}/arch/mips/configs/generic/board-${board}.config"
46 if [ ! -f "${board_cfg}" ]; then
47 echo "WARNING: Board config '${board_cfg}' not found"
51 # For each line beginning with # require, cut out the field following
52 # it & search for that in the reference config file. If the requirement
53 # is not found then the subshell will exit with code 1, and we'll
54 # continue on to the next board.
55 grep -E '^# require ' "${board_cfg}" | \
60 # If we require something =y then we check that a line
61 # containing it is present in the reference config.
62 grep -Eq "^${req}\$" "${ref_cfg}" && continue
65 # If we require something =n then we just invert that
66 # check, considering the requirement met if there isn't
67 # a line containing the value =y in the reference
69 grep -Eq "^${req/%=n/=y}\$" "${ref_cfg}" ||
continue
72 echo "WARNING: Unhandled requirement '${req}'"
76 [ ${print_skipped} -eq 1 ] && echo "Skipping ${board_cfg}"
80 # Merge this board config fragment into our final config file
81 ${srctree}/scripts
/kconfig
/merge_config.sh \
82 -m -O ${objtree} ${cfg} ${board_cfg} \
83 |
grep -Ev '^(#|Using)'