Hotplug partition manager
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
2.2 KiB

  1. Directory "watch" contains everything necessary to monitor the status of
  2. hot-plug partitions. Its makefile builds the library watch.a
  3. Directory "annex" contains code used to read username, home and
  4. configuration file and provide the results to the rest of the program. It
  5. can also manage a pid file. Its makefile builds the library annex.a
  6. Directory GTK2 contains a main program and functions to implement a
  7. user interface based on GTK+-2
  8. The interface between the User Interface (eg GTK2) and the two
  9. libraries is declared in hopman.h .
  10. The application is essentially reactive: reaction to events in the Linux
  11. Virtual File System and to external signals, and reaction to user actions.
  12. The design favours the centralization of all reactions in one system call,
  13. typically select(), or a wrapper around it provided by the UI's library.
  14. The VFS is monitored by the mean of the inotify API. Three kinds of events
  15. are monitored:
  16. - creation of a device file in /dev
  17. - deletion of a device file in /dev
  18. - creation of a symbolic link in /dev/disk/by-label
  19. Five signals are routed to a pseudo-file by the signalfd API:
  20. - SIGALRM, generated by an interval timer to remind periodically to read
  21. /proc/self/mountinfo (configurable),
  22. - SIGWAIT, generated when a child process terminates,
  23. - SIGHUP, can be used to show the UI when it is normally hidden,
  24. - SIGTERM and SIGINT to gracefully terminate the application when it
  25. is killed by one of these signals
  26. The main program must be provided by the UI, it must call a number of
  27. functions provided in library annex.a and watch.a to read configuration and
  28. initialize inotify and signalfd. It must incorporate the file descriptors
  29. provided by these APIs in its select() wrapper and call watch.a functions in
  30. its corresponding callbacks.
  31. watch.a provides functions to mount, unmount and open the mounted
  32. partition(s) in either a terminal or a file-manager. The UI just needs to
  33. provide simple wrappers around these, and the configuration file must provide
  34. command lines to invoke external helper commands to perform these actions, eg
  35. pmount, pumount, thunar, xfce4-terminal. The commands are executed by /bin/sh.