Tuesday, February 24, 2004

For the past week or so I have been working on a minor linux project - installing Linux From Scratch. LFS 5.0 is the one I am working on, and it is downloaded as either a PDF file or a text file. Yes - a text file. The file is a detailed list of instructions on how to download, compile, and install all of the bits and pieces you need to create your own linux system from source code!

I found all of the required source packages and patch files in one place, also on the LinuxFromScratch website - downloaded this and began the process on a P450 with 128mb ram and 2 hard drives, a 6gb and a 7gb drive. I partitioned the 7gb as ext2, all one partition. The 6gb I made into a 2gb swap and a 4gb ext2 partition.

After extracting all of the source tgz (compressed) files into their separate folders in the /source folder, I followed the instructions, configuring and compiling all of the tools, compilers, utilities, and other bits that you need to have a functional linux system. As of now I am compiling the compiler for the third time - this time with the system set to use the newly compiled tools exclusively (chroot). It's nice to know that I have done it correctly so far!

I did discover that when the instructions say 'It is now safe to delete the source and build folders for this package', that it isn't a suggestion, and you should immediately delete the source and build folders. Also, keep all of the compressed source files, you will need them.

You see, the first time you build GCC (the compiler), you patch the source with two patch files, then compile it. The second time, you need those existing source and build folders - it warns you not to delete them - and so the second time you compile the compiler with newly compiled tools and a fresher system. After the second compile, it tells you it is safe to delete the source and build trees.

Ahh - this is where I messed up. I didn't delete them, figuring on saving time and keeping them for the third go-round.

The third time, you are supposed to re-extract the source, patch it again with two patches (OOPS - two DIFFERENT patches than the first time), and re-compile. I missed the section where it warns you NOT to apply the patches from the first compile run. Argh.

So, the compile failed several times in a row, I researched it to no avail - seems that several people had the same error at the same point, but nobody could help them.

I just deleted the source and build folders, re-extracted the source, re-patched like the book says, and now it compiled fine.

*whew*

I'm on the home stretch! It has taken a long time though, mostly working as I find time during the busy days. It's a learning experience too, and I am definitely learning!