Linux.com

Feature: Linux

Building a distro

By Farrell J. McGovern on January 03, 2005 (8:00:00 AM)

Share    Print    Comments   

You download a CD or maybe a diskette image, transfer it to the appropriate media, boot your computer with it, and voilà, you're running Linux. It sounds so simple -- but a great deal of work goes into creating that software. Beginning about two years ago, I spent a year and a half building a desktop-oriented GNU/Linux distribution named MfxLinux, designed to be tightly integrated with Crowell Systems' Medformix medical office management system. Along the way, as with any project, a lot of design and implementation decisions had to be made -- some of which worked out better than others.

My main job at Crowell was as the primary developer of its distribution. Most of the design decisions were mine, but some were dictated to me, and some came from a consensus of the technical staff at Crowell.

The goal of the project was to replace Windows workstations, saving time on support, removing the prevalent threat of malware, and increasing reliability. Additionally, the company's developers wanted to get away from the moving target of Windows APIs. GNU/Linux's Unix heritage means that its APIs are stable.

The first choice any potential distro creator needs to address is whether to base the distro on an existing one or build it from scratch. Unless you have encyclopedic knowledge of Unix, a great deal of time or the need to serve an extremely specialized environment, it is easier to start with another distro.

Most derivative distros are based upon Red Hat, Debian, or Slackware. Of them, Slackware is the oldest. I started using Slackware in 1993, and therefore I was very familiar with it. Slackware is easy to modify. The package system is simple to work with and build packages for. It has an unencumbered init script structure, and you can install software from source without worrying about breaking dependency databases. Plus, Slackware author Patrick Volkerding does a good job of keeping even older versions of the software up-to-date with security revisions.

Crowell already had a tool that would take a functioning system, turn it into a series of tarballs, and, with a basic install program, burn it onto a bootable install CD. It had been developed to install a server Linux distro I had been writing for the company a couple of years previously. All that was needed was a working system to clone.

I began by installing everything from the Slackware 9.0 CDs, then slowly removed packages as I decided what we did and didn't need.

Configuring Slackware is fairly easy, but configuring X Windows was a more arcane process. I had played with a Slackware derivative called College Linux that had a nice X configuration setup. I took parts of it and adapted them. With some glue scripts, I created a hybrid of the College Linux and Slackware configuration scripts that was easy to use and worked well. With that setup, you could load a system and have it functional in 20 minutes.

The desktop side

I chose KDE as the window manager because it has the most Windows-like interface available for Linux, and that would make transitioning Windows users to Linux easier. Although the KOffice Suite has a good word processor, it takes a long time to load, so I suggested we use Abiword, as it was the fastest-loading GUI-based word processor and had lots of features. As the system evolved, we needed some features that AbiWord didn't have, so Crowell paid Dominic (Dom) Lachowicz, the overseer of AbiWord, to add the features we needed, but this didn't work out, and we ended up switching to OpenOffice.org.

My next challenge was support for the flatbed scanners used for imaging things like medical insurance cards. SANE kept my sanity in place, and Kooka, KDE's scanner application, gave us a consistent interface. Doctors' offices do a lot of scanning, and thus continually replace their scanners. Windows scanning programs that come with scanners have no standard interface, which required rewriting the integration software and retraining staff every time each office purchased a new scanner. Kooka gave us a standard interface for all scanners.

A somewhat related topic to scanners was digital still cameras. When connected to the client, some appear as USB storage devices, others interface via SANE, and a whole bunch are supported by gPhoto2. This gives Linux some very good support for digital cameras.

Next, I tackled integrating multimedia support with a Web browser. Linux has wonderful tools for creating and playing back audio and video, but until recently, trying to get them properly integrated with a Web browser was a challenge. The alternative was to get things working using MIME types and launching separate applications from within a browser. Tighter integration can be time-consuming, and involves a myriad of changes to allow the browser to access the various multimedia devices. I wanted a stricter file permission rights model, but I was overruled, and we just gave all the devices global read/write/execute permissions. Thus anyone who could log onto the system could access these devices. This was not a good idea from a security point of view, but the CIO considered our environment a "trusted" one, so that's how we set things up.

The next piece of the multimedia puzzle was integration with the Web browser, Mozilla. At the time only RealPlayer could be properly "swallowed" into a Web page, rather than being spawned to a separate window running the multimedia application. I had to fight with MIME types and the browser's support for spawning outside programs to support the media types we needed. These days, there are free programs like mplayerplug-in and gxine that allow you to properly integrate most multimedia types into a Web page. CodeWeavers' Crossover Plugin can also do the trick, but it costs.

We replaced Mozilla with Firefox as our default browser with the distro since it loads fairly quickly, has a smaller footprint, and is very fast. After a few deployments, we found a problem; many of the doctors did online billing to insurance companies via a Web interface, and a good number of those insurance companies had a Web site that demanded Internet Explorer or Netscape, not Firefox.

