Building Tiny Linux Systems with BusyBox, Part 3
This is the third article in the series ``Building Tiny Linux Systems with BusyBox''. You'll need to refer to my last article (part 2) on kernel building in the January/February 2001 issue of ELJ if you don't have a paper copy of the previous issue on hand, you can refer to the on-line magazine archive at http://embedded.linuxjournal.com/magazine/issue01/4395/ [Part 1 appeared in the ELJ supplement (November 2000) and is available at http://embedded.linuxjournal.com/magazine/issue00/4335/.]
In this article, we'll add writable storage and a multiuser capability to your tiny Linux system, and when we're done the system will be much smaller than when we started.
Progress on BusyBox and its friends has continued since I wrote the first two articles, largely due to the efforts of Erik Andersen, whose name I so horribly misspelled in the first article. Erik's work on BusyBox and associated programs is supported by Lineo and benefits the entire Embedded Linux community. Erik and his colleagues have continued to contribute to BusyBox using the original license I chose, the GPL, and they have made great contributions to other embedded programs under the GPL and LGPL.
In my last article, we used the 2.2 kernel, due to a bug in 2.4. That has now been repaired, and since the 2.4 kernel has been released, let's try it. syslinux has also been updated to cope with the new kernel.
We'll be using some new software: TinyLogin and uClibc, and new versions of BusyBox and syslinux. Create a directory where you will work on this example, and change to that directory. Download the 2.4 kernel source from http://www.kernel.org or any of its mirrors. Download all of the files from ftp://ftp.perens.com/ELJ/3/. Read the README.txt file. Extract the compressed tar archives you've just downloaded. Don't run the shell script as_in_episode_2.sh yet. Build and install syslinux from the downloaded sources, replacing the old version if you've installed it on your system. Build BusyBox from the downloaded sources.
Take the time to install the 2.4 kernel on a BusyBox floppy, just to get comfortable with configuring and running it. We'll use some scripts in the elj-3 directory to spare you most of the typing you did in the kernel article.
If you still have the tiny Linux directory that we used in the second article, move it out of the way. We're about to create a new one.
Extract the kernel source and configure it as we configured the kernel in my last article under the subhead ``Build the Kernel'', but add two new features to the kernel if they are not already in it: the DOS FAT filesystem and the VFAT (Windows 95) filesystem. These are in the filesystems menu of the kernel configuration. You will need to use these filesystems on both your development system and your tiny Linux system, so you may end up building and installing two kernels. Remember, you need to keep the kernel on your tiny Linux system small, so it probably won't be the same kernel you run on your development system.
Go to the BusyBox source directory and edit the Makefile, setting DOSTATIC to true to build a statically linked version of BusyBox. Build BusyBox with the make command, and then run:
make PREFIX=../tiny-linux install-hardlinks
This will create the tiny Linux directory in the directory above the BusyBox directory and will create the bin, sbin and /usr/sbin directories within the tiny Linux directory. The Makefile will install BusyBox in that directory tree and will create all of the links for the various command names, automatically doing much of the work we performed manually in Part 2. It won't install scripts and files and won't create the /dev directory. One of the scripts you downloaded will do that. Change directory to ../elj-3 and run:
sh -x as_in_episode_2.sh ../tiny-linuxThat will create the contents of the /dev and /etc directories and anything else you need to make a ROM filesystem.
Now, follow the instructions in my January/February 2001 article under the subheadings ``Generate the ROM Root Filesystem Image'' and ``Build the Floppy''. Finally, boot the floppy to test it.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Server Hardening
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- The Humble Hacker?
- The Death of RoboVM
- Why Python?
- The US Government and Open-Source Software
- EnterpriseDB's EDB Postgres Advanced Server and EDB Postgres Enterprise Manager
- On Your Marks, Get Set...Gutsy Gibbon!
- Open-Source Project Secretly Funded by CIA
- ACI Worldwide's UP Retail Payments
In modern computer systems, privacy and security are mandatory. However, connections from the outside over public networks automatically imply risks. One easily available solution to avoid eavesdroppers’ attempts is SSH. But, its wide adoption during the past 21 years has made it a target for attackers, so hardening your system properly is a must.
Additionally, in highly regulated markets, you must comply with specific operational requirements, proving that you conform to standards and even that you have included new mandatory authentication methods, such as two-factor authentication. In this ebook, I discuss SSH and how to configure and manage it to guarantee that your network is safe, your data is secure and that you comply with relevant regulations.Get the Guide