... What am I missing here?
AFAIK you are missing the point that in the past the location of the TCE directory was stored in '/opt/.tce_dir' (as a text string):
tc@box:~$ version
tinycore_4.1
tc@box:~$ ls -l /opt/.tce_dir
-rw-rw-r-- 1 tc staff 9 Jan 11 21:45 /opt/.tce_dir
tc@box:~$ cat /opt/.tce_dir
/tmp/tce
tc@box:~$
That meant that all scripts or programs had to read the contents of said file and then use this information.
Since Core 4.2 this has now changed insofar that there is no text file any more but a symbolic link (i.e. '/etc/sysconfig/tcedir'), which points to the TCE directory:
tc@box:~$ version
4.2
tc@box:~$ ls -l /etc/sysconfig/tcedir
lrwxrwxrwx 1 root root 8 Jan 8 16:56 /etc/sysconfig/tcedir -> /tmp/tce/
tc@box:~$ readlink /etc/sysconfig/tcedir
/tmp/tce
tc@box:~$
Therefore where in the past something like
TCE=$( cat /opt/.tce_dir ) could be use to read the value into a variable from now on this would need to be changed to
TCE=$( readlink /etc/sysconfig/tcedir )I guess for scripts to be compatible with both scenarios something like:
[ -f /opt/.tce_dir ] && TCE=$( cat /opt/.tce_dir ) || TCE=$( readlink /etc/sysconfig/tcedir )might be a way forward.