After a bit of searching, I ran across an add-in for Firefox that would solve the problem. User Agent Switcher gives you a pull-down menu choice that causes the browser to change the identity string it sends to Web sites to essentially anything you want, which allowed Foxfire to masquerade as Netscape.

The server side

Early on we decided to build one distribution for both the desktops and the servers. We wrote a script to be run after the install that would configure a machine one role or the other. This would replace the Red Hat-based server distro that I had developed for them previously.

We used IBM's xSeries eServers. For storage, these servers use the ServeRAID controller cards, whose Linux drivers are maintained by Adaptec. As development on the 2.6 kernel ramped up, the code in the 2.4 kernel started to lag behind, and often I had to patch the kernel by hand with the latest sources emailed to us from the code's maintainer. Not fun. We should have chosen the 2.6 kernel to start with, but as always, hindsight is 20/20.

We also had to deal with the WAN interfaces for connecting offices via T1 or frame relay connections. Originally, we used Cyclades WAN interface cards, but we found the company to be very bad at maintaining its 2.4 kernel code, and not very responsive to our inquiries. I did some research and found Sangoma had good quality WAN cards with good Linux support. Their code was always up-to-date in the 2.4 kernels, the developers loved Linux, and they were always willing to give us a hand. So we switched. We also needed to support a range of DigiBoards; some had support in the 2.4 kernel, others had to be patched into the kernel. It took a lot of compiles to get the right combination of building some as loadable modules, others compiled into the kernel. We needed two kernels, one with SMP support for the servers, and another for servers and workstations without SMP. Toward the end, I also updated the kernel for Serial ATA, as the newest workstation were using it.

The far side

One of the last things that I did with MfxLinux was enable desktop sharing on KDE with password protection. Desktop sharing is a compatible derivative of VNC. With it, we could connect to a system and actually see a problem a user was reporting. As the clients' workstations were behind firewalls, standard VNC was unusable. TightVNC, on the other tentacle, had the capability to transparently tunnel through the firewall to the workstation. It's also easy on bandwidth, due to using OpenSSH's compression. TightVNC rocks.

With all that software in place, virtually everything that the customers used to do on Windows systems could now be done on GNU/Linux. MfxLinux solved real problems, saved people time and money, and provided a more secure computing environment suitable for HIPAA and Sarbanes-Oxley regulations. The close integration of MfxLinux and Medformix is a great example of how GNU/Linux can be used to build an enterprise caliber FOSS system that reduces problems for both the users and support staff.

When I parted ways with Crowell Systems, I had delivered an easy to install and use Linux distro, with integration with Medformix. Despite the compromises, it was just what the doctors ordered -- literally!

Share    Print    Comments   

Comments

on Building a distro

Note: Comments are owned by the poster. We are not responsible for their content.

Excellent but limited article

Posted by: Preston St. Pierre on January 03, 2005 06:28 PM
The information in the article is excellent, but there is one main part missing that basically makes it so the rest of the information is useless: Those scripts the company made that would package everything and create an installable ISO. What was in those scripts? If you can't give us the scripts, please tell us what the general idea was behind what they did.

Good article, and I look forward to learning more (especially in the area I mentioned).

#

Re:Excellent but limited article

Posted by: Anonymous Coward on January 03, 2005 06:45 PM
I agree. The article covered a lot of topics, including the politics of building an open-source distribution in a seemingly closed-source environment. However, he failed to signicantly expand the topics, once introduced. It would have been nice had he gone into more depth on the technical details.

#

Re:Excellent but limited article

Posted by: farrelljmcgovern on January 03, 2005 08:25 PM
Thanks for the thumbs up on the article!

I would have loved to have dramaticaly expanded the article in all of the areas, but the kind people here at NewsForge only have so much space set aside for each article. Maybe at a latter date, they will ask me to create an expanded version. You can always ask them.

ttyl

          Farrell J. McGovern

#

Re:Excellent but limited article

Posted by: farrelljmcgovern on January 03, 2005 08:09 PM
Well, thanks for the complement on the article!

As for the installer, the company claims that the software is literally "patent pending", but in reality, there are many tools out there in the FOSS collective software archive that are as good, or better, and you don't have to worry about any potential patents.

In general, though, there is not much to the installer. It basically packages up the currently running system, splits the archives between however many CDs are needed, and has it's own set of install scripts on the bootable CD to install it on a computer. You could do as the College Linux people do; take the current Slackware install, and simply modify the install CD by adding a new package in to one of the install directories, or replacing an existing package, either new package would include all the software, files and existing files you delete that you add to/remove from the standard Slackware install. You could also do this with either Red Hat or Debian using their respective package system and building packages for them, but not as easily, IMOHO, of course.

ttyl

          Farrell J. McGovern

#

Re:Excellent but limited article

Posted by: Preston St. Pierre on January 04, 2005 06:52 AM
As far as that goes I have now found a way to make a custom Debian CD the way I want it (and quite easily). I'll explain here just in case anyone is curious.

