3. Building Your DropIn

3.1. Creating the Filesystem

Whatever software you are building a DropIn from must be compiled first. There is no such thing as a “source DropIn” because the runtime of Repairlix is read-only, and therefore cannot be used as a development environment itself. DropIns are always bult outside of Repairlix.

So first you must issue whatever commands are necessary to compile the DropIn. If the source uses autoconf and has a ./configure script, you should create an empty directory as the target before issuing the build command. Take into consideration where your software is going to end up in the Repairlix runtime. If you want programs installed in /bin and libraries installed in /lib, you only need to create the high-level directory and use that as your prefix. Most DropIns ought to be installed in /usr/bin and should use the following form:

grasshopper:~$ mkdir -p /tmp/myproggie/{tmp,usr,etc}
grasshopper:~$ ./configure --prefix=/tmp/myproggie/usr --enable-move-all-zig \
grasshopper:~$ make && make install

This will usually cause the software to be installed into the empty directory /tmp/myproggie/usr. The temporary directory is usually a good place to stage DropIns, for the simple expedient that you do not have to become root to install software there.

3.2. Adding Configuration Files

Repairlix is a read-only filesystem, so you will want to supply a default global configuration file (usually in /etc) that contains a set of useful default settings. If you anticipate that the users of your DropIn will want to select different configurations or edit the configurations, you may want to supply a rlxconf module.

grasshopper:~$ vim /tmp/myproggie/etc/myproggie.conf
(Make changes)

3.3. Bundling

3.3.1. Creating the Tarball

This is simple. Tar up the directory you created in Creating the Filesystem. In dropinlib.sh, packaged with Repairlix, you will find a set of functions that make this easier. The following shell script can be copied and used as your base for bundling your DropIn. It relies on a shell function called dropinlib_bundleDI (in dropinlib.sh) to do most of the work.

# bundledropin : tar up the directory specified on the command line 
# as a Repairlix DropIn
DROPIN_KEYWORD=myproggie    # a short name for your DropIn
INDIR=/tmp/myproggie        # change this to the correct directory

# compile myproggie source
# . . .
# copy myproggie installation files to $INDIR for staging
# . . .
# make sure to include any libs that myproggie needs
# . . .

. dropinlib.sh
dropinlib_bundleDI "$DROPIN_KEYWORD" "$INDIR"

# copy the built dropin into the Repairlix dropins/ directory
# . . .

Note: When you run this script, set INDIR to the root of the DropIn, e.g. /tmp/myproggie, not the path to the prefix (i.e. /tmp/myproggie/usr).

3.3.2. Editing the Administrative File

This is an optional text file that accompanies the DropIn. It must have the same filename, with .conf at the end instead of .tar.bz2. The bundledropin script above creates a template for this file with the appropriate filename, which you can simply fill proper values into. Or you can create one from scratch as below:

grasshopper:~$ cat > myproggie-v1.0#91a77e1a.conf << tac
DROPIN_NAME="My Proggie"
DROPIN_DESC="This program is the ideal solution for moving all zig." 

  • DROPIN_NAME: This is a free-form text string which will be displayed in menus when the end user is selecting modules to drop into Repairlix at runtime. It should be kept to 30 characters or less, but otherwise can contain any text.

  • DROPIN_DESC: This is a long free-form text string which can provide a summary of the capabilities the DropIn adds. You may make the configuration file more readable by embedding newlines with backslashes (\) in the middle of the string, but you should not embed actual newlines such as ^M characters, as the string will automatically be line-wrapped when it is finally displayed.

  • DROPIN_KEYWORD: This is a keyword which can be typed at the command line to install a DropIn. It should be brief and may contain only characters valid in C variables (a-zA-Z0-9_).

  • DROPIN_SIZE: The size, in bytes, of the uncompressed DropIn data.

Again, all of the above parameters are optional, and you may put comments in the file by beginning a line with #. If you use the bundledropin shell script suggested above you will get the correct value for DROPIN_SIZE automatically.

3.3.3. Adding rlxconf Modules

The process for adding modules for rlxconf is as follows: