5
# Script to merge all configs and run 'make silentoldconfig' on it to wade out bad juju.
6
# Then split the configs into distro-commmon and flavour-specific parts
8
# We have to be in the top level kernel source directory
9
if [ ! -f MAINTAINERS ] || [ ! -f Makefile ]; then
10
echo "This does not appear to be the kernel source directory." 1>&2
14
mode=${1:?"Usage: $0 [oldconfig|editconfig]"}
16
oldconfig) ;; # All is good
17
editconfig) ;; # All is good
18
genconfig) ;; # All is good
19
*) echo "$0 called with invalid mode" 1>&2
23
confdir="$kerneldir/${DEBIAN}/config"
24
sharedconfdir="$kerneldir/debian/config"
27
. $DEBIAN/etc/kernelconfig
29
bindir="`pwd`/${DROOT}/scripts/misc"
30
common_conf="$confdir/config.common.$family"
32
mkdir "$tmpdir/CONFIGS"
34
if [ "$mode" = "genconfig" ]; then
37
test -d CONFIGS || mkdir CONFIGS
40
for arch in $archs; do
44
# Map debian archs to kernel archs
46
amd64) kernarch="x86_64" ;;
47
lpia) kernarch="x86" ;;
48
sparc) kernarch="sparc64" ;;
49
armel) kernarch="arm" ;;
50
*) kernarch="$arch" ;;
54
echo "***************************************"
55
echo "* Processing $arch ($kernarch) ... "
56
archconfdir=$confdir/$arch
57
flavourconfigs=$(cd $archconfdir && ls config.flavour.*)
60
# We merge config.common.ubuntu + config.common.<arch> +
61
# config.flavour.<flavour>
63
for config in $flavourconfigs; do
64
fullconf="$tmpdir/$arch-$config-full"
68
if [ -f $common_conf ]; then
69
cat $common_conf >> "$fullconf"
71
if [ -f $archconfdir/config.common.$arch ]; then
72
cat $archconfdir/config.common.$arch >> "$fullconf"
74
cat "$archconfdir/$config" >>"$fullconf"
79
for config in $flavourconfigs; do
80
if [ -f $archconfdir/$config ]; then
81
fullconf="$tmpdir/$arch-$config-full"
82
cat "$fullconf" > build/.config
83
# Call oldconfig or menuconfig
86
# Weed out incorrect config parameters
87
echo "* Run silentoldconfig on $arch/$config ..."
88
make O=`pwd`/build ARCH=$kernarch silentoldconfig ;;
90
# Interactively edit config parameters
91
echo " * Run menuconfig on $arch/$config... Press a key."
93
make O=`pwd`/build ARCH=$kernarch menuconfig ;;
97
cat build/.config > $archconfdir/$config
98
cat build/.config > "$tmpdir/CONFIGS/$arch-$config"
99
if [ "$keep" = "1" ]; then
100
cat build/.config > CONFIGS/$arch-$config
103
echo "!! Config not found $archconfdir/$config..."
107
echo "Running splitconfig.pl for $arch"
110
# Can we make this more robust by avoiding $tmpdir completely?
111
# This approach was used for now because I didn't want to change
113
(cd $archconfdir; $bindir/splitconfig.pl; mv config.common \
114
config.common.$arch; cp config.common.$arch $tmpdir)
119
# Now run splitconfig.pl on all the config.common.<arch> copied to
121
(cd $tmpdir; $bindir/splitconfig.pl)
125
grep -v 'is UNMERGABLE' <$tmpdir/config.common >$common_conf
126
for arch in $archs; do
127
grep -v 'is UNMERGABLE' <$tmpdir/config.common.$arch \
128
>$arch/config.common.$arch
133
echo "Running config-check for all configurations ..."
136
for arch in $archs; do
137
archconfdir=$confdir/$arch
138
flavourconfigs=$(cd $archconfdir && ls config.flavour.*)
139
for config in $flavourconfigs; do
140
if [ -f $archconfdir/$config ]; then
141
fullconf="$tmpdir/CONFIGS/$arch-$config"
142
"$bindir/../config-check" "$fullconf" "$arch" "$config" "$sharedconfdir" "0" || let "fail=$fail+1"
147
if [ "$fail" != 0 ]; then
149
echo "*** ERROR: $fail config-check failures detected"