Very little has been done here. Not much is missing though. Look in the directory umsdos_progs.
[umsdos_progs/util/umssync.c,1]
#Specification: utility / synchroniser
The UMSDOS synchroniser (umssync) make sure that the EMD file is in sync with the MSDOS directory. File created during a DOS session should be add to the EMD. File removed should erased from the EMD.
The UMSDOS file system will operate normally even if the system is out of sync. However, files will be missing from directory search, creating an annoying feeling.
There is no easy way this kind of update may be achieved by UMSDOS transparently. Here are the reason:
This process take some time for each directory. If there were some access time in MSDOS for directories, then, based on boot time, it would be possible to do it once per directory. It is not the case.
When a file is discover in MSDOS which does not exist in the EMD, we need some directives to properly map the file. At least the owner must be known.
A set of ioctl are available (wrapper interface in umsdos_progs/umsdosio.c) to allow independant manipulation of the EMD and the DOS directory.
A utility is provided. It should be run from /etc/rc. A man page (umssync.8) describe its options.
[umsdos_progs/util/umssync.c,425]
#Specification: umssync / default creation mode
Unless override with command line option, file and directory created by umssync will be owned by root with mode 755 for directories and mode 644 for files.
[umsdos_progs/util/umssync.c,435]
#Specification: umssync / depth
Normally, umssync won't recurse into directory. Option -r allows for depth control. You may specify how deep you want umssync to work.
When recursing into directory, umssync will use the owner and group specified on the command line (see option -g and -u). If option -i+ is specified the specs of the sub-directory itself may be used.
umssync won't follow symlinks. And it won't cross mount points.
[umsdos_progs/util/umssync.c,85]
#Specification: umssync / mangled name
If a DOS file is missing from the EMD, it is added. If the file has an extension with the first character being a member of the restricted set for mangling, the operation won't be done. A message will be printed.
To synchronise back into the EMD, the file must be renamed. If one try to create a such a file with umsdos, it is automaticly mangled, producing a different file name in DOS.
This is always done to avoid the following problem
Unix command MsDOS file name created ============ ======================= mkdir DIR dir.{__ mkdir dir.{__ dir.{_1 ... mkdir dir.{_1 dir.{10
Now, suppose that dir.{__ does not exist in the EMD. dir.{_1 do exist in DOS. If we try to create it in Umsdos, this will create a mangled name. Mangling in based on the entry offset in the EMD.
So if say dir.{_1 exist in DOS, but not in Umsdos, rename it to anything (dir.111) and synchronise it in the EMD with umssync.
[umsdos_progs/util/umssync.c,367]
#Specification: umssync / mount point
umssync won't cross mount point. It means you must specify each mount point separatly.
[umsdos_progs/util/umssync.c,544]
#Specification: umssync / user mode
To execute umssync, the effective user id must be root. It it possible to configure umssync to run setuid root. In this case (when getuid() != geteuid()), umssync show a special behavior: Options -d -f -g -i -u are not available anymore. The inheriting mode is automaticly activated. No way to desactivated.
A user should be able to umssync its own directory. If a user apply umssync to a directory, all file uncovered will be given to the owner of the directory with restrictive permissions (600 for files, 700 for directory).
Another way would be to limit umssync operation to directory which belong to the user. Suggestion welcome.
[umsdos_progs/util/udump.c,4]
#Specification: utilities / udump
udump display the content of a --linux-.--- file (EMD file). Simply type:
udump file
This utility was mainly used to debug the UMSDOS file systems.
[umsdos_progs/util/udosctl.c,12]
#Specification: umsdos_progs / udosctl
The udosctl utility give acces directly to UMSDOS ioctl on directory.
udosctl command arg
Here are the commands:
ls:
List the content of dos directory arg. Bypass the EMD file. It uses UMSDOS_READDIR_DOS.
create:
Create the file arg in the EMD file. Do nothing on the DOS directory. Use UMSDOS_CREAT_UMSDOS.
mkdir:
Create the directory arg in the EMD file. Do nothing on the DOS directory. Use UMSDOS_CREAT_UMSDOS.
rm:
Remove the file arg in the DOS directory. Bypass the EMD file. Use UMSDOS_UNLINK_DOS.
rmdir:
Remove the directory arg in the DOS directory. Bypass the EMD file. Use UMSDOS_RMDIR_DOS.
uls:
List the content of the EMD and print the corresponding DOS mangled name. It uses UMSDOS_READDIR_EMD.
urm:
Remove the file arg from the EMD file. Don't touch the DOS directory. Use UMSDOS_UNLINK_UMSDOS.
urmdir:
Remove the directory arg from the EMD file. Don't touch the DOS directory. Use UMSDOS_UNLINK_UMSDOS.
version:
Prints the version of the UMSDOS driver running.
This program was done mostly for illustration of ioctl use and testing.