Linux from Scratch
Total Page:16
File Type:pdf, Size:1020Kb
Linux From Scratch Version 5.0 Gerard Beekmans Copyright © 1999−2003 Gerard Beekmans This book describes the process of creating a Linux system from scratch, using nothing but the sources of the required software. Copyright (c) 1999−2003, 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 in any form must retain the above copyright notice, this list of conditions and the following disclaimer. • Neither the name of "Linux From Scratch" nor the names of its contributors may be used to endorse or promote products derived from this material without specific prior written permission. • Any material derived from Linux From Scratch must contain a reference to the "Linux From Scratch" project. 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 Preface..................................................................................................................................................................1 1. Foreword..............................................................................................................................................1 2. Audience..............................................................................................................................................1 2.1. Who would want to read this book.............................................................................................1 2.2. Who would not want to read this book.......................................................................................2 3. Prerequisites.........................................................................................................................................2 4. Structure...............................................................................................................................................3 4.1. Part I − Introduction...................................................................................................................3 4.2. Part II − Preparing for the build.................................................................................................3 4.3. Part III − Building the LFS system............................................................................................3 4.4. Part IV − Appendices.................................................................................................................3 I. Part I − Introduction.......................................................................................................................................4 Chapter 1. Introduction......................................................................................................................................5 1.1. How things are going to be done......................................................................................................5 1.2. Conventions used in this book..........................................................................................................6 1.3. Book version.....................................................................................................................................6 1.4. Changelog.........................................................................................................................................7 1.5. Resources........................................................................................................................................16 1.5.1. FAQ.......................................................................................................................................16 1.5.2. IRC........................................................................................................................................16 1.5.3. Mailing lists...........................................................................................................................16 1.5.4. News server...........................................................................................................................16 1.5.5. Mirror sites............................................................................................................................17 1.5.6. Contact information...............................................................................................................17 1.6. Acknowledgments...........................................................................................................................17 1.6.1. Current Project Team Members............................................................................................17 1.6.2. Translators.............................................................................................................................18 1.6.3. Mirror Maintainers................................................................................................................18 1.6.4. Donators................................................................................................................................18 1.6.5. Former Team Members and Contributors.............................................................................19 Chapter 2. Important information..................................................................................................................20 2.1. About $LFS.....................................................................................................................................20 2.2. About SBUs....................................................................................................................................20 2.3. About the test suites........................................................................................................................21 2.4. How to ask for help.........................................................................................................................21 2.4.1. Things to mention..................................................................................................................21 2.4.2. Configure problems...............................................................................................................21 2.4.3. Compile problems.................................................................................................................22 2.4.4. Test suite problems................................................................................................................22 II. Part II − Preparing for the build................................................................................................................23 Chapter 3. Preparing a new partition.............................................................................................................24 3.1. Introduction.....................................................................................................................................24 3.2. Creating a new partition..................................................................................................................24 i Linux From Scratch Table of Contents Chapter 3. Preparing a new partition 3.3. Creating a file system on the new partition....................................................................................24 3.4. Mounting the new partition.............................................................................................................25 Chapter 4. The materials: packages and patches..........................................................................................26 4.1. Introduction.....................................................................................................................................26 4.2. All the packages..............................................................................................................................26 4.3. Needed patches...............................................................................................................................30 Chapter 5. Constructing a temporary system................................................................................................33 5.1. Introduction.....................................................................................................................................33 5.2. Toolchain technical notes...............................................................................................................33 5.2.1. Notes on static linking...........................................................................................................35 5.3. Creating the $LFS/tools directory...................................................................................................36