Essential pre-reading for life with LFS. AUTHOR: Richard A Downing FBCS CITP DATE: 2004-12-28 LICENSE: Creative Commons - Attribution-NonCommercial-ShareAlike 2.0 SYNOPSIS: Essential pre-reading for life with LFS. DESCRIPTION: This hint is a list of good documents that you can get for free on the Internet, together with some advice from me and my friends. It will help you get 'educated' to a level where you can: 1. successfully build [1]Linux from Scratch (LFS) 2. ask sensible questions on the LFS mailing lists and understand the replies. 3. stay sane while doing all this. PREREQUISITES: Just the ability to switch on the computer and access the Internet, navigate to the LFS website and find the hint. The rest is our topic... HINT: Please Note: * This will always be a 'work in progress' and I'm missing a good reference on some stuff. So, if you know of, or find a good one, please write to me. Also I just like feedback, so it never hurts to send an email. * If you are reading a text version, you will find a better maintained version of this hint on-line at: http://www.109bean.org.uk/lfsdocs/LFS-prereading.html - The URL links are easier to follow too. * I generate the text version of this hint by applying lynx -dump to the web version. This means that the URL's are collected at the end. This isn't so convenient for you, but it is really neat for me. The LFS book says: "This book assumes that its reader has a good deal of knowledge about using and installing Linux software." The book then suggests some further reading, including this document. But this is more than just an LFS reading list, we expect you to do some exercises too. Part 1. Social stuff. (Most important) Many people ask questions badly on the LFS mailing lists. Sometimes they get rude replies. To stay sane, I suggest you read the entertaining [2]How To Ask Questions The Smart Way by Eric Steven Raymond. Please note that all the LFS mailing lists expect: 1. plain text email. No HTML. 2. bottom posting. Add your bit UNDERNEATH the bit you quoted. 3. pruned quotes. Don't quote everything, just the significant bit. 4. no cross-posts. Just use the right list. 5. thick skins. Don't respond to rudeness, just ignore it. 6. [3]zazen. (Just Sitting) If others have a flame-war, just sit and watch. Before asking questions on lfs lists, please search the archives, at least the recent months, and please read [4]The LFS FAQ. Read the latest copy online, not some old thing you downloaded last week. If you ask a question that is in the FAQ, you are being extremely rude, not least to the maintainer who does that job out of the goodness of their heart. So you rightly WILL get flamed. Special note: If someone tells you to RTFM, they are not, repeat NOT, being rude or getting at you. This is the accepted phrase indicating that you need to Read The Friendly Manual. If you have previously been told that a certain Old Low Dutch word is referred to by the 'F', please be assured that this is just a myth :-) Part 2. Technical stuff. Many people attempt to build LFS without sufficient understanding or experience with LINUX. Here is an excerpt from the tar manual: "You should understand something about how Unix-type operating systems work, and you should know how to use some basic utilities. For example, you should know how to create, list, copy, rename, edit, and delete files and directories; how to change between directories; and how to figure out where you are in the filesystem. You should have some basic understanding of directory structure and how files are named according to which directory they are in. You should understand concepts such as standard output and standard input, what various definitions of the term "argument" mean, the differences between relative and absolute path names" In the LFS book, it says: "We are going to build the LFS system by using a previously installed Linux distribution such as Debian, SuSE, Slackware, Mandrake, RedHat, etc. We will use the existing Linux system as the development platform, because we need tools like a compiler, linker, text editor, and other development tools to build our system. Get a modern distro and play with it." The Base Distro Choosing a distro is only hard because of the choice, my advice is to choose a cheap one because once you have learned a bit and then built LFS you will junk it. I got mine free with a magazine. However it may help to read [5]The Linux Distribution HOWTO. Learning to use UNIX Unlike Windows, Unix requires you to understand what you are doing to get anything much out of it. Both Windows and Unix require deep understanding to get the best out of them. If you are coming from a Windows background or are new to computing in general then reading [6]The UNIX and Internet Fundamentals HOWTO is very basic and will help. Also, [7]Linux Installation and Getting Started , yes, is very dated, but is still good and worth a read. The Shell If you have read those, then you are aware that we drive Unix though a shell, which provides the command line interface. The shell we use in LFS, as in most of the Linux world, is bash (The Bourne Again Shell). You need to be fluent in using bash, and [8]The Advanced Bash Scripting Guide is a good tutorial. (Yes, I know it says 'Advanced', but read it anyway, do you want to be a newbie forever?) Becoming an apprentice guru Then there are three books that you ought to have available from or on your box for easy reference, skim read them now so you know how to use them: [9]The Linux User's Guide [10]The Linux Systems Adminstrator's Guide [11]The Linux Network Administrator's Guide, Second Edition I recommend that you put bookmarks to these in your browser, so that you can get to them quickly. It will save lots of time later. On Building from Source Having got yourself a LINUX system, and played a bit, you now will know a little about the subject, but before moving on to the building of Linux from Scratch you should learn how to build packages from source code. This is an area where it's hard to find good references. The LFS book suggests [12]Building and Installing Software Packages for Linux and [13]Autoconf, Automake, and Libtool is good too, if a little advanced. It's very important that you have some experience installing a package from source on your distro before attempting LFS. One good choice would be [14]GNU-Emacs. Here's what to do: 1. check out it's homepage 2. download a source distribution as a gzipped tar file 3. unpack the source with tar and gunzip 4. read the README file 5. read the INSTALL file 6. build it from scratch In doing this you will not only learn how to obtain and build a package from scratch, you'll also prove that you have installed the right tools for your distribution. If you want a real challenge, try [15]MPlayer. This package is a good test of your developing skills, as you will need to track down and install all it's dependencies first. (You could also cheat and look at the [16]Beyond Linux From Scratch book for a hint.) IBM, once Big Bad Blue, is now a great supporter of OpenSource and Linux. They have some free tutorials on their [17]developerWorks website. Like most Large Multi-nationals, IBM change their site around regularly, so any link I give to the tutorials may not be valid any more. Follow links to Technical Library and Tutorials though, and you should find: * Compiling and installing software from sources * Compiling the Linux kernel * Using regular expressions but there are rich pickings here, even for the experienced. Bootstraping One area where even seasoned UNIX veterans seem to have trouble is with setting up the bootstrap for the new LFS system. Often these problems come from not reading the available documents. Most people will be building for an X86 platform. Before LFS-5.0 we used Lilo as our recommended BootLoader, from LFS-5.0 we use GRUB. There is little to choose between the two, and they are not the only choices either. However, it is important to take time to familiarise yourself with the bootloader that you plan to use. Check out the homepages for the bootloader (lilo's is not very impressive): [18]Grub [19]Lilo And the various HOWTO's, not all will be relevant for you: [20]The Lilo mini-HOWTO [21]Boot + Root + Raid + Lilo : Software Raid mini-HOWTO [22]Linux+WindowsNT mini-HOWTO [23]Win95 + WinNT + Linux multiboot using LILO mini-HOWTO [24]Linux+Win9x+Grub HOWTO [25]Multiboot with GRUB Mini-HOWTO If you are building for a non-X86 platform you will have to research your own bootloader, try a google for whatever bootstrap is used by your base distro, but these links may help: [26]PA-RISC/Linux Boot HOWTO [27]SRM Firmware Howto [28]The Sparc Improved boot LOader But the most important thing you can do is to read the man and info pages for the bootloader. A print (on paper) of the error codes can be very helpful (as the online docs will not be available just when you need this info), and it is vital that you have an alternative means of booting your system before testing your new bootloader. Part 3. Other stuff. My starting point for any query or gap in my knowledge is google, yours should be too. Go to the [29]Google page, and hit the advanced search button. Learn the full capabilities of this essential tool, spend at least a whole day on this. Truely, you can't live without it. Note that if US English isn't your native tongue, then google has many national versions. I use [30]Google UK, as I'm English, and find this version more colourful. There is a whole heap of documentation at the [31]Linux Documentation Project, some of which I've quoted above. Learn to go there regularly and just poke about, it's a great storehouse of knowledge. Beware though a lot of it is out of date. You might want to find some other software for your Linux box. The place to search is: [32]Freshmeat LFS has it's own search system on the website. You can use it to find answers to obscure questions that others have asked in the distant past, as well as 'where is' type inquiries. Look on the LFS website homepage. And finally, whatever you read or don't read concerning LFS, before asking questions, start by reading the FAQ. FAQ stands for 'Frequently Asked Questions'. We don't want to answer them again, so don't ask them. Read [33]The LFS FAQ ACKNOWLEDGEMENTS: I have received encouragement and advice from the following, but the words are my fault alone: Dagmar D'Surreal, Tushar Teredesai, Ken Dyke, James Robertson, Eric Miller, and lots of others on lfs-chat. But nothing would have been done at all without the LFS project that Gerard Beekmans started: [34]Linux from Scratch CHANGELOG: [2002-12-31] Initial version in old hints format. [2003-09-29] Revision into new LFS hints format, minor changes and reproofing of links. [2003-12-14] Convertion to XHTML for easy on-line use [2004-12-14] Revalidated many of the hyperlinks [2004-12-28] Revised the online version and it's CSS stylesheet to correctly generate an LFS Hint with lynx -dump. No significant content changes. Changed license to Creative Commons. © Richard A Downing FBCS 2003, 2004 [35]Creative Commons License [36]Valid XHTML 1.1! [37]Valid CSS! References 1. http://www.linuxfromscratch.org/ 2. http://www.catb.org/~esr/faqs/smart-questions.html 3. http://en.wikipedia.org/wiki/Zazen 4. http://www.linuxfromscratch.org/faq/ 5. http://tldp.org/HOWTO/CD-Distributions-EN-HOWTO/index.html 6. http://tldp.org/HOWTO/Unix-and-Internet-Fundamentals-HOWTO/ 7. http://tldp.org/LDP/gs/ 8. http://tldp.org/LDP/abs/html/ 9. http://espc22.murdoch.edu.au/~stewart/guide/guide.html 10. http://tldp.org/LDP/sag/index.html 11. http://tldp.org/LDP/nag2/index.html 12. http://tldp.org/HOWTO/Software-Building-HOWTO.html 13. http://sources.redhat.com/autobook/autobook/autobook_toc.html 14. http://www.gnu.org/software/emacs/emacs.html 15. http://www.mplayerhq.hu/homepage/ 16. http://www.linuxfromscratch.org/blfs 17. http://www-106.ibm.com/developerworks/linux/ 18. http://www.gnu.org/software/grub 19. http://lilo.go.dyndns.org/ 20. http://www.tldp.org/HOWTO/LILO.html 21. http://www.tldp.org/HOWTO/Boot+Root+Raid+LILO.html 22. http://www.tldp.org/HOWTO/Linux+WinNT.html 23. http://www.tldp.org/HOWTO/Multiboot-with-LILO.html 24. http://www.tldp.org/HOWTO/Linux+Win9x+Grub-HOWTO/ 25. http://www.tldp.org/HOWTO/Multiboot-with-GRUB.html 26. http://www.tldp.org/HOWTO/PA-RISC-Linux-Boot-HOWTO/index.html 27. http://www.tldp.org/HOWTO/SRM-HOWTO/index.html 28. http://www.sparc-boot.org/ 29. http://www.google.com/ 30. http://www.google.co.uk/ 31. http://tldp.org/ 32. http://freshmeat.net/ 33. http://www.linuxfromscratch.org/faq/ 34. http://www.linuxfromscratch.org/ 35. http://creativecommons.org/licenses/by-nc-sa/2.0/ 36. http://validator.w3.org/check?uri=referer 37. http://jigsaw.w3.org/css-validator