I played a little with TC16 64 bits, by extracting the corepure64.cpio (from latest virgin core.gz) in a temporary folder. I try to "reproduce" one file at a time the logic of TC run flow, starting from an empty chroot. FYI, I have /bin and /sbin simlinks to /usr/bin, and /lib simlink to /usr/lib, (for faster searching, but it should not matter).
My observations:
1. the sh (or ash) in the latest busybox has buit-in commands echo and history. So there is no need for sim-links or file history.sh. Yes, I know, not big deal, not even speed or space gain, but if we want to be pedantic / minimalist, then we can remove redundancy. Same logic like why not to have already a /home/tc/ per-populated in core.gz and eventually rename user tc in whatever other user, by using "sed" if a parameter in command line is provided, instead of copy the /etc/skeleton. (Yeah, because we count few 4KB in RAM for x86_64).
2. in /etc/init.d/rc.shutdown , improvment for tcz and "scm" extensions, by first to check for [ -d /apps ] and for [ -d /tmp/tcloop ] before we ask the artillery for functions like ash (for),mount, awk, unmont.
# Unmount all tcz extensions that were mounted into /tmp/tcloop via loopback
for loop in $(mount | awk '/\/tmp\/tcloop/{print substr($1,10,3)}'|sort -nr); do umount -d /dev/loop"$loop" 2>/dev/null; done
# Unmount all scm extensions that were mounted into /apps via loopback
for loop in $(mount | awk '/\/apps/{print substr($1,10,3)}'|sort -nr); do umount -d /dev/loop"$loop" 2>/dev/null; done
3. Maybe add and extra condition for searching for swap to unmount (like blkid type swap?), not only if was initially in TC command line, if ! grep -q "noswap" /proc/cmdline; then
echo "${BLUE}Disabling swap space.${NORMAL}"
swapoff -a 2>/dev/null
fi
because maybe the user wanted later to add a file / partition swap, not when booted TC. YMMV.
FYI; I can live without any improvements, but I wanted to contribute back a little.