Directory structure

I wanted a structure which is pretty simple, and where every main directory has a very precise purpose. Nevertheless it should be similar to what is found on other Unix installations.

Also I wanted to have a dual view on each file, package to which a file belongs and kind/usage of file. I decided to install each "package" into a subdirectory of /opt and not directly into the /usr hierarchy as is done usually. The /usr directories would only contain soft links pointing to the real files under /opt, e.g /usr/bin/vim -> /opt/vim-5.5/bin/vim.

Device files.
Directory for all configuration files.
Home of all user directories.
Directory for mount points, like /mnt/cdrom.
Place into which packages are installed.
Parent of all link directories (bin, classes, include, lib, man).
Directory for temporary files. Cleaned out at each reboot.
Parent of all directories containing "variable" files, like log files, mail queues etc.

Getting the structure I want isn't that easy, because several programs and libraries except files in a special place. E.g. there are several instances in glibc where the shell "/bin/sh" is referred. Therfore I have to maintain these links, which I hope I can eliminate at some time in the future.

Link to /usr/bin.
Link to /usr/lib, needed because some fundamental libraries, are expected in this place, like /lib/ld.so.1 the ELF binary loader which is referenced in each executable.

I wrote the shell script makeDirs that will create all directories, set the desired owner and permissions, and create also just those devices I need. The script assumes, the current directory is the root of the directory tree. It will not erase already existing directories or devices. But will readjust permissions and ownership.
Note: this script is not up-to-date

Creating the links

The links are create using a semi-automatical method. The script makeLinks is maintained with the list of linking to perform. It can be either executed with the argument all, and will then recreate all links. Or it can be given a keyword which limits the work to those linkings flagged with that keyword. This reduces execution time, when a new version of a single package was installed, and only that one needs relinking.
Last updated: 1999-11-25 by Claudio Nieder