Basically what I've done is taken the Debian net-installer CD and added a new directory containing all the packages and prerequisites of the software I want. I then wrote a script which is put into the startup folder and, at first boot, uses dpkg to install all the new software and then delete itself.

Its a bit of a hack job, but it works for me.

#

Plenty have their own

Posted by: Anonymous Coward on January 03, 2005 07:03 PM
Plenty have their own Linux distro. It would be interesting to see an overview of the smaller distros and what they stpecialize in. For example, The University of Michigan ™ has been rolling their own distro, called <A HREF="http://www.itd.umich.edu/umce/features/2004/linux.html" title="umich.edu">UMCE Linux</a umich.edu> to meet specific needs that weren't addressed by any of the existing Linux or BSD distros.


It's not that terribly hard to learn how to do and easy to show others how.

#

Re:Plenty have their own

Posted by: farrelljmcgovern on January 03, 2005 08:38 PM
I agree it is <i>relatively</i> easy to 'roll your own' derivative distro, but as that saying goes, the devil is in the details. With a good community base, that can be solved quickly, but the problem is building that community. With an educational institution, you already have a community to work with.

I haven't played a round with UMCE Linux, but I have been a big fan of College Linux from the people at the Swiss Robert Kennedy University. They did a bang-up job of taking Slackware, and modifying it to their needs.

Thanks for reading my article!

ttyl

          Farrell J. McGovern

#

OK, what are you waiting for?

Posted by: Anonymous Coward on January 04, 2005 01:06 AM
Newsforge accepts article proposals from anyone- go for it!

#

You miss the point!

Posted by: emk on January 04, 2005 07:36 AM
The point is not that anyone can do this. But that its is actually being done out in the wild!

I think this is a super article! It is well written, interesting and an enjoyable and informative read.

I for one did not know that companies were actually creating privately branded distros and deploying them for their customers. This sort of thing has always seemed to me to be the big promise of Linux from a business standpoint. And to think they only needed a single full time employee! It speaks volumes to the value of free software in the economy.

Now what I would love to see in Linux distros, is the ability to install to a livecd. An install time option that says "install to livecd" and installs the OS to an ISO image which you can then burn and later install to hard disk.

It would be a great way to create custom distros.

#

Good article. as usual, people are the problem!

Posted by: Anonymous Coward on January 04, 2005 01:23 AM
Thanks for a great article. As usual, the technical challenges are trivial compared to the people problems. Ya gotta love a mindset (The CIO and other management twits) that takes all this great code handed to them on a platter, then wants to goof it up and lock it up.

I also appreciate that this was developed for real-world users, and not just the usual gaggle of F/OSS users and hobbyists. The very thought of Windows mentioned in the same breath as medical records should scare the pee out of anyone who expects accuracy and privacy in their medical files.

#

Re:Good article. as usual, people are the problem!

Posted by: farrelljmcgovern on January 04, 2005 03:21 AM
Thank you!

Technical challenges are easy to solve, they just take a bit of intellgence, some perserverance and luck. People challenges would be easy too...but not since they outlawed the use of 2x4's...<evil grin>

And your last comment does strike home, tech support at the company used to spend most of it's time hleping people re-load systems or getting around problems caused by a virus/worm or other piece of malware. Since the database was on a Unix/Linux server, it was relatively immune to these problems.

Thanks for reading.

ttyl

            Farrell J. McGovern

#

Re:Good article. as usual, people are the problem!

Posted by: Preston St. Pierre on January 04, 2005 07:04 AM
Actually, I believe the use of 2x4s is still legal. However, you must use them in a defensive fashion (ie boarding shut the server room door and possibly all the users' keyboards in with it).

#

Excellent article

Posted by: Anonymous Coward on January 05, 2005 09:06 AM
I'm guessing the system imaging software is similar to a bunch of the "single system image" packages for Linux, usually used on Linux clusters. The biggest problem with such systems is that you end up making some assumptions about the system you're going to dump the image onto. What assumptions depends on what level you image at. If you're working at the file level, then about all you assume is that the set of files you've copied is the set of files you want to install. Which is normally the case.


If you copy at the partition level (dd if=/dev/hda1 of=part1) then you also assume that the partitions you're copying onto are all the same size. If you're in a fairly homogenius environment, that's also pretty normal. It's faster than file installs, if you've lots of files, at the price of needing a little more conformity. Likewise, disk-level copies are even faster (if you've a lot of stuff) but require virtually identical setups.

#

You are beating about the bush

Posted by: Anonymous [ip: 59.92.47.20] on August 26, 2007 02:01 AM
Why don't you let us know how to make a distro practically /
(Plz don't refer LFS to us).
Is there any other way of doing it ?

#

Building a distro

Posted by: Anonymous [ip: 24.207.124.135] on January 12, 2008 02:07 AM
heres a great guide to re-mastering a Linux distribution: http://www.cyberpunkcafe.com/page.php?31 very easy to follow. I didn't have to know anything really, and it covered the whole process.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya