firmware

view sources/toys/miniconfig.sh @ 209:fe0e5b641cb4

Patch to uClibc to build better with soft float, and finally switch off
all floating point support in armv4l-soft kernel config.
author Rob Landley <rob@landley.net>
date Sun Sep 02 05:39:29 2007 -0500 (2 years ago)
parents 77dfe348925c
children c0d9e91f528b
line source
1 #!/bin/bash
3 # miniconfig.sh copyright 2005 by Rob Landley <rob@landley.net>
4 # Licensed under the GNU General Public License version 2.
6 # Run this in the linux kernel build directory with a starting file, and
7 # it creates a file called mini.config with all the redundant lines of that
8 # .config removed. The starting file must match what the kernel outputs.
9 # If it doesn't, then run "make oldconfig" on it to get one that does.
11 export KCONFIG_NOTIMESTAMP=1
13 if [ $# -ne 1 ] || [ ! -f "$1" ]
14 then
15 echo "Usage: miniconfig.sh configfile"
16 exit 1
17 fi
19 if [ "$1" == ".config" ]
20 then
21 echo "It overwrites .config, rename it and try again."
22 exit 1
23 fi
25 make allnoconfig KCONFIG_ALLCONFIG="$1" > /dev/null
26 if ! cmp .config "$1"
27 then
28 echo Sanity test failed, normalizing starting configuration...
29 diff -u "$1" .config
30 fi
31 cp .config .big.config
32 cp .config mini.config
34 echo "Calculating mini.config..."
36 LENGTH=`cat $1 | wc -l`
38 # Loop through all lines in the file
39 I=1
40 while true
41 do
42 if [ $I -gt $LENGTH ]
43 then
44 break
45 fi
46 sed -n "${I}!p" mini.config > .config.test
47 # Do a config with this file
48 make allnoconfig KCONFIG_ALLCONFIG=.config.test > /dev/null
50 # Compare. Because we normalized at the start, the files should be identical.
51 if cmp -s .config .big.config
52 then
53 mv .config.test mini.config
54 LENGTH=$[$LENGTH-1]
55 else
56 I=$[$I + 1]
57 fi
58 echo -n -e "\r$[$I-1]/$LENGTH lines $(cat mini.config | wc -c) bytes "
59 done
60 rm .big.config
61 echo