When I read gerald_clark's post about '/opt' I thought that this would be a good idea. So I did some "crude analysis" about the files in '/opt' and where they are used:
(1) First off let's recap what '/opt' represents in TC: AFAIK those are system-wide settings, e.g. which repository/mirror to use, which files to backup (or not), etc. This is in contrast to the other two "areas of persistence", i.e. "tce" and "home". The former being the local extension repository (and the files controlling the use of those extensions), and the latter being the user-specific settings (and what other files the user chooses to possibly keep in either a backup file or on a home partition).
(2) I wanted to find out what files are used in '/opt'. So I took a look into the initrd of a "plain" TC 2.9 system:
tc@box:~$ mkdir extr
tc@box:~$ cd extr
tc@box:~/extr$ mount /dev/hdc
tc@box:~/extr$ zcat /mnt/hdc/boot/tinycore.gz | sudo cpio -idum
30226 blocks
tc@box:~/extr$ find . -type f | while read f ; do
> sudo strings "$f" | grep 'opt\/' | sed "s#^#${f}: #"
> done | sed -e 's#: .*\(opt\)#:\1#' -e 's#[ ;"`)|].*##' -e "s#'.*##" \
> -e 's#:#: #' -e 's#/$##' -e s'#^\.##' -e 's#: opt#: /opt#' > /tmp/use-opt
If one wants to know which files in '/opt' are used, the answer can be found this way:
tc@box:~/extr$ sed 's#.*: ##' /tmp/use-opt | sort -u
/opt
/opt/.appbrowser
/opt/.backup_device
/opt/.filetool.lst
/opt/.tce_dir
/opt/.xfiletool.lst
/opt/backgrounds
/opt/bootlocal.sh
/opt/jwmThemes
/opt/kde
/opt/shutdown.sh
/opt/tce
/opt/tcemirror
OTOH, if one wants to know which script, executable or settings file (contained in the initrd) uses files under '/opt' the result is:
tc@box:~/extr$ sed 's#: .*##' /tmp/use-opt | sort -u
/etc/init.d/rc.shutdown
/etc/init.d/tc-config
/etc/init.d/tc-restore.sh
/etc/skel/.wmx/Tools/Add_to_Bootlocal
/etc/skel/.wmx/Tools/Add_to_Filetool
/etc/skel/.wmx/Tools/Add_to_Xfiletool
/etc/skel/.xsession
/opt/.filetool.lst
/opt/.xfiletool.lst
/usr/bin/appbrowser
/usr/bin/appsaudit
/usr/bin/exitcheck.sh
/usr/bin/exittc
/usr/bin/filetool
/usr/bin/filetool.sh
/usr/bin/netcardconf
/usr/bin/ondemand
/usr/bin/tce-audit
/usr/bin/tce-fetch.sh
/usr/bin/tce-load
/usr/bin/tce-setdrive
/usr/bin/tce-setup
/usr/bin/tce-update
/usr/bin/tcemirror
/usr/bin/wallpaper
/usr/lib/libfltk_images.so.1.1
The first list contains a few "surprises" (e.g.
/opt/.appbrowser referenced by /usr/bin/appbrowser,
/opt/jwmThemes referenced by /etc/skel/.xsession, and
/opt/kde referenced by /usr/lib/libfltk_images.so.1.1)
but otherwise it looks like what one would expect.
(3) With all those details now a bit more "visible" I wonder:
- Does it make sense to possibly "mix" the 'opt' and the 'tce' directories (as suggested by gerald_clark)? I personally believe they have to remain separate as they represent different things.
- Is there a need to have some files hidden and others not? Why not use e.g. tce_dir instead of .tce_dir?
- If one wants to "free up" the 'opt' area to not clash with other systems what might be a better option? Well, for system-wide settings the typical place is under '/etc'. So how does '/etc/tce' sound? (BTW, if you look on a big commercial UNIX systems (e.g. Solaris) one might be surprised how much gets put under '/opt', e.g. all GNU tools/compilers, etc.)
- Do those "surprise" files listed above need a bit of attention?
In summary, I believe there might be a need for a separate "location" for system-wide settings and scripts. Whether the name 'opt' is the perfect choice is almost a question of personal taste, but a major version change (i.e. TC 3.x) would be the right time for an adjustment.