LFS-BOOK-10.1.Pdf

Total Page:16

File Type:pdf, Size:1020Kb

LFS-BOOK-10.1.Pdf Linux From Scratch Version 10.1 Published March 1st, 2021 Created by Gerard Beekmans Managing Editor: Bruce Dubbs Linux From Scratch: Version 10.1 : Published March 1st, 2021 by Created by Gerard Beekmans and Managing Editor: Bruce Dubbs Copyright © 1999-2021 Gerard Beekmans Copyright © 1999-2021, Gerard Beekmans All rights reserved. This book is licensed under a Creative Commons License. Computer instructions may be extracted from the book under the MIT License. Linux® is a registered trademark of Linus Torvalds. Linux From Scratch - Version 10.1 Table of Contents Preface ......................................................................................................................................................................... viii i. Foreword ............................................................................................................................................................ viii ii. Audience ........................................................................................................................................................... viii iii. LFS Target Architectures .................................................................................................................................. ix iv. Prerequisites ........................................................................................................................................................ x v. LFS and Standards .............................................................................................................................................. x vi. Rationale for Packages in the Book ................................................................................................................. xi vii. Typography .................................................................................................................................................... xvii viii. Structure ...................................................................................................................................................... xviii ix. Errata ............................................................................................................................................................. xviii I. Introduction ................................................................................................................................................................. 1 1. Introduction .......................................................................................................................................................... 2 1.1. How to Build an LFS System .................................................................................................................... 2 1.2. What's new since the last release ............................................................................................................... 2 1.3. Changelog ................................................................................................................................................... 4 1.4. Resources .................................................................................................................................................... 8 1.5. Help ............................................................................................................................................................. 9 II. Preparing for the Build ........................................................................................................................................... 11 2. Preparing the Host System ................................................................................................................................ 12 2.1. Introduction ............................................................................................................................................... 12 2.2. Host System Requirements ....................................................................................................................... 12 2.3. Building LFS in Stages ............................................................................................................................ 14 2.4. Creating a New Partition .......................................................................................................................... 15 2.5. Creating a File System on the Partition ................................................................................................... 17 2.6. Setting The $LFS Variable ....................................................................................................................... 17 2.7. Mounting the New Partition ..................................................................................................................... 18 3. Packages and Patches ........................................................................................................................................ 20 3.1. Introduction ............................................................................................................................................... 20 3.2. All Packages ............................................................................................................................................. 20 3.3. Needed Patches ......................................................................................................................................... 28 4. Final Preparations .............................................................................................................................................. 30 4.1. Introduction ............................................................................................................................................... 30 4.2. Creating a limited directory layout in LFS filesystem ............................................................................. 30 4.3. Adding the LFS User ............................................................................................................................... 30 4.4. Setting Up the Environment ..................................................................................................................... 31 4.5. About SBUs .............................................................................................................................................. 33 4.6. About the Test Suites ............................................................................................................................... 34 III. Building the LFS Cross Toolchain and Temporary Tools .................................................................................... 35 Important Preliminary Material ........................................................................................................................ xxxvi i. Introduction .............................................................................................................................................. xxxvi ii. Toolchain Technical Notes .................................................................................................................... xxxvi iii. General Compilation Instructions ............................................................................................................... xl 5. Compiling a Cross-Toolchain ............................................................................................................................ 42 5.1. Introduction ............................................................................................................................................... 42 5.2. Binutils-2.36.1 - Pass 1 ............................................................................................................................ 43 iii Linux From Scratch - Version 10.1 5.3. GCC-10.2.0 - Pass 1 ................................................................................................................................. 45 5.4. Linux-5.10.17 API Headers ...................................................................................................................... 48 5.5. Glibc-2.33 ................................................................................................................................................. 49 5.6. Libstdc++ from GCC-10.2.0, Pass 1 ........................................................................................................ 52 6. Cross Compiling Temporary Tools ................................................................................................................... 53 6.1. Introduction ............................................................................................................................................... 53 6.2. M4-1.4.18 .................................................................................................................................................. 54 6.3. Ncurses-6.2 ................................................................................................................................................ 55 6.4. Bash-5.1 .................................................................................................................................................... 57 6.5. Coreutils-8.32 ............................................................................................................................................ 58 6.6. Diffutils-3.7 ..............................................................................................................................................
Recommended publications
  • University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science
    University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science EECS 61C, Fall 2003 Lab 2: Strings and pointers; the GDB debugger PRELIMINARY VERSION Goals To learn to use the gdb debugger to debug string and pointer programs in C. Reading Sections 5.1-5.5, in K&R GDB Reference Card (linked to class page under “resources.”) Optional: Complete GDB documentation (http://www.gnu.org/manual/gdb-5.1.1/gdb.html) Note: GDB currently only works on the following machines: • torus.cs.berkeley.edu • rhombus.cs.berkeley.edu • pentagon.cs.berkeley.edu Please ssh into one of these machines before starting the lab. Basic tasks in GDB There are two ways to start the debugger: 1. In EMACS, type M-x gdb, then type gdb <filename> 2. Run gdb <filename> from the command line The following are fundamental operations in gdb. Please make sure you know the gdb commands for the following operations before you proceed. 1. How do you run a program in gdb? 2. How do you pass arguments to a program when using gdb? 3. How do you set a breakpoint in a program? 4. How do you set a breakpoint which which only occurs when a set of conditions is true (eg when certain variables are a certain value)? 5. How do you execute the next line of C code in the program after a break? 1 6. If the next line is a function call, you'll execute the call in one step. How do you execute the C code, line by line, inside the function call? 7.
    [Show full text]
  • Source Code Trees in the VALLEY of THE
    PROGRAMMING GNOME Source code trees IN THE VALLEY OF THE CODETHORSTEN FISCHER So you’ve just like the one in Listing 1. Not too complex, eh? written yet another Unfortunately, creating a Makefile isn’t always the terrific GNOME best solution, as assumptions on programs program. Great! But locations, path names and others things may not be does it, like so many true in all cases, forcing the user to edit the file in other great programs, order to get it to work properly. lack something in terms of ease of installation? Even the Listing 1: A simple Makefile for a GNOME 1: CC=/usr/bin/gcc best and easiest to use programs 2: CFLAGS=`gnome-config —cflags gnome gnomeui` will cause headaches if you have to 3: LDFLAGS=`gnome-config —libs gnome gnomeui` type in lines like this, 4: OBJ=example.o one.o two.o 5: BINARIES=example With the help of gcc -c sourcee.c gnome-config —libs —cflags 6: gnome gnomeui gnomecanvaspixbuf -o sourcee.o 7: all: $(BINARIES) Automake and Autoconf, 8: you can create easily perhaps repeated for each of the files, and maybe 9: example: $(OBJ) with additional compiler flags too, only to then 10: $(CC) $(LDFLAGS) -o $@ $(OBJ) installed source code demand that everything is linked. And at the end, 11: do you then also have to copy the finished binary 12: .c.o: text trees. Read on to 13: $(CC) $(CFLAGS) -c $< manually into the destination directory? Instead, 14: find out how. wouldn’t you rather have an easy, portable and 15: clean: quick installation process? Well, you can – if you 16: rm -rf $(OBJ) $(BINARIES) know how.
    [Show full text]
  • ROOT I/O Compression Improvements for HEP Analysis
    EPJ Web of Conferences 245, 02017 (2020) https://doi.org/10.1051/epjconf/202024502017 CHEP 2019 ROOT I/O compression improvements for HEP analysis Oksana Shadura1;∗ Brian Paul Bockelman2;∗∗ Philippe Canal3;∗∗∗ Danilo Piparo4;∗∗∗∗ and Zhe Zhang1;y 1University of Nebraska-Lincoln, 1400 R St, Lincoln, NE 68588, United States 2Morgridge Institute for Research, 330 N Orchard St, Madison, WI 53715, United States 3Fermilab, Kirk Road and Pine St, Batavia, IL 60510, United States 4CERN, Meyrin 1211, Geneve, Switzerland Abstract. We overview recent changes in the ROOT I/O system, enhancing it by improving its performance and interaction with other data analysis ecosys- tems. Both the newly introduced compression algorithms, the much faster bulk I/O data path, and a few additional techniques have the potential to significantly improve experiment’s software performance. The need for efficient lossless data compression has grown significantly as the amount of HEP data collected, transmitted, and stored has dramatically in- creased over the last couple of years. While compression reduces storage space and, potentially, I/O bandwidth usage, it should not be applied blindly, because there are significant trade-offs between the increased CPU cost for reading and writing files and the reduces storage space. 1 Introduction In the past years, Large Hadron Collider (LHC) experiments are managing about an exabyte of storage for analysis purposes, approximately half of which is stored on tape storages for archival purposes, and half is used for traditional disk storage. Meanwhile for High Lumi- nosity Large Hadron Collider (HL-LHC) storage requirements per year are expected to be increased by a factor of 10 [1].
    [Show full text]
  • Red Hat Enterprise Linux 6 Developer Guide
    Red Hat Enterprise Linux 6 Developer Guide An introduction to application development tools in Red Hat Enterprise Linux 6 Dave Brolley William Cohen Roland Grunberg Aldy Hernandez Karsten Hopp Jakub Jelinek Developer Guide Jeff Johnston Benjamin Kosnik Aleksander Kurtakov Chris Moller Phil Muldoon Andrew Overholt Charley Wang Kent Sebastian Red Hat Enterprise Linux 6 Developer Guide An introduction to application development tools in Red Hat Enterprise Linux 6 Edition 0 Author Dave Brolley [email protected] Author William Cohen [email protected] Author Roland Grunberg [email protected] Author Aldy Hernandez [email protected] Author Karsten Hopp [email protected] Author Jakub Jelinek [email protected] Author Jeff Johnston [email protected] Author Benjamin Kosnik [email protected] Author Aleksander Kurtakov [email protected] Author Chris Moller [email protected] Author Phil Muldoon [email protected] Author Andrew Overholt [email protected] Author Charley Wang [email protected] Author Kent Sebastian [email protected] Editor Don Domingo [email protected] Editor Jacquelynn East [email protected] Copyright © 2010 Red Hat, Inc. and others. The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version. Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
    [Show full text]
  • Ebook - Informations About Operating Systems Version: August 15, 2006 | Download
    eBook - Informations about Operating Systems Version: August 15, 2006 | Download: www.operating-system.org AIX Internet: AIX AmigaOS Internet: AmigaOS AtheOS Internet: AtheOS BeIA Internet: BeIA BeOS Internet: BeOS BSDi Internet: BSDi CP/M Internet: CP/M Darwin Internet: Darwin EPOC Internet: EPOC FreeBSD Internet: FreeBSD HP-UX Internet: HP-UX Hurd Internet: Hurd Inferno Internet: Inferno IRIX Internet: IRIX JavaOS Internet: JavaOS LFS Internet: LFS Linspire Internet: Linspire Linux Internet: Linux MacOS Internet: MacOS Minix Internet: Minix MorphOS Internet: MorphOS MS-DOS Internet: MS-DOS MVS Internet: MVS NetBSD Internet: NetBSD NetWare Internet: NetWare Newdeal Internet: Newdeal NEXTSTEP Internet: NEXTSTEP OpenBSD Internet: OpenBSD OS/2 Internet: OS/2 Further operating systems Internet: Further operating systems PalmOS Internet: PalmOS Plan9 Internet: Plan9 QNX Internet: QNX RiscOS Internet: RiscOS Solaris Internet: Solaris SuSE Linux Internet: SuSE Linux Unicos Internet: Unicos Unix Internet: Unix Unixware Internet: Unixware Windows 2000 Internet: Windows 2000 Windows 3.11 Internet: Windows 3.11 Windows 95 Internet: Windows 95 Windows 98 Internet: Windows 98 Windows CE Internet: Windows CE Windows Family Internet: Windows Family Windows ME Internet: Windows ME Seite 1 von 138 eBook - Informations about Operating Systems Version: August 15, 2006 | Download: www.operating-system.org Windows NT 3.1 Internet: Windows NT 3.1 Windows NT 4.0 Internet: Windows NT 4.0 Windows Server 2003 Internet: Windows Server 2003 Windows Vista Internet: Windows Vista Windows XP Internet: Windows XP Apple - Company Internet: Apple - Company AT&T - Company Internet: AT&T - Company Be Inc. - Company Internet: Be Inc. - Company BSD Family Internet: BSD Family Cray Inc.
    [Show full text]
  • MIPS32 Malta Linux
    MIPS32 Malta Linux Imperas Software Limited Imperas Buildings, North Weston, Thame, Oxfordshire, OX9 2HA, UK [email protected] Author: OVP Version: 1.4.1 Filename: OVP_MIPS_Linux_Platform_User_Guide.doc Project: MIPS32 Malta Linux Platform Last Saved: December 7, 2016 Keywords: OVP MIPS Malta Linux © 2010 Imperas Software Limited www.OVPworld.org Page 1 of 115 MIPS32 Malta Linux Platform Copyright Notice Copyright © 2016 Imperas Software Limited All rights reserved. This software and documentation contain information that is the property of Imperas Software Limited. The software and documentation are furnished under a license agreement and may be used or copied only in accordance with the terms of the license agreement. No part of the software and documentation may be reproduced, transmitted, or translated, in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without prior written permission of Imperas Software Limited, or as expressly provided by the license agreement. Right to Copy Documentation The license agreement with Imperas permits licensee to make copies of the documentation for its internal use only. Each copy shall include all copyrights, trademarks, service marks, and proprietary rights notices, if any. Destination Control Statement All technical data contained in this publication is subject to the export control laws of the United States of America. Disclosure to nationals of other countries contrary to United States law is prohibited. It is the reader’s responsibility to determine the applicable regulations and to comply with them. Disclaimer IMPERAS SOFTWARE LIMITED, AND ITS LICENSORS MAKE NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    [Show full text]
  • Arxiv:2004.10531V1 [Cs.OH] 8 Apr 2020
    ROOT I/O compression improvements for HEP analysis Oksana Shadura1;∗ Brian Paul Bockelman2;∗∗ Philippe Canal3;∗∗∗ Danilo Piparo4;∗∗∗∗ and Zhe Zhang1;y 1University of Nebraska-Lincoln, 1400 R St, Lincoln, NE 68588, United States 2Morgridge Institute for Research, 330 N Orchard St, Madison, WI 53715, United States 3Fermilab, Kirk Road and Pine St, Batavia, IL 60510, United States 4CERN, Meyrin 1211, Geneve, Switzerland Abstract. We overview recent changes in the ROOT I/O system, increasing per- formance and enhancing it and improving its interaction with other data analy- sis ecosystems. Both the newly introduced compression algorithms, the much faster bulk I/O data path, and a few additional techniques have the potential to significantly to improve experiment’s software performance. The need for efficient lossless data compression has grown significantly as the amount of HEP data collected, transmitted, and stored has dramatically in- creased during the LHC era. While compression reduces storage space and, potentially, I/O bandwidth usage, it should not be applied blindly: there are sig- nificant trade-offs between the increased CPU cost for reading and writing files and the reduce storage space. 1 Introduction In the past years LHC experiments are commissioned and now manages about an exabyte of storage for analysis purposes, approximately half of which is used for archival purposes, and half is used for traditional disk storage. Meanwhile for HL-LHC storage requirements per year are expected to be increased by factor 10 [1]. arXiv:2004.10531v1 [cs.OH] 8 Apr 2020 Looking at these predictions, we would like to state that storage will remain one of the major cost drivers and at the same time the bottlenecks for HEP computing.
    [Show full text]
  • The GNOME Desktop Environment
    The GNOME desktop environment Miguel de Icaza ([email protected]) Instituto de Ciencias Nucleares, UNAM Elliot Lee ([email protected]) Federico Mena ([email protected]) Instituto de Ciencias Nucleares, UNAM Tom Tromey ([email protected]) April 27, 1998 Abstract We present an overview of the free GNU Network Object Model Environment (GNOME). GNOME is a suite of X11 GUI applications that provides joy to users and hackers alike. It has been designed for extensibility and automation by using CORBA and scripting languages throughout the code. GNOME is licensed under the terms of the GNU GPL and the GNU LGPL and has been developed on the Internet by a loosely-coupled team of programmers. 1 Motivation Free operating systems1 are excellent at providing server-class services, and so are often the ideal choice for a server machine. However, the lack of a consistent user interface and of consumer-targeted applications has prevented free operating systems from reaching the vast majority of users — the desktop users. As such, the benefits of free software have only been enjoyed by the technically savvy computer user community. Most users are still locked into proprietary solutions for their desktop environments. By using GNOME, free operating systems will have a complete, user-friendly desktop which will provide users with powerful and easy-to-use graphical applications. Many people have suggested that the cause for the lack of free user-oriented appli- cations is that these do not provide enough excitement to hackers, as opposed to system- level programming. Since most of the GNOME code had to be written by hackers, we kept them happy: the magic recipe here is to design GNOME around an adrenaline response by trying to use exciting models and ideas in the applications.
    [Show full text]
  • Linux Boot Loaders Compared
    Linux Boot Loaders Compared L.C. Benschop May 29, 2003 Copyright c 2002, 2003, L.C. Benschop, Eindhoven, The Netherlands. Per- mission is granted to make verbatim copies of this document. This is version 1.1 which has some minor corrections. Contents 1 introduction 2 2 How Boot Loaders Work 3 2.1 What BIOS does for us . 3 2.2 Parts of a boot loader . 6 2.2.1 boot sector program . 6 2.2.2 second stage of boot loader . 7 2.2.3 Boot loader installer . 8 2.3 Loading the operating system . 8 2.3.1 Loading the Linux kernel . 8 2.3.2 Chain loading . 10 2.4 Configuring the boot loader . 10 3 Example Installations 11 3.1 Example root file system and kernel . 11 3.2 Linux Boot Sector . 11 3.3 LILO . 14 3.4 GNU GRUB . 15 3.5 SYSLINUX . 18 3.6 LOADLIN . 19 3.7 Where Can Boot Loaders Live . 21 1 4 RAM Disks 22 4.1 Living without a RAM disk . 22 4.2 RAM disk devices . 23 4.3 Loading a RAM disk at boot time . 24 4.4 The initial RAM disk . 24 5 Making Diskette Images without Diskettes 25 6 Hard Disk Installation 26 7 CD-ROM Installation 29 8 Conclusions 31 1 introduction If you use Linux on a production system, you will only see it a few times a year. If you are a hobbyist who compiles many kernels or who uses many operating systems, you may see it several times per day.
    [Show full text]
  • Autoconf.Pdf
    Autoconf Creating Automatic Configuration Scripts for version 2.66, 2 July 2010 David MacKenzie Ben Elliston Akim Demaille This manual (2 July 2010) is for GNU Autoconf (version 2.66), a package for creating scripts to configure source code packages using templates and an M4 macro package. Copyright c 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover texts being \A GNU Manual," and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled \GNU Free Documentation License." (a) The FSF's Back-Cover Text is: \You have the freedom to copy and modify this GNU manual. Buying copies from the FSF supports it in developing GNU and promoting software freedom." i Table of Contents 1 Introduction::::::::::::::::::::::::::::::::::::: 1 2 The GNU Build System:::::::::::::::::::::::: 3 2.1 Automake:::::::::::::::::::::::::::::::::::::::::::::::::::::: 3 2.2 Gnulib ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 3 2.3 Libtool::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 2.4 Pointers:::::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 3 Making configure Scripts :::::::::::::::::::::: 5 3.1 Writing `configure.ac' ::::::::::::::::::::::::::::::::::::::::
    [Show full text]
  • Introduction to FOSS (Free and Open Source Software) Department Elective – Syllabi Department of Computer Engineering, MNIT Jaipur
    Introduction to FOSS (Free and Open Source Software) Department Elective – Syllabi Department of Computer Engineering, MNIT Jaipur 1. Unit 1 – Introduction to the FOSS philosophy (2 hrs) Overview of Free/Open Source Software, Definition of FOSS & GNU, History of GNU/Linux and the Free Software Movement, Advantages of Free Software and GNU/Linux, FOSS usage, trends and potential: global and Indian; Popular FOSS alternatives to non-free software (GIMP, OpenOffice, GAIM, Firefox, Thunderbird etc.) 2. Unit 2 – GNU/Linux Basics (8 hrs) GNU/Linux OS installation, detecting hardware, configuring disk partitions & file systems and install a GNU/Linux distribution, Basic shell commands - logging in, listing files, editing files, copying/moving files, viewing file contents, changing file modes and permissions, process management, User and group management, file ownerships and permissions, PAM authentication, Introduction to common system configuration files & log files, Configuring networking, basics of TCP/IP networking and routing, connecting to the Internet (through dialup, DSL, Ethernet, leased line and Wifi). Configuring additional hardware - sound cards, displays & display cards, network cards, modems, USB drives, CD writers. 3. Unit 3 – GNU/Linux Advanced (8 hrs) Understanding the OS boot up process; GNU/Linux distributions – case study of Fedora Core, Debian and Gentoo; basic understanding of the Linux kernel, kernel configuration, installing Linux from Scratch, understanding the Gnome and KDE environments and their components, Various
    [Show full text]
  • Foxclone User Guide
    Foxclone V46 Return to contents Foxclone User Guide To navigate round the guide: • Any item in the contents can be clicked to go to that item. • At the top of every page is a link that will go to the contents list. • Any items highlighted will go to the item, e.g. this will go to the contents list. 22 August 2021 Page 1 of 58 Foxclone V46 Return to contents Contents Contents ................................................................................................................................ 2 What is it? ............................................................................................................................. 4 How should it be used? ......................................................................................................... 5 Installation ............................................................................................................................ 6 Linux ....................................................................................................................... 6 Windows .................................................................................................................... 8 Boot ................................................................................................................................... 9 The desktop ......................................................................................................................... 11 Foxclone .............................................................................................................................
    [Show full text]