Tuesday, February 23, 2010

Chain, Chain, Chain - Chain of Tools

The Doctor is still out of town, and I must say:  I've had fun building the toolchain for this little creature of ours.  Now, of course, the real work begins, but, as of now, the building of usable tools is completed.

Synopsis:

 We discuss some of the errors made while building the basic toolchain for LFS, along with the steps taken to correct the problems which arose.



It's been kind of lonely in the laboratory of late without the Doctor puttering around, but I've managed to get a lot done.  I think he'll be proud of me when he gets back.

I've already ranted at some length about how the instructions for Chapter 5 of the LFS documentation are rather cryptic and hard to noodle out, so I won't get into that again.  Suffice it to say that, after the procedures were in place and a pattern was established,  I got into a rhythm of sorts.  Naturally, one thing led to another and I suppose it all started to run together after a while.

The first problem noted was with the package Glibc-2.5.1 (Section 5.6 of the manual).  This is a lengthy procedure, and has a lot of tricky-sticky in the pre-compile configuration, so I wasn't too surprised that the make check phase threw "Error 2" toward the end.  My first recourse was to the manual, and in it I saw a bit about some errors being expected, and to just run the make check command again each time errors are seen.

Some four passes later, the package was done throwing errors.  I have a list written down, but the documentation goes on to state that these are not really "worrisome", so off I went to complete the rest of the installation.  Sometimes persistence pays, I suppose?

The steps in Section 5.7, which dealt with "adjusting" the toolchain, were even more tricky-sticky than before.  A space out of place in any of the commands here can cause serious confusion, so sit on your fingers and read through twice before pressing the Enter key if you're following along in the book.
It is also noted about halfway through the section that a copy and paste directly from the documentation might be the best way to get through without typographical errors creeping into these devilishly twisted commands.  After several attempts to get it right by hand, I became convinced they were right!  This prompted a small delay where I had to figure out how to transfer the HTML version of the manual over to the system.

I finally copied the manual to a USB flash drive using the lab's main computer and brought that over to the slab where lay the LFS machine. A couple of quick commands mounted the drive and copied its contents into the /home/lfs folder for ready reference.  

It was about then that I discovered that the LFS Live CD system running the machine had a working X Window system with XFCE for a desktop environment.  Needless to say, I've been working from X ever since, using a terminal emulator to do all the command line stuff.  That made it a lot easier to cut and paste command texts when it was needed, which did, indeed, correct the problems I'd been having.  It's a shame that Section 5.7 is the only place that has so far required this.

I note something of an irony in the packaging of Tar-1.18:   here is an archiving program which is compressed, not into a tarball, but into a tarred bzip2 archive.  Like so many packages which had to be extracted, this one first gets extracted using bunzip2 and then tar -xvf is used to untar the resulting tarball.  This just seemed humorous at the time.  (Perhaps I've been spending too much time in the lab?  Perish the thought!)

The next place I had any trouble was Ncurses (section 5.13), but I didn't realize it until almost the end of the toolchain (Section 5.28) when texinfo is being built.  When texinfo began throwing errors about Ncurses not being available, I backtracked.  Apparently, I had neglected a step in the installation of Ncurses, and had managed to not install diffutils (section 5.17) entirely.  Going back, and re-installing these two packages set everything right, and texinfo finished installing as directed.

I suppose the moral of the story here is that one needs to take one's time reading and interpreting the intent of the instructions in the manual carefully, and to be careful to follow them in sequence.  I suppose only time will tell as to whether my error correction methods were sound, but we really didn't expect complete success on the first pass at this venture.

That is, of course, the real lesson I'm learning here, that persistence and attention to detail will carry one far in learning about Linux, more especially with Linux from Scratch.  I believe that, after this first pass, we will  doubtless make a second to verify the soundness of our methods.  That is where learning from these mistakes will certainly pay off.

I've received a cable just now from Vienna, stating that the Doctor will be arriving home late tomorrow evening.  Perhaps he will be ready to spend some time on our project by week's end.  I hope so, because he's been missing all the fun!

No comments:

Post a Comment