This tip came in from a subscriber/regular contributor. It’s a script for quickly creating busybox links based on the commands included in your build. I know it will be helpful to somebody out there.
Dunno if you are still doing your “DailyLinux” thing, but here’s
a bit of script I knocked together today to create busybox links.
Yes I know there is an “–install” option on a lot of busybox builds,
but it doesn’t seem to play well with installing in a chroot area.
So copy the busybox executable into the “bin” directory…
cp -p /bin/busybox /data/chroot/bin
and cd into that directory
Then run this shell snippet…
./busybox --help | \ sed -e '1,/^Currently defined functions:/d' \ -e 's/[ \t]//g' -e 's/,$//' -e 's/,/\n/g' | \ while read app ; do if [ "$app" != "" ]; then printf "linking %-12s ...\n" "$app" ln -sf "./busybox" "$app" ls -ld "$app" fi done
and all the links for the apps built-in to the busybox version you have
get built for you.
It takes advantage of the fact that “busybox –help” gives a list of the
built apps at the end of its output, after the line “Currently defined
functions:”. The sed script, removes all line upto and including this line,
and then removes spaces, tabs and trailing commas, then it converts all
commas to newlines. This gives a list of apps, one app to a line. The while
loop reads each line and does the linking.
Dunno if this would interest anyone else.
all the best