GoboHide
From GoboLinux Knowledge Base
As you might have already seen, GoboLinux adopts an alternative directory tree. As you might also be wondering, without the legacy tree a lot of common applications wouldn't work in GoboLinux. In order to allow both worlds to co-exist, a tool which allows symlinks and directories to be hidden was developed, called GoboHide.
GoboHide works by hooking directory read operations directly in the root of the problem: since every readdir() call is translated and performed by the kernel, we have added a list which is kept in kernel, checking every readdir() operation. If the current inode being read is stored in this list, then it simply doesn't get copied onto the destination buffer, which should be returned to the user.
The user's interface to the GoboHide ioctl's is through a userspace tool, called gobohide, and has the following options:
~] gobohide --help gobohide: Hide/Unhide a directory -h, --hide Hide the directory -u, --unhide Unhide the directory -l, --list List the hidden directories --version Show the program version --help Show this message
In order to hide a directory, one would need to run gobohide with '-h', passing the target entry. A subsequent "ls" will not show the hidden entry, then:
~] ls / Depot Mount System bin etc proc sys usr Files Programs Users dev lib sbin tmp var ~] gobohide -h /usr ~] gobohide -h /etc ~] ls / Depot Mount System bin lib sbin tmp Files Programs Users dev proc sys var
This allows entries to be really hidden from the filesystem. But don't worry, this can be only performed by the superuser, and he/she has power to ask the kernel for the entries being hidden. This ensures that nothing gets hidden without the superuser's conscience:
~] gobohide -l Hidden directories: /etc /usr
And the best of it all: you can still access your files inside these hidden entries, and even bash would tell you that files exist in these directories:
~] if [ -f /etc/fstab ]; then echo "ooookay"; fi ooookay ~] l /etc/zshrc rwxrwxrwx 28 /etc/zshrc -> /Programs/ZSH/Settings/zshrc ======================================================== 28 in 1 file - 7614808 kB used (96%), 388760 kB free
GoboHide currently supports hiding entries on any filesystem sitted on the top of the VFS. This includes EXT2, EXT3, ReiserFS, XFS, VFAT and any further filesystems incoming to the linux kernel tree.


