Hi, /usr/bin/tce depends on scripts /usr/bin/{search.sh, provides.sh, select, tce-size}.
I explicitly replaced all the busybox commands with their full path (/bin, /usr/bin), by that I eliminated the need for
. /etc/init.d/tc-functions && useBusybox
There is now no need to call /source tc-config (18497 bytes) by 4 times;
yes, I know was already in RAM, but I least I documented who call whom, which minimum busybox applets are in need for each script, etc. The speed could not be lower than original scripts.
The new scripts remain very small (less than 4KB -- as page cache): tce (2753 Bytes), tce-size (2499 bytes), select (1353 bytes), provides.sh (945 bytes), search.sh (921 bytes).
Also I commented each script, in its top, with which busybox was explicitly used. Sample:
# /usr/bin/tce call scripts from /usr/bin/{search.sh, provides.sh, select, tce-size}
# only used: /usr/bin/id, /bin/mktemp
# /usr/bin/search.sh only used: /bin/gunzip, /bin/date, /bin/awk
# provides.sh only used tc-functions:getMirror, /usr/bin/wget, /usr/bin/zsync, /bin/awk
# /usr/bin/select only used /bin/awk
# /usr/bin/tce-size only used: /bin/sed, /usr/bin/sort, /usr/bin/uniq,
# /bin/grep, /usr/bin/awk, /bin/gunzip, /bin/date, /bin/touch
Is any interest to have something like these (comments + explicit path busybox applets) in future Tc14?
EDIT: for provides.sh I did a substitution like:# getMirror from tc-functions
getBuild() {
ARCH=`uname -m`
case ${ARCH} in
armv6l) echo "armv6" ;;
armv7l) echo "armv7" ;;
aarch64) echo "aarch64" ;;
i686) echo "x86" ;;
x86_64) [ -f /lib/ld-linux-x86-64.so.2 ] && echo "x86_64" || echo "x86" ;;
*) echo "x86" ;;
esac
}
BUILD=$(getBuild)
verid=$(grep '^VERSION_ID=' /etc/os-release)
verid=${verid#*=}
getMajorVer=${verid%.*}
read MIRROR < /opt/tcemirror
MIRROR="${MIRROR%/}/$(getMajorVer).x/$BUILD/tcz"
and for tce one like:# checknotroot from tc-functions
if [ `/usr/bin/id -u` -eq 0 ]; then
echo "Don't run this as root." >&2
exit 1
fi
to avoid full tc-config sourcing for just few bytes functions.