[U-Boot] [RFC] Centralise documentation of CONFIG_ options (and finding unused ones)

Graeme Russ graeme.russ at gmail.com
Mon Apr 11 15:11:23 CEST 2011


Hi All,

As a bit of a lark, I ran the following shell command:

grep -r -h -o -G "#define CONFIG.*" * | \
sed 's/#define[ \t]*//' | \
sed 's/^\([A-Za-z0-9_]*\).*/\1/' | \
sort -u > README.configuration.options

I then ran the result through the following script into
README.configuration.options.counted

#!/bin/bash
INPUT=doc/README.configuration.options

#!/bin/bash
INPUT=doc/README.configuration.options

for i in `cat $INPUT`
do
	grep -rcs --exclude-dir=doc '\<'${i}'\>' * | \
	cut -d : -f 2 | \
	awk '{sum+=$1} END {printf("%d\t%s\n", sum, f);}' f=$i
done

The result? 5539 lines of pure configuration option goodness :)

Here's a little snippet:

6	CONFIG_100MHz
8	CONFIG_133MHZ_DRAM
7	CONFIG_300MHz
13	CONFIG_405
24	CONFIG_405CR
88	CONFIG_405EP
81	CONFIG_405EX



More information about the U-Boot mailing list