arm: Remove cm_t335 board
[platform/kernel/u-boot.git] / scripts / build-whitelist.sh
1 #!/bin/sh
2 # Copyright (c) 2016 Google, Inc
3 # Written by Simon Glass <sjg@chromium.org>
4 #
5
6 # This script creates the configuration whitelist file. This file contains
7 # all the config options which are allowed to be used outside Kconfig.
8 # Please do not add things to the whitelist. Instead, add your new option
9 # to Kconfig.
10 #
11 export LC_ALL=C LC_COLLATE=C
12
13 # Looks for the rest of the CONFIG options, but exclude those in Kconfig and
14 # defconfig files.
15 #
16 git grep CONFIG_ | \
17         egrep -vi "(Kconfig:|defconfig:|README|\.py|\.pl:)" \
18         | tr ' \t' '\n\n' \
19         | sed -n 's/^\(CONFIG_[A-Za-z0-9_]*\).*/\1/p' \
20         |sort |uniq >scripts/config_whitelist.txt.tmp1;
21
22 # Finally, we need a list of the valid Kconfig options to exclude these from
23 # the whitelist.
24 cat `find . -name "Kconfig*"` |sed -n \
25         -e 's/^\s*config *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
26         -e 's/^\s*menuconfig *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
27         |sort |uniq >scripts/config_whitelist.txt.tmp2
28
29 # Use only the options that are present in the first file but not the second.
30 comm -23 scripts/config_whitelist.txt.tmp1 scripts/config_whitelist.txt.tmp2 \
31         |sort |uniq >scripts/config_whitelist.txt.tmp3
32
33 # If scripts/config_whitelist.txt already exists, take the intersection of the
34 # current list and the new one.  We do not want to increase whitelist options.
35 if [ -r scripts/config_whitelist.txt ]; then
36         comm -12 scripts/config_whitelist.txt.tmp3 scripts/config_whitelist.txt \
37                 > scripts/config_whitelist.txt.tmp4
38         mv scripts/config_whitelist.txt.tmp4 scripts/config_whitelist.txt
39 else
40         mv scripts/config_whitelist.txt.tmp3 scripts/config_whitelist.txt
41 fi
42
43 rm scripts/config_whitelist.txt.tmp*
44
45 unset LC_ALL LC_COLLATE