1 #!/bin/sh 2 # SPDX-License-Identifier: GPL-2.0-or-later 3 # 4 # Copyright (C) 2017 Imagination Technologies 5 # Author: Paul Burton <paul.burton@mips.com> 6 # 7 # This script merges configuration fragments f 8 # generic MIPS kernel. It checks each for requ 9 # formatted comments, and then calls merge_con 10 # fragments which have no unmet requirements. 11 # 12 # An example of requirements in your board con 13 # 14 # # require CONFIG_CPU_MIPS32_R2=y 15 # # require CONFIG_CPU_LITTLE_ENDIAN=y 16 # 17 # This would mean that your board is only incl 18 # configured for little endian MIPS32r2 CPUs, 19 # configured for 64 bit or big endian systems. 20 # 21 22 srctree="$1" 23 objtree="$2" 24 ref_cfg="$3" 25 cfg="$4" 26 boards_origin="$5" 27 shift 5 28 29 # Only print Skipping... lines if the user exp 30 # general case it only serves to obscure the u 31 # was included. 32 case ${boards_origin} in 33 "command line") 34 print_skipped=1 35 ;; 36 environment*) 37 print_skipped=1 38 ;; 39 *) 40 print_skipped=0 41 ;; 42 esac 43 44 for board in $@; do 45 board_cfg="${srctree}/arch/mips/config 46 if [ ! -f "${board_cfg}" ]; then 47 echo "WARNING: Board config '$ 48 continue 49 fi 50 51 # For each line beginning with # requi 52 # it & search for that in the referenc 53 # is not found then the subshell will 54 # continue on to the next board. 55 grep -E '^# require ' "${board_cfg}" | 56 cut -d' ' -f 3- | \ 57 while read req; do 58 case ${req} in 59 *=y) 60 # If we require someth 61 # containing it is pre 62 grep -Eq "^${req}\$" " 63 ;; 64 *=n) 65 # If we require someth 66 # check, considering t 67 # a line containing th 68 # config. 69 grep -Eq "^${req/%=n/= 70 ;; 71 *) 72 echo "WARNING: Unhandl 73 ;; 74 esac 75 76 [ ${print_skipped} -eq 1 ] && 77 exit 1 78 done || continue 79 80 # Merge this board config fragment int 81 ${srctree}/scripts/kconfig/merge_confi 82 -m -O ${objtree} ${cfg} ${boar 83 | grep -Ev '^(#|Using)' 84 done
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.