Linux from Scratch
Total Page:16
File Type:pdf, Size:1020Kb
Linux From Scratch Gerard Beekmans Copyright © 1999, 2000, 2001 by Gerard Beekmans This book describes the process of creating your own Linux system from scratch from an already installed Linux distribution, using nothing but the sources of software that are needed. Copyright (c) 1999−2001, Gerard Beekmans All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. • Neither the name of LinuxFromScratch nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Dedication This book is dedicated to my loving and supportive wife Beverly Beekmans. Linux From Scratch Table of Contents 1. Who would want to read this book................................................................................................................1 2. Who would not want to read this book.........................................................................................................2 3. Organization....................................................................................................................................................3 3.1. Part I − Introduction..........................................................................................................................3 3.2. Part II − Installation of the LFS system............................................................................................3 3.3. Part III − Appendixes........................................................................................................................3 I. Part I − Introduction.......................................................................................................................................4 Chapter 1. Introduction......................................................................................................................................5 1.1. Introduction..................................................................................................................................................6 1.2. How things are going to be done.................................................................................................................7 1.3. Book versions................................................................................................................................................8 1.3.1. HTTP Mirrors................................................................................................................................8 1.3.2. FTP Mirrors...................................................................................................................................8 1.4. Acknowledgements......................................................................................................................................9 1.5. Changelog...................................................................................................................................................10 1.6. Mailinglists and archives...........................................................................................................................18 1.6.1. lfs−discuss....................................................................................................................................18 1.6.2. lfs−apps........................................................................................................................................18 1.6.3. lfs−announce................................................................................................................................18 1.6.4. lfs−security...................................................................................................................................18 1.6.5. alfs−discuss..................................................................................................................................18 1.6.6. alfs−docs......................................................................................................................................19 1.6.7. alfs−ipc.........................................................................................................................................19 1.6.8. alfs−profile...................................................................................................................................19 1.6.9. How to subscribe?........................................................................................................................19 1.6.10. How to unsubscribe?..................................................................................................................19 1.6.11. Mail archives..............................................................................................................................20 1.7. Contact information...................................................................................................................................21 Chapter 2. Important information..................................................................................................................22 2.1. About $LFS.................................................................................................................................................23 2.2. How to download the software..................................................................................................................24 2.3. How to install the software........................................................................................................................25 i Linux From Scratch Table of Contents 2.4. Download the bootscripts..........................................................................................................................27 2.5. Download the LFS Commands.................................................................................................................28 II. Part II − Installing the LFS system............................................................................................................29 Chapter 3. Packages you need to download...................................................................................................32 Chapter 4. Preparing a new partition.............................................................................................................35 4.1. Introduction................................................................................................................................................36 4.2. Creating a new partition...........................................................................................................................37 4.3. Creating a ext2 file system on the new partition.....................................................................................38 4.4. Mounting the new partition......................................................................................................................39 4.5. Creating directories...................................................................................................................................40 Chapter 5. Preparing the LFS system.............................................................................................................41 5.1. Introduction................................................................................................................................................42 5.2. Installing Bash............................................................................................................................................43 5.2.1. Installation of Bash......................................................................................................................43 5.2.2. Command explanations................................................................................................................43 5.2.3. Contents.......................................................................................................................................44 5.2.4. Description...................................................................................................................................44 5.3. Installing Binutils.......................................................................................................................................45 5.3.1. Installation of Binutils.................................................................................................................45