This article will explain the basics of building a Cross-compiled Linux From Scratch (hereafter referred to as CLFS) system to be run/installed on your EEE PC.
NOTE: This article assumes a fairly in-depth knowledge of linux systems and their administration. It does not go into copious detail in most cases, but rather gives an explanation of what needs to be done at each step. Furthermore, it requires that you have access to another linux machine, since the 701 does not ship with enough free space to build a system locally (you may get away with it if you have the 8G (or equivalent) model). Not only is space an issue, but speed - unless you want to spend a week in front of your EEE watching packages compile, chances are that your desktop machine will be MUCH faster when it comes to compiling, which is the bulk of the work when building CLFS.
The process described below is entirely based on the instructions available in the CLFS book. CLFS is in turn based on the/part of the main LinuxFromScratch project. Many thanks goes to all those who made and continue to make those projects such a rich source of information and instruction on building linux systems from the ground up - they are the ones who have done most of the work from which we'll benefit.
Building a cross-compiled linux from scratch (CLFS) system requires quite a bit of time (it took me a few days to go through everything the first time, not including setbacks due to typos, mis-reading instructions, etc) and a lot of attention to detail. You can go through the Audience section of the book for an explanation of why you would want to do this and the pros and cons… however at this point let's assume that you want a) a very compact system for your EEE, and b) a highly optimized system. Both of these things are highly desirable on our EEEs, where resources (processing power, space, memory, etc) are at a premium.
For the most part, the instructions in the CLFS book can be followed pretty closely - the main differences come when we're setting up the disk and partition, building the kernel and installing the bootloader.
We're assuming that for the most part, you're following the instructions in the book. As such, we're only going to include sections below corresponsing to chapters/steps where you need to do something different than what it says in the book. You can follow the book sequentially, and simply check for in-between or replacements steps below…
Since we're not installing to/building on a 'standard' hard disk for a normal laptop or desktop machine, we're going to basically skip this step.
Instead, we'll simply create a directory which will act as the CLFS partition, and only near the very end will we then copy our final system onto the destination media, which it's assumed will be some kind of non-standard boot media (USB key, SD card, TFTP image, etc). It's just easier and faster to use a 'local' directory somewhere then to build CLFS on an SD card or USB key directly.
The important thing to realize here is that the contents of the directory we use to build the CLFS system will eventually be used as the root of our CLFS filesystem. Ie: if you're using /clfs as your CLFS directory, then /clfs/etc will end up being /etc on your final CLFS system.
From here on in, whenever the book refers to the mount point used for the CLFS partition, substitute the directory you've created.
So, make sure the partition where you'll be creating the directory has enough space (you need at least 2 gigs of free space to build CLFS, according to the book) and go ahead and create your CLFS directory:
$ CLFS=/clfs $ mkdir -pv $CLFS
Just in case you don't have your EEE handy while performing this step, the target machine type (ie: your EEE's build type) is:
At this point, if you're building your CLFS system using an i486-pc-linux-gnu machine as well, you may be wondering why you're using the cross-compile version of the LFS book, instead of the basic LFS or others. The reason is that cross-compiling is a very tricky operation, and even though the architectures are the same, you're still compiling code that is to be run on a foreign machine. Although it may work, you don't want to take any chances at this point since any errors or bugs, no matter how small, could affect the overall stability of the entire system you're in the process of building.
The authors of the CLFS project have already spent a lot of time and effort to ensure that the cross-compiling process used to build a linux system here is stable, and so we might as well make use of that instead of taking chances unnecessarily by following the 'standard' LFS process instead.
Note: if you are performing the LFS build on an 8G model (or similar EEE model with enough storage to build a system from scratch locally, then feel free to follow the standard LFS book instead, you'll simply have to take the instructions in this article and modify them as necessary.