diff --git a/modules.d/00busybox/check b/modules.d/00busybox/check new file mode 100755 index 0000000..64d5b67 --- /dev/null +++ b/modules.d/00busybox/check @@ -0,0 +1,2 @@ +#!/bin/sh +[ -x /sbin/busybox ] diff --git a/modules.d/00busybox/install b/modules.d/00busybox/install new file mode 100755 index 0000000..5f5b218 --- /dev/null +++ b/modules.d/00busybox/install @@ -0,0 +1,20 @@ +#!/bin/bash +# Install busybox and symlink it accordingly +inst /sbin/busybox + +# Symlink each busybox supported command. +# If the file already exists on the local system, install the symlink into the +# same location +# If the file does not exist, put the symlink into /bin +for i in `busybox --help | sed -e '1,/Currently defined functions:/d'`; do + LOCATION="" + for dir in /bin/ /sbin/ /usr/bin/ /usr/sbin/; do + if [ -x ${dir}${i%,} ]; then + LOCATION=${dir} + ln -sf /sbin/busybox "${initdir}${dir}${i%,}" + fi + done + if [ -z $LOCATION ]; then + ln -sf /sbin/busybox "${initdir}/bin/${i%,}" + fi +done