finstall Achitecture page
This page describes the current (as in: work in progress) architecture of finstall and supersedes any previous documentation on this topic.
Back end
Back-end is a network server application written in Python that forks to background. Serves XML-RPC messages and broadcasts announcements of its presence so networked front-ends can connect.
XML-RPC is a stateless protocol, and most of the operations the server does (like: GetDrivePartitions, AddUser, etc.) are also stateless (though some like the AddUser example before have implicit side-effects). Some actions, however, require strong state keeping and/or are not suitable for synchronous RPC operation. Those are usually also long-lasting and so are implemented as asynchronous threads in the server, named "jobs", whose progress can be queried from the front-end. Some jobs (like InstallJob) implicitly require other jobs to be finished first (like PartitionJob). Their order of invocation in current implementation is canonical.
The back-end invokes standard system utilities (command-line programs like sysctl, fdisk, etc.) to do the work.
Future work
The big features that need to be implemented soon are:
- Partitioning support (this is actually mostly implemented, but not tested enough and without GPT support)
- Fine-grained package selection support
- Support for installing soft-RAID devices (for starts, gmirror).
- X.Org configuration on the installed system
- mDNS / Zeroconf broadcaster
The intention is that the back-end is available for use for multiple front-ends, some of which could have user interfaces (either graphical or textual), but some of which could be completely automated (essentially a batch file of XML-RPC calls). The long-term intention for the back-end is for it to be written in C (for example using the BSD-licensed xmlrpc-c library) so it could be included in the base system and become a system-wide configuration backend.
A part of the plan was to use mDNS for broadcast but since the mDNS project from SoC 2007 wasn't completed on time and was not friendly to scripting languages, this was temporarily replaced with a custom UDP broadcasts.
Front end
Front-end is a Python application using GTK for user interface. It implements a "wizard-like" interface with standard "previous -> next" behaviour.
The user interface itself is developed using GLADE, and has home-grown support for GUI and text templates, enabling work on different steps of the wizard interface without trampling other steps. The interface relies on standard GTK look and feel. Steps of the wizard modify the internal state of the front-end installer. As such, the front-end drives the stateless back-end.
Most function calls are synchronous, gathering or setting such information as network interfaces' states, etc. Asynchronous long-lasting jobs are presented in the interface with a "progress bar" updated from GTK GUI timers (asynchronously but within GTK thread-safety).
This front-end is started from an icon placed on the LiveCD's X.Org + XFCE desktop.
Future work
Future work for the front-end mostly mirrors that of the back-end:
- Partitioning support
- Fine-grained package selection support
- Support for installing soft-RAID devices
- X.Org configuration on the installed system
- mDNS / Zeroconf client
- Localization
Other
Other things currently done for the finstall project are:
- ISO image building script (makeimage.py), which creates LiveCD images with a selection of packages and with integrated finstall.
- Documentation, in wiki-formatted text files, which includes Developer's documentation (about the internals of finstall's front-end and back-end) and Makeimage guide (for using makeimage.py).
SourceForge project http://www.sf.net/projects/finstall , accessible to potentially interested developers (there's currently one more in addition to myself) without freebsd.org accounts.
Overall
Current state of finstall is that it's usable for simple installs on blank drives. This install mode will set up a default partition layout in any of the chosen file systems (UFS+SU, UFS+GJ, ZFS, ext2), install the base system and default packages and configure basic system properties and services (like hostname, network interfaces, sshd, etc.).