3.2. Design

Take another look at the Bootdisk-HOWTO and notice how many utilities can be squeezed onto on 1.44M floppy. There are three things that make this possible. One is the use of shared libraries. The second is stripped binaries. And the third is the use of a compressed filesystem. We can use all of these techniques to save space on our root disk.

3.2.1. Shared Libraries

First, in order to use shared libraries we will need to rebuild the BASH shell. This time we will configure it without using the "--enable-static-link" option. Once BASH is rebuilt we need to figure out which libraries it is linked with and be sure to include them on the root disk. The "ldd" command makes this job easy. By typing "ldd bash" on the command-line we can see a list of all the shared libraries that BASH uses. As long as all these libraries are copied to the root disk, the new BASH build should work fine.

3.2.2. Stripped Binaries

Next, we should strip any binaries that get copied to the root disk. The manpage for strip does not give much description of what it does other than to say, "strip discards all symbols from the object files." A vast majority of these symbols are for debugging. While these debugging symbols are very helpful to programmers working to improve the code, they do not do much for the average end-user other than take up more disk space. Since space is at a premium on a floppy disk, we should definitely strip all of the binaries.

3.2.3. Compressed Root Filesystem

Finally, we can tackle the problem of how to build a compressed root filesystem. The Bootdisk-HOWTO suggests three ways of constructing a compressed root filesystem using either a ramdisk, a spare hard drive partition or a loopback device. This project will concentrate on using the ramdisk approach. It seems logical that if the root filesystem is going to be run from a ramdisk, it may as well be built on a ramdisk. All we have to do is create a second extended filesystem on a ramdisk device, mount it and copy files to it. (Note: For this to work, we need to make sure the kernel is configured with ramdisk support and a default size of 4,096K. If this is not the case we will know right away, because the filesystem creation and mounting of the ramdisk will fail.) Once the filesystem is populated with all the files that the root disk needs, we simply unmount it, compress it and write it out to floppy.