Many of you following the OpenSolaris distribution should have heard about the Distro Constructor toolkit that allows one to build the LiveCD distribution of OpenSolaris. The Distro Constructor has it’s roots in the Live Media Kit which in turn was a re-whack of the toolkit used to build BeleniX 0.4.4.
After OpenSolaris 2008.05 was released I decided to pick the Distro Constructor toolkit available at that time and re-whack it into the BeleniX Constructor. There are several differences in the way LiveCD ISO construction is done in BeleniX and in the OpenSolaris distro. Given the way Distro Constructor is evolving today these differences will increase going forward both at the architecural and feature level. These considerations necessitated creating and maintaining a separate distro construction toolkit for BeleniX’s requirements. One of the most important differences is the way the miniroot is constructed. in addition BeleniX still uses SVR4 packaging. The differences are sufficiently fundamental to make it well nigh impossible to use Distro Constructor customizations to accommodate BeleniX requirements without patching the former.
Today the BeleniX Constructor lives in an SVN repository here: http://belenix.svn.sourceforge.net/viewvc/belenix/trunk/apps/belenix_constructor/
There is a README file in that directory that explains a bunch of things including various configuration settings. The top level directory structure and source code components is as follows:
|packages||Contains miscllaneous packages required for LiveCD at present this only has a Licensing package.|
|src||Contains all the source code for BeleniX Constructor.
|test_data||Contains base configurations for the BeleniX Constructor.|
|tools||A few tools used by constructor that are also useful by themselves.|
|usr||A remnant from some changes in the earlier Distro Constructor. Will be removed shortly.|
This is in essence a very high level view of the overall organization. Now if you wish to play with this utility can build custom LiveCDs, there are few steps:
- Check out the BeleniX Constructor tree: svn co https://belenix.svn.sourceforge.net/svnroot/belenix belenix/trunk/apps/belenix_constructor
- Next you need to set aside space for storing the packages and distro construction area. At least 15GB of space is needed.
- Lets assume that you are storing all the packages in “/export/pkgs” and “/export/livecd” is your distro construction area.
- Now you need to download all the required packages listed in “belenix/trunk/apps/belenix_constructor/test_data/pkgs.txt”. That file is in a SVR4 cluster definition format. It is very simple to understand once you take a single look. All the packages are available from “http://pkg.belenix.org/belenix_0.7.1/”. The packages are compressed using 7Zip. So you’d have to extract them as well and convert from datastream format to filesystem format. This is essentially a small loop in a shell script and is left as an exercise for the reader. Of course I will work up a tinny script and post it in a subsequent blog entry. Obviously these packages have to go into “/export/pkgs”
- Now it is time to configure the Constructor: cd belenix/trunk/apps/belenix_constructor/src; cp ../test_data/test1.conf .
- Edit test1.conf and setup the entries. The file is profusely commented and the settings are easy to understand. At the minimum you will have to set:
- TEST_DATA – This should contain full path to the test_data directory referred to above.
- DIST_MICROROOT_LIST – This contains full path to the belenix/src/belenix_constructor/src/microroot_list file. This is essentially a set of directories and patterns that are included in the ramdisk.
- DIST_METACLUSTER – This defines the cluster name as specified in pkgs.txt. Leave this unchanged.
- DIST_PROTO – This contains the full path to the proto or distro construction area. In our example this is “/export/livecd.
- DIST_ID – Name of the distro
- DIST_ISO – Full path to where the LiveCD ISO should be created. In our example this should be “/export/$DIST_ID.iso”
- DIST_PKG_DIR – Directory where all our SVR4 packages are stored. In our example this is “/export/pkgs”
- Once configuration is done. You are ready to fire off a build thus: cd belenix/trunk/apps/belenix_constructor/src; ./build_dist.bash ./test1.conf
Obviously drop an email off to belenix_discuss __at_ opensolaris (_dot) org if you face problems.