4 echo "Usage: $(basename $0) <busybox_sourcedir>"
11 [[ -e config.new
]] && {
12 echo -n "config.new exists already. delete? [y|n] "
21 echo "what is '$ans'?"
27 # store config paths relative to $bbsrc into an array
28 readarray
-t configs
<<< $
(cd "$bbsrc"; find .
-type f
-name Config.
in)
30 # copy each config into config.new
31 for config
in "${configs[@]}"; do
32 mkdir
-p config.new
/$
(dirname $config)
33 cp "$bbsrc/$config" "config.new/$config"
36 # store defined config symbols into an array
37 readarray
-t symbols
<<< $
(grep -hr '^config ' config.new | cut
-d' ' -f2)
39 ### customize busybox config system for OpenADK
43 # no extra mainmenu, allow replacing PREFIX
44 sed -i -e 's/^mainmenu/# mainmenu/' -e 's,./_install,@IDIR@,' Config.
in
46 # prefix all symbols with BUSYBOX_ to create a namespace
47 # limit replacement to lines containing given keywords to
48 # not mess up help texts and prompts too much
49 keywords
='\(config\|depends\|range\|select\|default\|^if \)'
50 sympipe
=$
(IFS
='|'; echo "${symbols[*]}" |
sed -e 's/|/\\|/g')
51 sympipe_s
='/'$keywords'/s/\b\('$sympipe'\)\b/BUSYBOX_\1/g'
53 # fix path of all sourced files
54 source_s
='s,^\(source *\)\([^ ]*\)$,\1package/busybox/config/\2,'
56 sed -i -e "$sympipe_s" -e "$source_s" "${configs[@]}"