Phinos Installer Development

From PhoeNUXWiki v2.0
Jump to: navigation, search

Contents

NOTICE

As of early 2008, the PhoeNUX team has decided to move away from developing Phinos and is now using a customized version of the installer created by the Ark Linux team. We will leave this information here for historical reasons. At some point down the road we may decide to revisit this installation route, but that is a decision for another day. ZDD - 5/21/08

Introduction

Phinos (PhoeNUX INstalls the OS) is the installer for PhoeNUX OS. Unlike a number of operating system installers, this one is written in Perl using Qt as the user interface toolkit. While there may be more efficient, compiled C or C++ installers available, having the flexibility of being able to patch and run the installer without rebuilding it is a powerful reason to use an interpreted language for its development. Coupled with the ease of user interface coding, Phinos meets the goals design-wise to allow it to be useful for a number of projects.

Design

Phinos is designed on pseudo-object oriented and structured Perl. At present, we use only a handful of outside Perl modules. These are Proc::Simple, Perl::Config::IniFile, and PerlQt. The core of the hardware detection at present is done not in Perl code, but by the command line tool lshw version 2.03 or higher. However, all drive detection is done via DiskTools.pm, a totally Perl driven module. Additionally, the installation of the RPM packages are done using the apt command line tool via kapt-get, a PerlQt apt manager. While most of the heavy lifting is done using previously created command line tools, the installer does much of the logic and all of the UI to present the tasks being performed in the most user accessible way possible.

The class structure of Phinos incorporates the following classes at present:

Phinos
PhinosConfig
MainWidget
Detect
Fs
MntPntDlg
WarningDlg
InstallProgressDlg
Unpack
Post

The hierarchy of the classes is best shown using this UML diagram:

Following is a short description of the classes and what they do in the installer.

Phinos

This is the driver class of the entire application. At present it does not contain a typical set of KDE application arguments (see kdelibs documentation, kapplication.) The only arguments that currently are honored at present is --windowed. The long term plan is to have a command line switch (--patch <path to file>) which would patch the classes before running the application with a patchset loaded from the path supplied as the argument to the flag.

Public Methods

None.

PhinosConfig

This class creates an .ini configuration file object for reading and writing configuration items. The core of this class is designed around perl::Config::IniFile, a Perl module designed to make parsing and writing ini style configuration files simple. All options for Phinos' configuration will be wrapped in this class for access by the rest of the application.

Public Methods

MainWidget

This class instantiates and builds the main window of the application. At present, far too much logic is placed in this class for true division of labour. This class inherits from Qt::VBox, presenting itself as a QVBox object to the application.

Public Methods

Detect

Detect is a thin wrapper around a Linux powered computer. Presently much of the hardware detection is handled by the external lshw application. This class needs extended emmensly to fully detect all hardware and current software / operating systems presently installed on the target computer. Additionally, it would be greatly enhanced if the class did NOT rely on lshw, or if it did, only invoked it once, or twice at most, since it is a slow application to begin with.

Public Methods

Fs

Fs creates partitions, destroys partitions, formats partitions, creates swap formatted partitions, generates the /etc/fstab, activates swap, and mounts targets. Presently Fs will not generate non-xfs target partitions, so it cannot presently make reiser v3/4, ext2/3, jfs formatted targets. Also, Fs does not allow for UUID strings or drive labels for uniquely identifying partitions. These limitations must be overcome and NTFS/FAT filesystem resizing must be added to allow this class to act as the engine for an advanced partitioning tool for the installer.

Public Methods

MntPntDlg

MntPntDlg maps partitions to mount points and configures whether the system uses swap partition or swap files. Currently the mount points are limited to /, /boot, /home, /usr, /var, and the swap. This limitation must be overcome to allow enterprise customers to mount partitions to any location. Additionally remote exports must also be supported. Another limitation is that presently it does not probe for partition format nor does it support non-Linux native partition types.

Public Methods

InstallProgressDlg

This class shows the current progress of the installation. Currently far too much logic is in this class to satisfy seperation of model and view.

Public Methods

Unpack

Unpack is a wrapper around all of RPM's functionality. Currently does not support some of RPM's more advanced features, nor does it support the use of a dependancy solver tool such as apt-get, which will be needed to handle PhoeNUX OS updates and upgrades.

Public Methods

Post

Post performs the essential post installation tasks necessary for making PhoeNUX OS bootable. This includes generating the initrd, grub initialization, hardware discovery, and various configuration file edits in /etc/syconfig.

Public Methods

Screen Shots of it in Action

Below is some screen captures from a box in use: Image:Phinos-opening.png

Image:Phinos-eula.png

Image:Phinos-timezone.png

Image:Phinos-type.png

Image:Phinos-driveselect.png

Image:Phinos-mapmounts.png

Image:Phinos-warning.png

Image:Phinos-installing.png

Image:Phinos-finished.png

TODO List

Logan's goals for Phinos 1.0

Just a quick note before I start this. Phinos as we know it will probably be retired after the 1.0 series. Version 1.0 will coincide with the first stable release on PhoeNUX OS (at this point, I'm just hoping we call it 1.0, but it's still not 100% clear at the moment). In preparation for the 2nd major release of PhoeNUX, a new GUI will be written which will hopefully be easier to program and more modular than Phinos currently is. A lot of the backend code will likely be copied over though, and some code from Zack's curses-based installer, which is currently in the works, will most likely be used as well.

OK, here's the list:

  • Mirror selection needs to be added for the Network Install feature. Obviously we can do without this for the initial alpha release since we won't *have* any mirrors, but the capability will still need to be added into Phinos at some point.
  • After "Step 3 - Installation Type," I'd like to add another page that asks the user if they have a desktop or a laptop computer. If they have a laptop, the "laptop mode" will be enabled. Laptop mode hasn't been fully defined yet, but either way, it will just involve installing PhoeNUX-Laptop during the install process if they say they have a laptop, and doing nothing particularly special if they have a desktop.
  • The "Step 4 - Select Intallation Target" portion of the installer is really not very good. "Take over this drive," except for the fact that it hasn't been tested, is fine. It's much better than the "System Install" in Ark which left a lot of users frustrated. My problem is with the "Map existing partions" feature. It's been improved a bit throughout Phinos's development, but it's still a total kludge. It's all based around the paradigm of "do something with one particular hard disk." So, I can't make /dev/hda1 my swap partition, and /dev/hdb2 my / partition, for instance. This needs to be improved ASAP.
  • After the user selects his/her partitioning options, the install kicks right in. I think another page needs added with some minimal options for package selection. A list of checkboxes should do the trick: "Desktop Software," "Office Software," "Development Suite," "Server Tools," "Games," "Educational Software," and "Accessibility Software." Likely, just the desktop and office software will be checked by default.
  • We'll need to figure out how to generate a local apt repo, and make a sources.list for it.

GARY'S OLD LIST (for reference purposes)

- Make installer load at boot up with a dialog for skipping out of it. Also make this dialog control whether the konsole will be used to load it, or to just load right into it.
- Use Perl-Config-IniFile to create a mechanism for reading in a pre-scripted configuration for the installation, to make auto-install a possibility (read OEM install mode.)
- Create a custom partitioner that uses the gnu parted command line tool as the backend, which can do NTFS resizing with ntfs-tools. This must have better usability than QtParted and DiskDrake.
- Add additional package selection options. For instance, allow the user to install or not install the extra applications, servers, and development tools bundled on the DVD.
- Add l10n so non-American or non-english speaking people can use PhoeNUX OS.
- Bundle lshw and PerlQt-v3.009 and create a configure script to check if the target box needs them.
- Update Mode.

Personal tools