Interactive System Build

Introduction

Interactive system build is a new approach to creation of a startup disk image. You can collect necessary packages, test settings and monitor the result of your operations at the same time while testing the distribution.

Development of a new build method was intended for:
  • letting anyone create their own distributive of the system in accordance with their ideas and needs.
  • making the process of system building easier and more apprehensible.

Operation of Calculate Builder

It is possible to use interactive building mode with all Calculate Linux distributives starting from v9.8. To use the mode you need either to install the system on your hard drive with build option or use Builder load mode on a flash card or even a livecd.

At loading in builder mode the file system is arranged by three aufs2 layers:
  • The first layer (calculate) features livecd.squashfs system image which is booted from an external media and is mounted in read-only mode. This is the basis for the future distributive.
  • The second layer (delta) saves all changes made during building of the new distributive.
  • The third layer (workspace) is a working layer where you change the source system.

All three layers will be available in /mnt/scratch directory after boot.

You can run programs, change settings, create files; all your changes will be saved in the workspace layer without changing the final image of the new distributive.

The process of interactive building takes place in /mnt/builder directory which results from meshing of calculate and delta layers. You can monitor current changes while testing preferred applications during the building process.

The process of system building

Calculate package also includes cl-builder utility used to switch to interactive building mode.

Execute ''cl-builder'' to prepare the system for building. Afterwards invitation in the command line will become brown (the color may depend on the terminal type) and you will be in chroot environment of /mnt/builder. The following directories: /proc, /dev, /dev/pts, /usr/calculate/share will be mounted from the system, resolv.conf will be transferred. Thus right after executing cl-builder you can start to change the system. You can update portages (command eix-update) and update, install, and delete programs. The result of programs installation will affect the booted system. And still all your operations in the booted system will not affect /mnt/builder and will stay only in workspace layer. To avoid software conflicts always execute cl-builder.

After building is completed type exit in the console or press ''Ctrl+D'' to exit ''chroot'' environment.

Installation templates

Templates feature configuration files where changes of programs settings are saved. Templates may contain conditional blocks as well as inner variables for better configuration of the system.

Calculate package has two types of installation templates: ''basic ones'' (which are included into Calculate package) and ''user ones''. To create your own templates go to /mnt/builder directory.

Saving changes

As you have finished changing the current distributive and exited chroot environment, you can create livecd startup image that includes all changes made. To do so execute command:

calculate --iso

The startup image will be saved in an .iso file in /usr/calculate/share/linux directory.

If you booted from a CD or a flash card toy may run out of ram memory. In this case you will need to mount a free section from the hard drive or a network drive into /usr/calculate/share/linux directory, so that the file is created outside computer memory.

If you boot from a flash card, you can save changes in livecd.squashfs on the flash card. The sequence number of build will be added to the end of the file. The new image with all changes will be used at the next start. Old files with images will be deleted after new builds.

System installation

The ISO image after changing the current system is 100% compatible with Gentoo and has all the features of Calculate Linux.

The system can be booted from livecd, installed on hard drive, saved on a flashcard or even on a portable usb-hdd. It will still be possible to change the distributive via boot in ''build'' mode. Thus, you can change contents of packages via updating portages as often as you wish.

Examples

Adding browser Opera to CLS distributive at CD boot

Do the following:
  1. boot from a CD in ''Builder'' mode;
  2. execute command cl-builder in the terminal;
  3. make sure the cursor has changed its color. Then install browser with command emerge opera;
  4. type exit to exit chroot;
  5. mount the hard drive section if needed: mount /dev/sdaX /usr/calculate/share/linux;
  6. save changes in a new file with ISO image: calculate --iso.

Installing CLS on a flash card and updating portages

Updating portages may use a lot of memory, that is why this operation requires not less than 2 Gb of ram memory.

Do the following:

  1. boot from CD in custom mode;
  2. install the system on a flash card: calculate -d /dev/sdX (replace sdX with the required device name);
  3. restart your computer with an option of flashcard boot, choose ''Builder'' mode start in the menu;
  4. execute command cl-builder in your terminal;
  5. make sure the cursor has changed its color, update portages with eix-sync command;
  6. type exit to exit chroot;
  7. update livecd.squashfs file with calculate --rebuild command;
  8. restart your computer.

If there is not enough ram memory you should install CLS on the hard drive in ''Builder'' mode; then all changes will be cashed on the hard drive. ­''--rebuild'' option will be unavailable in this case, and the results of your operations will be featured in a new ISO image.

Adding window manager XFCE in CLS distributive via installing system on the hard drive

  1. boot from CD in casual mode;
  2. install the system in Builder mode on the hard drive with command ''Codeline|calculate --build --disk=/dev/sdaX'' (replace sdaX with the name of the necessary hard drive section);
  3. restart your computer and boot from the CD;
  4. execute command cl-builder in the terminal;
  5. make sure the cursor has changed its color, update portages with eix-sync command;
  6. install XFCE with emerge xfce-base/xfce4-meta command;
  7. type exit to exit chroot.
  8. save changes in the new file with ISO image: calculate --iso;
  9. save changes on DVD:
    growisofs -Z /dev/cdrom=/usr/calculate/share/linux/cls-9.9-i686.iso
    

    replace ''cls-9.9-i686.iso'' with your own iso file.

''Enjoy your work!''

Thank you!