The BeleniX 0.7 Ride

The 0.7 release of BeleniX marked a significant step forward in the evolution of the distro. Till 0.6.1 the distro was mainly confined to a LiveCD with harddisk installation being quite clunky. There was also a lot of underlying hackery present to get all the livecd functionality.

The 0.7 release marks a back to basics approach with massive re-engineering and cleanup from the base. 0.7 is essentially a source-level derivative of Project Indiana just as Indiana itself is a derivate of the earlier BeleniX train (sadly very few recognize the fact). Every piece of the 0.7 release is cleanly setup and packaged properly. This includes all custom branding and configurations. Thus the branding is preserved even after harddisk installation. 0.7 also introduced a properly themed and configured KDM login manager with the option of dropping down to console login. Something that GDM in GNOME lacks. All these required a lot of effort in development and testing time burning a lot of mine and others free time. This activity started with my work on building the complete KDE 3.5.8 suite using Gcc on SXDE. I wrote a whole lot of spec files for KDE and apps. These can be found in the SFE repository. These were later copied to the BeleniX svn repository. I got valuable feedback from users of my KDE 3.5.8 packages on SXDE helping me fix a bunch of shortcomings and commit those upstream.

The story of 0.7 is essentially Unix from Scratch starting with building the OpenSolaris source. Here is a summarized point by point account of what I went through:

Start with an SXDE Build 78 installation:

  1. Start with my KDE 3.5.8 + dependencies spec files for SXDE (you can mention my name for this) and build and install them on SXDE to test.
  2. Build ON from source and patch packages till all the references to closed non-redistributable objects are removed and all packages build successfully.
  3. Build the FOX gate and fix some packaging issues.4) Build SFW gate on SXDE B78.
  4. Now populate an alternate-root image with all the ON, FOX and SFW packages using a couple of Perl scripts from the livekit (

Now we want do to chrooted builds inside this alternate-root image. However this alternate-root image is not yet chroot-capable as it is missing some critical pieces like libm. The following additional pieces had to be put together and installed into the alternate-root:

  1. SUNWlibm*, Medialib, SCCS, make, SUNWlibC, libmtsk from DevPro consolidation:
  2. OpenMotif modified to be partly compatible with Solaris Motif from earlier BeleniX releases.
  3. Mozilla NSS/NSPR – really tricky to build.
  4. SVR4 packaging and libs from the Slim Install repository. We were using a point in time snapshot of the repo so references to some libs were missing in the packages though they were built in the proto area, so we had to add the pkgdefs for SUNWadmlib-sysid and SUNWwsr2

We had to patch the slim_install repository to change all the output text in all the source files to be relevant for BeleniX. Shouldn’t all these text be in a common header for ease of use by other distros ? Change all the branding to BeleniX branding.

Okay looks like we have a working altroot now lets try a chroot. Yep it works but there are other problems like not having /etc/mnttab, /proc and so on. To cut a long story short we
have to do a series of loopback mounts for a properly functional chroot env.

Now that we have a working chroot env do the following inside of the chroot:

  1. Copy /usr/lib/cpp and /usr/bin/as from SXDE into the altroot – yay we now have these as redist in
  2. Install SUN Studio 11 in the chroot.
  3. Re-build a whole bunch of SFE packages including full KDE 3.5.8 and Xfce 4.4.1 from the Xfce spec-files mercurial repo. Yep networking works inside the chroot – yay.
  4. Grab JDS specs from the 2-20 branch and build them. Yikes the 2-20 branch is broken left, right and center, so I had to patch it left, right and center! All our patches are in the SVN repo.

Whew we now have an initial set of packages to work on. Next steps:

  1. Grab the distro constructor and create our belenix constructor. We made a bunch of changes:
    • Add the ability to use SVR4 packages in addition to IPS. This was done in a modular fashion preserving the ability to use IPS.
    • Add in a couple of pieces from the Livekit needed to handle SVR4 packages.
    • Build a microroot construction mechanism based on my suggestion on the Indiana list here:
    • Since we like our microroot to be as small as possible I chose to go with a 32-bit only microroot (75MB) for now.
    • Make changes to compress files unneeded in LiveCD env and all 64Bit stuff into an archive. This archive is compressed using 7Zip ultra compression. An additional list called archive_paths is maintained that list additional directories and patterns to be packed into the archive. For eg. the kopete pattern is listed so that all files belonging to the kopete IM app in KDE are packed up as we already use the lightweight Xchat in the LiveCD env.
    • A variety of sundry other stuff related to belenix branding and KDE stuff.
  2. Play with the new belenix constructor and fix numerous problems till we get a working LiveCD – long story πŸ™‚
  3. Prepare packages for all the usual BeleniX utilities like Ext2 and NTFS mount, prtpart, DTraceToolkit Doc Viewer, man enhancement, etc.
  4. Prepare a BeleniX-Branding package containing all the branding images, theming and customizations. /etc/skel is populated properly so newly created users will get the theming correctly.
  5. Prepare a LivecdTools package that contains all the livecd-specific components. This package is removed from the installed system.
  6. Lots of testing and modifications – blood, sweat and tears πŸ™‚

From subsequent releases our aim is to build everything including ON in BeleniX itself – lofty goal of being self-hosted.

Finally here is the exact series of loopmack mounts needed to get a chroot functional enough to allow builds using SUN Studio or Gcc:

mount -F lofs /proc <chroot path>/proc
mount -F lofs /etc/mnttab <chroot path>/etc/mnttab
mount -F lofs /dev <chroot path>/dev
mount -F fd -O fd <chroot path>/dev/fd
mount -F lofs -O /devices <chroot path>/devices/
mount -F lofs /opt/SUNWspro <chroot path>/opt/SUNWspro
mount -F lofs /var/run <chroot path>/var/run
mount -F lofs /opt/SS12 <chroot path>/opt/SS12


2 thoughts on “The BeleniX 0.7 Ride

  1. Paul M

    thanks for the loopback mounts. I was trying to patch a system by splitting mirrors, and chrooting into the mounted detached mirrors… df -k would fail and so would patching as it couldn’t determine space available.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s