Navigation: ( CryptoBoxDev, CryptoBoxDevCustomConfigure, CryptoBoxDevPreparation)

# Development workflow

## Preparations

You should have completed the steps described in CryptoBoxDevPreparation.

## Create a CryptoBox-LiveCD

The following steps can be executed in the order of their appearance.

Usually there is no need to repeat the whole process, after you changed some parts of the CryptoBox. Especially the first step (building of the base system with dfsbuild) may usually be skipped.

Every step of the building process must be executed as root.

### Build the base system

Run scripts/cbox-build.sh dfsbuild to create the base system for the LiveCD.

The result can be found in _builddir/cd1/image.

If you do not want to use the apt-cacher to save bandwidth and time, then you should modify the mirror-setting in dfs-cbox.conf (see CryptoBoxDevCustomBuild for details).

### Configure the base image

Run scripts/cbox-build.sh config to copy the CryptoBox-specific files to the base image.

TODO: link to cbox-build.sh-manpage

### Remove development features

The original base system, that was created by dfsbuild contains a lot packages and some scripts, that are only useful during development. You should remove them, as they cause severe security implications.

To reduce the CryptoBox-LiveCD to the usable minimum for operational use, you should run scripts/cbox-build.sh harden.

### Create an iso image

To burn a CryptoBox-LiveCD, you need an bootable iso9660-image.

Create the iso image with scripts/cbox-build.sh iso. The resulting file can be found at _builddir/cd1/cryptobox.iso.

### Burn the CD

Do it manually:

    cdrecord -v dev=0,0,0 _builddir/cryptobox.iso

(change the dev setting according to your setup).

Let the script do it for you: scripts/cbox-build.sh burn (maybe you have to change the CDWRITER setting in cbox-dev.conf - see CryptoBoxDevCustomBuild).

Of course, it is not wise to use CD-R media. CD-RW consume less resources.

## Test the CryptoBox-LiveCD

This section is only useful for developers, who want to improve or change the CryptoBox system.

### Chroot: quick & dirty tests

If you modified the perl- or shell-scripts of the CryptoBox, then you can check for syntax errors by running them in a chroot environment. Be careful: you have access to all ressources of your computer, while you are working within a chroot environment - so you can easily repartition your real disk ...

To start a chroot environment, you can execute scripts/cbox-dev.sh chroot.

For more intensive tests, you may use qemu (see below) or burn real LiveCDs - of course this would take much more time.

### Qemu: nearly complete emulation

The processor emulator qemu allows you test the CryptoBox in a virtual environment, that is completely separated from your real computer's resources. It is the tool of choice, if you do nat have a real computer around for testing.

Beware - there are some problems, when using qemu:

- smbd does not start (segfault)
- ???

To start a qemu emulation of the iso image, you may type:

    scripts/cbox-dev.sh qemu

## Debugging and merging

This section is only useful for developers, who want to develop on a running CryptoBox system (emulated or real).

You may access the CryptoBox directly or you can use ssh to open a remote session:

    ./cbox-dev.sh ssh

### Development on a running system

When you run an emulation or test a real LiveCD, you may encounter problems and bugs. To test your fixes for these problems, it is convenient, to change the running test system. Afterwards you can merge these changes to your local development copy.

Type scripts/cbox-dev.sh diff to see the changes, you made on the running CryptoBox system.

Type scripts/cbox-dev.sh merge to merge these changes to your local working copy.

### Copying a testversion

Alternatively you may also upload a new version of your local working copy to the running CryptoBox system.

Type scripts/cbox-dev.sh upload - beware: all recent changes you made to the running CryptoBox system, are lost.

## Setting up a new Release

Once you finished your development, you surely want to make a new release. Please read the instructions in the releas-policy.txt it will save you a lot of time! Then you basically just have to run scripts/cbox-build.sh release and get yourself a good coffee. After the command has finished you'll see the releasefiles in _buildir.

## Comments