Linux From Scratch

Version 3.1

Gerard Beekmans

Ce livre décrit le processus de création d'un système Linux depuis rien à partir d'une distribution Linux déjà installée, en utilisant uniquement les sources des logiciels utilisés.

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 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.



Dédicace

Ce livre est dédié à ma femme aimante au soutien indéfectible Beverly Beekmans.

Table des matières
Préface
Avant-propos
Qui voudrait lire ce livre
Qui ne voudrait pas lire ce livre
Organization
Partie I - Introduction
Partie II - Installation du système LFS
Partie III - Annexes
I. Première Partie - Introduction
1. Introduction
How things are going to be done
Conventions used in this book
Book version
Acknowledgments
Changelog
Mailing lists and archives
News server
Contact information
2. Informations importantes
A propos de $LFS
Comment télécharger les logiciels
Comment installer les logiciels
Comment demander de l'aide
Télécharger les scripts de démarage
Télécharger les commandes LFS
II. Partie II - Instalation du système LFS
3. Packages qui doivent être téléchargés
Introduction
Packages qui doivent être téléchargés
4. Preparing a new partition
Introduction
Création d'une nouvelle partition
Creating a file system on the new partition
Montage d'une nouvelle partition
Creating directories
5. Préparer le système LFS
Introduction
Pourquoi utiliser une édition de lien statique ?
Installer tous les logiciels sous l'utilisateur root
Installer Bash-2.05a
Installer binutils-2.11.2
Installer Bzip2-1.0.1
Installer Diffutils-2.7
Installer Fileutils-4.1
Installer GCC-2.95.3
Installer Grep-2.4.2
Installer Gzip-1.2.4a
Installer le noyau Linux-2.4.16
Installer Make-3.79.1
Installer Mawk-1.3.3
Installer Patch-2.5.4
Installer Sed-3.02
Installer Sh-utils-2.0
Installer Tar-1.13
Installer Texinfo-4.0
Installer Textutils-2.0
Créer les fichiers passwd et group
Copie des anciennes bibliothèques NSS
Monter le système de fichiers $LFS/proc
6. Installer les logiciels du système de base
Introduction
A propos des symboles de débogage
Création de $LFS/root/.bash_profile
Entrer dans l'environnement chroot
Installer Glibc-2.2.4
Créer les périphériques (Makedev-1.4)
Installer Man-pages-1.43
Installer Findutils-4.1
Installer Mawk-1.3.3
Installer Ncurses-5.2
Installer Vim-6.0
Installer GCC-2.95.3
Installer Bison-1.28
Installer Less-358
Installer Groff-1.17.2
Installer Man-1.5j
Installer Perl-5.6.1
Installer M4-1.4
Installer Texinfo-4.0
Installer Autoconf-2.52
Installer Automake-1.5
Installer Bash-2.05a
Installer Flex-2.5.4a
Installer File-3.36
Installer Libtool-1.4.2
Installer Bin86-0.16.0
Installer Binutils-2.11.2
Installer Bzip2-1.0.1
Installer Ed-0.2
Installer Gettext-0.10.40
Installer Kbd-1.06
Installer Diffutils-2.7
Installer E2fsprogs-1.25
Installer Fileutils-4.1
Installer Grep-2.4.2
Installer Gzip-1.2.4a
Installer Lilo-22.1
Installer Make-3.79.1
Installer Modutils-2.4.12
Installer Netkit-base-0.17
Installer Patch-2.5.4
Installer Procinfo-18
Installer Procps-2.0.7
Installer Psmisc-20.1
Installer Reiserfsprogs-3.x.0j
Installing Sed-3.02
Installer Sh-utils-2.0
Installer Net-tools-1.60
Installer Shadow-20001016
Installer Sysklogd-1.4.1
Installer Sysvinit-2.83
Installer Tar-1.13
Installing Textutils-2.0
Installer Util-linux-2.11m
Désinstaller les anciennes librairies NSS
Configurer les logiciels essentiels
7. Creating system boot scripts
Introduction
How does the booting process with these scripts work?
Creating directories
Creating the rc script
Création du script rcS
Création du script functions
Creating the checkfs script
Création du script halt
Création du script loadkeys
Création du script mountfs
Création du script de redémarrage
Création du script sendsignals
Création du script setclock
Création du script sysklogd
Création du script template
Création du script localnet
Création du fichier /etc/sysconfig/network
Création du fichier /etc/hosts
Créer un script ethnet
Mise en place des liens symboliques et des droits
8. Rendre le système LFS démarrable
Introduction
Creation du fichier /etc/fstab
Installation du noyau
Mettre son système LFS démarrable
9. The End
La fin
Get Counted
Redémarrer le système
III. Troisième Partie - Annexes
A. Package descriptions
Introduction
Bash
Binutils
Bzip2
Diffutils
Fileutils
GCC
Grep
Gzip
Linux kernel
Make
Mawk
Patch
Sed
Sh-utils
Tar
Texinfo
Textutils
Glibc
MAKEDEV
Man-pages
Findutils
Ncurses
Vim
Bison
Less
Groff
Man
Perl
M4
Autoconf
Automake
Flex
File
Libtool
Bin86
Ed
Gettext
Kbd
E2fsprogs
Lilo
Modutils
Procinfo
Procps
Psmisc
Reiserfsprogs
Shadow Password Suite
Sysklogd
Sysvinit
Util Linux
Netkit-base
Net-tools
B. Dependencies
Introduction
Bash-2.05
Binutils-2.11.2
Bzip2-1.0.1
Diffutils-2.7
Fileutils-4.1
GCC-2.95.3
Grep-2.4.2
Gzip-1.2.4a
Linux-2.4.8
Make-3.79.1
Mawk-1.3.3
Patch-2.5.4
Sed-3.02
Sh-utils-2.0
Tar-1.13
Texinfo-4.0
Textutils-2.0
Chroot
Glibc-2.2.4
Makedev-1.4
Man-pages-1.39
Findutils-4.1
Ncurses-5.2
Vim-5.8
Bison-1.28
Less-358
Groff-1.17.2
Man-1.5i2
Perl-5.6.1
M4-1.4
Autoconf-2.52
Automake-1.5
Flex-2.5.4a
File-3.36
Libtool-1.4
Bin86-0.16.0
Ed-0.2
Gettext-0.10.39
Kbd-1.06
E2fsprogs-1.22
Lilo-21.7.5
Modutils-2.4.7
Netkit-base-0.17
Procinfo-18
Procps-2.0.7
Psmisc-20.1
Reiserfs-N/A
Net-tools-1.60
Shadow-20001016
Sysklogd-1.4.1
Sysvinit-2.82
Util-linux-2.11h
C. Ressources
Introduction
Livres
HOWTOs and Guides
Other
D. Sites de téléchargements officiels
Official download locations

Préface


Avant-propos

Ayant utilisé certaines distributions de Linux, je n'ai jamais été satisfait par aucune d'entre elles. Je n'aimais pas la façon dont les scripts de boot étaient arrangés , je n'aimais pas la manière dont certains programmes étaient configurés par défaut, et d'autres choses de ce genre. J'en suis venu au fait que si je voulais être entièrement satisfait d'un système linux, il me fallait créer mon propre système depuis le début, idéalement en n'utilisant que le code-source. Sans utiliser de package pré-compilé. Sans aide d'aucun CD-ROM ni de disquette d'amorce qui installerait quelques utilitaires de base. J'utiliserais mon système Linux actuel et m'en servirais pour construire le mien.

Ceci, au premier abord, peut sembler très difficile et parfois impossible. Après avoir réglé les problèmes de dépendance, problèmes de compilation, etcetera, un système Linux personalisé a été créé avec succès. J'ai nommé ce système le système LFS, c'est à dire "Linux From Scratch" (Linux Par Le Début).

J'espère que vous passerez du bon temps en travaillant sur LFS !

-- Gerard Beekmans gerard@linuxfromscratch.org


Qui voudrait lire ce livre

Il y a beaucoup de raisons qui pousseraient quelqu'un à vouloir lire ce livre afin d'installer un système LFS. La question que beaucoup de personnes se posent est "pourquoi se fatiguer à installer manuellement un système Linux depuis le départ alors qu'il suffit de télécharger une distribution existante comme Debian ou Redhat". C'est une question censée que j'espère pouvoir vous répondre.

La raison principale de l'existence de LFS est d'apprendre comment fonctionne un système Linux à l'intérieur. Construire un système LFS vous apprend à propos de tout ce qui fait que Linux fonctionne, comment les choses travaillent ensemble, et dépendent de l'une l'autre. Et le plus important, comment le personaliser afin qu'il soit à votre goût et réponde à vos besoins.

Un autre avantage clé de LFS est que vous êtes maître de votre système sans avoir à dépendre d'une implémentation créée par quelqu'un d'autre comme Debian. Vous êtes sur le siège conducteur maintenant et êtes capable de décider chaque chose comme la disposition des répertoires ainsi que la configuration des fichiers de démarrage. Vous saurez également exactement où, pourquoi et comment les programmes sont installés.

Un autre avantage de LFS est que vous pouvez créer un système Linux compact. Quand vous installez une distribution comme Debian ou Redhat, vous finirez par installer beaucoup de programmes que vous n'utiliserez jamais de votre vie. Ils sont juste là et prennent de l'espace disque (précieux). Il n'est pas difficile d'avoir un système LFS installé sous 100 MB. Celà vous semble-t-il beaucoup ? Certains d'entre nous ont travaillés afin de creer un système LFS minuscule. Nous avons installé un système juste suffisant pour faire fonctionner le serveur web Apache; l'espace disque total était approximativement 8 MB. Avec plus de depouillement, celà peut être ramené à 5 MB ou moins. Essayez de faire pareil avec une distribution générique comme debian ou Redhat.

Si nous devions comparer une distribution Linux avec un hamburger que vous achetez au supermarché ou au restaurant fast-food, vous le mangeriez sans précisément savoir ce que vous mangez, alors que LFS vous donne tous les ingrédients pour faire un hamburger. Celà vous permet de prudemment l'inspecter, d'enlever les ingrédients non-désirés, et par la même manière vous permettre de rajouter des ingrédients qui correspondent mieux à la saveur que vous attendez de votre hamburger. Quand vous êtes satisfaits des ingrédients, vous passez à la partie suivante en les combinant ensemble. Vous avez désormais la chance de le faire de la façon dont vous le voulez : grillez-le, faites-le cuire au four, faites-le frire, au barbecue, ou mangez-le cru.

Une autre analogie que nous pouvons utiliser est de comparer LFS avec une maison construite. LFS vous donnera le squelette de la maison, mais c'est à vous de faire la plomberie, le système électrique, la cuisine, la baignoire, le papier-peint, etc.

Un autre avantage d'un système Linux personalisé est l'ajout de sécurité. Vous compilerez le système complet à partir de la base, ce qui vous permet de tout vérifier, si vous le voulez, et d'appliquer tous les patchs de sécurité que vous voulez ou devez appliquer. Vous n'avez pas à attendre quelqu'un d'autre pour vous fournir un package fixant un trou de sécurité. Cependant, vous n'avez aucune garantie que le nouveau package résoud le problème (adéquatement). Vous ne pourrez jamais savoir si un trou de sécurité est fixé si vous ne le faites pas vous-même.


Qui ne voudrait pas lire ce livre

Les personnes ne voulant pas construire un système linux en entier depuis le début ne voudrons probablement pas lire ce livre. Si vous, cependant, voulez en apprendre plus au sujet de ce qui se produit dans les coulisses, en particulier ce qui se passe entre allumer un ordinateur et voir la ligne de commande, vous pouvez vouloir lire le << From-PowerUp-To-Bash-Prompt-HOWTO>> . Ce \ HOWTO construit un système de base, d'une manière similaire à ce que ce livre-ci utilise, mais il se concentre plus sur l'installation d'un système de démarrage au lieu d'un système complet.

Afin de décider de lire ce livre ou le From-PowerUp-To-Bash -Prompt-HOWTO, posez-vous cette question : "Mon objectif principal est-il d'avoir un système Linux opérationnel que je vais construire moi-même, et ainsi apprendre ce que chaque composant d'un système fait ? Ou alors mon objectif principal est de juste apprendre ? ". Si vous voulez construire et apprendre, lisez ce livre. Si vous voulez simplement apprendre les bases, alors le From-PowerUp-To-Bash-Prompt-HOWTO est probablement un meilleur support à lire.

Le << From-PowerUp-To-Bash-Prompt-HOWTO>>  est disponible sur http://www.netspace.net.au/~gok/power2bash/


Organization

This book is divided into the following parts. Although most of the appendices is copied into part II (which enlarges the book somewhat), we believe it's the easiest way to read it like this. It simply saves you from having to click to an Appendix, then back to where you were in part II. That's a real chore especially if you're reading the TXT version of this book.


Partie I - Introduction

La première partie donne les informations générales à propos de ce livre (les versions, où se le procurer, changelog, listes de diffusions, et comment nous contacter). Elle va également vous expliquer certains aspects importants qu'il vous faut lire avant de commencer à créer son système LFS.


Partie II - Installation du système LFS

La seconde partie va vous guider à travers l'installation du sustème LFS lequel sera le fondation du reste du système. Quelque soit votre choix d'utilisation de votre nouveau système LFS, il devra être construit sur les fondations installées dans cette partie.


Partie III - Annexes

La troisième partie contient différentes annexes.

I. Première Partie - Introduction

Table des matières
1. Introduction
2. Informations importantes

Chapitre 1. Introduction


How things are going to be done

We are going to build the LFS system by using an already installed Linux distribution such as Debian, SuSe, Slackware, Mandrake, RedHat, etc. There is no need to have any kind of bootdisk. We will use an existing Linux system as the base (since we need a compiler, linker, text editor, and other tools).

After you have downloaded the necessary packages that make up an LFS system you will create a new Linux native partition onto which the LFS system will be installed.

The next step, chapter 5, will be the installation of a number of packages that are statically linked and installed on the LFS partition. These packages form a basic development suite which will be used to install the actual system, and are also needed to resolve circular dependencies. Examples of circular dependencies are: you need a compiler to install a compiler. You need a shell in order to install a shell. And so on.

Chapter 6 installs the actual base system. We use the chroot program to start a new shell whose root directory will be set to the LFS partition. This, in essence, is the same as rebooting and having the kernel mount the LFS partition as the root partition. The reason that we don't actually reboot, but instead chroot, is that this way you can still use your host system. While software is being installed you can simply switch to a different VC (Virtual Console) or X desktop and continue using your computer as you normally would.

When all the software is installed, chapter 7 will setup the boot scripts. Chapter 8 will setup the Linux boot loader and in chapter 9 there are some pointers what you can do after you finish the book. Then you can finally reboot your system into your new LFS system, and start to really use it.

This is the process in a nutshell. Detailed information on the steps you are taking are provided in the chapters as you go through them. If something isn't completely clear yet, don't worry. It will become very clear shortly.

Please read chapter 2 carefully as it explains a few important things you need to be aware of before you work your way through chapters 5 and above.


Conventions used in this book

To make things easy to follow, there are a number of conventions used throughout the book. Following are some examples:

./configure --prefix=/usr

This form of text is designed to be typed exactly as seen unless otherwise noted in the surrounding text. It is also used in the explanation sections to identify which of the commands is being referred to.

install-info: unknown option `--dir-file=/mnt/lfs/usr/info/dir'

This form of text (fixed width text) is showing screen output, probably as the result of commands issued and is also used to show filenames such as /etc/lilo.conf

Emphasis

This form of text is used for several purposes in the book but mainly to emphasize important points or to give examples as to what to type.

http://www.linuxfromscratch.org/

This form of text is used for hyperlinks, both within the book and to external pages such as HowTo's, download locations, websites, etc.

cat > $LFS/etc/group << "EOF"
root:x:0:
bin:x:1:
......
EOF

This type of section is used mainly when creating configuration files. The first command (in bold) tells the system to create the file $LFS/etc/group from whatever is typed on the following lines until the sequence EOF is encountered. Therefore, this whole section is generally typed as seen.


Book version

This is LFS-BOOK version 3.1 dated December 3rd, 2001. If this version is older than a month a newer version is probably already available for download. Check one of the mirror sites below for updated versions.

Below is a list of our current HTTP and FTP mirror sites as of November 18th, 2001. This list might not be accurate anymore. The latest info can be found on our website at http://www.linuxfromscratch.org.


FTP Mirrors

North America


Europe


Australia


Acknowledgments

We would like to thank the following people and organizations for their contributions toward the Linux From Scratch project:

  • Mark Stone <mstone@linux.com> for donating the linuxfromscratch.org server.

  • VA Linux Systems for providing rackspace and bandwidth for the linuxfromscratch.org server.

  • Mark Hymers <markh@linuxfromscratch.org> for being more than a great help in editing this book.

  • DREAMWVR.COM for their ongoing sponsorship by donating various resources to the LFS and related sub projects.

  • Jesse Tie Ten Quee <highos@highos.com> for running the www.ca.linuxfromscratch.org mirror.

  • Jan Niemann <jan.niemann@tu.bs.de> for running the www.de.linuxfromscratch.org mirror.

  • Torsten Westermann <westermann@linux-provider.net> for running the lfs.linux-provider.net mirror.

  • Ian Chilton <ian@ichilton.co.uk> for running the www.us.linuxfromscratch.org and www.linuxfromscratch.co.uk mirrors.

  • Dag Stenstad <dag@stenstad.net> for providing the www.no.linuxfromscratch.org mirror, and Ian Chilton <ian@ichilton.co.uk> for running it.

  • Antonin Sprinzl <Antonin.Sprinzl@tuwien.ac.at> for running the www.at.linuxfromscratch.org mirror.

  • Jason Andrade <jason@dstc.edu.au> for running the www.au.linuxfromscratch.org mirror.

  • Ian Cooper <ian@wpi.edu> for running the www.us2.linuxfromscratch.org mirror.

  • VA Linux Systems who, on behalf of Linux.com, donated a VA Linux 420 (former StartX SP2) workstation towards this project.

  • Johan Lenglet <johan@linuxfromscratch.org> for leading the French LFS translation project.

  • Jesse Tie Ten Quee <highos@highos.com> for donating a Yamaha CDRW 8824E cd writer.

  • O'Reilly for donating books on SQL and PHP.

  • Robert Briggs for donating the linuxfromscratch.org and linuxfromscratch.com domain names.

  • Frank Skettino <bkenoah@oswd.org> at OSWD for coming up the initial design of the LFS website.

  • Garrett LeSage <garrett@linux.com> for creating the LFS banner

  • Dean Benson <dean@vipersoft.co.uk> for helping out financially with setting up the LFS non-profit organization.

  • Countless other people on the various LFS mailinglists who are making this book happen by giving their suggestions, testing the book and submitting bug reports.


Changelog

3.1 - December 3rd, 2001

  • Added:

    • reiserfsprogs-3.x.0j

  • Updated to:

    • MAKEDEV-1.4

    • bash-2.05a

    • e2fsprogs-1.25

    • gettext-0.10.40

    • libtool-1.4.2

    • lilo-22.1

    • linux-2.4.16

    • man-1.5j

    • man-pages-1.43

    • modutils-2.4.12

    • sysvinit-2.83

    • util-linux-2.11m

    • vim-6.0

  • November 30th, 2001 [markh]: Chapter 6: Updated to man-1.5j. Removed the sed which we had to use with the old version as the new one detects awk properly.

  • November 30th, 2001 [markh]: Chapter 5: Added static library explanation originally posted on lfs-apps (when it still existed) by Plasmatic.

  • November 26th, 2001 [markh]: Chapter 5+6: Updated to kernel-2.4.16 and modutils-2.4.12.

  • November 26th, 2001 [markh]: Chapter 6: Added FHS compliance notes to the findutils installation.

  • November 19th, 2001 [markh]: Chapter 5+6: Updated to bash-2.05a, lilo-22.1, MAKEDEV-1.4, man-pages-1.43 and util-linux-2.11m.

  • November 5th, 2001 [markh]: Chapter 6: Created new lex script instead of link to flex following comment on lfs-dev. (This is similar to what we do with bison and yacc).

  • October 27th, 2001 [markh]: General: Large XML Tidy-up. Shouldn't affect the book text or layout. If it does, something has gone wrong!

  • October 27th, 2001 [markh]: Chapter 6: Added reiserfsprogs-3.x.0j and updated to lilo-22.0.2.

  • October 24th, 2001 [markh]: General: Fixed a bundle of spelling errors which were reported.

  • October 12th, 2001 [markh]: Chapter 5 - Kernel: Added explanation as to why we copy the kernel headers rather than symlink them.

  • October 12th, 2001 [markh]: Appendix A - Gzip: Added uncompress to the gunzip description as it was missing.

  • October 12th, 2001 [markh]: Chapter 6 - Util-linux: Removed the USRGAMES_DIR=/usr/bin entry as it's no longer needed with util-linux-2.11l.

  • October 9th, 2001 [gerard]: Chapter 6 - Kbd: Removed the --datadir option, kbd's default is set properly already.

  • October 7th, 2001 [gerard]: Chapter 6 - Shadow: Mentioned the http://hints.linuxfromscratch.org/hints/shadowpasswd_plus.txt lfs-hint

  • October 7th, 2001 [gerard]: Chapter 6 - Vim: Changed the installation instructions to fix a bug in vim-6.0's syntax/sh.vim file, and added the CPPFLAGS variable to specify the global vimrc file as /etc/vimrc

  • October 7th, 2001 [gerard]: Chapter 6: Updated to libtool-1.4.2, lilo-22.0, man-pages-1.40, modutils-2.4.10, sysvinit-2.83, util-linux-2.11l and vim-6.0

  • October 2nd, 2001 [gerard]: Chapter 9 - The End: Added the reference to the LFS Counter at http://linuxfromscratch.org/cgi-bin/lfscounter.cgi

  • September 26th, 2001 [gerard]: Chapter 1 - News server: Added reference to the news server

  • September 26th, 2001 [markh]: Chapter 6 - E2fsprogs: Changed --with-root-prefix=/ to --with-root-prefix="" in e2fsprogs install instructions. The reason for the change is that a value of / will cause symlinks and installation paths to use things like //lib instead of just /lib. This isn't bad perse, it just doesn't look nice.

  • September 26th, 2001 [markh]: Chapter 5+6: Updated to e2fsprogs-1.25, gettext-0.10.40, linux-2.4.10, modutils-2.4.9 and util-linux-2.11i.

  • September 22nd, 2001 [markh]: Appendix A: Re-ordered the descriptions into alphabetical order.

3.0 - September 21st, 2001

  • Updated to:

    • e2fsprogs-1.24

  • September 21st, 2001 [markh]: Chapter 1+7: Changed the mailing list information to reflect the new ml structure. The Ch7 change is that the rc and rcS scripts now ask people to report problems to lfs-dev instead of lfs-discuss.

  • September 18th, 2001 [gerard]: Chapter 5+6 - GCC: Added --enable-threads=posix to chapter 5, and changed --enable-threads to --enable-threads=posix in chapter 6. Although the default is posix threads when not specified, it's clearer this way what's being enabled.

  • September 17th, 2001 [gerard]: Chapter 6 - Psmisc: Added notes how to deal with psmisc's pidof symlink (in case sysvinit isn't installed) and man page. Also, added --exec-prefix=/ to psmisc's configure script in order for the programs to be installed in /bin rather than /usr/bin (bootscripts may use them, so they must be in /bin).

  • September 16th, 2001 [markh]: Chapter 6 - Util-linux: Added USRGAMES_DIR=/usr/bin to the make install routine so that /usr/games isn't created for banner and it is installed in /usr/bin.

  • September 14th, 2001 [markh]: Chapter 6 - E2fsprogs: Updated to version 1.24.

  • September 11th, 2001 [gerard]: Chapter 6 - Man: Added missing && to 'done' and chmod the configure script to mode 755 instead of 700 (more of a default mode so people don't _have_ to be running as the owner of that file).


Mailing lists and archives

The linuxfromscratch.org server is hosting the following publicly accessible mailing lists:

  • lfs-support

  • lfs-dev

  • lfs-announce

  • lfs-security

  • lfs-book

  • alfs-discuss

  • blfs-dev

  • blfs-book

  • blfs-support


lfs-support

The lfs-support mailing list provides support to users building an LFS system as far as the end of the main book. Requests for help with installing software beyond the base system should go to the blfs-support list.


lfs-dev

The lfs-dev mailing list discusses matters strictly related to the LFS-BOOK. If problems with the book come up, a bug or two need to be reported, or suggestions to improve the book should be made, this mailing list is the right one.

Requests for help should go to lfs-support or blfs-support.


lfs-announce

The lfs-announce list is a moderated list. It can be subscribed to, but you can't post any messages to this list. This list is used to announce new stable releases. The lfs-dev list will carry information about development releases as well. If a user is already on the lfs-dev list, there's little use subscribing to this list as well because everything that is posted to the lfs-announce list will be posted to the lfs-dev list as well.


lfs-security

The lfs-security mailing list discusses security-related matters. Security concerns or security problems with a package used by LFS, should be addressed on this list.


lfs-book

The lfs-book list is used by the LFS-BOOK editors to co-ordinate lfs-book's maintenance, like XML issues and the like. Actual discussion on what should be added and removed take place on lfs-dev.


alfs-discuss

The alfs-discuss list discusses the development of ALFS, which stands for Automated Linux From Scratch. The goal of this project is to develop an installation tool that can install an LFS system automatically. Its main goal is to speed up compilation by taking away the need to manually enter the commands to configure, compile, and install packages.


blfs-dev

The blfs-dev mailing list discusses matters related to the BLFS-BOOK (Beyond LFS). If problems with the book come up, a bug or two need to be reported, or suggestions to improve the book (such as suggestions as to installation instructions to add) are to be made, this mailing list is the right one.

Requests for help with programs beyond the base LFS setup (not just those in BLFS) should go to blfs-support.


blfs-book

The blfs-book list is used by the BLFS-BOOK editors to co-ordinate blfs-book's maintenance, like XML issues and the like. Actual discussion on what should be added and removed should take place on blfs-dev.


blfs-support

The blfs-support list deals with support requests for any software not installed in the LFS book. The list is not just for help with software explicitly mentioned in the BLFS book, any software beyond that installed as part of the base LFS system can be discussed here.


How to subscribe?

Any of the above-mentioned mailinglists can be subscribed to by sending an email to listar@linuxfromscratch.org and writing subscribe listname as the subject header of the message.

Multiple lists at the same time can be subscribed to by using one email. This is done by leaving the subject blank and putting all the commands in the body of the email. The email will look like:

To: listar@linuxfromscratch.org
Subject:

subscribe lfs-dev
subscribe blfs-support
subscribe alfs-discuss

After the email is sent, the Listar program will reply with an email requesting a confirmation of the subscription request. After this confirmation email is sent back, Listar will send an email again with the message that the user has been subscribed to the list(s) along with an introduction message for that particular list.


How to unsubscribe?

To unsubscribe from a list, send an email to listar@linuxfromscratch.org and write unsubscribe listname as the subject header of the message.

Multiple lists can be unsubscribed at the same time using one email. This is done by leaving the subject header blank and putting all the commands in the body of the email. The email will look like:

To: listar@linuxfromscratch.org
Subject:

unsubscribe lfs-dev
unsubscribe blfs-support
unsubscribe alfs-discuss

After the email is sent, the Listar program will reply with an email requesting a confirmation of the unsubscription request. After this confirmation email is sent back, Listar will send an email again with the message that the user has been unsubscribed from the list(s).


Other list modes

The modes that can be set by a user require sending an email to listar@linuxfromscratch.org. The modes themselves are set by writing the appropriate commands in the subject header of the message.

As the name implies, the Set command tells what to write to set a mode. The Unset command tells what to write to unset a mode.

The listname in the example subject headers should be replaced with the listname to which the mode is going to be applied to. If more than one mode is to be set (to the same list or multiple lists) with one email, this can be done by leaving the subject header blank and writing all the commands in the body of the message instead.


Digests


Set command: set listname digest
Unset command: unset listname digest

All lists have the digest mode available which can be set after a user has subscribed to a list. Being in digest mode will cause you to stop receiving individual messages as they are posted to the list and instead receive one email a day containing all the messages posted to the list during that day.

There is a second digest mode called digest2. When a user is set to this mode he will receive the daily digests but will also continue to receive the individual messages to the lists as they are posted. To set this mode, substitute digest for digest2 in the command.


Vacation


Set command: set listname vacation
Unset command: unset listname vacation

If a user is going to be away for a while or wishes to stop receiving messages from the lists but doesn't want to unsubscribe, he can change to vacation mode. This has the same effect as unsubscribing, but without having to go through the unsubscribe process and then later through the subscribe process again.


News server

All the mailing lists hosted at linuxfromscratch.org are also accessible via the NNTP server. All messages posted to a mailing list will be copied to the correspondent newsgroup, and vice versa.

The news server can be reached at news.linuxfromscratch.org


Contact information

Please direct your emails to one of the LFS mailing lists. See Chapter 1 - Mailing lists and archives for more information on the available mailing lists.

If you need to reach Gerard Beekmans personally, send an email to gerard@linuxfromscratch.org


Chapitre 2. Informations importantes


A propos de $LFS

S'il vous plait, lisez ce paragraphe attentivement : tout au long de ce livre, la variable $LFS sera utilisée fréquemment. Vous devrez la remplacer partout où vous la trouverez par le répertoire dans lequel vous avez monté la partition qui contient votre système LFS. La méthode pour créer et l'endroit où monter cette partition seront expliqués en détail au chapitre 4. A titre d'exemple, supposons que la partition LFS soit montée dans le répertoire /mnt/lfs.

Quand il est demandé de lancer une commande telle que ./configure --prefix=$LFS, il vous faut en pratique exécuter ./configure --prefix=/mnt/lfs

Il est très important que cela soit fait quel que soit l'endroit où vous le lisez, que ce soit pour une commande à donner à un shell ou dans un fichier édité ou créé.

Une solution possible est de définir la variable d'environnement LFS. De cette façon, $LFS peut être tapé directement au lieu de le remplacer par /mnt/lfs. Cela peut être accomplit en exécutant la commande export LFS=/mnt/lfs.

A partir de ce moment, lorsqu'il vous sera demandé d'entrer une commande telle que ./configure --prefix=$LFS vous pourrez la taper littéralement. Votre shell fera le remplacement de $LFS par /mnt/lfs lors de l'analyse de la ligne de commande (c'est-à-dire après avoir appuyé sur la touche Entrée).

Si vous décidez d'utiliser cette méthode pour $LFS, n'oubliez pas de définir cette variable à chaque fois. Si la variable n'a pas été définie mais qu'elle est utilisée dans une commande, $LFS sera remplacée par rien, et la commande résultante sera tout de même exécutée. Une commande telle que echo "root:x:0:0:root:/root:/bin/bash" > $LFS/etc/passwd avec la variable non définie va effacer et re-créer le fichier /etc/passwd de votre système courant. En clair : vous aurez perdu la base des utilisateurs sur votre machine !

Une bonne méthode pour s'assurer que la variable $LFS est définie à chaque fois consiste à la définir dans le fichier /root/.bash_profile et/ou le fichier /root/.bashrc afin qu'à chacune de vos connections (ou sessions par 'su') vers le compte root, la variable $LFS soit définie.


Comment télécharger les logiciels

Throughout this document, we will assume that all the packages that were downloaded are placed somewhere in $LFS/usr/src.

A convention you could use is having a $LFS/usr/src/sources directory. Under sources, you can create the directory 0-9 and the directories a through z. A package like sysvinit-2.83.tar.bz2 is stored under $LFS/usr/src/sources/s/. A package like bash-2.05a.tar.bz2 is stored under $LFS/usr/src/sources/b/, and so forth.

Tout au long de ce document, nous supposerons que vous avez placé les packages dans le répertoire $LFS/usr/src.

Vous pourriez par exemple choisir comme convention d'avoir un répertoire $LFS/usr/src/sources, dans lequel vous pourriez créer des répertoires 0-9 et a à z. Un package tel que sysvinit-2.83.tar.bz2 serait alors placé dans $LFS/usr/src/sources/s/. Le package bash-2.05a.tar.bz2 serait quant à lui dans $LFS/usr/src/sources/b/, et ainsi de suite.

Le chapitre suivant contient la liste de tous les packages que vous devez télécharger, mais la partition devant héberger votre système LFS n'a pas encore été créée. Les fichiers seront donc stockés temporairement ailleurs, libre à vous de décider où, et ce ne sera qu'à la fin du chapitre décrivant la préparation de cette partition que vous les déplacerez dans le répertoire $LFS/usr/src/.


Comment installer les logiciels

Avant que vous ne commenciez à utiliser le livre LFS, nous aimerions vous faire remarquer que toutes les commandes employées supposent que vous utilisiez le shell bash. Si cela n'est pas le cas, les commandes peuvent fonctionner mais nous ne pouvons le garantir. Si vous voulez vous simplifier la vie, utilisez bash.

Avant de pouvoir faire quelquechose d'un package, vous devrez d'abord le déballer. Souvent, les packages sont des archives tar qui ont été compréssés avec gzip ou bzip2. Nous n'expliquerons pas à chaque fois comment déballer une arhive. Nous allons vous l'expliquer une bonne fois pour toutes dans cette section.

Pour commencer, placez vous dans le répertoire $LFS/usr/src en tapant :

cd $LFS/usr/src

Si une archive est au format tar et gzip, elle est déballée grâce à l'une de ces deux commandes, suivant le nom du fichier :

tar xvzf filename.tar.gz
tar xvzf filename.tgz

Si une archive est au format tar et bzip2, elle est déballée par la commande :

bzcat filename.tar.bz2 | tar xv

Quelques versions de tar (la plupart de nos jours, mais pas encore toutes) ont été modifiés pour utiliser directement bzip2 grâce à l'option I, y ou j, qui fonctionne me manière identique à l'option z pour la gestion des archives compréssées avec gzip. La commande ci-dessus fonctionne quel que soit la manière dont votre système à été modifié pour gérer le bzip2 dans la commande tar.

Si une archive est simplement en tar, elle est déballée par la commande :

tar xvf filename.tar

Quand une archive est déballée, un nouveau répertoire est crée dans le répertoire courant (et ce livre suppose que les archives sont déballées dans le répertoire $LFS/usr/src). Placez vous dans ce nouveau répertoire pour la suite de la procédure d'installation. A chaque fois que ce livre vous expliquera l'installation d'un package, ce sera à vous de déballer l'archive des sources et de vous placer dans le répertoire créé.

De temps en temps, il vous faudra travailler avec de simple fichiers tels que des fichiers de patch. Ces fichiers vous seront généralement fournis compréssés avec gzip ou bzip2. Avant de pouvoir les utiliser, il faudra les décomprésser.

Si un fichier a été compréssé avec gzip, il sera décompréssé par :

gunzip filename.gz

Si un fichier a été compréssé avec bzip2, il sera décompréssé par :

bunzip2 filename.bz2

Après l'installation d'un package s'offrent à vous deux choix : soit effacer le répertoire contenant les sources, soit le garder. Nous vous recommendons vivement de le supprimer. Si vous ne le faites pas et essayez de ré-utiliser les sources plus tard (par exemple, ré-utiliser les sources du chapitre 5 pour les utiliser au chapitre 6), il est possible que cela ne fonctionne pas de la manière attendue. En effet, les sources utilisés au chapitre 5 auront des paramètres de configuration propres à la distribution hôte que vous avez utilisé, qui ne sont pas toujours applicables au système LFS après être rentré dans l'environnement chroot. Même l'utilisation de la commande make clean ne garantie pas toujours le nettoyage complet des sources.

Pensez donc à vous éviter nombre d'ennuis, et supprimez simplement le répertoire contenant les sources après installation.

Il est cependant un cas d'exception à cette règle, c'est celui des sources du noyau. Gardez le dans un coin, car vous en aurez besoin plus tard pour compiler un noyau. Aucun package n'utilise les sources du noyau, donc celles-ci ne seront pas un obstacle.


Comment demander de l'aide

Si vous rencontrez dans problèmes en utilisant ce livre, vous vous rendrez compte que les personnes sur IRC et sur les listes de discution seront pret à vous aider. Vous trouverez la liste des listes de discution dans Chapter 1 - Mailing lists and archives. Pour nous permettre de vous aider, vous devrez cependant vous assurer d'avoir le plus possible d'informations sur le problème, afin de pouvoir diagnostiquer le problème et lui apporter une solution. Cette partie du livre va vous guider pour le type d'information utiles.


Information de base

Tout d'abord, nous aurons besoin d'une explication rapide du problème. Les choses essentielles à inclure sont :

  • la version du livre que vous utilisez, qui est 3.1;

  • avec quel package ou section vous aves un problème;

  • quel est le message d'erreur exact, ou le symptome, que vous recevez;

  • si vous vous êtes éloigné du livre ou non.

Notez que dire que vous vous êtes éloigné du livre ne signifie pas que nous ne vous aiderons pas, car après tout la LFS est justement un ensemble de choix. Cela nous aidera simplement à voir les autres causes possibles à votre problème.


Problèmes de configuration

Quand quelquechose se passe mal pendant l'étape où le script configure est lancé, regardez dans les dernières lignes du fichier config.log. Il contient les erreurs pôssibles qui ont été rencontrées pendant la phase de configuration, et qui ne sont pas toujours affichées à l'écran. Incluez les lignes appropriées si vous décidez de demander de l'aide..


Problèmes de compilation

Pour nous aider à trouver la cause du problème, à la fois les textes affichés à l'écran et le contenus de plusieurs fichiers sont utils. Les informations affichées par à la fois le script ./configure et la commande make peuvent être utiles. N'incluez pas aveuglément l'ensemble, mais d'un autre côté n'en donnez pas trops peu. A titre d'exemple, voici l'affichage d'une commande make :

gcc -DALIASPATH=\"/mnt/lfs/usr/share/locale:.\" 
-DLOCALEDIR=\"/mnt/lfs/usr/share/locale\" -DLIBDIR=\"/mnt/lfs/usr/lib\" 
-DINCLUDEDIR=\"/mnt/lfs/usr/include\" -DHAVE_CONFIG_H -I. -I.   
-g -O2 -c getopt1.c
gcc  -g -O2 -static -o make  ar.o arscan.o commands.o dir.o expand.o file.o 
function.o getopt.o implicit.o job.o main.o misc.o read.o remake.o rule.o 
signame.o variable.o vpath.o default.o remote-stub.o version.o opt1.o    
-lutil job.o: In function `load_too_high':
/lfs/tmp/make-3.79.1/job.c:1565: undefined reference to `getloadavg'
collect2: ld returned 1 exit status
make[2]: *** [make] Error 1
make[2]: Leaving directory `/lfs/tmp/make-3.79.1'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/lfs/tmp/make-3.79.1'
make: *** [all-recursive-am] Error 2

Dans ce genre de cas, nombreuses sont les personnes qui ne fournissent que la section du bas contenant le texte
make [2]: *** [make] Error 1
jusqu'en bas. Cela n'est pas suffisant pour émettre un diagnostique sur le problème, car cela nous signale que quelquechose s'est mal passé, mais pas ce qui s'est mal passé. La section complète, comme fournie ci-dessus, constitue ce qui doit être inclus pour nous être utile, car il inclus la commande qui à été éxécutée avec son message d'erreur.


Télécharger les scripts de démarage

Retaper tous les scripts de démarrage fournis au chapitre 7 risque d'être long et ennuyeux, pour ne pas dire une grande source d'erreur.

Pour gagner du temps, ces scripts peuvent être téléchargés à partir de http://ftp.linuxfromscratch.org/lfs-bootscripts/lfs-bootscripts-3.1.tar.bz2 ou de ftp://ftp.linuxfromscratch.org/lfs-bootscripts/lfs-bootscripts-3.1.tar.bz2 .


Télécharger les commandes LFS

Les commandes LFS sont fournis sous la forme d'une archive tar qui contient les fichiers donnant la liste des commandes d'installation pour les package proposés dans ce livre.

Ces fichiers peuvent être utilisés pour trouver rapidement quelles commandes ont changés entre les différentes versions de la LFS. Téléchargez l'archive lfs-commands accompagnant cette version du livre et celle de la version précédente, et lancez l'utilitaire diff sur les fichiers. Cela permet de mettre en évidence pour quels packages les instructions d'installation ont été modifiés, de tel façon que tout script que vous pourriez avoir puisse être modifié ou que vous puissez réinstaller n'importe quel package si nécessaire.

A side effect is that these files can be used to dump to a shell and install the packages, though some files need to be modified (where certain settings can't be guessed and depend on user preference or system hardware). Keep in mind, please, that these files are not thoroughly checked for correctness. There may be bugs in the files (since they are manually created at the moment) so do check them and don't blindly trust them.

If you decide to use the commands to automatically install a package and it doesn't work, try reading the book's instructions instead before you ask for help on the mailinglist.

Une des conséquences est que ces fichiers peuvent être utilisés à partir d'un shell pour installer un package, bien que quelques fichiers puissent nécéssiter des modifications (là où certains paramètres ne peuvent pas être devinés, puisque dépendant des préférences de l'utilisateur ou de la configuration matérielle). Gardez toujours à l'esprit que ces scripts n'ont pas été vérifiés à la perfection. Il peut subsister quelques bugs dans les fichiers (car ils sont créés manuellement pour le moment), donc prenez la peine de les vérifier vous-même et ne croyez pas aveuglement.

Si vous décidez d'utiliser la commande pour installer automatiquement un package et que cela ne fonctionne pas, commencez par lire les instructions dans le livre avant de demander de l'aide sur la liste de discution.

Les commandes LFS peuvent être obtenues à partir de http://ftp.linuxfromscratch.org/lfs-commands/ ou de ftp://ftp.linuxfromscratch.org/lfs-commands/ .


Chapitre 3. Packages qui doivent être téléchargés


Introduction

Ci-dessous, se trouve une liste de tous les paquetages à télécharger pour construire le système de base. Les numéros de version affichés correspondent à des versions de logiciel qui fonctionnent, et qui sont la base du livre. Si vous rencontrez des problèmes que vous ne pouvez résoudre vous-même, veuillez télécharger dans ce cas la version indiquée par le livre (au cas où vous auriez téléchargé une version plus récente).

Toutes les URLs ci-dessous appartiennent au serveur ftp.linuxfromscratch.org. Nous avons quelques miroirs FTP disponibles, à partir desquels vous pouvez aussi télécharger les fichiers. Les adresses des sites miroirs peuvent être trouvé sur Chapter 1 - Book Version.

Nous avons fourni une liste des sites officiels de téléchargement des packages dans Annexe D - Sites de téléchargements officiels. L'archive LFS FTP ne contient que les versions des paquetages recommandées par ce livre. Vous avez toujours la possibilite de consulter les Sites officiels dans l'Annexe C afin de vérifier s'il existe une nouvelle version. Pour ceux qui téléchargeront une version plus récente, nous apprécierions énormement de savoir si vous êtes parvenus ou non à installer cette version, grâce aux instructions de ce livre.

Prenez note que tous les fichiers téléchargés de l'archive LFS FTP sont compressés avec bzip2 au lieu de gzip. Si vous ne savez pas comment utiliser les fichiers bz2, veuillez vous reporter à Chapter 2 - How to install the software.


Packages qui doivent être téléchargés


Explorer avec FTP: 
ftp://ftp.linuxfromscratch.org/

Explorer avec HTTP:
http://ftp.linuxfromscratch.org/


Vous pouvez soit télécharger une archive tar qui contient tous les packages
utilisés pour compiler un système LFS:


Tous les packages LFS - 80,540 MB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/lfs-packages-3.1.tar
http://ftp.linuxfromscratch.org/lfs-packages/3.1/lfs-packages-3.1.tar


Soit télécharger individuellement les packages suivants:


Bash (2.05a) - 1,400 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/bash-2.05a.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/bash-2.05a.tar.bz2


Binutils (2.11.2) - 7,641 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/binutils-2.11.2.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/binutils-2.11.2.tar.bz2


Bzip2 (1.0.1) - 410 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/bzip2-1.0.1.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/bzip2-1.0.1.tar.bz2


Diff Utils (2.7) - 247 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/diffutils-2.7.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/diffutils-2.7.tar.bz2


File Utils (4.1) - 1217 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/fileutils-4.1.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/fileutils-4.1.tar.bz2


GCC (2.95.3) - 9,618 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/gcc-2.95.3.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/gcc-2.95.3.tar.bz2


Patch de GCC (2.95.3-2) - 8 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/gcc-2.95.3-2.patch.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/gcc-2.95.3-2.patch.bz2


Noyau Linux (2.4.16) - 23,190 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/linux-2.4.16.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/linux-2.4.16.tar.bz2


Grep (2.4.2) - 382 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/grep-2.4.2.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/grep-2.4.2.tar.bz2


Gzip (1.2.4a) - 178 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/gzip-1.2.4a.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/gzip-1.2.4a.tar.bz2


Patch de Gzip (1.2.4a) - 1 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/gzip-1.2.4a.patch.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/gzip-1.2.4a.patch.bz2


Make (3.79.1) - 794 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/make-3.79.1.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/make-3.79.1.tar.bz2


Sed (3.02) - 221 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/sed-3.02.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/sed-3.02.tar.bz2


Sh-utils (2.0) - 824 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/sh-utils-2.0.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/sh-utils-2.0.tar.bz2


Patch de Sh-utils (2.0) - 1 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/sh-utils-2.0.patch.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/sh-utils-2.0.patch.bz2


Tar (1.13) - 730 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/tar-1.13.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/tar-1.13.tar.bz2


Patch de Tar (1.13) - 1 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/tar-1.13.patch.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/tar-1.13.patch.bz2


Text Utils (2.0) - 1,040 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/textutils-2.0.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/textutils-2.0.tar.bz2


Mawk (1.3.3) - 168 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/mawk1.3.3.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/mawk1.3.3.tar.bz2


Texinfo (4.0) - 812 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/texinfo-4.0.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/texinfo-4.0.tar.bz2


Patch (2.5.4) - 149 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/patch-2.5.4.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/patch-2.5.4.tar.bz2


MAKEDEV (1.4) - 7 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/MAKEDEV-1.4.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/MAKEDEV-1.4.bz2


Glibc (2.2.4) - 11,932 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/glibc-2.2.4.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/glibc-2.2.4.tar.bz2


Glibc-linuxthreads (2.2.4) - 161 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/glibc-linuxthreads-2.2.4.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/glibc-linuxthreads-2.2.4.tar.bz2


Man-pages (1.43) - 509 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/man-pages-1.43.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/man-pages-1.43.tar.bz2


Patch de Man-pages (1.43) - 2 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/man-pages-1.43.patch.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/man-pages-1.43.patch.bz2


Ed (0.2) - 158 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/ed-0.2.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/ed-0.2.tar.bz2


Find Utils (4.1) - 226 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/findutils-4.1.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/findutils-4.1.tar.bz2


Patch de Find Utils (4.1) - 226 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/findutils-4.1.patch.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/findutils-4.1.patch.bz2


Ncurses (5.2) - 1,308 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/ncurses-5.2.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/ncurses-5.2.tar.bz2


Vim (6.0) - 2,711 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/vim-6.0.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/vim-6.0.tar.bz2


Bison (1.28) - 321 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/bison-1.28.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/bison-1.28.tar.bz2


Less (358) - 178 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/less-358.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/less-358.tar.bz2


Groff (1.17.2) - 1,214 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/groff-1.17.2.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/groff-1.17.2.tar.bz2


Man (1.5j) - 167 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/man-1.5j.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/man-1.5j.tar.bz2


Perl (5.6.1) - 4,750 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/perl-5.6.1.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/perl-5.6.1.tar.bz2


M4 (1.4) - 249 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/m4-1.4.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/m4-1.4.tar.bz2


Autoconf (2.52) - 618 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/autoconf-2.52.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/autoconf-2.52.tar.bz2


Automake (1.5) - 409 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/automake-1.5.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/automake-1.5.tar.bz2


Flex (2.5.4a) - 278 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/flex-2.5.4a.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/flex-2.5.4a.tar.bz2


File (3.36) - 138 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/file-3.36.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/file-3.36.tar.bz2



Libtool (1.4.2) - 653 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/libtool-1.4.2.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/libtool-1.4.2.tar.bz2


Bin86 (0.16.0) - 113 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/bin86-0.16.0.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/bin86-0.16.0.tar.bz2


Gettext (0.10.40) - 941 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/gettext-0.10.40.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/gettext-0.10.40.tar.bz2


Kbd (1.06) - 559 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/kbd-1.06.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/kbd-1.06.tar.bz2


E2fsprogs (1.25) - 1,029 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/e2fsprogs-1.25.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/e2fsprogs-1.25.tar.bz2


Lilo (22.1) - 262 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/lilo-22.1.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/lilo-22.1.tar.bz2


Modutils (2.4.12) - 209 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/modutils-2.4.12.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/modutils-2.4.12.tar.bz2


Procinfo (18) - 22 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/procinfo-18.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/procinfo-18.tar.bz2


Procps (2.0.7) - 153 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/procps-2.0.7.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/procps-2.0.7.tar.bz2


Psmisc (20.1) - 51 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/psmisc-20.1.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/psmisc-20.1.tar.bz2


Reiserfsprogs (3.x.0j) - 196 Kb:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/reiserfsprogs-3.x.0j.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/reiserfsprogs-3.x.0j.tar.bz2


Kit Shadow Password (20001016) - 551 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/shadow-20001016.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/shadow-20001016.tar.bz2


Sysklogd (1.4.1) - 67 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/sysklogd-1.4.1.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/sysklogd-1.4.1.tar.bz2


Sysvinit (2.83) - 75 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/sysvinit-2.83.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/sysvinit-2.83.tar.bz2


Util Linux (2.11m) - 995 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/util-linux-2.11m.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/util-linux-2.11m.tar.bz2


Netkit-base (0.17) - 49 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/netkit-base-0.17.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/netkit-base-0.17.tar.bz2


Net-tools (1.60) - 194 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/net-tools-1.60.tar.bz2
http://ftp.linuxfromscratch.org/lfs-packages/3.1/net-tools-1.60.tar.bz2



Taille totale de tous les packages: 80,540 MB (78.65 MB)


Chapitre 4. Preparing a new partition


Introduction

Dans ce chapitre, nous allons préparer la partition qui accueillera le système LFS. On créera tout d'abord cette partition, puis un système de fichiers et enfin la structure des répertoires. Après cela, nous pourrons passer au chapitre suivant et entamer réellement le processus de construction.


Création d'une nouvelle partition

Tout d'abord, sachez qu'il est possible de construire un système LFS sur une seule partition, où se trouve votre distribution originale. Ceci n'est pas recommandé si c'est la première fois que vous essayez LFS, mais peut être utile si vous vous trouvez à court d'espace disque. Au cas où cela vous tente, jetez un oeil sur le document accessible à http://hints.linuxfromscratch.org/hints/one-partition-hint.txt. Gardez à l'esprit que ceci est un vrai hint et que par conséquent, il ne s'agit pas encore d'un document fini.

Avant de pouvoir construire notre nouveau système Linux, nous devons avoir une partition Linux vide dans laquelle nous pourrons créer notre nouveau système. Je vous recommande une partition d'une taille d'au moins 750 Mo. Cela vous donne assez d'espace pour stocker toutes les archives et pour compiler tous les paquetages sans avoir à se préoccuper de manquer d'espace disque temporaire nécessaire. Cependant vous aurez probablement envie de plus d'espace que cela, si vous décidez d'utiliser le système LFS comme système principal. Si c'est le cas, vous aurez besoin de plus d'espace pour installer d'autres logiciels. Si vous disposez déjà d'une partition native Linux, vous pouvez passer cette sous-section.

Le programme cfdisk (ou tout autre programme fdisk de votre choix) est démarré avec comme option le disque dur approprié (tel que /dev/hda, si une nouvelle partition doit être créée sur le disque maître primaire IDE). Cela permet de créer une partition native Linux, écrire la table de partition et sortir du programme cfdisk. Veuillez vous reporter à la documentation concernant le programme fdisk de votre choix (la lecture des pages man est souvent un bon début) et lisez les procédures relatives à la création d'une partition native Linux et à l'écriture d'une table de partition.

Rappelez vous de l'identification de votre nouvelle partition. Ce peut être quelque chose comme hda11. Cette partition nouvellement créée sera appelée la partition LFS dans ce livre.


Creating a file system on the new partition

Once the partition is created, we have to create a new file system on that partition. The standard file system used these days is the ext2 file system, but the so-called journaling file systems are becoming increasingly popular too. It's of course up to you to decide which file system you want to create, but because we have to assume and work with something, we will assume you chose the ext2 file system.

To create an ext2 file system, use the mke2fs command. The LFS partition is used as the only option to the command and the file system is created.

mke2fs /dev/xxx

Replace "xxx" by the partition's designation (like hda11).


Montage d'une nouvelle partition

Maintenant que le système de fichiers a été créé, il est prêt à être utilisé. Tout ce que nous avons à faire pour accéder à la partition (c'est-à-dire pour pouvoir y lire ou écrire des données), c'est de la monter. Si vous la montez sous /mnt/lfs, vous pouvez accéder à la partition en allant au répertoire /mnt/lfs. Nous considérerons dans ce livre que vous l'avez montée dans /mnt/lfs. Peu importe le répertoire que vous choisirez, du moment que vous vous en rappelez.

Créez le répertoire /mnt/lfs en exécutant :

mkdir -p /mnt/lfs

Maintenant, montez la partition LFS en exécutant :

mount /dev/xxx /mnt/lfs

Remplacez << xxx>>  par l'identificateur de votre partition (tel que hda11).

Ce répertoire (/mnt/lfs) est la variable $LFS dont nous avons déjà parlé précédemment. Désormais si vous voulez utiliser la variable d'environnement $LFS, il vous faudra exécuter export LFS=/mnt/lfs maintenant.


Creating directories

Before we start creating directories, we need to check the base system's umask setting. To do this, we run umask. The result should be 022. If it isn't, then run the following command to ensure that the directories will be created with the correct permissions:

umask 022

We would advise you to make sure that the umask is set to 022 throughout your LFS installation.

Let's now create the directory tree on the LFS partition based on the FHS standard, which can be found at http://www.pathname.com/fhs/. Issuing the following commands will create a default directory layout:

cd $LFS &&
mkdir -p bin boot dev/pts etc/opt home lib mnt proc root sbin tmp var opt &&
for dirname in $LFS/usr $LFS/usr/local
   do
   mkdir $dirname
   cd $dirname
   mkdir bin etc include lib sbin share src var
   ln -s share/man man
   ln -s share/doc doc
   ln -s share/info info
   cd $dirname/share
   mkdir dict doc info locale man nls misc terminfo zoneinfo
   cd $dirname/share/man
   mkdir man{1,2,3,4,5,6,7,8}
done
cd $LFS/var &&
mkdir -p lock log mail run spool tmp opt cache lib/misc local &&
cd $LFS/opt &&
mkdir bin doc include info lib man &&
cd $LFS/usr &&
ln -s ../var/tmp tmp

Normally, directories are created with permission mode 755, which isn't desired for all directories. The first change is a mode 0750 for the $LFS/root directory. This is to make sure that not just everybody can enter the /root directory (the same a user would do with /home/username directories). The second change is a mode 1777 for the tmp directories. This way, any user can write data to the /tmp or /var/tmp directory but cannot remove another user's files (the latter is caused by the so-called "sticky bit" - bit 1 of the 1777 bit mask).

cd $LFS &&
chmod 0750 root &&
chmod 1777 tmp var/tmp

Now that the directories are created, copy the source files that were downloaded in chapter 3 to some subdirectory under $LFS/usr/src (you will need to create the desired directory yourself).


FHS compliance notes

The FHS stipulates that the /usr/local directory should contain the bin, games,include, lib, man, sbin, and share subdirectories. You can alter your /usr/local directory yourself if you want your system to be FHS-compliant.

Also, the standard says that there should exist a /usr/share/games directory, which we don't much like for a base system. But feel free to make your system FHS-compliant if you wish. The FHS isn't precise as to the structure of the /usr/local/share subdirectories, so we took the liberty of creating the directories that we felt needed.


Chapitre 5. Préparer le système LFS


Introduction

Dans les chapitres suivants, nous allons installer tous les logiciels qui font partie d'un système Linux de base. Après en avoir terminé avec ce chapitre et le suivant, vous aurez un système Linux pleinement fonctionnel. Les chapitres restants traitent de la création des scripts de démarrage, de la manière de rendre le système LFS amorçable, et de la mise en place du réseau de base.

Les logiciels dans ce chapitre seront liés statiquement et seront réinstallés au chapitre suivant avec une édition de liens dynamiques. Nous commencons par une version statique parce qu'il est possible que notre système Linux normal et notre système LFS n'utilisent pas la même version de bibliothèque C. Si les programmes de la première partie étaient liés à une version ancienne de la bibliothèque C, ces programmes pourraient ne pas bien fonctionner dans le système LFS. Une autre raison est de résoudre les dépendances circulaires. Un exemple d'une telle dépendance est que vous avez besoin d'un compilateur pour installer un compilateur, et que vous allez avoir besoin d'un shell pour installer un shell et le compilateur.

La clef pour apprendre ce qui fait fonctionner Linux est de savoir exactement quelle est l'utilité de chaque package et en quoi un utilisateur ou le système en a besoin. Les descriptions du contenu des packages sont fournies après la sous-section Installation de chaque package, et aussi dans l'annexe A.

Pendant l'installation de certains packages, vous verrez très probablement des messages d'alerte du compilateur défilant sur votre écran. Ceci est normal et peut être ignoré sans danger. Il s'agit seulement de messages d'avertissement (principalement au sujet d'utilisation incorrecte, mais pas illégale, de la syntaxe de C ou de C++. C'est simplement que, souvent, les standards du langage C ont changé, et les packages utilisent encore le vieux standard, ce qui n'est pas un problème).

Avant de commencer, assurez-vous que vous avez positionné correctement la variable LFS, si vous avez décidé de l'utiliser. Exécutez ce qui suit:

echo $LFS

Vérifiez que la sortie contient le bon répertoire vers le point de montage de la partition LFS (/mnt/lfs par exemple).


Pourquoi utiliser une édition de lien statique ?

Merci à Plasmatic d'avoir posté, dans une des listes de diffusion, le texte sur lequel cette partie est principalement fondée.

Lorsque l'on crée (compile) un programme, plutôt que d'avoir à réécrire l'ensemble des fonctions nécessaires à l'accès au noyau, au matériel, aux fichiers, etc. on récupère toutes ces fonctions de base dans des bibliothèques. glibc, que l'on installera plus tard, est une des principales bibliothèques, qui contient le code pour toutes les fonctions de base nécessaires aux programmes, telles que l'accès aux fichiers, l'affichage d'informations à l'écran, et les comptes-rendus aux utilisateurs. A la compilation du programme, ces bibliothèques sont liées au nouveau programme, de façon à ce qu'il puisse utiliser toutes les fonctions contenues dans les bibliothèques.

Cependant, ces bibliothèques peuvent être assez volumineuses (par exemple, libc.a approche régulièrement les 2,5Mo), vous ne voudrez sans doute pas dupliquer chaque bibliothèque liée à votre programme. Imaginez que vous ayez une commande simple comme ls liée avec une bibliothèque de 2,5Mo! Au lieu de fusionner la bibliothèque et le programme, ce qui correspond à une édition de liens statique, mieux vaut la laisser dans un fichier indépendant et ne la charger qu'en cas de besoin. C'est cette édition de liens dynamiques qui permet de charger et décharger dynamiquement une bibliothèque selon les besoins du programme.

Nous avons maintenant un fichier de 1Ko et un de 2.5Mo, mais somme toute nous n'avons pas économisé d'espace mémoire (excepté peut-être en mémoire vive jusqu'à ce que l'on utilise la bibliothèque). L'avantage REEL de l'édition de liens dynamiques est qu'il nous suffit d'une seule copie de cette bibliothèque. Si ls et rmutilisent tous deux la même bibliothèque, ils n'ont pas besoin de deux copies de cette bibliothèque, alors qu'ils peuvent tous les deux accéder au code d'un seul et même fichier. Même en mémoire, les deux programmes se partagent le même code, plutôt que de le dupliquer en mémoire. Du coup, nous n'économisons pas seulement l'espace disque, mais aussi la mémoire vive si précieuse.

Si l'édition de liens dynamiques a tous ces avantages, pourquoi utiliser alors exclusivement l'édition de liens statiques ? Et bien, c'est parce que lorsque vous exécuterez chroot dans votre flambant neuf (mais plutôt incomplet) environnement LFS, ces bibliothèques dynamiques ne seront pas disponibles car elles se situeront dans votre ancienne arborescence de répertoires (/usr/lib par exemple) qui ne sera pas accessible depuis votre racine LFS ($LFS).

Ainsi, pour que vos nouveaux programmes fonctionnent dans l'environnement chroot vous devrez être sûr que les bibliothèques soient liées statiquement lorsque vous les compilerez, ce qui explique les options --enable-static-link, --disable-shared, et -static utilisées tout au long du chapitre 5. Au Chapitre 6, la première chose que nous ferons sera la création de la principale bibliothèque du système, glibc. Cela fait, nous commencerons à recréer tous les programmes étudiés au chapitre 5, mais en les liant dynamiquement cette fois, de façon à profiter du gain d'espace proposé par cette méthode.

Et maintenant vous savez pourquoi utiliser cette mystérieuse option -static. Si vous essayer de ne pas l'utiliser, vous verrez très rapidement ce qui arrivera lors de l'exécution du chroot dans votre nouveau et imparfait système LFS.

Si vous voulez en savoir plus sur l'édition de liens dynamiques, consultez un ouvrage ou un site web sur la programmation, plus spéciallement consacré à Linux.


Installer tous les logiciels sous l'utilisateur root

Il vaut mieux se connecter sous root, ou changer l'utilisateur en root, quand on installe les packages. Ainsi, vous êtes sûr que tous les fichiers appartiennent à l'utilisateur et au groupe root (et ne sont pas la possession d'un utilisateur identifié en non root). Si un package nécessite des permissions particulières, cela peut se faire sans problème lié à un accès non root.

La documentation fournie avec Glibc, Gcc et les autres packages recommande de ne pas compiler les packages en étant utilisateur root. Nous pensons qu'il est sage d'ignorer cette recommandation et de compiler quand même sous root. Des centaines de personnes utilisant LFS l'ont fait sans problème, et nous n'avons rencontré aucun bogue dans le processus de compilation qui puisse causer du tort. C'est donc suffisamment sûr (on ne peut jamais être sûr à 100%, c'est donc à vous au final qu'il appartient de décider).


Installer Bash-2.05a

Estimation du temps de construction:           3 minutes 
Estimation de l'espace disque requis:  20 MB

Installation de Bash

Avant d'installer Bash, vous devez vérifier que votre distribution a les fichiers /usr/lib/libcurses.a et /usr/lib/libncurses.a présents. Si votre distribution est un système LFS, tous les fichiers seront présents si vous suivez les instructions du livre que vous êtes en train de lire précisement.

Si les deux fichiers sont manquants, vous devez installer le package de développement de ncurses. Ce package est souvent dénommé ncurses-dev. Si ce package est déjà installé, ou si vous venez de l'installer, vérifiez à nouveau la présence des deux fichiers. Souvent, le fichier libcurses.a est (encore) manquant. S'il l'est, alors créez libcurses.a comme un lien symbolique en exécutant les commandes suivantes:

cd /usr/lib &&
ln -s libncurses.a libcurses.a

Maintenant nous pouvons continuer. Installez Bash en exécutant les commandes suivantes:

./configure --enable-static-link --prefix=$LFS/usr \
   --bindir=$LFS/bin --with-curses &&
make &&
make install &&
cd $LFS/bin &&
ln -sf bash sh

Si le make install se termine avec quelque chose du style

install-info: unknown option `--dir-file=/mnt/lfs/usr/info/dir' 
usage: install-info [--version] [--help] [--debug] [--maxwidth=nnn] 
	[--section regexp title] [--infodir=xxx] [--align=nnn] 
	[--calign=nnn] [--quiet] [--menuentry=xxx]
	[--info-dir=xxx] 
	[--keep-old] [--description=xxx] [--test]
	[--remove] [--] filename 
make[1]: *** [install] Error 1 
make[1]: Leaving directory `/mnt/lfs/usr/src/bash-2.05a/doc' 
make: [install] Error 2 (ignored)

cela veut dire probablement que vous utilisez une distribution Debian et que vous avez une ancienne version du package texinfo. Cette erreur n'est pas gênante outre mesure : les pages d'info seront installées quand vous recompilerez bash dynamiquement au chapître 6, vous pouvez donc l'ignorer.

Lorsque nous l'avons testé avec la dernière distribution de Debian, les deux dernières commandes ont été exécutées car le processus d'installation n'a pas retourné de valeurs supérieures à 0. Mais vous feriez bien de vérifier si vous avez le lien symbolique $LFS/bin/sh dans votre partition LFS. Si vous ne l'avez pas, lancez les deux dernières commandes manuellement.


Détail de la commande

--enable-static-link: Cette option permet au Bash d'être lié statiquement

--prefix=$LFS/usr: Cette option installe tous les fichiers Bash dans le répertoire $LFS/usr, qui devient alors le répertoire /usr lors d'un chroot ou d'un reboot dans LFS.

--bindir=$LFS/bin: Ceci installe les fichiers executables dans $LFS/bin. Nous faisons ceci pour que bash soit dans /bin, et non pas dans /usr/bin. Une des raisons d'être: /usr devrait être dans une partition différente et, avant d'être montée vous aurez besoin de bash (il serait difficile d'exécuter les scripts au boot sans un shell de disponible).

--with-curses: Ceci permet à Bash d'être lié à la bibliothèque curses plutôt qu'à la bibliothèque termcap par défaut, laquelle devient obsolète.

Il n'est pas nécessaire au sens strict que le bash statique soit lié à libncurses (il peut être lié à la bibliothèque statique termcap dans un premier temps car nous réinstallerons Bash dans le chapître 6 de toute façon, où là nous utiliserons libncurses), cependant c'est un bon test pour être sûr que le package ncurses a été correctement installé. S'il ne l'a pas été, vous aurez quelques problèmes plus loin dans ce chapître lorsqu'il s'agira d'installer le package Texinfo. Ce package requiert ncurses et termcap ne peut plus alors être utilisé.

ln -sf bash sh: Cette commande crée le lien symbolique sh qui pointe sur bash. La plupart des scripts se lance eux-même via 'sh' (par #!/bin/sh en première ligne du script) qui invoque un mode spécial de bash. Bash ce comportera alors (aussi fidèlement que possible) comme le Bourne shell original.

Les caractères && à la fin de chaque ligne permettent de n'exécuter la prochaine commande que si la commande précédente existe et retourne 0 indiquant qu'elle s'est exécutée sans erreur. Dans ce cas, toutes les commandes sont copiées&collées dans le shell, il est important de s'assurer que si ./configure échoue, make ne sera pas exécuté et, de ce fait, si make échoue, alors make install ne doit pas être exécuté, et ainsi de suite.


Contents

The Bash package contains the bash program


Description

Bash is the Bourne-Again SHell, which is a widely used command interpreter on Unix systems. Bash is a program that reads from standard input, the keyboard. A user types something and the program will evaluate what he has typed and do something with it, like running a program.


Dependencies

Bash-2.05 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
size from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mv from the fileutils package

rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
echo from the sh-utils package
expr from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer binutils-2.11.2

Temps estimé:           6 minutes
Espace disque nécessaire:  96 MB

Installation de Binutils

Ce package est connu pour son mauvais fonctionnement si vous changez les options d'optimisation qui sont définies par défaut (y compris -march and -mcpu). Binutils fonctionne bien mieux tel quel, nous vous recommandons donc de ne pas modifier CFLAGS, CXXFLAGS et autres variables ou options qui pourraient modifier l'optimisation par défaut.

Installer Binutils en exécutant les commandes suivantes :

./configure --prefix=$LFS/usr --disable-nls &&
make LDFLAGS=-all-static tooldir=$LFS/usr &&
make tooldir=$LFS/usr install


Détails de la commande

--disable-nls: Cette option invalide l'internationalisation (aussi connue comme i18n). Nous n'avons pas besoin de cela pour nos programmes statiques et NLS cause souvent quelques problèmes lors de l'édition de liens statiques.

LDFLAGS=-all-static: Mettre la variable LDFLAGS à la valeur -all-static permet à Binutils d'être lié statiquement.

tooldir=$LFS/usr: Normalement, tooldir (le répertoire où les exécutables de binutils vont se situer) est $(exec_prefix)/$(target_alias) ce qui donne, par exemple, /usr/i686-pc-linux-gnu. Depuis que nous avons construit notre propre système, nous n'avons pas eu besoin de positionner cette option au répertoire $LFS/usr. Cette option ne devrait être utilisée que pour une plateforme de compilation croisée (par exemple compiler un package sur une machine Intel qui génère un code exécutable sur des PowerPC).


Contents

The Binutils package contains the addr2line, as, ar, c++filt, gasp, gprof, ld, nm, objcopy, objdump, ranlib, readelf, size, strings and strip programs


Description

addr2line

addr2line translates program addresses into file names and line numbers. Given an address and an executable, it uses the debugging information in the executable to figure out which file name and line number are associated with a given address.


as

as is primarily intended to assemble the output of the GNU C compiler gcc for use by the linker ld.


ar

The ar program creates, modifies, and extracts from archives. An archive is a single file holding a collection of other files in a structure that makes it possible to retrieve the original individual files (called members of the archive).


c++filt

The C++ language provides function overloading, which means that it is possible to write many functions with the same name (providing each takes parameters of different types). All C++ function names are encoded into a low-level assembly label (this process is known as mangling). The c++filt program does the inverse mapping: it decodes (demangles) low-level names into user-level names so that the linker can keep these overloaded functions from clashing.


gasp

Gasp is the Assembler Macro Preprocessor.


gprof

gprof displays call graph profile data.


ld

ld combines a number of object and archive files, relocates their data and ties up symbol references. Often the last step in building a new compiled program to run is a call to ld.


nm

nm lists the symbols from object files.


objcopy

objcopy utility copies the contents of an object file to another. objcopy uses the GNU BFD Library to read and write the object files. It can write the destination object file in a format different from that of the source object file.


objdump

objdump displays information about one or more object files. The options control what particular information to display. This information is mostly useful to programmers who are working on the compilation tools, as opposed to programmers who just want their program to compile and work.


ranlib

ranlib generates an index to the contents of an archive, and stores it in the archive. The index lists each symbol defined by a member of an archive that is a relocatable object file.


readelf

readelf displays information about elf type binaries.


size

size lists the section sizes --and the total size-- for each of the object files objfile in its argument list. By default, one line of output is generated for each object file or each module in an archive.


strings

For each file given, strings prints the printable character sequences that are at least 4 characters long (or the number specified with an option to the program) and are followed by an unprintable character. By default, it only prints the strings from the initialized and loaded sections of object files; for other types of files, it prints the strings from the whole file.

strings is mainly useful for determining the contents of non-text files.


strip

strip discards all or specific symbols from object files. The list of object files may include archives. At least one object file must be given. strip modifies the files named in its argument, rather than writing modified copies under different names.


Dependencies

Binutils-2.11.2 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package
ranlib from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
rmdir from the fileutils package
touch from the fileutils package

gcc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

makeinfo from the texinfo package

cat from the textutils package
sort from the textutils package
tail from the textutils package
tr from the textutils package
true from the sh-utils package
uniq from the textutils package


Installer Bzip2-1.0.1

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  3 MB

Installation de Bzip2

Installez Bzip2 en exécutant les commandes suivantes :

make CC="gcc -static" &&
make PREFIX=$LFS/usr install &&
cd $LFS/usr/bin &&
mv bzcat bunzip2 bzip2 bzip2recover $LFS/bin

Bien qu'il ne fasse pas partie du système de base LFS, il est utile de mentionner que le patch de compression/décompression utilisant les programmes bzip2/bunzip2 est disponible au téléchargement. Sans ajout de ce patch, vous devrez utiliser des commandes comme bzcat file.tar.bz|tar xv ou tar --use-compress-prog=bunzip2 -xvf file.tar.bz2 pour utiliser bzip2/bunzip2 avec tar. Ce patch apporte l'option -j pour décompresser une archive bzip2 avec la commande tar xvfj file.tar.bz2. Appliquer ce patch sera décrit plus tard quand le package tar sera installé.


Explication des commandes

make CC="gcc -static": Cette méthode nous permet de dire à gcc que nous voulons lier bzip2 statiquement.


Contents

The Bzip2 packages contains the bunzip2, bzcat, bzip2 and bzip2recover programs.


Description

bunzip2

Bunzip2 decompresses files that are compressed with bzip2.


bzcat

bzcat (or bzip2 -dc) decompresses all specified files to the standard output.


bzip2

bzip2 compresses files using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. Compression is generally considerably better than that achieved by more conventional LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors.


bzip2recover

bzip2recover recovers data from damaged bzip2 files.


Dependencies

Bzip2-1.0.1 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cp from the fileutils package
ln from the fileutils package
rm from the fileutils package

gcc from the gcc package

make from the make package


Installer Diffutils-2.7

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  4 MB

Installation de Diffutils

Si vous installez Diffutils en utilisant glibc-2.1.x à partir de votre système de base, il pourra être nécessaire d'utiliser un patch pour empêcher un conflit de nom de variable. Les commandes suivantes peuvent être utilisées dans ce cas. Notez que ces commandes peuvent aussi être utilisées pour d'autres versions de glibc, donc en cas de doute, utilisez la première version.

export CPPFLAGS=-Dre_max_failures=re_max_failures2 &&
./configure --prefix=$LFS/usr &&
unset CPPFLAGS &&
make LDFLAGS=-static &&
make install

Si vous utilisez une version récente de glibc (2.2.x), vous pouvez utiliser les commandes suivantes pour installer Diffutils:

./configure --prefix=$LFS/usr &&
make LDFLAGS=-static &&
make install


Explication des commandes

CPPFLAGS=-Dre_max_failures=re_max_failures2: La variable CPPFLAGS est lue par le programme cpp (préprocesseur C). La valeur de cette variable indique au préprocesseur de remplacer chaque instance de re_max_failures trouvée par re_max_failures2 avant de passer le fichier source au compilateur lui-même pour la compilation. Ce package a des problèmes quand on en fait l'édition de liens statiques sur certaines plate-formes (cela dépend de la version de Glibc utilisée par le système), et cette construction résout ce problème.


Contents

The Diffutils package contains the cmp, diff, diff3 and sdiff programs.


Description

cmp and diff

cmp and diff both compare two files and report their differences. Both programs have extra options which compare files in different situations.


diff3

The difference between diff and diff3 is that diff compares 2 files, diff3 compares 3 files.


sdiff

sdiff merges two files and interactively outputs the results.


Dependencies

Diffutils-2.7 needs the following to be installed:


sh from the bash package

ld from the binutils package
as from the binutils package

chmod from the fileutils package
cp from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Fileutils-4.1

Estimation du temps de construction:           3 minutes
Estimation de l'espace disque requis:  25 MB

Installation de Fileutils

A partir d'un fileutils lié statiquement, les programmes peuvent causer des erreurs de segmentation sur certains systèmes, si votre distribution possède Glibc-2.2.3 ou supérieure installée. Cela semble apparaître souvent sur des machines disposant d'un processeur AMD, mais il existe aussi un cas ou deux où un système Intel en était pareillement affecté. Si votre système appartient à cette catégorie, essayez la correction suivante.

Noter que dans certains cas utiliser les commandes sed aboutira à des problèmes de compilation du package, même si votre système dispose d'un processeur AMD et de Glibc-2.2.3 (ou supérieur) installée. Si c'est le cas, vous aurez besoin de supprimer le répertoire fileutils-4.1 et de le déballer de nouveau de l'archive tar. Nous croyons que cela peut être le cas si votre distribution a modifié Glibc-2.2.3, mais aucun détail n'est disponible pour l'instant.

Pour permettre au package de compiler correctement sur des machines AMD/Glibc-2.2.3, exécuter les commandes suivantes. N'essayez pas cette correction si vous n'avez pas Glibc-2.2.3 installé. Cela créerait toutes sortes de problèmes de compilation.

cp lib/Makefile.in lib/Makefile.in.backup &&
sed -e 's/\(.*\)\(fopen-safer\.c \)\\/\1\2atexit.c \\/' \
   -e 's/\(.*\)\(idcache\$U\.\$.*\)\\/\1\2atexit$U.$(OBJEXT) \\/' \
   lib/Makefile.in > lib/Makefile.in~ &&
mv lib/Makefile.in~ lib/Makefile.in

Installez Fileutils en lançant les commandes suivantes:

./configure --disable-nls \
   --prefix=$LFS/usr --libexecdir=$LFS/bin --bindir=$LFS/bin &&
make LDFLAGS=-static &&
make install &&
cd $LFS/usr/bin &&
ln -sf ../../bin/install

Une fois fileutils installé, vous pouvez tester si le problème d'erreur de segmentation a été supprimé en lançant $LFS/bin/ls. Si cela fonctionne, tout va bien. Sinon, vous devez refaire l'installation en utilisant les commandes sed si vous ne les aviez pas utilisé, ou sans les commandes sed si vous les aviez utilisé.


Explication de la commande

cp lib/Makefile.in lib/Makefile.in.backup : Nous exécutons cette commande pour garder une copie du fichier que nous allons modifier.

cp lib/Makefile.in lib/Makefile.in.backup &&
sed -e 's/\(.*\)\(fopen-safer\.c \)\\/\1\2atexit.c \\/' \
   -e 's/\(.*\)\(idcache\$U\.\$.*\)\\/\1\2atexit$U.$(OBJEXT) \\/' \
   lib/Makefile.in > lib/Makefile.in~ &&
mv lib/Makefile.in~ lib/Makefile.in:
Ceci corrige un problème lors de la construction statique de fileutils sur un système comprenant glibc 2.2.3. Si ceci n'est pas fait, les programmes du package fileutils pourraient causer des erreurs de segmentation une fois chroot lancé à partir du chapitre 6.

--libexecdir=$LFS/bin: Cette option de configuration positionne le répertoire d'exécution à $LFS/bin. La valeur habituelle est /usr/libexec mais rien n'y est mis. Changer cette valeur permet juste d'empêcher la création de ce répertoire.


Contents

The Fileutils package contains the chgrp, chmod, chown, cp, dd, df, dir, dircolors, du, install, ln, ls, mkdir, mkfifo, mknod, mv, rm, rmdir, shred, sync, touch and vdir programs.


Description

chgrp

chgrp changes the group ownership of each given file to the named group, which can be either a group name or a numeric group ID.


chmod

chmod changes the permissions of each given file according to mode, which can be either a symbolic representation of changes to make, or an octal number representing the bit pattern for the new permissions.


chown

chown changes the user and/or group ownership of each given file.


cp

cp copies files from one place to another.


dd

dd copies a file (from the standard input to the standard output, by default) with a user-selectable blocksize, while optionally performing conversions on it.


df

df displays the amount of disk space available on the filesystem containing each file name argument. If no file name is given, the space available on all currently mounted filesystems is shown.


dir, ls and vdir

dir and vdir are versions of ls with different default output formats. These programs list each given file or directory name. Directory contents are sorted alphabetically. For ls, files are by default listed in columns, sorted vertically, if the standard output is a terminal; otherwise they are listed one per line. For dir, files are by default listed in columns, sorted vertically. For vdir, files are by default listed in long format.


dircolors

dircolors outputs commands to set the LS_COLOR environment variable. The LS_COLOR variable is use to change the default color scheme used by ls and related utilities.


du

du displays the amount of disk space used by each argument and for each subdirectory of directory arguments.


install

install copies files and sets their permission modes and, if possible, their owner and group.


ln

ln makes hard or soft (symbolic) links between files.


mkdir

mkdir creates directories with a given name.


mkfifo

mkfifo creates a FIFO with each given name.


mknod

mknod creates a FIFO, character special file, or block special file with the given file name.


mv

mv moves files from one directory to another or renames files, depending on the arguments given to mv.


rm

rm removes files or directories.


rmdir

rmdir removes directories, if they are empty.


shred

shred deletes a file securely, overwriting it first so that its contents can't be recovered.


sync

sync forces changed blocks to disk and updates the super block.


touch

touch changes the access and modification times of each given file to the current time. Files that do not exist are created empty.


Dependencies

Fileutils-4.1 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
install from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package
uniq from the textutils package


Installer GCC-2.95.3

Estimation du temps de construction:           22 minutes
Estimation de l'espace disque requis:  168 MB

Installation de GCC

Ce package est connu pour se comporter bizarrement si vous avez changer les options d'optimisation par défaut (y compris les options -march et -mcpu). GCC se comporte mieux sans, donc nous vous recommendons de supprimer CFLAGS, CXXFLAGS et toute autre variable/option qui pourrait changer l'optimisation par défaut du package.

Installez GCC en lançant les commandes suivantes:

patch -Np1 -i ../gcc-2.95.3-2.patch &&
mkdir ../gcc-build &&
cd ../gcc-build &&
../gcc-2.95.3/configure --prefix=/usr --enable-languages=c,c++ \
   --disable-nls --disable-shared --enable-threads=posix &&
make BOOT_LDFLAGS=-static bootstrap &&
make prefix=$LFS/usr install &&
cd $LFS/lib &&
ln -sf ../usr/bin/cpp &&
cd $LFS/usr/lib &&
ln -sf ../bin/cpp &&
cd $LFS/usr/bin &&
ln -sf gcc cc


Explication des commandes

patch -Np1 -i ../gcc-2.95.3-2.patch: Ce nouveau patch traite la gestion incorrecte des symboles faibles, la sur-optimisation des appels vers ces symboles, un problème sur atexit et le symbole __dso_handle requis pour la fonction propre de atexit.

make BOOT_LDFLAGS=-static: Ceci est l'équivalent de LDFLAGS=-static que nous utilisons avec d'autres packages pour les compiler statiquement.

--prefix=/usr: Ce n'est PAS une erreur de frappe. GCC garde en dur certains chemins lors de la compilation et nous devons donc donner /usr lors du ./configure. Nous donnons le vrai préfixe du chemin d'installation plus tard lors de la commande make install.

--enable-languages=c,c++: Ceci ne crée que les compilateurs C et C++, et pas les autres compilateurs disponibles, parce qu'ils sont en moyenne très peu utilisés. Si certains de ces autres compilateurs sont nécessaires, le paramètre --enable-languages peut être omis.

--enable-threads=posix: Ceci permet la gestion des exceptions C++ pour le code multithread.

ln -sf ../usr/bin/cpp: Ceci crée le lien symbolique $LFS/lib/cpp. Certains packages essaient explicitement de trouver cpp dans /lib.

ln -sf ../bin/cpp: Ceci crée le lien symbolique $LFS/usr/lib/cpp, parce qu'il y a des packages qui s'attendent à ce que cpp soit dans /usr/lib.


Contents

The GCC package contains compilers, preprocessors and the GNU C++ Library.


Description

Compiler

A compiler translates source code in text format to a format that a computer understands. After a source code file is compiled into an object file, a linker will create an executable file from one or more of these compiler generated object files.


Preprocessor

A preprocessor pre-processes a source file, such as including the contents of header files into the source file. It's a good idea to not do this manually to save a lot of time. Someone just inserts a line like #include <filename>. The preprocessor inserts the contents of that file into the source file. That's one of the things a preprocessor does.


C++ Library

The C++ library is used by C++ programs. The C++ library contains functions that are frequently used in C++ programs. This way the programmer doesn't have to write certain functions (such as writing a string of text to the screen) from scratch every time he creates a program.


Dependencies

GCC-2.95.3 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package
ranlib from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
touch from the fileutils package

find from the find package

gcc from the gcc package
cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

mawk from the mawk package

sed from the sed package

basename from the sh-utils package
echo from the sh-util package
expr from the sh-utils package
sleep from the sh-utils package
true from the sh-utils package
uname from the sh-utils package

tar from the tar package

makeinfo from the texinfo package

cat from the textutils package
head from the textutils package
sort from the textutils package
tail from the textutils package
tr from the textutils package
uniq from the textutils package


Installer Grep-2.4.2

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  4 MB

Installation de Grep

Lors de l'installation de Grep en utilisant glibc-2.1.x à partir de votre système de base, il peut être nécessaire d'utilise une correction pour empêcher un conflit de nom de variable. Les commandes suivantes peuvent être utilisées dans ce cas. Notez que ces commandes peuvent être utilisées pour d'autres versions de glibc donc si vous n'êtes pas sûr, utilisez la première version.

export CPPFLAGS=-Dre_max_failures=re_max_failures2 &&
./configure --prefix=$LFS/usr --disable-nls &&
unset CPPFLAGS &&
make LDFLAGS=-static &&
make install

Si vous utilisez une version récente de glibc (2.2.x), vous pouvez utiliser les commandes suivantes pour installer Grep:

./configure --prefix=$LFS/usr --disable-nls &&
make LDFLAGS=-static &&
make install


Contents

The grep package contains the egrep, fgrep and grep programs.


Description

egrep

egrep prints lines from files matching an extended regular expression pattern.


fgrep

fgrep prints lines from files matching a list of fixed strings, separated by newlines, any of which is to be matched.


grep

grep prints lines from files matching a basic regular expression pattern.


Dependencies

Grep-2.4.2 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Gzip-1.2.4a

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  2 MB

Installation de Gzip

Avant que Gzip soit installé, le patch doit être appliqué. Ce patch est nécessaire pour éviter un conflit de noms de variables avec les systèmes Glibc-2.0 lors de la compilation et de l'édition de liens statiques, seulement si votre système de base tourne avec Glibc-2.0. Toutefois, il est préférable d'utiliser ce patch même si vous utilisez une version différente de Glibc. Si vous n'êtes pas sûr, appliquez le patch.

Appliquer le patch en lançant la commande suivante:

patch -Np1 -i ../gzip-1.2.4a.patch

Installer Gzip en lançant les commandes suivantes:

./configure --prefix=$LFS/usr &&
make LDFLAGS=-static &&
make install &&
cp $LFS/usr/bin/gunzip $LFS/usr/bin/gzip $LFS/bin &&
rm $LFS/usr/bin/gunzip $LFS/usr/bin/gzip


Contents

The Gzip package contains the compress, gunzip, gzexe, gzip, uncompress, zcat, zcmp, zdiff, zforce, zgrep, zmore and znew programs.


Description

gunzip, uncompress

gunzip and uncompress decompress files which are compressed with gzip.


gzexe

gzexe allows you to compress executables in place and have them automatically uncompress and execute when they are run (at a penalty in performance).


gzip

gzip reduces the size of the named files using Lempel-Ziv coding (LZ77).


zcat

zcat uncompresses either a list of files on the command line or its standard input and writes the uncompressed data on standard output


zcmp

zcmp invokes the cmp program on compressed files.


zdiff

zdiff invokes the diff program on compressed files.


zforce

zforce forces a .gz extension on all gzip files so that gzip will not compress them twice. This can be useful for files with names truncated after a file transfer.


zgrep

zgrep invokes the grep program on compressed files.


zmore

zmore is a filter which allows examination of compressed or plain text files one screen at a time on a soft-copy terminal (similar to the more program).


znew

znew re-compresses files from .Z (compress) format to .gz (gzip) format.


Dependencies

Gzip-1.2.4a needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package
nm from the binutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

grep from the grep package

make from the make package

sed from the sed package

cat from the textutils package
tr from the textutils package


Installer le noyau Linux-2.4.16

Estimation du temps de construction:           3 minutes
Estimation de l'espace disque requis:  132 MB

Installation du noyau Linux

Nous n'allons pas encore compiler une nouvelle image du noyau. Nous le ferons après avoir fini l'installation des logiciels du système de base dans ce chapitre. Mais, parce que certains logiciels ont besoin des fichiers d'en-tête du noyau, nous allons désarchiver le noyau maintenant et le configurer pour pouvoir compiler les packages ayant besoin du noyau.

Le fichier de configuration du noyau est créé en exécutant la commande suivante:

make mrproper &&
yes "" | make config &&
make dep &&
cd $LFS/usr/include &&
cp -a ../src/linux/include/linux . &&
chown -R root.root $LFS/usr/include/linux &&
mkdir asm &&
cp -a ../src/linux/include/asm/* asm &&
chown -R root.root $LFS/usr/include/asm


Explication des commandes

make mrproper: Ceci s'assure que l'arborescence du noyau est parfaitement propre.

yes "" | make config: Ceci exécute make config et donne la réponse par défaut à toutes les questions que le script de configuration pose à l'utilisateur (il fait ceci en se contentant de transmettre l'équivalent de l'appui sur la touche Enter, qui accepte les réponses par défaut Y et N aux questions). Nous ne configurons pas, ici, le véritable noyau; nous n'avons besoin que d'un fichier de configuration quelconque, pour pouvoir ensuite exécuter make dep qui créera de nouveaux fichiers dans $LFS/usr/src/linux/include/linux, comme version.h, entre autres, dont nous aurons besoin plus tard dans chroot pour compiler Glibc ainsi que d'autres packages.

make dep: make dep vérifie les dépendances et crée le fichier des dépendances. Nous n'avons pas vraiment besoin de la vérification des dépendances, mais ce qui nous importe est que make dep crée les fichiers susmentionnés dans $LFS/usr/src/linux/include/linux, dont nous aurons besoin plus tard.

cp -a ../src/linux/include/linux . and mkdir asm && cp -a ../src/linux/include/asm/* asm: Ces commandes copient les entêtes du kernel dans le répertoire $LFS/usr/include.

chown -R root.root $LFS/usr/include/linux et chown -R root.root $LFS/usr/include/asm: Ces commandes changent l'utilisateur propriétaire des répertoires $LFS/usr/include/linux et $LFS/usr/include/asm, plus tous les fichiers contenus, en utilisateur root du groupe root.


Pourquoi nous copions les en-têtes du noyau et pourquoi nous ne créons pas de liens

Auparavant, une pratique commune consistait à créer des liens symboliques pour les répertoires /usr/include/linux et asm vers respectivement /usr/src/linux/include/linux et asm. Ceci est une mauvaise idée d'après cet extrait d'un envoi de Linus Torvalds sur la liste de diffusion du noyau Linux:

Je suggère que les personnes qui compilent des noyaux devraient:

 - ne pas créer un seul lien symbolique (sauf celui créé lors de la construction du 
  noyau, "linux/include/asm" qui est utilisé pour la compilation du noyau lui-même)

Et oui, c'est ce que je fais. Mon répertoire /usr/src/linux a toujours les anciens 
en-têtes du kernel 2.2.13, même si je n'ai pas lancé cette version du kernel depuis 
un _loong_ moment. Mais glibc a été compilé avec, donc ces entêtes correspondent 
aux objets de la bibliothèque.
  
Et cela correspond à l'environnement suggéré depuis au moins les cinq dernières 
années. Je ne sais pas pourquoi l'idée du lien symbolique est toujours vivante, 
comme un mauvais zombie. Pratiquement toutes les distributions conservent l'idée 
du lien et tout le monde se souvient que les sources du noyau doivent aller sous 
"/usr/src/linux" même si ce n'est plus vrai depuis _trèès_ longtemps.

La partie importante là-dedans correspond au moment où il indique que les en-têtes doivent être ceux avec lesquels glibc a été compilé. Ces en-têtes doivent rester accessibles et en les copiant, nous nous assurons de suivre ces recommandations. Notez aussi que tant que ces liens symboliques ne sont pas créés, il est tout à fait correct d'avoir les sources du noyau sous /usr/src/linux.


Contents

The Linux kernel package contains the Linux kernel.


Description

The Linux kernel is at the core of every Linux system. It's what makes Linux tick. When a computer is turned on and boots a Linux system, the very first piece of Linux software that gets loaded is the kernel. The kernel initializes the system's hardware components such as serial ports, parallel ports, sound cards, network cards, IDE controllers, SCSI controllers and a lot more. In a nutshell the kernel makes the hardware available so that the software can run.


Dependencies

Linux-2.4.8 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package
objcopy from the binutils package

chown from the fileutils package
cp from the fileutils package
ln from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

find from the findutils package
xargs from the findutils package

gcc from the gcc package

grep from the grep package

make from the make package

awk from the mawk package

depmod from the modutils package
genksyms from the modutils package

hostname from the net-tools package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package
expr from the sh-utils package
pwd from the sh-utils package
uname from the sh-utils package
whoami from the sh-utils package
yes from the sh-utils package

cat from the textutils package
md5sum from the textutils package
sort from the textutils package
tail from the textutils package
touch from the textutils package
tr from the textutils package


Installer Make-3.79.1

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  6 MB

Installation de Make

Installez Make en exécutant les commandes suivantes:

./configure --prefix=$LFS/usr --disable-nls &&
make LDFLAGS=-static &&
make install


Contents

The Make package contains the make program.


Description

make determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them.


Dependencies

Make-3.79.1 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

cmp from the diffutils package

chgrp from the fileutils package
chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package
egrep from the grep package

grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Mawk-1.3.3

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  2 MB

Installation de Mawk

Installez Mawk en lançant les commandes suivantes:

./configure &&
make CC="gcc -static" &&
make BINDIR=$LFS/usr/bin \
   MANDIR=$LFS/usr/share/man/man1 install


Explication des commandes

make CC="gcc -static" Ceci est utilisé pour construire mawk de manière statique.


Contents

The Mawk package contains the mawk program.


Description

mawk

Mawk is an interpreter for the AWK Programming Language. The AWK language is useful for manipulation of data files, text retrieval and processing, and for prototyping and experimenting with algorithms.


Dependencies

Mawk-1.3.3 needs the following to be installed:


chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
rm from the fileutils package

as from the binutils package
ld from the binutils package

cmp from the diffutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

tee from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Patch-2.5.4

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  2 MB

Installation de Patch

Installez Patch en lançant les commandes suivantes:

./configure --prefix=$LFS/usr &&
make LDFLAGS=-static &&
make install


Contents

The Patch package contains the patch program.


Description

The patch program modifies a file according to a patch file. A patch file usually is a list created by the diff program that contains instructions on how an original file needs to be modified. Patch is used a lot for source code patches since it saves time and space. Imagine a package that is 1MB in size. The next version of that package only has changes in two files of the first version. It can be shipped as an entirely new package of 1MB or just as a patch file of 1KB which will update the first version to make it identical to the second version. So if the first version was downloaded already, a patch file avoids a second large download.


Dependencies

Patch-2.5.4 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Sed-3.02

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  2 MB

Installation de Sed

Lors de l'installation de Sed avec glic-2.1.x à partir de votre système de base, il peut être nécessaire d'utiliser une correction pour empêcher un conflit de noms de variables. Les commandes suivantes peuvent être utilisées dans ce cas. Notez que ces commandes peuvent aussi être utilisées avec d'autres versions de glibc, donc si vous n'êtes pas sûr, essayez la première version.

export CPPFLAGS=-Dre_max_failures=re_max_failures2 &&
./configure --prefix=$LFS/usr --bindir=$LFS/bin &&
unset CPPFLAGS &&
make LDFLAGS=-static &&
make install

Si vous utilisez une version plus récente de glibc (2.2.x), vous pouvez utiliser les commandes suivantes pour installer Sed:

./configure --prefix=$LFS/usr --bindir=$LFS/bin &&
make LDFLAGS=-static &&
make install


Contents

The Sed package contains the sed program.


Description

sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline).


Dependencies

Sed-3.02 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Sh-utils-2.0

Estimation du temps de construction:           2 minutes
Estimation de l'espace disque requis:  23 MB

Installation de Sh-utils

Avant d'installer Sh-utils, il sera peut-être nécessaire d'appliquer un patch. Ce patch sert à éviter un conflit de noms de variables avec certaines versions de Glibc (habituellement glib-2.1.x) lors de la compilation de sh-utils en statique. Néanmoins, il est préférable d'installer le patch même si vous utilisez une autre version de glibc, donc si vous n'êtes pas sûr, il est mieux de l'appliquer.

Installez le patch en lançant la commande suivante:

patch -Np1 -i ../sh-utils-2.0.patch

Installez Shellutils en lançant les commandes suivantes:

./configure --prefix=$LFS/usr --disable-nls &&
make LDFLAGS=-static &&
make install &&
cd $LFS/usr/bin &&
mv date echo false pwd stty $LFS/bin &&
mv su true uname hostname $LFS/bin


Contents

The Sh-utils package contains the basename, chroot, date, dirname, echo, env, expr, factor, false, groups, hostid, hostname, id, logname, nice, nohup, pathchk, pinky, printenv, printf, pwd, seq, sleep, stty, su, tee, test, true, tty, uname, uptime, users, who, whoami and yes programs.


Description

basename

basename strips directory and suffixes from filenames.


chroot

chroot runs a command or interactive shell with special root directory.


date

date displays the current time in a specified format, or sets the system date.


dirname

dirname strips non-directory suffixes from file name.


echo

echo displays a line of text.


env

env runs a program in a modified environment.


expr

expr evaluates expressions.


factor

factor prints the prime factors of all specified integer numbers.


false

false always exits with a status code indicating failure.


groups

groups prints the groups a user is in.


hostid

hostid prints the numeric identifier (in hexadecimal) for the current host.


hostname

hostname sets or prints the name of the current host system


id

id prints the real and effective UIDs and GIDs of a user or the current user.


logname

logname prints the current user's login name.


nice

nice runs a program with modified scheduling priority.


nohup

nohup runs a command immune to hangups, with output to a non-tty


pathchk

pathchk checks whether file names are valid or portable.


pinky

pinky is a lightweight finger utility which retrieves information about a certain user


printenv

printenv prints all or part of the environment.


printf

printf formats and prints data (the same as the printf C function).


pwd

pwd prints the name of the current/working directory


seq

seq prints numbers in a certain range with a certain increment.


sleep

sleep delays for a specified amount of time.


stty

stty changes and prints terminal line settings.


su

su runs a shell with substitute user and group IDs


tee

tee reads from standard input and writes to standard output and files.


test

test checks file types and compares values.


true

True always exits with a status code indicating success.


tty

tty prints the file name of the terminal connected to standard input.


uname

uname prints system information.


uptime

uptime tells how long the system has been running.


users

users prints the user names of users currently logged in to the current host.


who

who shows who is logged on.


whoami

whoami prints the user's effective userid.


yes

yes outputs a string repeatedly until killed.


Dependencies

Sh-utils-2.0 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
chown from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Tar-1.13

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  7 MB

Installation de Tar

Pour pouvoir utiliser directement les fichiers bzip2 avec tar, utiliser le patch tar disponible depuis le site FTP LFS. Ce patch ajoutera l'option -j à tar, option qui fonctionne de manière identique à l'option -z de tar (qui permet d'utiliser directement les fichiers gzip).

Installer le patch en lançant la commande suivante:

patch -Np1 -i ../tar-1.13.patch

Installer Tar en lançant les commandes suivantes:

./configure --prefix=$LFS/usr --disable-nls \
   --libexecdir=$LFS/usr/bin --bindir=$LFS/bin && 
make LDFLAGS=-static &&
make install


Contents

The tar package contains the rmt and tar programs.


Description

rmt

rmt is a program used by the remote dump and restore programs in manipulating a magnetic tape drive through an interprocess communication connection.


tar

tar is an archiving program designed to store and extract files from an archive file known as a tar file.


Dependencies

Tar-1.13 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

patch from the patch package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Texinfo-4.0

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  11 MB

Installation de Texinfo

Installez Texinfo en lançant les commandes suivantes:

./configure --prefix=$LFS/usr --disable-nls &&
make LDFLAGS=-static &&
make install


Contents

The Texinfo package contains the info, install-info, makeinfo, texi2dvi and texindex programs


Description

info

The info program reads Info documents, usually contained in the /usr/doc/info directory. Info documents are like man(ual) pages, but they tend to be more in depth than just explaining the options to a program.


install-info

The install-info program updates the info entries. When the info program is run a list with available topics (ie: available info documents) will be presented. The install-info program is used to maintain this list of available topics. If info files are removed manually, it is also necessary to delete the topic in the index file as well. This program is used for that. It also works the other way around when info documents are added.


makeinfo

The makeinfo program translates Texinfo source documents into various formats. Available formats are: info files, plain text and HTML.


texi2dvi

The texi2dvi program prints Texinfo documents


texindex

The texindex program is used to sort Texinfo index files.


Dependencies

Texinfo-4.0 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Textutils-2.0

Estimation du temps de construction:           2 minutes
Estimation de l'espace disque requis:  24 MB

Installation de Textutils

Installez Texutils en lançant les commandes suivantes:

./configure --prefix=$LFS/usr --disable-nls &&
make LDFLAGS=-static &&
make install &&
mv $LFS/usr/bin/cat $LFS/bin


Contents

The Textutils package contains the cat, cksum, comm, csplit, cut, expand, fmt, fold, head, join, md5sum, nl, od, paste, pr, ptx, sort, split, sum, tac, tail, tr, tsort, unexpand, uniq and wc programs.


Description

cat

cat concatenates file(s) or standard input to standard output.


cksum

cksum prints CRC checksum and byte counts of each specified file.


comm

comm compares two sorted files line by line.


csplit

csplit outputs pieces of a file separated by (a) pattern(s) to files xx01, xx02, ..., and outputs byte counts of each piece to standard output.


cut

cut prints selected parts of lines from specified files to standard output.


expand

expand converts tabs in files to spaces, writing to standard output.


fmt

fmt reformats each paragraph in the specified file(s), writing to standard output.


fold

fold wraps input lines in each specified file (standard input by default), writing to standard output.


head

Print first xx (10 by default) lines of each specified file to standard output.


join

join joins lines of two files on a common field.


md5sum

md5sum prints or checks MD5 checksums.


nl

nl writes each specified file to standard output, with line numbers added.


od

od writes an unambiguous representation, octal bytes by default, of a specified file to standard output.


paste

paste writes lines consisting of the sequentially corresponding lines from each specified file, separated by TABs, to standard output.


pr

pr paginates or columnates files for printing.


ptx

ptx produces a permuted index of file contents.


sort

sort writes sorted concatenation of files to standard output.


split

split outputs fixed-size pieces of an input file to PREFIXaa, PREFIXab, ...


sum

sum prints checksum and block counts for each specified file.


tac

tac writes each specified file to standard output, last line first.


tail

tail print the last xx (10 by default) lines of each specified file to standard output.


tr

tr translates, squeezes, and/or deletes characters from standard input, writing to standard output.


tsort

tsort writes totally ordered lists consistent with the partial ordering in specified files.


unexpand

unexpand converts spaces in each file to tabs, writing to standard output.


uniq

Uniq removes duplicate lines from a sorted file.


wc

wc prints line, word, and byte counts for each specified file, and a total line if more than one file is specified.


Dependencies

Textutils-2.0 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Créer les fichiers passwd et group

Pour que l'utilisateur et le groupe root soient reconnus et puissent se connecter, il faut une entrée correspondante dans les fichiers /etc/passwd et /etc/group. D'autre part, le groupe root ainsi que quelques autres sont recommandés et nécessaires pour certains packages. Les groupes et leur GID ci-dessous ne font partie d'aucun standard. Le LSB recommande uniquement, à côté d'un groupe root, un groupe bin avec un GID de 1. Les noms et GID des autres groupes peuvent être choisis par l'utilisateur. Les packages bien écrits ne dépendent pas du numéro de GID, mais seulement du nom du groupe, car le GID d'un groupe importe peu. Comme il n'y a aucun standard pour les groupes, je ne suivrai pas les conventions utilisées par Debian, RedHat ou d'autres. Les groupes ajoutés ici sont ceux mentionnés dans le script MAKEDEV (le script qui crée les fichiers de périphériques dans le répertoire /dev).

Créez un nouveau fichier $LFS/etc/passwd en lançant la commande suivante:

echo "root:x:0:0:root:/root:/bin/bash" > $LFS/etc/passwd

Créez un nouveau fichier $LFS/etc/group en lançant ce qui suit:

cat > $LFS/etc/group << "EOF"
root:x:0:
bin:x:1:
sys:x:2:
kmem:x:3:
tty:x:4:
tape:x:5:
daemon:x:6:
floppy:x:7:
disk:x:8:
lp:x:9:
dialout:x:10:
audio:x:11:
EOF


Copie des anciennes bibliothèques NSS

Si votre système Linux de base utilise Glibc-2.0, vous avez besoin de copier les bibliothèques NSS dans la partition LFS. Certains programmes liés statiquement dépendent des bibliothèques NSS, spécialement les programmes qui ont besoin de récupérer les noms, les ID des utilisateurs et des groupes. Vous pouvez vérifier la version de la bibliothèque C que votre système Linux utilise en exécutant simplement la bibliothèque ainsi:

/lib/libc.so.6

La première ligne vous donne le numéro de version. Les lignes suivantes contiennent d'autres informations intéressantes. Si Glibc-2.0.x est installé sur votre système de base, copiez les bibliothèques NSS en lançant:

cp -av /lib/libnss* $LFS/lib


Monter le système de fichiers $LFS/proc

Pour que certains programmes fonctionnent correctement, le système de fichiers proc doit être monté et accessible depuis l'environnement chroot. Il n'y a pas de problèmes à monter le système de fichiers proc deux fois, ou même plus, car c'est un système de fichiers virtuel maintenu par le noyau lui-même.

Le système de fichiers proc est monté sous $LFS/proc en exécutant la commande suivante:

mount proc $LFS/proc -t proc


Chapitre 6. Installer les logiciels du système de base


Introduction

L'installation de tous les logiciels est plutôt simple et vous allez probablement penser qu'il est tellement plus facile et plus court de donner les instructions génériques d'installation pour chaque package et de seulement expliquer comment installer quelque chose si un certain package demande une méthode d'installation alternative. Même si je suis d'accord avec ceci, j'ai choisi de donner les instructions complètes pour chaque package. Il s'agit simplement d'éviter toute confusion ou erreur.

Ce serait le bon moment pour jeter un oeil aux astuces d'optimisation dans http://hints.linuxfromscratch.org/hints/optimization.txt si vous prévoyez d'utiliser des options d'optimisations lors la compilation des packages du chapitre qui suit. Les options d'optimisation peuvent faire qu'un programme s'exécute plus vite, mais peuvent également causer des problèmes de compilation. Si vous rencontrez des problèmes après avoir utilisé les optimisations, essayez toujours sans optimisations pour voir si vous pouvez reproduire le problème.


A propos des symboles de débogage

La plupart des programmes et des bibliothèques sont compilés par défaut avec des symboles de débogage (gcc option -g).

Un programme compilé avec des symboles de débogage permet à un utilisateur d'exécuter un programme ou une bibliothèque via un débogueur et d'utiliser facilement les résultats obtenus. Ces symboles de débogage augmentent également la taille du programme de façon significative.

Avant de que vous ne commenciez à vous demander si ces symboles de débogage font réellement une grande différence, voici quelques statistiques. Utilisez-les pour en tirer vos propres conclusions.

  • Un binaire Bash dynamique avec symboles de débogage: 1,2Mo.

  • Un binaire Bash dynamique sans symboles de débogage: 478Ko.

  • /lib et /usr/lib (fichiers glibc et gcc) avec symboles de débogage: 87Mo.

  • /lib et /usr/lib (fichiers glibc et gcc) sans symboles de débogage: 16Mo.

Les tailles varient selon le compilateur utilisé et la version de la bibliothèque C utilisée pour les liens dynamiques entre les programmes, mais les résultats seront similaires si vous comparez des programmes avec ou sans symboles de débogage.

Pour enlever les symboles de débogage d'un binaire (qui doit être de type a.out ou ELF) exécutezstrip --strip-debug filename. Les jokers peuvent être utilisés pour supprimer les symboles de débogage dans plusieurs fichiers (utilisez quelque chose commestrip --strip-debug $LFS/usr/bin/*). La plupart des gens n'utiliseront probablement jamais un débogueur sur leur logiciels, vous gagnerez donc beaucoup de place sur le disque en supprimant ces symboles.

Pour vous faciliter l'opération, le chapitre 9 comprend une commande unique pour supprimer tous les symboles de débogage de tous les programmes et bibliothèques de votre système.

Vous obtiendrez des informations supplémentaires dans le guide de l'optimisation qui peut être trouvé à http://hints.linuxfromscratch.org/hints/optimization.txt .


Création de $LFS/root/.bash_profile

Lorsque nous serons dans l'environnement chroot de la prochaine section nous voudrons exporter deux variables d'environnement dans ce shell comme PS1, PATH et d'autres variables qu'il sera bon d'avoir parémétré. Dans cet objectif nous allons créer le fichier $LFS/root/.bash_profile qui sera lu par bash lorsque nous entrerons dans l'environnement chroot.

Créer un nouveau fichier $LFS/root/.bash_profile en exécutant ce qui suit.

cat > $LFS/root/.bash_profile << "EOF"
# Début /root/.bash_profile

PS1='\u:\w\$ '
PATH=/bin:/usr/bin:/sbin:/usr/sbin

export PS1 PATH

# Fin /root/.bash_profile
EOF

La variable PS1 est une variable d'environnement qui contrôle l'apparence de l'invite de commande. Voyez les pages man de bash pour les détails de la construction de cette variable. D'autres variables d'environnement, alias et aussi tout ce dont vous avez besoin et/ou voulez peuvent être ajouter à votre discrétion.


Entrer dans l'environnement chroot

Il est temps d'entrer dans l'environnement chroot afin d'installer le reste des logiciels dont nous avons besoin.

Exécuter la commande suivante pour entrer dans l'environnement chroot. A partir d'ici nous n'aurons plus besoin d'utiliser la variable $LFS car tout ce que fera un utilisateur sera restreint à la partition LFS (puisque / est actuellement /mnt/lfs mais le shell ne le sait pas)

cd $LFS &&
chroot $LFS /usr/bin/env -i HOME=/root \
   TERM=$TERM /bin/bash --login

L'option -i va supprimer toutes les variables d'environnement tant que vous serez dans l'environnement chroot et seules les variables HOME et TERM seront paramétrées. La construction TERM=$TERM va paramétrer la vairable TERM sur la valeur que ce soit à l'intérieur ou à l'extérieur de l'environnement chroot, ce qui est nécessaire pour des programmes comme vim et less puissent fonctionner correctement. Si vous avez besoin d'autres variables, comme CFLAGS ou CXXFLAGS, vous devrez les paramétrer à nouveau.

Maintenant que nous sommes à l'intérieur de l'environnement chroot, nous pouvons continuer à installer tous les logiciels du sytême de base. Vous devez surtout faire attention à ce que les commandes suivante, de ce chapitre et des suivants, soient exécutés sous chroot. Si vous avez déjà quitter cet environement pour quelques raisons que ce soit (un redémarrage par exemple) rappeler vous de monter une nouvelle fois $LFS/proc et de re-entrer dans chroot avant de continuer avec ce livre.

Nter que le symbole d'accueil (prompt) contiendra "I have no name!". C'est normal car Glibc n'a pas encore été installé.


Dependencies

Chroot needs the following to be installed:


bash from the bash package

env from the sh-utils package


Installer Glibc-2.2.4

Estimation du temps de construction:           46 minutes
Estimation de l'espace disque requis:  350 MB

Installation de Glibc

Avant d'installer glibcBefore starting to install glibc, you must cd into the glibc-2.2.4 directory and unpack glibc-linuxthreads inside the glibc-2.2.4 directory, not in /usr/src as you normally would do.

Ce paquetage est connu pour avoir un mauvais fonctionnement si vous avez changé ses paramètres d'optimisation par défaut (incluant les options -march et mcpu). Glibc est meilleur tel tel, nous vous recommandons donc de régler CFLAGS, CXXFLAGS et d'autres varaible/reglages du même type qui changeraient la configuration par défaut..

Installez Glibc en exécutant les commandes suivantes:

mknod -m 0666 /dev/null c 1 3 &&
touch /etc/ld.so.conf &&
cp malloc/Makefile malloc/Makefile.backup &&
sed 's%\$(PERL)%/usr/bin/perl%' malloc/Makefile > tmp~ &&
mv tmp~ malloc/Makefile &&
cp login/Makefile login/Makefile.backup &&
sed 's/root/0/' login/Makefile > tmp~ &&
mv tmp~ login/Makefile &&
mkdir ../glibc-build &&
cd ../glibc-build &&
../glibc-2.2.4/configure --prefix=/usr \
   --enable-add-ons --libexecdir=/usr/bin &&
cp config.make config.make.backup &&
sed 's/cross-compiling = yes/cross-compiling = no/' \
   config.make > tmp~ &&
mv tmp~ config.make &&
make &&
make install &&
make localedata/install-locales &&
exec /bin/bash --login

Une alternative à l'exécution de make localedata/install-locales est de n'installer que les locales dont vous avez besoin ou que vous voulez.Cela peut être achevé en exécutant la commande localdef. Des informations sur cela peuvent être trouvé dans le fichier INSTALL de l'arborescence de glibc-2.2.4.

Durant l'étape de configuration vous allez voir ces avertissements:

configure: warning:
*** These auxiliary programs are missing or too old: msgfmt
*** some features will be disabled.
*** Check the INSTALL file for required versions.

Le msgfmt manquant (du paquetage gettext que nous installerons plus tard dans ce chapitre) n'est pas fatal. Le fichier que msgfmt aurait voulu créer est déjà pré-construit, il ne nous manque donc rien. Vous en aurez seulement besoin si vous faites des changemenents dans le dossier de l'aide de Glibc. Or comme nous ne faisons pas cela par défaut, nous pouvons l'ignorer en toute sécurité.


Explication des commandes

mknod -m 0666 /dev/null c 1 3: Glibc a besoin d'un périphérique null pour compiler correctement. Tous les autres périphériques seront créés dans la prochaine section.

touch /etc/ld.so.conf Une des étapes finales de l'installation de Glibc est d'exécuter ldconfig afin de mettre à jour le cache du chargeur dynamique. Si le fichier n'existe pas l'installation échouera retournant que le fichier ne peut être lu, donc nous avons simplement créé un fichier vide (le fichier vide que Glibc utilisera par defaut /lib et usr/lib est satisfaisant)

sed 's%\$(PERL)%/usr/bin/perl%' malloc/Makefile > tmp~: Cette commande sed cherche dans malloc/Makefile et converti toutes les occurences de $(PERL) en /usr/bin/perl. Le résultat est alors écrite dans le fichier tmp~. Cela est fait parce que Glibc ne peut pas détecter perl puisuq'il na pas encore été installé.

mv tmp~ malloc/Makefile: Le fichier tmp~ est maintenant retourné vers malloc/Makefile. Nous faisons cela car lorsque l'on utilise sed, nous ne pouvons pas écrire directement dans ce fichier, nous devons donc utiliser un fichier temporaire intermediaire.

sed 's/root/0' login/Makefile > tmp~: Cette commande sed replace toutes les occurences de root dans login/Makefile avec 0. Cela parce que nous n'avons pas encore Glibc sur le système LFS, les noms d'utilisateurs ne peuvent pas être résolus avec les id des utilisateurs. Pour cette raison nous replaçons le nom d'utilisateur root avec l'id 0. Therefore, we replace the username root with the id 0.

mv tmp~ login/Makefile: Comme précédemment, nous utilisons un fichier temporaire (tmp~) pour stocker le Makefile édité et le recopier par dessus l'original.

--enable-add-ons: Cela autorise l'appendice (add-on) que nous installions avec Glibc: linuxthreads

--libexecdir=/usr/bin: Cela force l'installation du programme pt_chown dans /usr/bin directory.

sed 's/cross-compiling = yes/cross-compiling = no/' config.make > config.make~: Cette fois nous remplaçons cross-compiling = yes par cross-compiling = no. Nous faisons cela parce que nous construisons pour notre propre système. Cross-compiling est utilisé, par exemple, pour construire un paquetage pour un Apple Power PC sur un système Intel. La raison pour laquelle Glibc pense que nous compilons au travers de sytème est qu'il ne peut pas compiler un programme test qui le détermine, il se positionne donc automatiquement par défaut comme une compiliation au travers de sytèmes. La raison pour laquelle le programme à échoué est que Gblic n'a pas encore été installé.

mv config.make~ config.make: Une fois de plus nous déplaçons le fichier temporaire pour écraser l'original.

exec /bin/bash: Cette commande va demarrer un nouveau shell bash qui va remplacer l'actuel. Cela est fait pour suprimer le message "I have non name!" du symbole d'accueil (prompt) qui est dû à l'incapacité de bash à faire correspondre un id utilisateur avec un nom utilisateur (qui était dû au fait que Glibc n'était pas installé).


Contents

The Glibc package contains the GNU C Library.


Description

The C Library is a collection of commonly used functions in programs. This way a programmer doesn't need to create his own functions for every single task. The most common things like writing a string to the screen are already present and at the disposal of the programmer.

The C library (actually almost every library) come in two flavors: dynamic ones and static ones. In short when a program uses a static C library, the code from the C library will be copied into the executable file. When a program uses a dynamic library, that executable will not contain the code from the C library, but instead a routine that loads the functions from the library at the time the program is run. This means a significant decrease in the file size of a program. The documentation that comes with the C Library describes this in more detail, as it is too complicated to explain here in one or two lines.


Dependencies

Glibc-2.2.4 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
ranlib from the binutils  package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
mknod from the fileutils package
mv from the fileutils package
mkdir from the fileutils package
rm from the fileutils package
touch from the fileutils package

cpp from the gcc package
gcc from the gcc package

egrep from the grep package
grep from the grep package

gzip from the gzip package

make from the make package

mawk from the mawk package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
pwd from the sh-utils package
uname from the sh-utils package

cat from the textutils package
sort from the textutils package
tr from the textutils package


Créer les périphériques (Makedev-1.4)

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  57 KB

Créer les périphériques

Note: le fichier MAKEDEV-1.4.bz2 que vous avez déballé n'est pas une archive, alors il ne créera pas de répertoire dans lequel vous pourrez entrer.

Créez les fichiers périphériques en exécutant les commandes suivantes:

cp MAKEDEV-1.4 /dev/MAKEDEV &&
cd /dev &&
chmod 754 MAKEDEV

Maintenant, suivant que vous allez utiliser devpts ou non, vous pouvez exécuter l'une des commandes:

Si vous ne comptez pas utiliser devpts, lancez:

./MAKEDEV -v generic

Si vous comptez utiliser devpts, alors lancez:

./MAKEDEV -v generic-nopty

Notez qui si vous n'êtes pas sûr, il vaut mieux utiliser la commande ./MAKEDEV -v generic qui assure que vous disposez des périphériques dont vous avez besoin. Si vous êtes toutefois sûr que vous allez utiliser devpts, l'autre commande assure que vous ne créiez pas un jeu de périphériques dont vous n'avez pas besoin.

MAKEDEV créera hda[1-20] à hdh[1-20] et d'autres périphériques de la sorte, mais gardez à l'esprit que vous ne pourrez pas tous les utiliser à cause des limitations du noyau sur le nombre max. de partitions.


Explication des commandes

./MAKEDEV -v generic: Ceci crée les périphériques génériques. Normalement ces périphériques sont tous ceux dont vous avez besoin. Il est possible qu'il vous manque certains périphériques spéciaux, qui sont nécessaires pour votre configuration matérielle. Créez-les avec ./MAKEDEV -v <device>. L'option generic-nopty effectue un travail similaire mais évite certains périphériques inutiles si vous utilisez devpts.


Contents

The MAKEDEV package contains the MAKEDEV script.


Description

MAKEDEV is a script that can help in creating the necessary static device files that usually reside in the /dev directory.


Dependencies

MAKEDEV-1.4 needs the following to be installed:


sh from the bash package

chmod from the fileutils package
chown from the fileutils package
cp from the fileutils package
ln from the fileutils package
mknod from the fileutils package
mv from the fileutils package
rm from the fileutils package

grep from the grep package

expr from the sh-utils package


Installer Man-pages-1.43

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  5 MB

Installation de Man-pages

Avant que man-pages soit installé, le fichier patch doit être déballé. Installer Man-pages en exécutant les commandes suivantes:

patch -Np1 -i ../man-pages-1.43.patch &&
make install


Explication des Commandes

patch -Np1 -i ../man-pages-1.43.patch: Nous patchons le package man-pages pour inclure les pages pour ldd et ld.so.


Contents

The Man-pages package contains various manual pages that don't come with the packages.


Description

Examples of provided manual pages are the manual pages describing all the C and C++ functions, few important /dev/ files and more.


Dependencies

Man-pages-1.39 needs the following to be installed:


sh from the bash package

install from the fileutils package

make from the make package

patch from the patch package


Installer Findutils-4.1

Estimation du temps de construction:           1 minute
Estimation de l'espace disuqe requis:  3 MB

Installer Findutils

Avant que Findutils ne soit installé, il faut que le fichier pacth de findutils soit déballé..

Installez Findutils en exécutant les commandes suivantes:

patch -Np1 -i ../findutils-4.1.patch &&
./configure --prefix=/usr &&
make &&
make libexecdir=/usr/bin install


Note de conformité FHS

Par défaut, la localisation de la base de donnée de updatedb est dans /usr/var. Si vous préférez être conforme pour FHS, vous devriez utiliser une autre localisation. La commande suivante utilise le fichier de base de donnée/var/lib/misc/locatedb qui est compatible FHS.

patch -Np1 -i ../findutils-4.1.patch &&
./configure --prefix=/usr &&
make localstatedir=/var/lib/misc &&
make localstatedir=/var/lib/misc libexecdir=/usr/bin install


Explication des commandes

patch -Np1 -i ../findutils-4.1.patch:Ce pacth est pour réparer quelques erreurs de compilation en évitant des conflits de variables et en changeant de mauvaises syntaxes.


Contents

The Findutils package contains the bigram, code, find, frcode, locate, updatedb and xargs programs.


Description

bigram

bigram is used together with code to produce older-style locate databases. To learn more about these last three programs, read the locatedb.5 manual page.


code

code is the ancestor of frcode. It was used in older-style locate databases.


find

The find program searches for files in a directory hierarchy which match a certain criteria. If no criteria is given, it lists all files in the current directory and its subdirectories.


frcode

updatedb runs a program called frcode to compress the list of file names using front-compression, which reduces the database size by a factor of 4 to 5.


locate

Locate scans a database which contain all files and directories on a filesystem. This program lists the files and directories in this database matching a certain criteria. If a user is looking for a file this program will scan the database and tell him exactly where the files he requested are located. This only makes sense if the locate database is fairly up-to-date else it will provide out-of-date information.


updatedb

The updatedb program updates the locate database. It scans the entire file system (including other file system that are currently mounted unless it is told not to do so) and puts every directory and file it finds into the database that's used by the locate program which retrieves this information. It's good practice to update this database once a day to have it up-to-date whenever it is needed.


xargs

The xargs command applies a command to a list of files. If there is a need to perform the same command on multiple files, a file can be created that contains all these files (one per line) and use xargs to perform that command on the list.


Dependencies

Findutils-4.1 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

chmod from the fileutils package
cp from the fileutils package
mv from the fileutils package
rm from the fileutils package

grep from the grep package

cc from the gcc package

make from the make package

patch from the patch package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Mawk-1.3.3

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  2 MB

Installation de Mawk

Installez Mawk en exécutant les commandes suivantes:

./configure &&
make &&
make BINDIR=/usr/bin \
   MANDIR=/usr/share/man/man1 install &&
cd /usr/bin &&
ln -sf mawk awk


Contents

The Mawk package contains the mawk program.


Description

mawk

Mawk is an interpreter for the AWK Programming Language. The AWK language is useful for manipulation of data files, text retrieval and processing, and for prototyping and experimenting with algorithms.


Dependencies

Mawk-1.3.3 needs the following to be installed:


chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
rm from the fileutils package

as from the binutils package
ld from the binutils package

cmp from the diffutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

tee from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Ncurses-5.2

Temps de construction estimé:           6 minutes
Espace disque nécessaire estimé:  29 MB

Installation de Ncurses

Installez Ncurses en exécutant les commandes suivantes:

./configure --prefix=/usr --libdir=/lib \
   --with-shared --disable-termcap &&
make &&
make install &&
cd /lib &&
mv *.a /usr/lib &&
chmod 755 *.5.2 &&
cd /usr/lib &&
ln -sf libncurses.a libcurses.a &&
ln -sf ../../lib/libncurses.so &&
ln -sf ../../lib/libcurses.so &&
ln -sf ../../lib/libform.so &&
ln -sf ../../lib/libpanel.so &&
ln -sf ../../lib/libmenu.so


Explication des Commandes

--with-shared: Ceci valide la construction des fichiers de bibliothèques partagées ncurses.

--disable-termcap: Désactive la compilation du support termcap.

cd /lib && mv *.a /usr/lib : Ceci déplace toutes les fichiers bibliothèques statiques de ncurses de /lib vers /usr/lib. /lib ne devrait contenir que les fichier partagés qui sont éssentiels au système lorsque /usr peut ne pas être monté.

chmod 755 *.5.2: Les bibliothèques partagées devraient être exécutables. La routine d'installation de Ncurses ne positionne pas les permissions correctement, alors nous le faisons manuellement à la place.

ln -sf libncurses.a libcurses.a: Certains programmes essayent de faire l'édition des liens avec -lcurses au lieu de -lncurses. Ce lien symbolique assure que de tels programmes seront liés sans erreurs.

ln -sf ../../lib/libncurses.so etc: Ces liens sont créés, car si il ne le sont pas, le linker ne trouvera pas les bibliothèques dynamiques lors de l'édition des liens, et de fait, liera tous les programmes avec les versions statiques.


Contents

The Ncurses package contains the ncurses, panel, menu and form libraries. It also contains the clear, infocmp, tic, toe, tput and tset programs.


Description

The libraries

The libraries that make up the Ncurses library are used to display text (often in a fancy way) on the screen. An example where ncurses is used is in the kernel's << make menuconfig>>  process. The libraries contain routines to create panels, menu's, form and general text display routines.


clear

The clear program clears the screen if this is possible. It looks in the environment for the terminal type and then in the terminfo database to figure out how to clear the screen.


infocmp

The infocmp program can be used to compare a binary terminfo entry with other terminfo entries, rewrite a terminfo description to take advantage of the use= terminfo field, or print out a terminfo description from the binary file (term) in a variety of formats (the opposite of what tic does).


tic

Tic is the terminfo entry-description compiler. The program translates a terminfo file from source format into the binary format for use with the ncurses library routines. Terminfo files contain information about the capabilities of a terminal.


toe

The toe program lists all available terminal types by primary name with descriptions.


tput

The tput program uses the terminfo database to make the values of terminal-dependent capabilities and information available to the shell, to initialize or reset the terminal, or return the long name of the requested terminal type.


tset

The Tset program initializes terminals so they can be used, but it's not widely used anymore. It's provided for 4.4BSD compatibility.


Dependencies

Ncurses-5.2 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

c++ from the gcc package
gcc from the gcc package

egrep from the grep package
fgrep from the grep package
grep from the grep package

make from the make package

mawk from the mawk package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package
echo from the sh-utils package
expr from the sh-utils package
test from the sh-utils package
uname from the sh-utils package

cat from the textutils package
sort from the textutils package
tr from the textutils package
wc from the textutils package


Installer Vim-6.0

Temps de construction estimé:           2 minutes
Espace disque nécessaire estimé:  15 MB

Installation de Vim

Si vous ne voulez pas de vim comme éditeur sur le système LFS, vous devriez télécharger et installer un éditeur que vous préférez. Il y a quelques astuces sur la manière d'installer différents éditeurs disponible à http://hints.linuxfromscratch.org/hints/. Les astuces actuellement disponibles sont pour Emacs, Joe et nano.

Installez Vim en exécutant les commandes suivantes:

sed '/shUntil\|link shRepeat/{
   /shUntil/N
   /^/i\
   if exists("b:is_kornshell") || exists("b:is_bash")
   p
   /$/i\
   endif
   d
   }' runtime/syntax/sh.vim > sh.vim.fixed &&
mv sh.vim.fixed runtime/syntax/sh.vim &&
./configure --prefix=/usr &&
make CPPFLAGS=-DSYS_VIMRC_FILE=\\\"/etc/vimrc\\\" &&
make install &&
cd /usr/bin &&
ln -sf vim vi

Si vous pensez installer le système X Window sur votre système LFS, Vous voudrez peut-être re-compiler Vim après avoir installer X. Vim est livré avec une jolie versin GUI de l'éditeur qui requiert que X et quelques autres librairies soint installées. Pour plus d'informations, consultez la documentation de Vim.


Notes sur la conformité FHS

Le FHS dit que les éditeurs comme vim devrainet utiliser /var/lib/<editor> pour leur fichier temporaires, comme les sauvegardes temporaires par exemple. Si vous voulez que Vim respecte le FHS, vous devriez utiliser le groupe de commandes suivantes à la place des précedentes.

sed '/shUntil\|link shRepeat/{
   /shUntil/N
   /^/i\
   if exists("b:is_kornshell") || exists("b:is_bash")
   p
   /$/i\
   endif
   d
   }' runtime/syntax/sh.vim > sh.vim.fixed &&
mv sh.vim.fixed runtime/syntax/sh.vim &&
./configure --prefix=/usr --localstatedir=/var/lib/vim &&
make CPPFLAGS=-DSYS_VIMRC_FILE=\\\"/etc/vimrc\\\" &&
make install &&
cd /usr/bin &&
ln -sf vim vi


Explication des Commandes

sed '/shUntil\|link shRepeat/{...: Cette commande sed fixe un bogue dans le fichier syntax/sh.vim qui causera un message d'erreur lorsque vous éditerez un script shell en utilisant le surlignage de la syntaxe.

make CPPFLAGS=-DSYS_VIMRC_FILE=\\\"/etc/vimrc\\\": Positionner cette variable fera que vim cherche le fichier /etc/vimrc qui contient les paramètres globaux de vim. Normalement ce fichier est recherché dans /usr/share/vim, mais /etc est un endroit plus logique pour ce genre de fichiers.


Contents

The Vim package contains the ex, gview, gvim, rgview, rgvim, rview, rvim, view, vim, vimtutor and xxd programs.


Description

ex

ex starts vim in Ex mode.


gview

gview is the GUI version of view.


gvim

gvim is the GUI version of vim.


rgview

rgview is the GUI version of rview.


rgvim

rgvim is the GUI version of rvim.


rview

rview is a restricted version of view. No shell commands can be started and Vim can't be suspended.


rvim

rvim is the restricted version of vim. No shell commands can be started and Vim can't be suspended.


view

view starts vim in read-only mode.


vim

vim starts vim in the normal, default way.


vimtutor

vimtutor starts the Vim tutor.


xxd

xxd makes a hexdump or does the reverse.


Dependencies

Vim-5.8 needs the following to be installed:


sh from the bash package

ld from the binutils package
as from the binutils package

cmp from the diffutils package
diff from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
touch from the fileutils package

find from the find package

cc from the gcc package

grep from the grep package

make from the make package

hostname from the net-tools package

sed from the sed package

echo from the sh-utils package
expr from the sh-utils package
uname from the sh-utils package
whoami from the sh-utils package

cat from the textutils package
tr from the textutils package
wc from the textutils package


Installer GCC-2.95.3

Estimation du temps de construction:           22 minutes
Estimation de l'espace disque requis:  148 MB

Installation de GCC

Ce package est connu pour avoir un mauvais fonctionnement si vous avez changez ses paramètres d'optimisation par défaut (incluant les options -march et -mcpu). GCC est meilleure tel quel, donc nous vous recommandons de ne pas paramètrer CFALGS, CXXFLAGS et quelques autres varaibles/paramètres qui changerait la configuration par défault.

Installer GCC en exécutant les commandes suivantes. ces commandes construirons les compilateurs C et C++. D'autres compilateurs sont accessibles avec le package gccc. Si vous voulez également construire tous les autres compilateurs n'entrez pas l'option --enable-languages=c,c++ dans la commande de configuration. Voyez la documentation de GCC pour plus de détail sur les compilateurs disponibles.

Note: la construction des autres compilateur n'est pas testé par les personnes qui travaille sur LFS.

patch -Np1 -i ../gcc-2.95.3-2.patch &&
mkdir ../gcc-build &&
cd ../gcc-build &&
../gcc-2.95.3/configure --prefix=/usr --enable-shared \
   --enable-languages=c,c++ --enable-threads=posix &&
make bootstrap &&
make install


Contents

The GCC package contains compilers, preprocessors and the GNU C++ Library.


Description

Compiler

A compiler translates source code in text format to a format that a computer understands. After a source code file is compiled into an object file, a linker will create an executable file from one or more of these compiler generated object files.


Preprocessor

A preprocessor pre-processes a source file, such as including the contents of header files into the source file. It's a good idea to not do this manually to save a lot of time. Someone just inserts a line like #include <filename>. The preprocessor inserts the contents of that file into the source file. That's one of the things a preprocessor does.


C++ Library

The C++ library is used by C++ programs. The C++ library contains functions that are frequently used in C++ programs. This way the programmer doesn't have to write certain functions (such as writing a string of text to the screen) from scratch every time he creates a program.


Dependencies

GCC-2.95.3 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package
ranlib from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
touch from the fileutils package

find from the find package

gcc from the gcc package
cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

mawk from the mawk package

sed from the sed package

basename from the sh-utils package
echo from the sh-util package
expr from the sh-utils package
sleep from the sh-utils package
true from the sh-utils package
uname from the sh-utils package

tar from the tar package

makeinfo from the texinfo package

cat from the textutils package
head from the textutils package
sort from the textutils package
tail from the textutils package
tr from the textutils package
uniq from the textutils package


Installer Bison-1.28

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  3 MB

Installation de Bison

Installez Bison en exécutant les commandes suivantes:

./configure --prefix=/usr \
   --datadir=/usr/share/bison &&
make &&
make install

Quelques programmes ne reconnaissent pas bison et essaient de trouver le programme yacc -- bison est une (bonne) alternative à yacc --. Donc pour satisfaire ces quelques programmes nous allons créer un script yacc qui appelle bison et fait que celui-ci imite les conventions de nom des fichiers de sortie de yacc.

Créer un nouveau fichier /usr/bin/yacc en exécutant ce qui suit

cat > /usr/bin/yacc << "EOF"
#!/bin/sh
# Début /usr/bin/yacc

exec /usr/bin/bison -y "$@"

# Fin /usr/bin/yacc
EOF
chmod 755 /usr/bin/yacc


Explication des commandes

--datadir=/usr/share/bison: cela installe les fichiers de grammaire de bison dans /usr/share/bison plutôt que dans /usr/share.


Contents

The Bison package contains the bison program.


Description

Bison is a parser generator, a replacement for YACC. YACC stands for Yet Another Compiler Compiler. What is Bison then? It is a program that generates a program that analyzes the structure of a text file. Instead of writing the actual program a user specifies how things should be connected and with those rules a program is constructed that analyzes the text file.

There are a lot of examples where structure is needed and one of them is the calculator.

Given the string :

        1 + 2 * 3

A human can easily come to the result 7. Why? Because of the structure. Our brain knows how to interpret the string. The computer doesn't know that and Bison is a tool to help it understand by presenting the string in the following way to the compiler:

            +
           / \
          *   1
         / \
        2   3

Starting at the bottom of a tree and coming across the numbers 2 and 3 which are joined by the multiplication symbol, the computer multiplies 2 and 3. The result of that multiplication is remembered and the next thing that the computer sees is the result of 2*3 and the number 1 which are joined by the add symbol. Adding 1 to the previous result makes 7. In calculating the most complex calculations can be broken down in this tree format and the computer just starts at the bottom and works its way up to the top and comes with the correct answer. Of course, Bison isn't only used for calculators alone.


Dependencies

Bison-1.28 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

rm from the fileutils package
cp from the fileutils package
mkdir from the fileutils package
ls from the fileutils package
chmod from the fileutils package
mv from the fileutils package
ln from the fileutils package

cc from the gcc package

grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package

tr from the textutils package
cat from the textutils package


Installer Less-358

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  2 MB

Installation de Less

Installez Less en exécutant les commandes suivantes:

./configure --prefix=/usr --bindir=/bin &&
make &&
make install


Contents

The Less package contains the less program


Description

The less program is a file pager (or text viewer). It displays the contents of a file with the ability to scroll. Less is an improvement on the common pager called << more>> . Less has the ability to scroll backwards through files as well and it doesn't need to read the entire file when it starts, which makes it faster when reading large files.


Dependencies

Less-358 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
mv from the fileutils package
rm from the fileutils package
touch from the fileutils package

grep from the grep package

cc from the gcc package

make from the make package

sed from the sed package

dirname from the sh-utils package
expr from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Groff-1.17.2

Temps de construction estimé:           2 minutes
Espace disque nécessaire estimé:  16 MB

Installation de Groff

Installez Groff en exécutant les commandes suivantes:

./configure --prefix=/usr &&
make &&
make install


Contents

The Groff packages contains the addftinfo, afmtodit, eqn, grodvi, groff, grog, grohtml, grolj4, grops, grotty, hpftodit, indxbib, lkbib, lookbib, neqn, nroff, pfbtops, pic, psbb, refer, soelim, tbl, tfmtodit and troff programs.


Description

addftinfo

addftinfo reads a troff font file and adds some additional font-metric information that is used by the groff system.


afmtodit

afmtodit creates a font file for use with groff and grops.


eqn

eqn compiles descriptions of equations embedded within troff input files into commands that are understood by troff.


grodvi

grodvi is a driver for groff that produces TeX dvi format.


groff

groff is a front-end to the groff document formatting system. Normally it runs the troff program and a post-processor appropriate for the selected device.


grog

grog reads files and guesses which of the groff options -e, -man, -me, -mm, -ms, -p, -s, and -t are required for printing files, and prints the groff command including those options on the standard output.


grohtml

grohtml translates the output of GNU troff to html


grolj4

grolj4 is a driver for groff that produces output in PCL5 format suitable for an HP Laserjet 4 printer.


grops

grops translates the output of GNU troff to Postscript.


grotty

grotty translates the output of GNU troff into a form suitable for typewriter-like devices.


hpftodit

hpftodit creates a font file for use with groff -Tlj4 from an HP tagged font metric file.


indxbib

indxbib makes an inverted index for the bibliographic databases a specified file for use with refer, lookbib, and lkbib.


lkbib

lkbib searches bibliographic databases for references that contain specified keys and prints any references found on the standard output.


lookbib

lookbib prints a prompt on the standard error (unless the standard input is not a terminal), reads from the standard input a line containing a set of keywords, searches the bibliographic databases in a specified file for references containing those keywords, prints any references found on the standard output, and repeats this process until the end of input.


neqn

The neqn script formats equations for ascii output.


nroff

The nroff script emulates the nroff command using groff.


pfbtops

pfbtops translates a Postscript font in .pfb format to ASCII.


pic

pic compiles descriptions of pictures embedded within troff or TeX input files into commands that are understood by TeX or troff.


psbb

psbb reads a file which should be a Postscript document conforming to the Document Structuring conventions and looks for a %%BoundingBox comment.


refer

refer copies the contents of a file to the standard output, except that lines between .[ and .] are interpreted as citations, and lines between .R1 and .R2 are interpreted as commands about how citations are to be processed.


soelim

soelim reads files and replaces lines of the form .so file by the contents of file.


tbl

tbl compiles descriptions of tables embedded within troff input files into commands that are understood by troff.


tfmtodit

tfmtodit creates a font file for use with groff -Tdvi


troff

troff is highly compatible with Unix troff. Usually it should be invoked using the groff command, which will also run preprocessors and post-processors in the appropriate order and with the appropriate options.


Dependencies

Groff-1.17.2 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

bison from the bison package
yacc from the bison package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package
c++ from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

awk from the mawk package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package
echo from the sh-utils package
expr from the sh-utils package
uname from the sh-utils package

cat from the textutils package
touch from the fileutils package
tr from the textutils package


Installer Man-1.5j

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  1 MB

Installation de Man

Exécutez les commandes suivantes pour installer man:

./configure -default &&
make &&
make install

Vous voudrez peut-être jeter un oeil à l'astuce man à http://hints.linuxfromscratch.org/hints/man.txt qui traite du formatage et de la compression pour les pages de manuel.


Contents

The Man package contains the apropos, makewhatis, man and whatis programs.


Description

apropos

apropos searches a set of database files containing short descriptions of system commands for keywords and displays the result on the standard output.


makewhatis

makewhatis reads all the manual pages contained in given sections of manpath or the pre-formatted pages contained in the given sections of catpath. For each page, it writes a line in the whatis database; each line consists of the name of the page and a short description, separated by a dash. The description is extracted using the content of the NAME section of the manual page.


man

man formats and displays the on-line manual pages.


whatis

whatis searches a set of database files containing short descriptions of system commands for keywords and displays the result on the standard output. Only complete word matches are displayed.


Dependencies

Man-1.5i2 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

bzip2 from the bzip2 package

chmod from the fileutils package
cp from the fileutils package
install from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

gcc from the gcc package

grep from the grep package

gunzip from the gzip package
zcat from the gzip package

make from the make package

awk from the mawk package

sed from the sed package

echo from the sh-utils package
cat from the textutils package


Installer Perl-5.6.1

Temps de construction estimé:           6 minutes
Espace disque nécessaire estimé:  35 MB

Installation de Perl

Installez Perl en exécutant les commandes suivantes:

./Configure -Dprefix=/usr &&
make &&
make install

Si vous ne voulez pas répondre à toutes les questions que Perl pose, vous pouvez ajouter l'option -d au script configure, et Perl utilisera tous les paramètres par défaut. Pour éviter le que le script Configure pose des questions après que le fichier config.sh est été créé, vous pouvez également passer le paramètre -e à Perl. Les commandes avec ces paramètres inclus seront :

./Configure -Dprefix=/usr -d -e &&
make &&
make install


Contents

The Perl package contains Perl - Practical Extraction and Report Language


Description

Perl combines the features and capabilities of C, awk, sed and sh into one powerful programming language.


Dependencies

Perl-5.6.1 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package

bison from the bison package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
touch from the fileutils package

gcc from the gcc package

egrep from the grep package
grep from the grep package

nroff from the groff package

gzip from the gzip package

less from the less package

make from the make package

awk from the mawk package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package
echo from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
tee from the sh-utils package
test from the sh-utils package
true from the sh-utils package
uname from the sh-utils package

cat from the textutils package
comm from the textutils package
sort from the textutils package
split from the textutils package
tr from the textutils package
uniq from the textutils package
wc from the textutils package


Installer M4-1.4

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  3 MB

Installation de M4

Installez M4 en exécutant les commandes suivantes:

./configure --prefix=/usr &&
make &&
make install


Contents

The M4 package contains the M4 processor


Description

M4 is a macro processor. It copies input to output expanding macros as it goes. Macros are either built-in or user-defined and can take any number of arguments. Besides just doing macro expansion m4 has built-in functions for including named files, running UNIX commands, doing integer arithmetic, manipulating text in various ways, recursion, etc. M4 can be used either as a front-end to a compiler or as a macro processor in its own right.


Dependencies

M4-1.4 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

chmod from the fileutils package
cp from the fileutils package
mv from the fileutils package
rm from the fileutils package

make from the make package

cc from the gcc package

egrep from the grep package
grep from the grep package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Texinfo-4.0

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  10 MB

Installation de Texinfo

Installez Texinfo en exécutant les commandes suivantes:

./configure --prefix=/usr &&
make &&
make install &&
make TEXMF=/usr/share/texmf install-tex


Explication des Commandes

make TEXMF=/usr/share/texmf install-tex: Ceci installe les composants texinfo qui font parti d'une installation TeX. Même si TeX n'est pas installé sur LFS, ils sont installés ici au cas où vous utiliserez TeX. Ceci étant complètement optionnel, vous pouvez passer à la suite si vous le désirez.


Contents

The Texinfo package contains the info, install-info, makeinfo, texi2dvi and texindex programs


Description

info

The info program reads Info documents, usually contained in the /usr/doc/info directory. Info documents are like man(ual) pages, but they tend to be more in depth than just explaining the options to a program.


install-info

The install-info program updates the info entries. When the info program is run a list with available topics (ie: available info documents) will be presented. The install-info program is used to maintain this list of available topics. If info files are removed manually, it is also necessary to delete the topic in the index file as well. This program is used for that. It also works the other way around when info documents are added.


makeinfo

The makeinfo program translates Texinfo source documents into various formats. Available formats are: info files, plain text and HTML.


texi2dvi

The texi2dvi program prints Texinfo documents


texindex

The texindex program is used to sort Texinfo index files.


Dependencies

Texinfo-4.0 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Autoconf-2.52

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  4 MB

Installation de Autoconf

Autoconf-2.52 est connu pour être trop récent pour quelques applications. KDE-CVS est souvent repporté comme ne fonctionnant pas bien avec cette version et il est recommandé de rétrograder à la version 2.13 si vous commencez à expérimenter quelques problèmes avec cette version.

Installez Autoconf en exécutant les commandes suivantes:

./configure --prefix=/usr &&
make &&
make install


Contents

The Autoconf package contains the autoconf, autoheader, autoreconf, autoscan, autoupdate and ifnames programs


Description

autoconf

Autoconf is a tool for producing shell scripts that automatically configure software source code packages to adapt to many kinds of UNIX-like systems. The configuration scripts produced by Autoconf are independent of Autoconf when they are run, so their users do not need to have Autoconf.


autoheader

The autoheader program can create a template file of C #define statements for configure to use


autoreconf

If there are a lot of Autoconf-generated configure scripts, the autoreconf program can save some work. It runs autoconf (and autoheader, where appropriate) repeatedly to remake the Autoconf configure scripts and configuration header templates in the directory tree rooted at the current directory.


autoscan

The autoscan program can help to create a configure.in file for a software package. autoscan examines source files in the directory tree rooted at a directory given as a command line argument, or the current directory if none is given. It searches the source files for common portability problems and creates a file configure.scan which is a preliminary configure.in for that package.


autoupdate

The autoupdate program updates a configure.in file that calls Autoconf macros by their old names to use the current macro names.


ifnames

ifnames can help when writing a configure.in for a software package. It prints the identifiers that the package already uses in C preprocessor conditionals. If a package has already been set up to have some portability, this program can help to figure out what its configure needs to check for. It may help fill in some gaps in a configure.in generated by autoscan.


Dependencies

Autoconf-2.52 needs the following to be installed:


sh from the bash package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

m4 from the m4 package

make from the make package

perl from the perl package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Automake-1.5

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  3 MB

Installation d'Automake

Automake-1.5 est connu pour être trop récent pour quelques applications. KDE-CVS est repporté comme ne fonctionnant pas bien avec cette version il est recommandé de rétrograder à la version 1.4-p5 si vous commencez à avoir des problèmes avec cette version.

Installez Automake en exécutant les commandes suivantes:

./configure --prefix=/usr &&
make install


Contents

The Automake package contains the aclocal and automake programs


Description

aclocal

Automake includes a number of Autoconf macros which can be used in packages; some of them are actually required by Automake in certain situations. These macros must be defined in the aclocal.m4-file; otherwise they will not be seen by autoconf.

The aclocal program will automatically generate aclocal.m4 files based on the contents of configure.in. This provides a convenient way to get Automake-provided macros, without having to search around. Also, the aclocal mechanism is extensible for use by other packages.


automake

To create all the Makefile.in's for a package, run the automake program in the top level directory, with no arguments. automake will automatically find each appropriate Makefile.am (by scanning configure.in) and generate the corresponding Makefile.in.


Dependencies

Automake-1.5 needs the following to be installed:


sh from the bash package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

grep from the grep package

make from the make package

perl from the perl package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Bash-2.05a

Estimation du temps de construction:           3 minutes
Estimation de l'espace disque requis:  19 MB

Installation de Bash

Avant d'essayer d'installer Bash, vous devez vérifier que votre distribution dipose des fichiers /usr/lib/libcurses.a et /usr/lib/libncurses.a. Si votre distribution est un système LFS, tous les fichiers devraient être présents si vous avez suivi à la lettre les instructions du livre.

Si les deux fichiers manquent, vous devez installer le package de développement ncurses. Ce package est souvent appelé quelque chose comme ncurses-dev. Si ce package est déja installé, ou si vous venez de l'installer, vérifez encore une fois la présence des deux fichiers. Souvent le fichier libcurses.a manque encore. Si tel est le cas, alors créez libcurses.a en tant que lien symbolique en exécutant la commande suivante:

cd /usr/lib &&
ln -s libncurses.a libcurses.a

Maintenant nous pouvons continuer. Installez Bash en lançant la commande suivante:

./configure --enable-static-link --prefix=$LFS/usr \
   --bindir=$LFS/bin --with-curses &&
make &&
make install &&
cd $LFS/bin &&
ln -sf bash sh

Si la phase de make install se termine avec quelque chose du style

install-info: unknown option `--dir-file=/mnt/lfs/usr/info/dir' 
usage: install-info [--version] [--help] [--debug] [--maxwidth=nnn] 
	[--section regexp title] [--infodir=xxx] [--align=nnn] 
	[--calign=nnn] [--quiet] [--menuentry=xxx]
	[--info-dir=xxx] 
	[--keep-old] [--description=xxx] [--test]
	[--remove] [--] filename 
make[1]: *** [install] Error 1 
make[1]: Leaving directory `/mnt/lfs/usr/src/bash-2.05a/doc' 
make: [install] Error 2 (ignored)

alors cela signifie que vous utilisez probablement Debian, et que vous avez une vieille version du package texinfo. Cette erreur est n'est pas bien grave: les pages info seront installées quand nous recompilerons Bash dynamiquement au chapitre 6, donc vous pouvez l'ignorer.

Quand on l'a testé dans la dernière version de Debian, les deux dernières commandes ont été lancées parceque le processus d'installation n'a pas retourné de valeur supérieure à 0. Mais vous devriez vraiment vérifier s'il existe le lien symbolique $LFS/bin/sh sur votre partition LFS. Si ce n'est pas le cas, lancez maintenant les deux dernières commandes manuellement.


Contents

The Bash package contains the bash program


Description

Bash is the Bourne-Again SHell, which is a widely used command interpreter on Unix systems. Bash is a program that reads from standard input, the keyboard. A user types something and the program will evaluate what he has typed and do something with it, like running a program.


Dependencies

Bash-2.05 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
size from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mv from the fileutils package

rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
echo from the sh-utils package
expr from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Flex-2.5.4a

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  3MB

Installation de Flex

Installez Flex en exécutant les commandes suivante:

./configure --prefix=/usr &&
make &&
make install

Quelques programmes ne reconnaissent pas flex et essaient de trouver le programme lex (flex est une (meilleure) alternative à lex). Donc pour satisfaire ces quelques programmes nous devrons créer un script lex, qui appelle flex et qui induit que celui-ci imite lex.

Créez un nouveau fichier /usr/bin/lex en exécutant ce qui suit:

cat > /usr/bin/lex << "EOF"
#!/bin/sh
# Debut /usr/bin/lex

exec /usr/bin/flex -l "$@"

# Fin /usr/bin/lex
EOF
chmod 755 /usr/bin/lex


Contents

The Flex package contains the flex program


Description

Flex is a tool for generating programs which recognize patterns in text. Pattern recognition is very useful in many applications. A user sets up rules what to look for and flex will make a program that looks for those patterns. The reason people use flex is that it is much easier to sets up rules for what to look for than to write the actual program that finds the text.


Dependencies

Flex-2.5.4a needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

bison from the bison package
yacc from the bison package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
mv from the fileutils package
rm from the fileutils package
touch from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

dirname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer File-3.36

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  2 MB

Installation de File

Installez File en éxécutant les commandes suivantes:

cp readelf.h readelf.h.backup &&
sed $'/#define __/a \\\n#include <stdint.h>' readelf.h.backup > readelf.h &&
./configure --prefix=/usr --datadir=/usr/share/misc &&
make &&
make install

File utilise les nombres magiques pour déterminer le type d'un fichier. Ces nombres magiques sont fournis avec File dans un fichier texte. File compile en interne cette base de données à chacune de ses exécutions. Ce n'est pas le type normal d'opérations pour File, car compiler un fichier texte à chaque fois n'est pas le moyen le plus rapide de faire cela. File fournit une option "-C" pour compiler ce fichier de nombres magiques. La raison pour laquelle cela n'est pas fait automatiquement est que certaines personnes veulent travailler sur les nombres magiques. D'un autre côté, beaucoup de gens ne réalisent pas qu'ils devraient compiler les nombres magiques; l'auteur de File a donc ajouté un avertissement quand le fichier texte magique est utilisé. Comme nous ne travaillerons pas de façon courante sur le fichier texte magique, nous le compilerons, parce que cela est plus rapide, évite un avertissement ennuyeux et correspond à ce qui devrait être:

file -C


Explication des commandes

sed $'/#define __/a \\\n#include <stdint.h>' readelf.h.backup > readelf.h : Ce sed corrige une erreur qui se produit lorsque l'on compile file-3.36 avec automake-1.15 installé.


Contents

The File package contains the file program.


Description

File tests each specified file in an attempt to classify it. There are three sets of tests, performed in this order: filesystem tests, magic number tests, and language tests. The first test that succeeds causes the file type to be printed.


Dependencies

File-3.36 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Libtool-1.4.2

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  5 MB

Installation de Libtool

Installez Libtool en exécutant les commandes suivantes:

./configure --prefix=/usr &&
make &&
make install


Contents

The Libtool package contains the libtool and libtoolize programs. It also contains the ltdl library.


Description

libtool

Libtool provides generalized library-building support services.


libtoolize

libtoolize provides a standard way to add libtool support to a package.


ltdl library

Libtool provides a small library, called `libltdl', that aims at hiding the various difficulties of dlopening libraries from programmers.


Dependencies

Libtool-1.4 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
rmdir from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Bin86-0.16.0

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  1 MB

Installation de Bin86

Ce package est nécessaire seulement si vous décidez d'utiliser Lilo sur votre système LFS. Si vous escomptez utiliser un autre outil tel que Grub vous n'aurez pas besoin de bin86. Vérifiez la documentation de votre chargeur préféré pour voir si vous avez besoin du package bin86 (habituellement seulement ld86 et/ou as86 de ce package sont requis).

Gardez à l'esprit qu'il n'y a pas seulement les chargeurs qui utilisent le package bin86. Il y a toujours une chance qu'un autre package ait besoin de programmes de ce package, donc garder tout ça à l'esprit si vous décidez de le sauter.

Installez Bin86 en exécutant les commandes suivantes:

make &&
make PREFIX=/usr install


Contents

The Bin86 contains the as86, as86_encap, ld86, objdump86, nm86 and size86 programs.


Description

as86

as86 is an assembler for the 8086...80386 processors.


as86_encap

as86_encap is a shell script to call as86 and convert the created binary into a C file prog.v to be included in or linked with programs like boot block installers.


ld86

ld86 understands only the object files produced by the as86 assembler, it can link them into either an impure or a separate I&D executable.


objdump86

No description available.


nm86

No description available.


size86

No description available.


Dependencies

Bin86-0.16.0 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package
strip from the binutils package

chmod from the fileutils package
install from the fileutils package
ln from the fileutils package
mv from the fileutils package

cc from the gcc package

make from the make package

sed from the sed package


Installer Binutils-2.11.2

Estimation du temps de construction:           6 minutes
Estimation de l'espace disque requis:  85 MB

Installation de Binutils

Ce package est connu pour avoir un mauvais fonctionnement si vous changez ses flags d'optimisation par défaut (y compris les options -march et -mcpu). Binutils est meilleur tel quel, nous vous recommandons donc de ne pas paramétrer CFLAGS, CXXFLAGS et d'autres variables/réglages qui changeraient l'optimisation par défaut.

Installez Binutils en exécutant les commandes suivantes:

./configure --prefix=/usr --enable-shared &&
make tooldir=/usr &&
make tooldir=/usr install &&
make tooldir=/usr install-info


Explication des commandes

make tooldir=/usr install-info: cela vous installera les pages d'information de binutil.


Contents

The Binutils package contains the addr2line, as, ar, c++filt, gasp, gprof, ld, nm, objcopy, objdump, ranlib, readelf, size, strings and strip programs


Description

addr2line

addr2line translates program addresses into file names and line numbers. Given an address and an executable, it uses the debugging information in the executable to figure out which file name and line number are associated with a given address.


as

as is primarily intended to assemble the output of the GNU C compiler gcc for use by the linker ld.


ar

The ar program creates, modifies, and extracts from archives. An archive is a single file holding a collection of other files in a structure that makes it possible to retrieve the original individual files (called members of the archive).


c++filt

The C++ language provides function overloading, which means that it is possible to write many functions with the same name (providing each takes parameters of different types). All C++ function names are encoded into a low-level assembly label (this process is known as mangling). The c++filt program does the inverse mapping: it decodes (demangles) low-level names into user-level names so that the linker can keep these overloaded functions from clashing.


gasp

Gasp is the Assembler Macro Preprocessor.


gprof

gprof displays call graph profile data.


ld

ld combines a number of object and archive files, relocates their data and ties up symbol references. Often the last step in building a new compiled program to run is a call to ld.


nm

nm lists the symbols from object files.


objcopy

objcopy utility copies the contents of an object file to another. objcopy uses the GNU BFD Library to read and write the object files. It can write the destination object file in a format different from that of the source object file.


objdump

objdump displays information about one or more object files. The options control what particular information to display. This information is mostly useful to programmers who are working on the compilation tools, as opposed to programmers who just want their program to compile and work.


ranlib

ranlib generates an index to the contents of an archive, and stores it in the archive. The index lists each symbol defined by a member of an archive that is a relocatable object file.


readelf

readelf displays information about elf type binaries.


size

size lists the section sizes --and the total size-- for each of the object files objfile in its argument list. By default, one line of output is generated for each object file or each module in an archive.


strings

For each file given, strings prints the printable character sequences that are at least 4 characters long (or the number specified with an option to the program) and are followed by an unprintable character. By default, it only prints the strings from the initialized and loaded sections of object files; for other types of files, it prints the strings from the whole file.

strings is mainly useful for determining the contents of non-text files.


strip

strip discards all or specific symbols from object files. The list of object files may include archives. At least one object file must be given. strip modifies the files named in its argument, rather than writing modified copies under different names.


Dependencies

Binutils-2.11.2 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package
ranlib from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
rmdir from the fileutils package
touch from the fileutils package

gcc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

makeinfo from the texinfo package

cat from the textutils package
sort from the textutils package
tail from the textutils package
tr from the textutils package
true from the sh-utils package
uniq from the textutils package


Installer Bzip2-1.0.1

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  2 MB

Installation de Bzip2

Installez Bzip2 en exécutant les commandes suivantes:

make -f Makefile-libbz2_so &&
make bzip2recover libbz2.a &&
ln -s libbz2.so.1.0.1 libbz2.so &&
cp bzip2-shared /bin/bzip2 &&
cp bzip2recover /bin &&
cp bzip2.1 /usr/share/man/man1 &&
cp bzlib.h /usr/include &&
cp -a libbz2.so* /lib &&
rm /usr/lib/libbz2.a &&
cp libbz2.a /usr/lib &&
cd /usr/lib &&
ln -sf ../../lib/libbz2.so &&
cd /bin &&
ln -sf bzip2 bunzip2 &&
ln -sf bzip2 bzcat &&
cd /usr/share/man/man1 &&
ln -sf bzip2.1 bunzip2.1 &&
ln -sf bzip2.1 bzcat.1 &&
ln -sf bzip2.1 bzip2recover.1

Bien que ce ne soit pas, à proprement parler, une partie du système LFS de base, il vaut la peine de mentionner que vous pouvez télécharger un patch pour Tar qui permet au programme tar de compresser et décompresser facilement en utilisant bzip2/bunzip2. Avec un tar normal, un utilisateur doit utiliser des constructions telles que bzcat fichier.tar.bz | tar xv ou tar --use-compress-prog=bunzip2 -xvf fichier.tar.bz2 pour utiliser bzip2 et bunzip2 avec tar. Ce patch vous fournit l'option -y pour qu'un utilisateur puisse décompacter des archives Bzip2 avec tar xvfy fichier.tar.bz2. L'application de ce patch sera décrite plus tard quand vous réinstallerez le package Tar.


Explication de la commande

make -f Makefile-libbz2_so: cela provoque la construction de bzip2 en utilisant un fichier Makefile différent, dans ce cas le fichier Makefile-libbz2_so qui crée une bibliothèque dynamique libbz2.so et la lie avec les utilitaires de bzip2.

La raison pour laquelle nous n'utilisons pas make install est que le make install de bzip2 n'installe pas la libbz2.so partagée, ni les binaires de bzip2 qui sont liés à cette bibliothèque. Donc nous n'avons pas d'autres choix que d'installer les fichiers manuellement.


Contents

The Bzip2 packages contains the bunzip2, bzcat, bzip2 and bzip2recover programs.


Description

bunzip2

Bunzip2 decompresses files that are compressed with bzip2.


bzcat

bzcat (or bzip2 -dc) decompresses all specified files to the standard output.


bzip2

bzip2 compresses files using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. Compression is generally considerably better than that achieved by more conventional LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors.


bzip2recover

bzip2recover recovers data from damaged bzip2 files.


Dependencies

Bzip2-1.0.1 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cp from the fileutils package
ln from the fileutils package
rm from the fileutils package

gcc from the gcc package

make from the make package


Installer Ed-0.2

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  2 MB

Installation de Ed

Ed est un package optionnel. Le seul programme sur un système LFS qui utilise Ed est Patch. Mais maintenant les fichiers Ed de Patch sont assez rares la faveur étant au fichier Patch de format Diff. Donc si vous n'en n'avez pas personnellement besoin vous pouver passer outre.

Installer Ed en exécutant les commandes suivantes:

cp buf.c buf.c.backup &&
sed 's/int u/int u, sfd/' buf.c.backup | \
   sed '/.*\*mktemp.*/d' | \
   sed 's/.*if (mktemp.*/  sfd = mkstemp(sfn);\
   if ((sfd == -1) || (sfp = fopen (sfn, "w+")) == NULL)/' > buf.c &&
./configure --prefix=/usr &&
make &&
make install &&
mv /usr/bin/ed /usr/bin/red /bin


Explication des commandes

les commandes sed réparent une vulnérabilité dans ed. Les exécutables de ed créent dans /tmp.des fichiers dont les noms sont prévisibles. En utilisant diverses attaques sur les liens symboliques, il est possible de faire écrire à ed des fichiers qu'il ne devrait pas, de changer des permissions de divers fichiers, etc.


Contents

The Ed package contains the ed program.


Description

Ed is a line-oriented text editor. It is used to create, display, modify and otherwise manipulate text files.


Dependencies

Ed-0.2 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
mv from the fileutils package
rm from the fileutils package
touch from the fileutils package

cc from the gcc package

grep from the grep package
egrep from the grep package

make from the make package

sed from the sed package

cat from the textutils package
tr from the textutils package


Installer Gettext-0.10.40

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  11MB

Installation de Gettext

Installez Gettext en exécutant les commandes suivantes:

./configure --prefix=/usr &&
make &&
make install


Contents

The gettext package contains the gettext, gettextize, msgcmp, msgcomm, msgfmt, msgmerge, msgunfmt and xgettext programs.


Description

gettext

The gettext package is used for internationalization (also known as i18n) and for localization (also known as l10n). Programs can be compiled with Native Language Support (NLS) which enable them to output messages in the users native language rather than in the default English language.


gettextize

No description is currently available for this program.


msgcmp

No description is currently available for this program.


msgcomm

No description is currently available for this program.


msgfmt

No description is currently available for this program.


msgmerge

No description is currently available for this program.


msgunfmt

No description is currently available for this program.


xgettext

No description is currently available for this program.


Dependencies

Gettext-0.10.39 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
rmdir from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
echo from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
sort from the textutils package
tr from the textutils package
uniq from the textutils package


Installer Kbd-1.06

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  8 MB

Installation de Kbd

Installez Kbd en exécutant les commandes suivantes:

./configure &&
make &&
make install

Lors de l'utilisation du programme loadkeys de ce package, n'utilisez pas l'option -d pour charger un plan de clavier par défaut. Cela ne marchera pas avec des plans de clavier qui incluent d'autres plans de clavier.


Contents

The Kbd package contains the chvt, deallocvt, dumpkeys, fgconsole, getkeycodes, kbd_mode, kbdrate, loadkeys, loadunimap, mapscrn, psfxtable, resizecons, screendump, setfont, setkeycodes, setleds, setmetamode, setvesablank, showfont, showkey, unicode_start, and unicode_stop programs. There are some other programs that don't get installed by default, as they are very optional. Take a look at the Kbd package contents if you have trouble with your console.


Description

chvt

chvt changes foreground virtual terminal.


deallocvt

deallocvt deallocates unused virtual terminals.


dumpkeys

dumpkeys dumps keyboard translation tables.


fgconsole

fgconsole prints the number of the active virtual terminal.


getkeycodes

getkeycodes prints the kernel scancode-to-keycode mapping table.


kbd_mode

kbd_mode reports or sets the keyboard mode.


kbdrate

kbdrate sets the keyboard repeat and delay rates.


loadkeys

loadkeys loads keyboard translation tables.


loadunimap

loadunimap loads the kernel unicode-to-font mapping table.


mapscrn

mapscrn loads a user defined output character mapping table into the console driver. Note that it is obsolete and that its features are built into setfont.


psfxtable

psfxtable is a tool for handling Unicode character tables for console fonts.


resizecons

resizecons changes the kernel idea of the console size.


screendump

A screen shot utility for the console.


setfont

This lets you change the EGA/VGA fonts in console.


setkeycodes

setkeycodes loads kernel scancode-to-keycode mapping table entries.


setleds

setleds sets the keyboard LEDs. Many people find it useful to have numlock enabled by default, and it is by using this program that you can achieve this.


setmetamode

setmetamode defines the keyboard meta key handling.


setvesablank

This lets you fiddle with the built-in hardware screensaver (not toasters, only a blank screen).


showfont

showfont displays data about a font. The information shown includes font information, font properties, character metrics, and character bitmaps.


showkey

showkey examines the scancodes and keycodes sent by the keyboard.


unicode_start

unicode_start puts the console in Unicode mode.


unicode_stop

unicode_stop reverts keyboard and console from unicode mode.


Dependencies

Kbd-1.06 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package
strip from the binutils package

bison from the bison package

cp from the fileutils package
install from the fileutils package
ln from the fileutils package
mv from the fileutils package
rm from the fileutils package

flex from the flex package

cpp from the gcc package
gcc from the gcc package

gunzip from the gzip package
gzip from the gzip package

make from the make package

sed from the sed package

uname from the sh-utils package


Installer Diffutils-2.7

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  2 MB

Installation de Diffutils

Installez Diffutils en éxécutant les commandes suivantes:

./configure --prefix=/usr &&
make &&
make install


Contents

The Diffutils package contains the cmp, diff, diff3 and sdiff programs.


Description

cmp and diff

cmp and diff both compare two files and report their differences. Both programs have extra options which compare files in different situations.


diff3

The difference between diff and diff3 is that diff compares 2 files, diff3 compares 3 files.


sdiff

sdiff merges two files and interactively outputs the results.


Dependencies

Diffutils-2.7 needs the following to be installed:


sh from the bash package

ld from the binutils package
as from the binutils package

chmod from the fileutils package
cp from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer E2fsprogs-1.25

Estimation du temps de construction:           2 minutes
Estimation de l'espace disque requis:  21 MB

Installation de E2fsprogs

Installez E2fsprogs en exécutant les commandes suivantes:

./configure --prefix=/usr --with-root-prefix="" \
   --enable-elf-shlibs &&
make &&
make install &&
make install-libs


Explication des commandes

--with-root-prefix="":La raison de fournir cette option est dûe à la configuration du Makefile de e2fsprogs. Certains programmes sont essentiel pour l'utilisation du système quand, par exemple, /usr n'est pas monté (comme le programme e2fsck).Ces programmes et bibliothèques appartiennent donc à des répertoires tel que /lib et /sbin. Si l'option n'est pas déclarée à la configuration de e2fsprog, il va placer ces programmes dans /usr, ce que nous ne voulons pas.

--enable-elf-shlibs: Cela créé des bibliothèques partagées que quelques programmes dans ce package peuvent utiliser.

make install-libs: Cela installe les bibliothèques partagées qui sont construites..


Contents

The e2fsprogs package contains the badblocks, chattr, debugfs, dumpe2fs, e2fsck, e2label, fsck, fsck.ext2, lsattr, mke2fs, mkfs.ext2, mklost+found, tune2fs and uuidgen programs.


Description

badblocks

badblocks is used to search for bad blocks on a device (usually a disk partition).


chattr

chattr changes the file attributes on a Linux second extended file system.


debugfs

The debugfs program is a file system debugger. It can be used to examine and change the state of an ext2 file system.


dumpe2fs

dumpe2fs prints the super block and blocks group information for the filesystem present on a specified device.


e2fsck and fsck.ext2

e2fsck is used to check a Linux second extended file system. fsck.ext2 does the same as e2fsck.


e2label

e2label will display or change the filesystem label on the ext2 filesystem located on the specified device.


fsck

fsck is used to check and optionally repair a Linux file system.


lsattr

lsattr lists the file attributes on a second extended file system.


mke2fs and mkfs.ext2

mke2fs is used to create a Linux second extended file system on a device (usually a disk partition). mkfs.ext2 does the same as mke2fs.


mklost+found

mklost+found is used to create a lost+found directory in the current working directory on a Linux second extended file system. mklost+found pre-allocates disk blocks to the directory to make it usable by e2fsck.


tune2fs

tune2fs adjusts tunable filesystem parameters on a Linux second extended filesystem.


uuidgen

The uuidgen program creates a new universally unique identifier (UUID) using the libuuid library. The new UUID can reasonably be considered unique among all UUIDs created on the local system, and among UUIDs created on other systems in the past and in the future.


Dependencies

E2fsprogs-1.22 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
sync from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

gzip from the gzip package

make from the make package

awk from the mawk package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
uname from the sh-utils package

makeinfo from the texinfo package

cat from the textutils package
tr from the textutils package


Installer Fileutils-4.1

Estimatation du temps de construction:           3 minutes
Estimation de l'espace disque requis:  16 MB

Installation de Fileutils

Installez Fileutils en exécutant les commandes suivantes:

./configure --prefix=/usr --bindir=/bin \
   --libexecdir=/bin &&
make &&
make install


Contents

The Fileutils package contains the chgrp, chmod, chown, cp, dd, df, dir, dircolors, du, install, ln, ls, mkdir, mkfifo, mknod, mv, rm, rmdir, shred, sync, touch and vdir programs.


Description

chgrp

chgrp changes the group ownership of each given file to the named group, which can be either a group name or a numeric group ID.


chmod

chmod changes the permissions of each given file according to mode, which can be either a symbolic representation of changes to make, or an octal number representing the bit pattern for the new permissions.


chown

chown changes the user and/or group ownership of each given file.


cp

cp copies files from one place to another.


dd

dd copies a file (from the standard input to the standard output, by default) with a user-selectable blocksize, while optionally performing conversions on it.


df

df displays the amount of disk space available on the filesystem containing each file name argument. If no file name is given, the space available on all currently mounted filesystems is shown.


dir, ls and vdir

dir and vdir are versions of ls with different default output formats. These programs list each given file or directory name. Directory contents are sorted alphabetically. For ls, files are by default listed in columns, sorted vertically, if the standard output is a terminal; otherwise they are listed one per line. For dir, files are by default listed in columns, sorted vertically. For vdir, files are by default listed in long format.


dircolors

dircolors outputs commands to set the LS_COLOR environment variable. The LS_COLOR variable is use to change the default color scheme used by ls and related utilities.


du

du displays the amount of disk space used by each argument and for each subdirectory of directory arguments.


install

install copies files and sets their permission modes and, if possible, their owner and group.


ln

ln makes hard or soft (symbolic) links between files.


mkdir

mkdir creates directories with a given name.


mkfifo

mkfifo creates a FIFO with each given name.


mknod

mknod creates a FIFO, character special file, or block special file with the given file name.


mv

mv moves files from one directory to another or renames files, depending on the arguments given to mv.


rm

rm removes files or directories.


rmdir

rmdir removes directories, if they are empty.


shred

shred deletes a file securely, overwriting it first so that its contents can't be recovered.


sync

sync forces changed blocks to disk and updates the super block.


touch

touch changes the access and modification times of each given file to the current time. Files that do not exist are created empty.


Dependencies

Fileutils-4.1 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
install from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package
uniq from the textutils package


Installer Grep-2.4.2

Estimation du temps de construction:           1 minute
Estimation de l'espace disque requis:  3 MB

Installation de Grep

Installez Grep en exécutant les commandes suivantes:

./configure --prefix=/usr &&
make &&
make install


Contents

The grep package contains the egrep, fgrep and grep programs.


Description

egrep

egrep prints lines from files matching an extended regular expression pattern.


fgrep

fgrep prints lines from files matching a list of fixed strings, separated by newlines, any of which is to be matched.


grep

grep prints lines from files matching a basic regular expression pattern.


Dependencies

Grep-2.4.2 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Gzip-1.2.4a

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  1 MB

Installation de Gzip

Installez Gzip en exécutant les commandes suivantes:

./configure --prefix=/usr &&
make &&
make install &&
cd /usr/bin &&
mv gzip /bin &&
rm gunzip zcat &&
cd /bin &&
ln -sf gzip gunzip &&
ln -sf gzip zcat &&
ln -sf gzip compress &&
ln -sf gunzip uncompress


Contents

The Gzip package contains the compress, gunzip, gzexe, gzip, uncompress, zcat, zcmp, zdiff, zforce, zgrep, zmore and znew programs.


Description

gunzip, uncompress

gunzip and uncompress decompress files which are compressed with gzip.


gzexe

gzexe allows you to compress executables in place and have them automatically uncompress and execute when they are run (at a penalty in performance).


gzip

gzip reduces the size of the named files using Lempel-Ziv coding (LZ77).


zcat

zcat uncompresses either a list of files on the command line or its standard input and writes the uncompressed data on standard output


zcmp

zcmp invokes the cmp program on compressed files.


zdiff

zdiff invokes the diff program on compressed files.


zforce

zforce forces a .gz extension on all gzip files so that gzip will not compress them twice. This can be useful for files with names truncated after a file transfer.


zgrep

zgrep invokes the grep program on compressed files.


zmore

zmore is a filter which allows examination of compressed or plain text files one screen at a time on a soft-copy terminal (similar to the more program).


znew

znew re-compresses files from .Z (compress) format to .gz (gzip) format.


Dependencies

Gzip-1.2.4a needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package
nm from the binutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

grep from the grep package

make from the make package

sed from the sed package

cat from the textutils package
tr from the textutils package


Installer Lilo-22.1

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  3 MB

Installation de Lilo

Nous avons choisi Lilo car nous nous sentons à l'aise avec, mais vous désirez peut-être regarder ailleurs. Quelqu'un a écrit une astuce sur GRUB, un chargeur alternatif, dans http://hints.linuxfromscratch.org/hints/grub-howto.txt.

Installez Lilo en exécutant les commandes suivantes:

make &&
make install

Il semble que la compilation de ce package échoue sur certaines machines quand l'option de compilation -g est utilisée. Si vous ne pouvez pas compiler Lilo du tout, vous devriez essayer de retirer la valeur -g de la variable CFLAGS dans le fichier Makefile.

A la fin de l'installtion le processus make install écrira un message disant que /sbin/lilo doit être exécuté pour complèter la mise à jour. Ne le faites pas car c'est inutile. Le fichier /etc/lilo.conf n'est pas encore présent. Nous terminerons l'installation de Lilo au chapitre 8.

Peut-être serez vous intéressé de savoir que quelqu'un a écrit une astuce sur la manière d'avoir un logo à la place du prompt ou du menu standard de Lilo. Jetez un oeil dessus à http://hints.linuxfromscratch.org/hints/bootlogo.txt .


Contents

The Lilo package contains the lilo program.


Description

lilo installs the Linux boot loader which is used to start a Linux system.


Dependencies

Lilo-21.7.5 needs the following to be installed:


sh from the bash package

as86 from the bin86 package
ld86 from the bin86 package

as from the binutils package
ld from the binutils package
strip from the binutils package

cp from the fileutils package
dd from the fileutils package
ln from the fileutils package
mv from the fileutils package

cc from the gcc package

make from the make package

sed from the sed package

cat from the textutils package


Installer Make-3.79.1

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  6 MB

Installation de Make

Installez Make en exécutant les commandes suivantes:

./configure --prefix=/usr &&
make &&
make install


Contents

The Make package contains the make program.


Description

make determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them.


Dependencies

Make-3.79.1 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

cmp from the diffutils package

chgrp from the fileutils package
chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package
egrep from the grep package

grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Modutils-2.4.12

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  2 MB

Installation de Modutils

Installez Modutils en exécutant les commandes suivantes:

./configure &&
make &&
make install


Contents

The Modutils package contains the depmod, genksyms, insmod, insmod_ksymoops_clean, kerneld, kernelversion, ksyms, lsmod, modinfo, modprobe and rmmod programs.


Description

depmod

depmod handles dependency descriptions for loadable kernel modules.


genksyms

genksyms reads (on standard input) the output from gcc -E source.c and generates a file containing version information.


insmod

insmod installs a loadable module in the running kernel.


insmod_ksymoops_clean

insmod_ksymoops_clean deletes saved ksyms and modules not accessed in 2 days.


kerneld

kerneld performs kernel action in user space (such as on-demand loading of modules)


kernelversion

kernelversion reports the major version of the running kernel.


ksyms

ksyms displays exported kernel symbols.


lsmod

lsmod shows information about all loaded modules.


modinfo

modinfo examines an object file associated with a kernel module and displays any information that it can glean.


modprobe

Modprobe uses a Makefile-like dependency file, created by depmod, to automatically load the relevant module(s) from the set of modules available in predefined directory trees.


rmmod

rmmod unloads loadable modules from the running kernel.


Dependencies

Modutils-2.4.7 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
strip from the binutils package

bison from the bison package

cmp from the diffutils package

chmod from the fileutils package
install from the fileutils package
ln from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

flex from the flex package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

expr from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Netkit-base-0.17

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  1 MB

Installation de Netkit-base

Installez Netkit-base en exécutant les commandes suivantes:

./configure &&
make &&
make install &&
cd etc.sample &&
cp services protocols /etc

Il y a d'autres fichiers dans le répertoire etc.sample qui pourraient vous intéresser.


Contents

The Netkit-base package contains the inetd and ping programs.


Description

inetd

inetd is the mother of all daemons. It listens for connections, and transfers the call to the appropriate daemon.


ping

ping sends ICMP ECHO_REQUEST packets to a host and determines its response time.


Dependencies

Netkit-base-0.17 needs the following to be installed:


sh rom the bash package

as rom the binutils package
ld rom the binutils package
strip rom the binutils package

cp rom the fileutils package
install from the fileutils package
rm rom the fileutils package

make rom the make package

cc rom the gcc package

sed rom the sed package

date from the sh-utils package

cat from the textutils package


Installer Patch-2.5.4

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  2 MB

Installation de Patch

Installez Patch en exécutant les commandes suivantes:

./configure --prefix=/usr &&
make &&
make install


Contents

The Patch package contains the patch program.


Description

The patch program modifies a file according to a patch file. A patch file usually is a list created by the diff program that contains instructions on how an original file needs to be modified. Patch is used a lot for source code patches since it saves time and space. Imagine a package that is 1MB in size. The next version of that package only has changes in two files of the first version. It can be shipped as an entirely new package of 1MB or just as a patch file of 1KB which will update the first version to make it identical to the second version. So if the first version was downloaded already, a patch file avoids a second large download.


Dependencies

Patch-2.5.4 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Procinfo-18

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  170 KB

Installation de Procinfo

Installez Procinfo en exécutant les commandes suivantes:

make LDLIBS=-lncurses &&
make install


Explication des Commandes

make LDLIBS=-lncurses : Ceci utilisera -lncurses à la place de -ltermcap lors de la construction de procinfo. Ceci est fait car libtermcap est déclarée obsolète en faveur de libncurses.


Contents

The Procinfo package contains the procinfo program.


Description

procinfo gathers some system data from the /proc directory and prints it nicely formatted on the standard output device.


Dependencies

Procinfo-18 needs the following to be installed:


as from the binutils package
ld from the binutils package

install from the fileutils package
mkdir from the fileutils package

make from the make package

sed from the sed package


Installer Procps-2.0.7

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  2 MB

Installation de Procps

Installez Procps en exécutant les commandes suivantes:

make &&
make XSCPT='' install &&
mv /usr/bin/kill /bin


Explication des Commandes

make XSCPT='' install: Cela positionne la variable XSCPT du Makefile à une valeur nulle afin que l'installation de XConsole soit désactivée. Sinon "Make install" essaye de copier le fichier XConsole dans /usr/X11R6/lib/app-defaults. Et ce répertoire n'existe pas, car X n'est pas installé.


Contents

The Procps package contains the free, kill, oldps, ps, skill, snice, sysctl, tload, top, uptime, vmstat, w and watch programs.


Description

free

free displays the total amount of free and used physical and swap memory in the system, as well as the shared memory and buffers used by the kernel.


kill

kills sends signals to processes.


oldps and ps

ps gives a snapshot of the current processes.


skill

skill sends signals to process matching a criteria.


snice

snice changes the scheduling priority for process matching a criteria.


sysctl

sysctl modifies kernel parameters at runtime.


tload

tload prints a graph of the current system load average to the specified tty (or the tty of the tload process if none is specified).


top

top provides an ongoing look at processor activity in real time.


uptime

uptime gives a one line display of the following information: the current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.


vmstat

vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity.


w

w displays information about the users currently on the machine, and their processes.


watch

watch runs command repeatedly, displaying its output (the first screen full).


Dependencies

Procps-2.0.7 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package
strip from the binutils package

install from the fileutils package
ln from the fileutils package
mv from the fileutils package
rm from the fileutils package

gcc from the gcc package

grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
pwd from the sh-utils package

sort from the textutils package
tr from the textutils package


Installer Psmisc-20.1

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  500 KB

Installation de Psmisc

Installez Psmisc en exécutant les commandes suivantes:

./configure --prefix=/usr --exec-prefix=/ &&
make &&
make install

psmisc installe la page de man /usr/share/man/man1/pidof.1, mais le programme pidof de psmisc n'est pas installé par défaut. Généralement ceci n'est pas un problème car nous installerons le package sysvinit plus tard, qui nous fournit un meilleur programme pidof.

C'est à vous de décider maintenant si vous allez utiliser le package sysvinit qui fournit un programme pidof, ou non. Si vous le souhaitez, vous devriez enlever la page man pidof de psmisc en exécutant:

rm /usr/share/man/man1/pidof.1

Si vous n'utiliserez pas sysvinit, vous devriez complèter l'installation de ce package en créant le lien symbolique /bin/pidof en exécutant:

cd /bin
ln -s killall pidof


Explication des Commandes

--exec-prefix=/: Cela fera que les programmes seront installés dans /bin plutôt que dans /usr/bin. Les programmes de ce package sont souvent utilisés dans des scripts de boot, alors ils devraient être dans le répertoire /bin afin qu'ils puissent être utilisés quand la partition /usr n'est pas encore montée.


Contents

The Psmisc package contains the fuser, killall, pidof and pstree programs.


Description

fuser

fuser displays the PIDs of processes using the specified files or file systems.


killall

killall sends a signal to all processes running any of the specified commands.


pidof

Pidof finds the process id's (pids) of the named programs and prints those id's on standard output.


pstree

pstree shows running processes as a tree.


Dependencies

Psmisc-20.1 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Reiserfsprogs-3.x.0j

Temps de construction estimé:           TBD
Espace disque nécessaire estimé:  TBD

Installation de Reiserfsprogs

Reiserfsprogs ne doivent être installés seulement si vous comptez utiliser le système de fichiers reiserfs. Installez Reiserfsprogs en exécutant les commandes suivantes:

./configure --mandir=/usr/share/man &&
make &&
make install


Explication des Commandes

--mandir=/usr/share/man: Ceci assure que les pages de man sont installées dans le répertoire correct, tandis que les programmes seront toujours installés dans /sbin comme ils devraient l'être.


Contents

The reiserfsprogs package contains the debugreiserfs, mkreiserfs, reiserfsck, resize_reiserfs and unpack programs.


Description

debugreiserfs

debugreiserfs can sometimes help to solve problems with reiserfs filesystems. If it is called without options it prints the super block of any reiserfs filesystem found on the device.


mkreiserfs

mkreiserfs creates a reiserfs file system.


reiserfsck

reiserfsck checks a reiserfs file system.


resize_reiserfs

resize_reiserfs is used to resize an unmounted reiserfs file system


unpack

No description is currently available for unpack.


Dependencies

Reiserfs-N/A needs the following to be installed:


TO BE DETERMINED


Installing Sed-3.02

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  2 MB

Installation de Sed

Installez Sed en exécutant les commandes suivantes:

./configure --prefix=/usr --bindir=/bin &&
make &&
make install


Contents

The Sed package contains the sed program.


Description

sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline).


Dependencies

Sed-3.02 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Sh-utils-2.0

Temps de construction estimé:           2 minutes
Espace disque nécessaire estimé:  11 MB

Installation de Sh-utils

Installez Shellutils en exécutant les commandes suivantes:

./configure --prefix=/usr &&
make &&
make install &&
cd /usr/bin &&
mv date echo false pwd stty /bin &&
mv su true uname hostname /bin &&
mv chroot ../sbin


Notes sur la conformité FHS

Il y a une commande installée dans ce package qui est nommée test. Elle est souvent utilisée dans les scripts shell pour évaluer des conditions, mais elle est encore plus souvent rencontrée sous la forme [ condition ]. Ces crochets sont construits dans l'interpreteur bash, mais le FHS défini qu'ils devraient être un binaire [. Nous le créons de cette manière, pendant qu'on est encore dans le répertoire /usr/bin :

ln -sf test [


Contents

The Sh-utils package contains the basename, chroot, date, dirname, echo, env, expr, factor, false, groups, hostid, hostname, id, logname, nice, nohup, pathchk, pinky, printenv, printf, pwd, seq, sleep, stty, su, tee, test, true, tty, uname, uptime, users, who, whoami and yes programs.


Description

basename

basename strips directory and suffixes from filenames.


chroot

chroot runs a command or interactive shell with special root directory.


date

date displays the current time in a specified format, or sets the system date.


dirname

dirname strips non-directory suffixes from file name.


echo

echo displays a line of text.


env

env runs a program in a modified environment.


expr

expr evaluates expressions.


factor

factor prints the prime factors of all specified integer numbers.


false

false always exits with a status code indicating failure.


groups

groups prints the groups a user is in.


hostid

hostid prints the numeric identifier (in hexadecimal) for the current host.


hostname

hostname sets or prints the name of the current host system


id

id prints the real and effective UIDs and GIDs of a user or the current user.


logname

logname prints the current user's login name.


nice

nice runs a program with modified scheduling priority.


nohup

nohup runs a command immune to hangups, with output to a non-tty


pathchk

pathchk checks whether file names are valid or portable.


pinky

pinky is a lightweight finger utility which retrieves information about a certain user


printenv

printenv prints all or part of the environment.


printf

printf formats and prints data (the same as the printf C function).


pwd

pwd prints the name of the current/working directory


seq

seq prints numbers in a certain range with a certain increment.


sleep

sleep delays for a specified amount of time.


stty

stty changes and prints terminal line settings.


su

su runs a shell with substitute user and group IDs


tee

tee reads from standard input and writes to standard output and files.


test

test checks file types and compares values.


true

True always exits with a status code indicating success.


tty

tty prints the file name of the terminal connected to standard input.


uname

uname prints system information.


uptime

uptime tells how long the system has been running.


users

users prints the user names of users currently logged in to the current host.


who

who shows who is logged on.


whoami

whoami prints the user's effective userid.


yes

yes outputs a string repeatedly until killed.


Dependencies

Sh-utils-2.0 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
chown from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Net-tools-1.60

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  5 MB

Installation de Net-tools

Installez Net-tools en exécutant les commandes suivantes:

make &&
make update


Explication des Commandes

make update: Réalise la même chose qu'un make install avec la différence que make update n'effectue pas de sauvegardes des fichiers qu'il remplace. Une des choses que net-tools remplace est la version sh-utils de /bin/hostname (la version net-tools est de loin meilleure que celle de sh-utils).

De même, si vous décidez dans le futur de réinstaller ce package, un make update ne sauvegardera pas les fichiers d'une précédente installation de net-tools.


Contents

The Net-tools package contains the arp, hostname, ifconfig, netstat, plipconfig, rarp, route, and slattach programs.


Description

arp

arp is used to manipulate the kernel's ARP cache, usually to add or delete an entry, or to dump the ARP cache.


hostname

hostname, with its symlinks domainname, dnsdomainname, nisdomainname, ypdomainname, and nodename, is used to set or show the system's hostname (or other, depending on the symlink used).


ifconfig

The ifconfig command is the general command used to configure network interfaces.


netstat

netstat is a multi-purpose tool used to print the network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.


plipconfig

plipconfig is used to fine-tune the PLIP device parameters, hopefully making it faster.


rarp

Akin to the arp program, the rarp program manipulates the system's RARP table.


route

route is the general utility which is used to manipulate the IP routing table.


slattach

slattach attaches a network interface to a serial line, i.e.. puts a normal terminal line into one of several "network" modes.


Dependencies

Net-tools-1.60 needs the following to be installed:


bash from the bash package
sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

install from the fileutils package
ln from the fileutils package
rm from the fileutils package

msgfmt from the gettext package

cc from the gcc package

make from the make package

basename from the sh-utils package
echo from the sh-utils package
env from the sh-utils package


Installer Shadow-20001016

Temps de construction estimé:           3 minutes
Espace disque nécessaire estimé:  6 MB

Installation de Shadow Password Suite

Avant d'installer ce package, vous devriez jeter un oeil à l'astuce lfs http://hints.linuxfromscratch.org/hints/shadowpasswd_plus.txt. Celle ci examine la manière de rendre votre système plus sûr en ce qui concerne les mots de passe et comment tirer le meilleur parti de ce package Shadow.

Installez la Shadow Password Suite en exécutant les commandes suivantes:

cp src/useradd.c src/useradd.c.backup &&
sed 's/\(.*\) (nflg || \(.*\))\(.*\)/\1\2\3/' \
   src/useradd.c > tmp~ &&
mv tmp~ src/useradd.c &&
./configure --prefix=/usr &&
make &&
make install &&
cd etc &&
cp limits login.access /etc &&
sed 's%/var/spool/mail%/var/mail%' login.defs.linux > /etc/login.defs &&
cd /lib &&
mv libshadow.a /usr/lib &&
mv libshadow.la /usr/lib &&
ln -sf libshadow.so.0 libshadow.so &&
cd /usr/lib &&
ln -sf ../../lib/libshadow.so


Explication des Commandes

sed 's/\(.*\) (nflg || \(.*\))\(.*\)/\1\2\3/' src/useradd.c > useradd.c.temp &&: Ce script sed est utilisé pour fixer un bogue de compilation qui apparait à cause d'une variable (nflg) utilisée, mais pas définie.

cp limits login.access and others: Ces fichiers n'ont pas été installés pendant l'installation du package, alors nous les copions manuellement car ces fichiers sont utilisés pour configurer les processus d'identification sur le système.

sed "s%/var/spool/mail%/var/mail%" login.defs.linux > /etc/login.defs: /var/spool/mail est l'ancien emplacement des boites aux lettres utilisateur. L'emplacement utilisé de nos jours est /var/mail.


Contents

The Shadow Password Suite contains the chage, chfn, chpasswd, chsh, dpasswd, expiry, faillog, gpasswd, groupadd, groupdel, groupmod, grpck, grpconv, grpunconv, lastlog, login, newgrp, passwd, sg, su, logoutd, mkpasswd, newusers, pwck, pwconv, pwunconv, useradd, userdel, usermod, vigr and vipw programs.


Description

chage

chage changes the number of days between password changes and the date of the last password change.


chfn

chfn changes user full name, office number, office extension, and home phone number information for a user's account.


chpasswd

chpasswd reads a file of user name and password pairs from standard input and uses this information to update a group of existing users.


chsh

chsh changes the user login shell.


dpasswd

dpasswd adds, deletes, and updates dial-up passwords for user login shells.


expiry

Checks and enforces password expiration policy.


faillog

faillog formats the contents of the failure log,/var/log/faillog, and maintains failure counts and limits.


gpasswd

gpasswd is used to administer the /etc/group file


groupadd

The groupadd command creates a new group account using the values specified on the command line and the default values from the system.


groupdel

The groupdel command modifies the system account files, deleting all entries that refer to group.


groupmod

The groupmod command modifies the system account files to reflect the changes that are specified on the command line.


grpck

grpck verifies the integrity of the system authentication information.


grpconv

grpunconv converts to shadow group files from normal group files.


grpunconv

grpunconv converts from shadow group files to normal group files.


lastlog

lastlog formats and prints the contents of the last login log, /var/log/lastlog. The login-name, port, and last login time will be printed.


login

login is used to establish a new session with the system.


newgrp

newgrp is used to change the current group ID during a login session.


passwd

passwd changes passwords for user and group accounts.


sg

sg executes command as a different group ID.


su

Change the effective user id and group id to that of a user. This replaces the su programs that's installed from the Shellutils package.


logoutd

logoutd enforces the login time and port restrictions specified in /etc/porttime.


mkpasswd

mkpasswd reads a file in the format given by the flags and converts it to the corresponding database file format.


newusers

newusers reads a file of user name and clear text password pairs and uses this information to update a group of existing users or to create new users.


pwck

pwck verifies the integrity of the system authentication information.


pwconv

pwconv converts to shadow passwd files from normal passwd files.


pwunconv

pwunconv converts from shadow passwd files to normal files.


useradd

useradd creates a new user or update default new user information.


userdel

userdel modifies the system account files, deleting all entries that refer to a specified login name.


usermod

usermod modifies the system account files to reflect the changes that are specified on the command line.


vipw and vigr

vipw and vigr will edit the files /etc/passwd and /etc/group, respectively. With the -s flag, they will edit the shadow versions of those files, /etc/shadow and /etc/gshadow, respectively.


Dependencies

Shadow-20001016 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
rmdir from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
sort from the textutils package
uniq from the textutils package


Installer Sysklogd-1.4.1

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  710 KB

Installation de Sysklogd

Installez Sysklogd en exécutant les commandes suivantes:

make &&
make install


Contents

The Sysklogd package contains the klogd and syslogd programs.


Description

klogd

klogd is a system daemon which intercepts and logs Linux kernel messages.


syslogd

Syslogd provides a kind of logging that many modern programs use. Every logged message contains at least a time and a hostname field, normally a program name field, too, but that depends on how trusty the logging program is.


Dependencies

Sysklogd-1.4.1 needs the following to be installed:


as from the binutils package
ld from the binutils package
strip from the binutils package

install from the fileutils package

gcc rom the gcc package

make from the make package


Installer Sysvinit-2.83

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  630 KB

Installation de Sysvinit

Lorsque les niveaux d'exécution sont changés (par exemple lors d'un arrêt système) le programme init va envoyé les signaux TERM et KILL à tous les processus démarrés par init. Mais init écrit un message sur l'écran disant : "sending all processes the TERM signal" et la même chose pour le signal KILL. Cela implique que init envoi ce signal à tous les processus en cours d'exécution, ce qui n'est pas le cas. pour éviter cette confusion, vous changez le fichier init.c afin que la phrase devienne "sending all processes started by init the TERM signal", en exécutant les comamdnes suivantes. Si vous ne voulez pas la changer, passez ces commandes.

cp src/init.c src/init.c.backup &&
sed 's/\(.*\)\(Sending processes\)\(.*\)/\1\2 started by init\3/' \
   src/init.c > tmp~ &&
mv tmp~ src/init.c

Installez Sysvinit en exécutant les commandes suivantes:

make -C src &&
make -C src install


Contents

The Sysvinit package contains the halt, init, killall5, last, lastb, mesg, pidof, poweroff, reboot, runlevel, shutdown, sulogin, telinit, utmpdump, wall,


Description

halt

Halt notes that the system is being brought down in the file /var/log/wtmp, and then either tells the kernel to halt, reboot or poweroff the system. If halt or reboot is called when the system is not in runlevel 0 or 6, shutdown will be invoked instead (with the flag -h or -r).


init

Init is the parent of all processes. Its primary role is to create processes from a script stored in the file /etc/inittab. This file usually has entries which cause init to spawn gettys on each line that users can log in. It also controls autonomous processes required by any particular system.


killall5

killall5 is the SystemV killall command. It sends a signal to all processes except the processes in its own session, so it won't kill the shell that is running the script it was called from.


last

last searches back through the file /var/log/wtmp (or the file designated by the -f flag) and displays a list of all users logged in (and out) since that file was created.


lastb

lastb is the same as last, except that by default it shows a log of the file /var/log/btmp, which contains all the bad login attempts.


mesg

Mesg controls the access to the users terminal by others. It's typically used to allow or disallow other users to write to his terminal.


pidof

Pidof finds the process id's (pids) of the named programs and prints those id's on standard output.


poweroff

poweroff is equivalent to shutdown -h -p now. It halts the computer and switches off the computer (when using an APM compliant BIOS and APM is enabled in the kernel).


reboot

reboot is equivalent to shutdown -r now. It reboots the computer.


runlevel

Runlevel reads the system utmp file (typically /var/run/utmp) to locate the runlevel record, and then prints the previous and current system runlevel on its standard output, separated by a single space.


shutdown

shutdown brings the system down in a secure way. All logged-in users are notified that the system is going down, and login is blocked.


sulogin

sulogin is invoked by init when the system goes into single user mode (this is done through an entry in /etc/inittab). Init also tries to execute sulogin when it is passed the -b flag from the boot loader (eg, LILO).


telinit

telinit sends appropriate signals to init, telling it which runlevel to change to.


utmpdump

utmpdumps prints the content of a file (usually /var/run/utmp) on standard output in a user friendly format.


wall

Wall sends a message to everybody logged in with their mesg permission set to yes.


Dependencies

Sysvinit-2.82 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

chown from the fileutils package
install from the fileutils package
ln from the fileutils package
mknod from the fileutils package
rm from the fileutils package

cc from the gcc package

make from the make package

patch from the patch package


Installer Tar-1.13

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  7 MB

Installation de Tar

Si vous voulez pouvoir utiliser directement des fichiers bzip2 avec tar, vous pouvez utiliser le patch tar disponible depuis le site FTP de LFS. Ce patch ajoutera l'option -j à tar, qui fonctionne comme l'option -z de tar (qui peut être utilisée pour les fichiers gzip).

Appliquez le patch en exécutant la commande suivante:

patch -Np1 -i ../tar-1.13.patch

Installez Tar en exécutant les commandes suivantes depuis le répertoire de plus haut niveau:

./configure --prefix=/usr --libexecdir=/usr/bin \
   --bindir=/bin &&
make &&
make install


Contents

The tar package contains the rmt and tar programs.


Description

rmt

rmt is a program used by the remote dump and restore programs in manipulating a magnetic tape drive through an interprocess communication connection.


tar

tar is an archiving program designed to store and extract files from an archive file known as a tar file.


Dependencies

Tar-1.13 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

patch from the patch package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installing Textutils-2.0

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  15 MB

Installation de Textutils

Installez Textutils en exécutant les commandes suivantes:

./configure --prefix=/usr &&
make &&
make install &&
mv /usr/bin/cat /bin


Contents

The Textutils package contains the cat, cksum, comm, csplit, cut, expand, fmt, fold, head, join, md5sum, nl, od, paste, pr, ptx, sort, split, sum, tac, tail, tr, tsort, unexpand, uniq and wc programs.


Description

cat

cat concatenates file(s) or standard input to standard output.


cksum

cksum prints CRC checksum and byte counts of each specified file.


comm

comm compares two sorted files line by line.


csplit

csplit outputs pieces of a file separated by (a) pattern(s) to files xx01, xx02, ..., and outputs byte counts of each piece to standard output.


cut

cut prints selected parts of lines from specified files to standard output.


expand

expand converts tabs in files to spaces, writing to standard output.


fmt

fmt reformats each paragraph in the specified file(s), writing to standard output.


fold

fold wraps input lines in each specified file (standard input by default), writing to standard output.


head

Print first xx (10 by default) lines of each specified file to standard output.


join

join joins lines of two files on a common field.


md5sum

md5sum prints or checks MD5 checksums.


nl

nl writes each specified file to standard output, with line numbers added.


od

od writes an unambiguous representation, octal bytes by default, of a specified file to standard output.


paste

paste writes lines consisting of the sequentially corresponding lines from each specified file, separated by TABs, to standard output.


pr

pr paginates or columnates files for printing.


ptx

ptx produces a permuted index of file contents.


sort

sort writes sorted concatenation of files to standard output.


split

split outputs fixed-size pieces of an input file to PREFIXaa, PREFIXab, ...


sum

sum prints checksum and block counts for each specified file.


tac

tac writes each specified file to standard output, last line first.


tail

tail print the last xx (10 by default) lines of each specified file to standard output.


tr

tr translates, squeezes, and/or deletes characters from standard input, writing to standard output.


tsort

tsort writes totally ordered lists consistent with the partial ordering in specified files.


unexpand

unexpand converts spaces in each file to tabs, writing to standard output.


uniq

Uniq removes duplicate lines from a sorted file.


wc

wc prints line, word, and byte counts for each specified file, and a total line if more than one file is specified.


Dependencies

Textutils-2.0 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Installer Util-linux-2.11m

Temps de construction estimé:           1 minute
Espace disque nécessaire estimé:  9 MB

Notes sur la conformité FHS

Le FHS nous recommande d'utiliser /var/lib/hwclock comme emplacement du fichier adjtime, à la place de l'habituel /etc. Pour rendre hwclock, qui fait parti du package util-linux, compatible FHS, exécutez les commandes suivantes:

cp hwclock/hwclock.c hwclock/hwclock.c.backup &&
sed 's%etc/adjtime%var/lib/hwclock/adjtime%' \
   hwclock/hwclock.c > tmp~ &&
mv tmp~ hwclock/hwclock.c &&
mkdir -p /var/lib/hwclock


Installation de Util-Linux

Installez Util-Linux en exécutant les commandes suivantes:

./configure &&
make HAVE_SLN=yes ADD_RAW=yes &&
make HAVE_SLN=yes ADD_RAW=yes install


Explication des Commandes

HAVE_SLN=yes: Nous ne construisons pas ce programme car il est déjà installé par la Glibc.


Contents

The Util-linux package contains the agetty, arch, blockdev, cal, cfdisk, chkdupexe, col, colcrt, colrm, column, ctrlaltdel, cytune, ddate, dmesg, elvtune, fdformat, fdisk, fsck.minix, getopt, hexdump, hwclock, ipcrm, ipcs, kill, logger, look, losetup, mcookie, mkfs, mkfs.bfs, mkfs.minix, mkswap, more, mount, namei, umount, ramsize, rdev, readprofile, rename, renice, rev, rootflags, script, setfdprm, setsid, setterm, sfdisk, swapdev, swapoff, swapon, tunelp, ul, vidmode, whereis, and write programs.


Description

agetty

agetty opens a tty port, prompts for a login name and invokes the /bin/login command.


arch

arch prints the machine architecture.


blockdev

blockdev allows to call block device ioctls from the command line


cal

cal displays a simple calender.


cfdisk

cfdisk is an libncurses based disk partition table manipulator.


chkdupexe

chkdupexe finds duplicate executables.


col

col filters reverse line feeds from input.


colcrt

colcrt filters nroff output for CRT previewing.


colrm

colrm removes columns from a file.


column

column columnates lists.


ctrlaltdel

ctrlaltdel sets the function of the CTRL+ALT+DEL key combination (hard or soft reset).


cytune

cytune queries and modifies the interruption threshold for the Cyclades driver.


ddate

ddate converts Gregorian dates to Discordian dates.


dmesg

dmesg is used to examine or control the kernel ring buffer (boot messages from the kernel).


elvtune

elvtune allows to tune the I/O elevator per block device queue basis.


fdformat

fdformat low-level formats a floppy disk.


fdisk

fdisk is a disk partition table manipulator.


fsck.minix

fsck.minix performs a consistency check for the Linux MINIX filesystem.


getopt

getops parses command options the same way as the getopt C command.


hexdump

hexdump displays specified files, or standard input, in a user specified format (ascii, decimal, hexadecimal, octal).


hwclock

hwclock queries and sets the hardware clock (Also called the RTC or BIOS clock).


ipcrm

ipcrm removes a specified resource.


ipcs

ipcs provides information on IPC facilities.


kill

kill sends a specified signal to the specified process.


logger

logger makes entries in the system log.


look

look displays lines beginning with a given string.


losetup

losetup sets up and controls loop devices.


mcookie

mcookie generates magic cookies for xauth.


mkfs

mkfs builds a Linux filesystem on a device, usually a harddisk partition.


mkfs.bfs

mkfs.bfs creates a SCO bfs file system on a device, usually a harddisk partition.


mkfs.minix

mkfs.minix creates a Linux MINIX filesystem on a device, usually a harddisk partition.


mkswap

mkswap sets up a Linux swap area on a device or in a file.


more

more is a filter for paging through text one screen full at a time.


mount

mount mounts a filesystem from a device to a directory (mount point).


namei

namei follows a pathname until a terminal point is found.


umount

umount unmounts a mounted filesystem.


ramsize

ramsize queries and sets RAM disk size.


rdev

rdev queries and sets image root device, swap device, RAM disk size, or video mode.


readprofile

readprofile reads kernel profiling information.


rename

rename renames files.


renice

renice alters priority of running processes.


rev

rev reverses lines of a file.


rootflags

rootflags queries and sets extra information used when mounting root.


script

script makes typescript of terminal session.


setfdprm

setfdprm sets user-provides floppy disk parameters.


setsid

setsid runs programs in a new session.


setterm

setterm sets terminal attributes.


sfdisk

sfdisk is a disk partition table manipulator.


swapdev

swapdev queries and sets swap device.


swapoff

swapoff disables devices and files for paging and swapping.


swapon

swapon enables devices and files for paging and swapping.


tunelp

tunelp sets various parameters for the LP device.


ul

ul reads a file and translates occurrences of underscores to the sequence which indicates underlining for the terminal in use.


vidmode

vidmode queries and sets the video mode.


whereis

whereis locates a binary, source and manual page for a command.


write

write sends a message to another user.


Dependencies

Util-linux-2.11h needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

chgrp from the fileutils package
chmod from the fileutils package
cp from the fileutils package
install from the fileutils package
ln from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package
cpp from the gcc package

rpcgen from the glibc package

grep from the grep package

make from the make package

sed from the sed package

unam  from the sh-utils package
whoami from the sh-utils package

cat from the textutils package


Désinstaller les anciennes librairies NSS

Si vous avez copié les fichiers des librairies NSS depuis le système Linux normal vers le système LFS (car le système normal utilise Glibc-2.0) il est temps de les désinstaller en exécutant:

rm /lib/libnss*.so.1 /lib/libnss*2.0*


Configurer les logiciels essentiels

Maintenant que tous les logiciels sont installés, tout ce dont nous avons besoin pour que les programmes tournent correctemment est de créer leurs fichiers de configuration.


Configurer Vim

Par défault Vim fonctionne en mode compatible vi. Certaines personnes l'aiment comme cela, mais nous avons une forte préférence pour faire tourner Vim en mode Vim (autrement nous n'aurions pas inclu Vim dans ce livre mais l'original Vi). Créez /root/.vimrc en exécutant ce qui suit:

cat > /root/.vimrc << "EOF"
" Begin /root/.vimrc

set nocompatible
set bs=2

" End /root/.vimrc
EOF


Configurer Glibc

Nous avons besoin de créer le fichier /etc/nsswitch.conf. Bien que glibc puisse fournir un paramétrage par défault lorsque ce fichier manque ou est corrompu, celle-ci ne ne fonctionne pas correctement avec les réseaux, que nous traiterons dans un prochain chapitre. Notre zone horaire a également besoin d'être configurée

Créez un nouveau fichier/etc/nsswitch.conf en exécutant ce qui suit:

cat > /etc/nsswitch.conf << "EOF"
# Begin /etc/nsswitch.conf

passwd: files
group: files
shadow: files

publickey: files

hosts: files dns
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: db files

# End /etc/nsswitch.conf
EOF

Le script tzselect doit être lancé et vous devez répondre aux questions correspondant à votre zone horaire. Lorsque vous l'aurez fait, le script vous donnera l'adresse du fichier de zone horaire nécessaire

Crée le lien symbolique /etc/localtime en exécutant:

cd /etc &&
ln -sf ../usr/share/zoneinfo/<tzselect's output> localtime

Les sorties de tzselect peuvent être du style EST5EDT ou Canada/Eastern.

Le lien symbolique que vous avez créé serait:

ln -sf ../usr/share/zoneinfo/EST5EDT localtime

Ou:

ln -sf ../usr/share/zoneinfo/Canada/Eastern localtime
 


Configurer le chargeur dynamique

Par défault le chargeur dynamique cherhce quelques chemin par défault pour les bibliothèques dynamiques, donc il n'y en n'a normalement pas besoin pour le fichier /etc/ld.so.conf a moins que le sytèmes n'ait des répertoires supplémentaires dans lesquels il doit y chercher des bibliothèques. Le répertoire /usr/local/lib n'est pas utilisé par défault pour les bibliothèques dynamiques, ne soyez donc pas surpris si lorsque vous installez de nouveaux logiciels il ne fonctionne pas sans aucune raison apparente, nous voulons donc ajouter ce chemin.

Créer un nouveau fichier /etc/ld.so.conf en exécutant ce qui suit:

cat > /etc/ld.so.conf << "EOF"
# Begin /etc/ld.so.conf

/lib
/usr/lib
/usr/local/lib

# End /etc/ld.so.conf
EOF

Même s'il n'est pas necessaire d'ajouter les répertoires /lib et /usr/lib cela ne mange pas de pain. De cette façon ce qui est cherché peut être trouvé immédiatement sans pour autant que vous ayez à vous rappeller le chemin par défault si vous n'en n'avez pas envie.


Configurer Sysklogd

Créez un nouveau fichier /etc/syslog.conf en éxécutant ce qui suit:

cat > /etc/syslog.conf << "EOF"
# Begin /etc/syslog.conf

auth,authpriv.* -/var/log/auth.log
*.*;auth,authpriv.none -/var/log/sys.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
*.emerg *

# End /etc/syslog.conf
EOF


Configurer la suite Shadow Password

Ce package contient les utilitaires pour modifier les mots de passe des utilisateurs, ajouter des nouveaux utilisateurs/groupe, supprimer des utilisateurs/groupes et plus. Nous n'allons pas expliquer ce que "password shadowing" (masquage des mots de passe) signifie. Tout cela peut être lu dans le fichier doc/howto de l'arborescence des sources de la suite shadows password une fois celle-ci "déballée". Il y a une chose que vous devez garder à l'esprit, si vous décidez d'utiliser le support de masquage, c'est que les programmes qui ont besoin de vérifier les mots de passe (par exemple xdm, les démons ftp, les démons pop3, etc) doivent être "masquage-complaisant", c'est à dire qu'ils ont besoin d'être capable de travailler avec des mots de passe masqués.

Pour mettre en état les mots de passe masqués, exécuter la commande suivante:

/usr/sbin/pwconv


Configurer Sysvinit

Créez un nouveau fichier /etc/inittab en exécutant ce qui suit:

cat > /etc/inittab << "EOF"
# Begin /etc/inittab

id:3:initdefault:

si::sysinit:/etc/init.d/rcS

l0:0:wait:/etc/init.d/rc 0
l1:S1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6

ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

su:S016:respawn:/sbin/sulogin

1:2345:respawn:/sbin/agetty tty1 9600
2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
4:2345:respawn:/sbin/agetty tty4 9600
5:2345:respawn:/sbin/agetty tty5 9600
6:2345:respawn:/sbin/agetty tty6 9600

# End /etc/inittab
EOF


Créer les fichiers /var/run/utmp, /var/log/wtmp and /var/log/btmp

Des programmes tels que login, shutdown, uptime et d'autre veulent lire et écrire dans les fichiers /var/run/utmp /var/log/btmp et /var/log/wtmp. Ces fichiers contiennent des informations sur qui est actuellement loggé. Ils contiennent également des informations sur quand l'ordinateur à été démarré et arrêté pour la dernière fois ainsi que les tentatives infructueuses pour se logger.

Créez ces fichiers avec leurs propres permissions en exécutant les commandes suivantes:

touch /var/run/utmp /var/log/wtmp \
    /var/log/btmp /var/log/lastlog &&
chmod 644 /var/run/utmp /var/log/wtmp \
   /var/log/btmp /var/log/lastlog


Créer un mot de passe pour root

Choisissez un mot de passe pour l'utilisateur root et créez le en éxécutant la commande suivante:

passwd root


Chapitre 7. Creating system boot scripts


Introduction

This chapter will create the necessary scripts that are run at boot time. These scripts perform tasks such as remounting the root file system mounted read-only by the kernel into read-write mode, activating the swap partition(s), running a check on the root file system to make sure it's intact, setting up networking and starting the daemons that the system uses.

We will be using SysV style init scripts. We have chosen this style because it is widely used and we feel comfortable with it. If you want to try something else, someone has written an LFS-Hint on BSD style init scripts at http://hints.linuxfromscratch.org/hints/bsd-init.txt .

If you decided to copy&paste the scripts from this chapter, you would do best to copy&paste them in small chunks, one screenfull at a time. Some scripts are too large to fit in the copy buffer and will be truncated when you paste it.


How does the booting process with these scripts work?

Linux uses a special booting facility named SysVinit. It's based on a concept of runlevels. It can be widely different from one system to another, so it can't be assumed that because things worked in <insert distro name> they should work like that in LFS too. LFS has its own way of doing things, but it respects generally accepted standards.

SysVinit (which we'll call init from now on) works using a runlevels scheme. There are 7 (from 0 to 6) runlevels (actually, there are more runlevels but they are for special cases and generally not used. The init man page describes those details), and each one of those corresponds to the things the computer is supposed to do when it starts up. The default runlevel is 3. Here are the descriptions of the different runlevels as they are often implemented:

0: halt the computer
1: single-user mode
2: multi-user mode without networking
3: multi-user mode with networking
4: reserved for customization, otherwise does the same as 3
5: same as 4, it is usually used for GUI login (like X's xdm or KDE's kdm)
6: reboot the computer

The command used to change runlevels is init <runlevel> where <runlevel> is the target runlevel. For example, to reboot the computer, a user would issue the init 6 command. The reboot command is just an alias, as is the halt command an alias to init 0.

The /etc/init.d/rcS script is run at every startup of the computer, before any runlevel is executed and runs the scripts listed in /etc/rcS.d

There are a number of directories under /etc that look like like rc?.d where ? is the number of the runlevel and rcS.d which contain a number of symbolic links. Some begin with an K, the others begin with an S, and all of them have three numbers following the initial letter. The K means to stop (kill) a service, and the S means to start a service. The numbers determine the order in which the scripts are run, from 000 to 999; the lower the number the sooner it gets executed. When init switches to another runlevel, the appropriate services get killed and others get started.

The real scripts are in /etc/init.d. They do all the work, and the symlinks all point to them. Killing links and starting links point to the same script in /etc/init.d. That's because the scripts can be called with different parameters like start, stop, restart, reload, status. When a K link is encountered, the appropriate script is run with the stop argument. When a S link is encountered, the appropriate script is run with the start argument.

There is one exception. Links that start with an S in the rc0.d and rc6.d directories will not cause anything to be started. They will be called with the parameter stop to stop something. The logic behind it is that when you are going to reboot or halt the system, you don't want to start anything, only stop the system.

These are descriptions of what the arguments make the scripts do:

  • start: The service is started.

  • stop: The service is stopped.

  • restart: The service is stopped and then started again.

  • reload: The configuration of the service is updated. This is used after the configuration file of a service was modified, when the service doesn't need to be restarted.

  • status: Tells if the service is running and with which PID's.

Feel free to modify the way the boot process works (after all it's your LFS system, not ours). The files here are just an example of how it can be done in a nice way (well what we consider nice anyway. You may hate it).


Creating directories

We need to start by creating a few extra directories that are used by the boot scripts. These directories are created by running:

cd /etc &&
mkdir rc{0,1,2,3,4,5,6,S}.d init.d sysconfig &&
cd init.d


Creating the rc script

The first main boot script is the /etc/init.d/rc script. Create the /etc/init.d/rc script by running the following command:

cat > /etc/init.d/rc << "EOF"
#!/bin/sh
# Begin /etc/init.d/rc
#
# By Jason Pearce  - jason.pearce@linux.org
# Modified by Gerard Beekmans - gerard@linuxfromscratch.org
# print_error_msg based on ideas by Simon Perreault -
# nomis80@videotron.ca
#

#
# Include the functions declared in the /etc/init.d/functions file
#

source /etc/init.d/functions

#
# The print_error_msg function prints an error message when an unforeseen
# error occurred that wasn't trapped for some reason by a evaluate_retval
# call or error checking in different ways.

print_error_msg()
{

        echo
        $FAILURE
        echo -n "You should not read this error message. It means "
        echo "that an unforeseen error "
        echo -n "took place and subscript $i exited with "
        echo "a return value "
        echo -n "of $error_value for an unknown reason. If you're able "
        echo "to trace this error down "
        echo -n "to a bug in one of the files provided by this book, "
        echo "please be so kind to "
        echo -n "inform us at lfs-dev@linuxfromscratch.org"
        $NORMAL
        echo
        echo
        echo "Press a key to continue..."
        read

}

#
# If you uncomment the debug variable below none of the scripts will be
# executed, just the script name and parameters will be echo'ed to the
# screen so you can see how the scripts are called by rc.
#

# Un-comment the following for debugging.
# debug=echo

#
# Start script or program.
# 
startup() {

        $debug "$@"

}   

#
# Ignore CTRL-C only in this shell, so we can interrupt subprocesses.
#

trap ":" INT QUIT TSTP

#
# Now find out what the current and what the previous runlevel are. The
# $RUNLEVEL variable is set by init for all it's children. This script
# runs as a child of init.
#

runlevel=$RUNLEVEL

#
# Get first argument. Set new runlevel to this argument. If no runlevel
# was passed to this script we won't change runlevels.
#

[ "$1" != "" ] && runlevel=$1
if [ "$runlevel" = "" ]
then
        echo "Usage: $0 <runlevel>" >&2
        exit 1
fi

#
# The same goes for $PREVLEVEL (see above for $RUNLEVEL). previous will
# be set to the previous run level. If $PREVLEVEL is not set it means
# that there is no previous runlevel and we'll set previous to N.
#

previous=$PREVLEVEL
[ "$previous" = "" ] && previous=N

export runlevel previous

#
# Is there an rc directory for the new runlevel?
#

if [ -d /etc/rc$runlevel.d ]

then

#
# If so, first collect all the K* scripts in the new run level.
#

        if [ $previous != N ]
        then
                for i in /etc/rc$runlevel.d/K*
                do
                [ ! -f $i ] && continue

#
# the suffix variable will contain the script name without the leading
# Kxxx
#

                        suffix=${i#/etc/rc$runlevel.d/K[0-9][0-9][0-9]}
#
# If there is a start script for this K script in the previous runlevel
# determine what it's full path is
#
            previous_start=/etc/rc$previous.d/S[0-9][0-9][0-9]$suffix
#
# If there was no previous run level it could be that something was
# started in rcS.d (sysinit level) so we'll determine the path for that
# possibility as well.
#

                        sysinit_start=/etc/rcS.d/S[0-9][0-9][0-9]$suffix

#
# Stop the service if there is a start script in the previous run level 
# or in the sysinit level. If previous_start or sysinit_start do not 
# exist the 'continue' command is run which causes the script to abort
# this iteration of the for loop and continue with the next iteration.
# This boils down to that it won't run the commands after the next two
# lines and start over from the top of this for loop. See man bash for
# more info on this.
#

                        [ ! -f $previous_start ] &&
                        [ ! -f $sysinit_start ] && continue

#
# If we found previous_start or sysinit_start, run the K script
#

                        startup $i stop
                        error_value=$?
#
# If the return value of the script is not 0, something went wrong with
# error checking inside the script. the print_error_msg function will be
# called and the message plus the return value of the K script will be
# printed to the screen
#

                        if [ $error_value != 0 ]
                        then
                                print_error_msg 
                        fi

                done
        fi

#
# Now run the START scripts for this runlevel.
#

        for i in /etc/rc$runlevel.d/S*
        do
                [ ! -f $i ] && continue

                if [ $previous != N ]
        then
#
# Find start script in previous runlevel and stop script in this
# runlevel.
#

                        suffix=${i#/etc/rc$runlevel.d/S[0-9][0-9][0-9]}
                        stop=/etc/rc$runlevel.d/K[0-9][0-9][0-9]$suffix
                previous_start=/etc/rc$previous.d/S[0-9][0-9][0-9]$suffix
#
# If there is a start script in the previous level and no stop script in 
# this level, we don't have to re-start the service; abort this
# iteration and start the next one.
#

                        [ -f $previous_start ] && [ ! -f $stop ] && 
                        continue
                fi

                case "$runlevel" in
                        0|6)

#
# levels 0 and 6 are halt and reboot levels. We don't really start
# anything here so we call with the 'stop' parameter
#

                                startup $i stop
                                error_value=$?
#
# If the return value of the script is not 0, something went wrong with
# error checking inside the script. the print_error_msg function will be
# called and the message plus the return value of the K script will be
# printed to the screen
#

                                if [ $error_value != 0 ]
                                then
                                        print_error_msg
                                fi
                                ;;
                        *)
                                startup $i start
                                error_value=$?
#
# If the return value of the script is not 0, something went wrong with
# error checking inside the script. the print_error_msg function will be
# called and the message plus the return value of the K script will be
# printed to the screen
#

                                if [ $error_value != 0 ]
                                then
                                        print_error_msg
                                fi
                                ;;
                esac
        done
fi

# End /etc/init.d/rc
EOF


Création du script rcS

Le second script de démarrage est le script rcS. Créez le script /etc/init.d/rcS en lançant la commande suivante:

cat > /etc/init.d/rcS << "EOF"
#!/bin/sh
# Début de /etc/init.d/rcS

#
# Se référer au script rc pour des commentaires exhaustifs sur les constructions 
# utilisées ici
#

source /etc/init.d/functions

print_error_msg()
{
 
        echo
        $FAILURE
	echo -n "Vous ne devriez pas lire ce message d'erreur. Cela signifie "
        echo "qu'une nouvelle erreur "
	echo -n "est apparue et le script $i s'est terminé avec "
	echo "une valeur de retour "
	echo -n "à $error_value pour une raison inconnue. Si vous êtes capable "
        echo "de tracer cette erreur "
	echo -n "jusqu'à un bug dans l'un des fichiers fourni par ce livre, "
        echo "merci de bien vouloir nous"
        echo -n "en informer à lfs-dev@linuxfromscratch.org"
        $NORMAL
        echo
        echo
        echo "Presser une touche pour continuer..."
        read

}

runlevel=S
prevlevel=N
umask 022
export runlevel prevlevel

trap ":" INT QUIT TSTP

#
# Récupère tous les scripts S dans /etc/rcS.d et les exécute
#

for i in /etc/rcS.d/S*
do
        [ ! -f  "$i" ] && continue;
                $i start
                error_value=$?

                if [ $error_value != 0 ]
                then
                        print_error_msg
                fi
done

# Fin de /etc/init.d/rcS
EOF


Création du script functions

Créez le script /etc/init.d/functions par la commande suivante:

cat > /etc/init.d/functions << "EOF"
#!/bin/sh
# Début de /etc/init.d/functions

#
# Positionne certaines variables qui influencent l'affichage du texte à l'écran.
# La variable SET_COL positionne le texte au numéro de colonne 
# initialisé dans les sections COL et WCOL (comme défini par la variable COL). 
# NORMAL affiche le texte en mode normal.
# SUCCESS affiche le texte en vert et FAILURE l'affiche en rouge.
#

# Si COLUMNS n'a pas encore été initialisé (bash le fait mais pas lorsqu'il est 
# appelé comme sh), faisons-le

	if [ -z "$COLUMNS" ]
    	then
		# Récupère le périphérique de la console si nous ne l'avions pas
		# déjà. Cela est conforme au FHS comme il y a une sécurité si
		# /usr/bin/tty n'est pas présent, par exemple au démarrage.
        	test -x /usr/bin/tty && CONSOLE=`/usr/bin/tty`
        	test -z "$CONSOLE" && CONSOLE=/dev/console

    		# Récupère la taille de la console (lignes colonnes)
        	SIZE=$(stty size < $CONSOLE)
 
    		# Ne garde que les colonnes
      		COLUMNS=${SIZE#*\ }
	fi
 
COL=$[$COLUMNS - 10]
WCOL=$[$COLUMNS - 30]
SET_COL="echo -en \\033[${COL}G"
SET_WCOL="echo -en \\033[${WCOL}G"
NORMAL="echo -en \\033[0;39m"
SUCCESS="echo -en \\033[1;32m"
WARNING="echo -en \\033[1;33m"
FAILURE="echo -en \\033[1;31m"

#
# La fonction evaluate_retval évalue la valeur de retour du processus
# précédemment exécuté juste avant que cette fonction ne soit appelée. Si la 
# valeur de retour est égale à 0, indiquant une sortie sans erreur, la
# fonction print_status est appelée avec le paramètre 'success'.
# Sinon, la fonction print_status est appelée avec le paramètre 'failure'.
#

evaluate_retval()
{
        if [ $? = 0 ]
        then
                print_status success
        else
                print_status failure
        fi
}

#
# Print_status affiche [  OK  ] ou [FAILED] à l'écran. OK apparaît
# dans la couleur définit par la variable SUCCESS et FAILED apparaît dans
# la couleur définit par la variable FAILURE. Ils sont tous les deux affichés
# à partir de la colonne définit par la variable COL.
#

print_status()
{

#
# Si aucun paramètre n'est donné à la fonction print_status, l'usage de la
# fonction est affiché.
#

        if [ $# = 0 ]
        then
                echo "Usage: print_status {success|failure}"
                return 1
        fi

        case "$1" in
                success)
                        $SET_COL
                        echo -n "[  "
                        $SUCCESS
                        echo -n "OK"
                        $NORMAL
                        echo "  ]"
                        ;;
                warning)
                        $SET_COL
                        echo -n "[ "
                        $WARNING
                        echo -n "ATTN"
                        $NORMAL
                        echo " ]"
                        ;;
                failure)
                        $SET_COL
                        echo -n "["
                        $FAILURE
                        echo -n "FAILED"
                        $NORMAL
                        echo "]"
                        ;;
        esac

}

#
# La fonction loadproc démarre un processus (appelé daemon)
# avec son propre système de vérification d'exécution
#

loadproc()
{

#
# Si aucun paramètre n'est donné, affiche les informations
# d'usage.
#

        if [ $# = 0 ]
        then
                echo "Usage: loadproc {program}"
                exit 1
        fi
#
# Récupère le nom seul du premier paramètre (le nom du daemon sans
# le chemin, c'est le cas de /usr/sbin/syslogd qui devient 'syslogd' après
# l'exécution de la commande)
#

        base=$(/usr/bin/basename $1)
#
# la variable pidlist contiendra la sortie de la commande pidof.
# pidof tentera de trouver les PID associés à une certaine chaîne de 
# caractères ; $base dans notre cas
#

        pidlist=$(/bin/pidof -o $$ -o $PPID -o %PPID -x $base)

        pid=""

        for apid in $pidlist
        do
                if [ -d /proc/$apid ]
                then
                        pid="$pid $apid"
                fi
        done
#
# Si la variable $pid n'est pas vide (résultat de la précédente boucle) cela
# veut dire que le daemon est déjà présent
#

        if [ ! -n "$pid" ]
        then
#
# Une variable $pid vide signifie que le daemon ne tourne pas, donc nous 
# lançons "$@" (l'ensemble des paramètres donnés à cette fonction par le 
# script) puis nous vérifions la valeur de retour
#

                "$@"
                evaluate_retval
        else
#
# Une variable $pid non vide, signifie qu'il tournait déjà. Nous afficherons
# [ ATTN ] alors
#

                $SET_WCOL
                echo -n "Already running"
                print_status warning
        fi

}

#
# La fonction killproc tue un processus avec son propre système de vérification
# d'erreur
#

killproc()
{

#
# Si aucun paramètre n'est passé, affichage des informations d'usage.
#

        if [ $# = 0 ]
        then
                echo "Usage: killproc {program} [signal]"
                exit 1
        fi

#
# Récupère le nom seul du premier paramètre (le nom du daemon sans
# le chemin, c'est le cas de /usr/sbin/syslogd qui devient 'syslogd' après
# l'exécution de la commande)
#

        base=$(/usr/bin/basename $1)

#
# Vérifie si nous avons un signal avec lequel tuer le processus (comme -HUP, -TERM,
# -KILL, etc) de cette fonction (le deuxième paramètre). Si aucun deuxième paramètre
# n'est fourni, positionne la variable nolevel. Sinon met la variable
# killlevel à la valeur de $2 (le second paramètre).
#

        if [ "$2" != "" ]
        then
                killlevel=-$2
        else
                nolevel=1
        fi

#
# la variable pidlist contiendra la sortie de la commande pidof.
# pidof tentera de trouver les PID associés à une certaine chaîne de 
# caractères ; $base dans notre cas
#

        pidlist=$(/bin/pidof -o $$ -o $PPID -o %PPID -x $base)

        pid=""

        for apid in $pidlist
        do
                if [ -d /proc/$apid ]
                then
                        pid="$pid $apid"
                fi
        done

#
# Si $pid contient quelque chose, résultat de la précédente boucle
# cela signifie qu'un ou plusieurs PID ont été trouvés
# et correspondent aux processus à tuer
#

        if [ -n "$pid" ]
        then

#
# Si aucun signal n'est spécifié nous essayerons -TERM d'abord puis attendrons
# 2 secondes pour attendre la fin du processus de terminaison
#

                if [ "$nolevel" = 1 ]
                then
                        /bin/kill -TERM $pid

#
# Si après -TERM le PID continue d'exister nous attendrons 2 secondes avant
# d'essayer de le tuer avec le signal -KILL. Si le PID existe toujours après ça,
# nous attendons encore 2 secondes. Si le PID existe toujours on peut 
# raisonnablement estimer que l'on ne peut le tuer.
#

                        if /bin/ps h $pid >/dev/null 2>&1
                        then
                                /usr/bin/sleep 2
                                if /bin/ps h $pid > /dev/null 2>&1
                                then
                                        /bin/kill -KILL $pid
                                        if /bin/ps h $pid > /dev/null 2>&1
                                        then
                                                /usr/bin/sleep 2
                                        fi
                                fi
                        fi
                        /bin/ps h $pid >/dev/null 2>&1
                        if [ $? = 0 ]
                        then
#
# Si après l'utilisation du signal KILL il continue d'exister, c'est qu'il ne
# peut être tué et nous affichons alors [FAILED]
#

                                print_status failure
                        else

#
# S'il a été tué, on peut alors effacer le fichier associé au PID dans /var/run et 
# afficher [  OK  ]
#

                                /bin/rm -f /var/run/$base.pid
                                print_status success
                        fi
                else

#
# Un signal d'arret a été fourni. On tue le processus avec ce signal et on attend
# 2 secondes pour permettre au processus de s'arrêter
#

                        /bin/kill $killlevel $pid
                        if /bin/ps h $pid > /dev/null 2>&1
                        then
                                /usr/bin/sleep 2
                        fi
                        /bin/ps h $pid >/dev/null 2>&1
                        if [ $? = 0 ]
                        then

#
# Si la valeur de retour de la commande ps est égale à 0, cela signifie que le PID
# continue de vivre et donc que le processus n'a pas été tué proprement avec le 
# signal fourni. On affiche [FAILED].
#

                                print_status failure
                        else

#
# Si la valeur de retour est supérieure ou égale à 1 alors le PID n'existe plus.
# On peut alors effacer le fichier associé à ce PID dans /var/run et afficher [  OK  ]
#

                                /bin/rm -f /var/run/$base.pid
                                print_status success
                        fi
                fi
        else

#
# Le PID n'existe pas donc pas besoin de le tuer. On affiche [ ATTN ]
#

                $SET_WCOL
                echo -n "Not running"
                print_status warning
        fi
}

#
# La fonction reloadproc envoie un signal au daemon pour lui dire de 
# recharger son fichier de configuration. C'est à peu près le même
# fonctionnement que la fonction killproc sans l'envoi du signal
# -KILL (aka -9)
#

reloadproc()
{

#
# Si aucun paramètre n'est donné à la fonction print_status, on affiche les
# informations d'usage.
#

        if [ $# = 0 ]
        then
                echo "Usage: reloadproc {program} [signal]"
                exit 1
        fi

#
# Récupère le nom seul du premier paramètre (le nom du daemon sans
# le chemin, c'est le cas de /usr/sbin/syslogd qui devient 'syslogd' après
# l'exécution de la commande)
#

        base=$(/usr/bin/basename $1)

#
# Vérifie si nous avons un signal avec lequel tuer le processus (comme -HUP, -TERM,
# -KILL, etc) de cette fonction (le deuxième paramètre). Si aucun deuxième paramètre
# n'est fourni, positionne la variable nolevel. Sinon met la variable
# killlevel à la valeur de $2 (le second paramètre).
#

        if [ -n "$2" ]
        then
                killlevel=-$2
        else
                nolevel=1
        fi

#
# la variable pidlist contiendra la sortie de la commande pidof.
# pidof tentera de trouver les PID associés à une certaine chaîne de 
# caractères ; $base dans notre cas
#

        pidlist=$(/bin/pidof -o $$ -o $PPID -o %PPID -x $base)

        pid=""

        for apid in $pidlist
        do
                if [ -d /proc/$apid ]
                then
                        pid="$pid $apid"
                fi
        done

#
# Si $pid contient quelque chose, résultat de la précédente boucle
# cela signifie qu'un ou plusieurs PID ont été trouvés
# et correspondent aux processus à recharger
#

        if [ -n "$pid" ]
        then

#
# Si nolevel est positionnée nous utilserons le signal par défaut SIGHUP.
#

                if [ "$nolevel" = 1 ]
                then
                        /bin/kill -SIGHUP $pid
                        evaluate_retval
                else

#
# Sinon nous utiliserons le signal fourni
#

                        /bin/kill $killlevel $pid
                        evaluate_retval
                fi
        else

#
# Si $pid est vide alors aucun PID ne correspond.
# On affiche [ ATTN ]
#

                $SET_WCOL
                echo -n "Not running"
                print_status warning
        fi
}

#
# La fonction statusproc essaiera de déterminer si un processus tourne
# ou pas
#

statusproc()
{

#
# Si aucun paramètre n'est donné à la fonction print_status, on affiche
# les informations d'usage.
#

        if [ $# = 0 ]
        then
                echo "Usage: status {program}"
                return 1
        fi

#
# $pid contiendra une liste des PID qui correspondent au processus.
#

        pid=$(/bin/pidof -o $$ -o $PPID -o %PPID -x $1)
        if [ -n "$pid" ]
        then

#
# Si $pid contient quelque chose, le processus tourne, on affiche alors
# le contenu de la variable $pid.
#

                echo "$1 running with Process ID $pid"
                return 0
        fi

#
# Si $pid ne contient rien, on vérifie si un fichier associé au PID existe
# dans /var/run et on informe l'utilisateur de sa présence.
#

        if [ -f /var/run/$1.pid ]
        then
                pid=$(/usr/bin/head -1 /var/run/$1.pid)
                if [ -n "$pid" ]
                then
                        echo "$1 not running but /var/run/$1.pid exists"
                        return 1
                fi
        else
                echo "$1 is not running"
        fi

}

# Fin de /etc/init.d/functions
EOF


Creating the checkfs script

Create the /etc/init.d/checkfs script by running the following command:

cat > /etc/init.d/checkfs << "EOF"
#!/bin/sh
# Begin /etc/init.d/checkfs

#
# Include the functions declared in the /etc/init.d/functions file
#

source /etc/init.d/functions

#
# Activate all the swap partitions declared in the /etc/fstab file
#

echo -n "Activating swap..."
/sbin/swapon -a
evaluate_retval

#
# If the /fastboot file exists we don't want to run the partition checks
#

if [ -f /fastboot ]
then
        echo "Fast boot, no file system check"
else

#
# Mount the root partition read-only (just in case the kernel mounts it
# read-write and we don't want to run fsck on a read-write mounted 
# partition).
#

        /bin/mount -n -o remount,ro /
        if [ $? = 0 ]
        then

#
# If the /forcefsck file exists we want to force a partition check even 
# if the partition was unmounted cleanly the last time
#

                if [ -f /forcefsck ]
                then
                        echo -n "/forcefsck exists, forcing "
                        echo "file system check"
                        force="-f"
                else
                        force=""
                fi

#
# Check all the file systems mentioned in /etc/fstab that have the
# fs_passno value set to 1 or 2 (the 6th field. See man fstab for more
# info)
#

                echo "Checking file systems..."
                /sbin/fsck $force -a -A -C -T

#
# If something went wrong during the checks of one of the partitions,
# fsck will exit with a return value greater than 1. If this is
# the case we start sulogin so you can repair the damage manually
#

                if [ $? -gt 1 ]
                then
                        $FAILURE
                        echo
                        echo -n "fsck failed. Please repair your file "
                        echo "systems manually by running /sbin/fsck"
                        echo "without the -a option"
                        echo
                        echo -n "Please note that the root file system " 
                        echo "is currently mounted in read-only mode."
                        echo
                        echo -n "I will start sulogin now. When you  "
                        echo "logout I will reboot your system."
                        echo
                        $NORMAL
                        /sbin/sulogin
                        /sbin/reboot -f
                else
                        print_status success
                fi

        else

#
# If the remount to read-only mode didn't work abort the fsck and print
# an error
#

                echo -n "Cannot check root file system because it "
                echo "could not be mounted in read-only mode."
        fi
fi

# End /etc/init.d/checkfs
EOF


Création du script halt

Pour créer le script /etc/init.d/halt faites:

cat > /etc/init.d/halt << "EOF"
#!/bin/sh
# Début de /etc/init.d/halt

#
# Appelle la commande halt. Voir l'aide de halt pour la compréhension des 
# paramètres.
#

/sbin/halt -d -f -i -p

# Fin de /etc/init.d/halt
EOF


Création du script loadkeys

Vous ne devez créer ce script que si vous ne possédez pas un clavier à 101 touches américains.

Créez le script /etc/init.d/loadkeys avec la commande suivante:

cat > /etc/init.d/loadkeys << "EOF"
#!/bin/sh
# Début de /etc/init.d/loadkeys

#
# Inclut les fonctions déclarées dans le fichier /etc/init.d/functions
#

source /etc/init.d/functions

#
# Inclut /etc/sysconfig/keyboard qui contient la variable LAYOUT
#

source /etc/sysconfig/keyboard

#
# Charge le fichier clavier par défaut
#

echo -n "Loading keymap..."
/bin/loadkeys $LAYOUT 2>/dev/null
evaluate_retval

# Fin de /etc/init.d/loadkeys
EOF


Créer le fichier /etc/sysconfig/keyboard

Créez un nouveau fichier /etc/sysconfig/keyboard par:

cat > /etc/sysconfig/keyboard << "EOF"
# Début de /etc/sysconfig/keyboard
 
LAYOUT=<chemin-de-description-clavier>
 
# Fin de /etc/sysconfig/keyboard
EOF

Remplacez <chemin-de-description-clavier> par le chemin de description clavier que vous avez sélectionné. Par exemple, si vous avez choisi un clavier américain, vous devriez mettre /usr/share/kbd/keymaps/i386/qwerty/us.map.gz


Création du script mountfs

Créez le script /etc/init.d/mountfs en exécutant la commande suivante:

cat > /etc/init.d/mountfs << "EOF"
#!/bin/sh
# Début de /etc/init.d/mountfs

#
# Inclut les fonctions déclarées dans le fichier /etc/init.d/functions
#

source /etc/init.d/functions

case "$1" in
    start)

        #
        # Remonte la partition root en lecture-écriture. -n permet
        # de ne pas écrire le montage dans le fichier
        # /etc/mtab (parce qu'il ne peut le faire. La partition
        # root est heureusement encore montée en lecture seule).
        #

        echo -n "Remounting root file system in read-write mode..."
        /bin/mount -n -o remount,rw /
        evaluate_retval

        #
        # Premièrement efface le contenu du fichier /etc/mtab. Puis remonte la 
	# partition root en lecture-écriture à nouveau en passant l'option -f 
	# à la commande mount. Ceci permet à mount de tout faire excepté
        # le montage proprement dit. De cette façon, on tient à jour
	# le fichier /etc/mtab qui contient la liste
	# des systèmes de fichiers montés.
        #

        echo > /etc/mtab
        /bin/mount -f -o remount,rw /

        #
        # Efface les éventuels fichiers /fastboot et /forcefsck. Ils sont
        # supposés être uniquement utilisés pour chekfs lors du prochain 
	# redémarrage lequel vient juste d'avoir lieu.
        # Si vous voulez utiliser à nouveau fastboot ou forcefsck vous
        # devrez recréer ces fichiers.
        #

        /bin/rm -f /fastboot /forcefsck

        #
        # Utilise /etc/fstab pour monter les systèmes de fichiers qui n'ont 
	# pas l'option noauto de positionnée dans le champ fs_mntops (le 4ième
        # champ ; voir l'aide de fstab pour plus d'informations).
	#

        echo -n "Mounting other file systems..."
        /bin/mount -a
        evaluate_retval
        ;;

    stop)

        #
        # Désactive toutes les partitions de swap
        #

        echo -n "Deactivating swap..."
        /sbin/swapoff -a
        evaluate_retval

        #
	# Et démonte tous les systèmes de fichiers, monte le système
	# de fichier racine en lecture-seule
        # (tous sont démontés mais comme root ne peux pas être
        # démontée, mount le montera automatiquement en lecture-seule.
        # De cette façon aucune donnée ne peut plus être écrite sur
        # le disque).
        #

        echo -n "Unmounting file systems..."
        /bin/umount -a -r
        evaluate_retval
        ;;

    *)
        echo "Usage: $0 {start|stop}"
        exit 1
    ;;
esac

# Fin de /etc/init.d/mountfs
EOF


Création du script de redémarrage

Créez le script /etc/init.d/reboot en lançant la commande suivante :

cat > /etc/init.d/reboot << "EOF"
#!/bin/sh
# Début de /etc/init.d/reboot

#
# Appelle le redémarrage. Voir la page man de halt pour la 
# signification des paramètres
#


echo "Le système est en train de redémarrer..."

/sbin/reboot -d -f -i

# Fin de /etc/init.d/reboot
EOF


Création du script sendsignals

Créez le script /etc/init.d/sendsignals en lançant la commande suivante:

cat > /etc/init.d/sendsignals << "EOF"
#!/bin/sh
# Début de /etc/init.d/sendsignals

#
# Inclu les fonctions déclarées dans le fichier /etc/init.d/functions
#

source /etc/init.d/functions

#
# Envoie à tous les processus encore en cours le signal TERM
#

echo -n "Sending all processes the TERM signal..."
/sbin/killall5 -15
evaluate_retval

#
# Envoie à tous les processus encore en cours (après avoir auparavant envoyé 
# le signal TERM) le signal KILL.
#

echo -n "Sending all processes the KILL signal..."
/sbin/killall5 -9
evaluate_retval

# Fin de /etc/init.d/sendsignals
EOF


Création du script setclock

Le script qui suit n'est vraiment utile que quand l'horloge matérielle (aussi appelée BIOS or horloge CMOS) n'est pas à l'heure GMT. La configuration recommandée est de mettre l'horloge matérielle à GMT et de convertir l'heure en heure local en utilisant le lien symbolique /etc/localtime. Mais si un autre système d'exploitation qui ne comprend pas une horloge positionnée à GMT ( les plus connus étant les systèmes d'exploitation Microsoft ) vous voudrez certaienemnt mettre votre horloge à l'heure locale pour que l'heure soit correctement affichée sous les deux systèmes. Ce script affectera l'heure du noyau à celle de l'horloge matérielle sans utiliser le lien symbolique /etc/localtime.

Créez le script /etc/init.d/setclock en lançant la commande suivante:

cat > /etc/init.d/setclock << "EOF"
#!/bin/sh
# Début de /etc/init.d/setclock

#
# Inclu les fonctions déclarées dans le fichier /etc/init.d/functions
# inclu les variables du fichier /etc/sysconfig/clock
#

source /etc/init.d/functions
source /etc/sysconfig/clock

#
# Maintenant, nous voulons que l'heure de l'horloge noyau soit la même
# que celle de l'horloge matérielle, pour cela on utilise le parametre -hctosys.
#

CLOCKPARAMS="--hctosys"

#
# Si la varaible UTC est positionnée dans le fichier /etc/sysconfig/clock, ajoutez
# aussi le paramètre -u qui indique que l'horloge matérielle est à l'heure UTC
# au lieu de l'heure locale.
#

case "$UTC" in
        yes|true|1)
                CLOCKPARAMS="$CLOCKPARAMS --utc"
                ;;
        no|false|0)
                CLOCKPARAMS="$CLOCKPARAMS --localtime"
                ;;
esac

echo -n "Mise à l'heure..."
/sbin/hwclock $CLOCKPARAMS
evaluate_retval

# End /etc/init.d/setclock
EOF


Création du fichier /etc/sysconfig/clock

Si vous voulez utilisez ce script sur votres système même si l'horloge matérielle est positionnée à GMT, alors la variable UTC suivante doit être changée à la valeur 1.

Créez un nouveau fichier /etc/sysconfig/clock en lançant la commande suivante:

cat > /etc/sysconfig/clock << "EOF"
# Begin /etc/sysconfig/clock

UTC=0

# Fin de /etc/sysconfig/clock
EOF

Maintenant, vous voudrez peut-être jeter un oeil sur ce topo expliquant comment on gère le temps avec LFS: http://hints.linuxfromscratch.org/hints/time.txt. Il explique des points tels les timezones, UTC, et la varaible d'environnement TZ.


Création du script sysklogd

Créez le script /etc/init.d/sysklogd en lançant la commande suivante:

cat > /etc/init.d/sysklogd << "EOF"
#!/bin/sh
# Début de  /etc/init.d/sysklogd

#
# Inclu les fonctions déclarées dans le fichier /etc/init.d/functions
#

source /etc/init.d/functions

case "$1" in
        start)
	echo -n "Démarrage du démon de log du système..."
                loadproc /usr/sbin/syslogd -m 0

		echo -n "Démarrage du démon de log du noyau..."
                loadproc /usr/sbin/klogd
                ;;

        stop)
		echo -n "Arrêt du démon de log du noyau..."
                killproc klogd

		echo -n "Arrêt du démon de log du système..."
                killproc syslogd
                ;;

        reload)
	echo -n "Rechargement du fichier de configuration du démon de log..."
                reloadproc syslogd 1
                ;;

        restart)
                $0 stop
                /usr/bin/sleep 1
                $0 start
                ;;

        status)
                statusproc /usr/sbin/syslogd
                statusproc /usr/sbin/klogd
                ;;

        *)
                echo "Usage: $0 {start|stop|reload|restart|status}"
                exit 1
	        ;;

esac

# Fin de /etc/init.d/sysklogd
EOF


Création du script template

Créez le script /etc/init.d/template en lançant la commande suivante:

cat > /etc/init.d/template << "EOF"
#!/bin/sh
# Début de /etc/init.d/

#
# Inclu les fonctions déclarées dans le fichier /etc/init.d/functions
#

source /etc/init.d/functions

case "$1" in
        start)
		echo -n "Démarrage ..."
                loadproc
                ;;

        stop)
                echo -n "Arrêt ..."
                killproc
                ;;

        reload)
                echo -n "Rechargement ..."
                reloadproc
                ;;

        restart)
                $0 stop
                /usr/bin/sleep 1
                $0 start
                ;;

        status)
                statusproc
                ;;

        *)
                echo "Usage: $0 {start|stop|reload|restart|status}"
                exit 1
	        ;;

esac

# Fin de /etc/init.d/
EOF


Création du script localnet

Pour créer le script /etc/init.d/localnet entrez la commande suivante:

cat > /etc/init.d/localnet << "EOF"
#!/bin/sh 
# Début de /etc/init.d/localnet

#
# Inclut les fonctions déclarées dans le fichier /etc/init.d/functions
# et inclut également les variables du fichier /etc/sysconfig/network.
# 

source /etc/init.d/functions
source /etc/sysconfig/network

case "$1" in
        start)
                echo -n "Bringing up the loopback interface..."
                /sbin/ifconfig lo 127.0.0.1
                evaluate_retval

                echo -n "Setting up hostname..."
                /bin/hostname $HOSTNAME
                evaluate_retval
                ;;

        stop)
                echo -n "Bringing down the loopback interface..."
                /sbin/ifconfig lo down
		evaluate_retval
                ;;

        restart)
                $0 stop
                sleep 1
                $0 start
                ;;
        *)
                echo "Usage: $0: {start|stop|restart}"
                exit 1
                ;;
esac

# Fin de /etc/init.d/localnet
EOF


Création du fichier /etc/sysconfig/network

Un nouveau fichier /etc/sysconfig/network est créé et le nom d'hôte est initialisé par:

echo "HOSTNAME=lfs" > /etc/sysconfig/network

<< lfs>>  doit être remplacé par le nom de l'ordinateur que vous utilisez. Vous ne devriez pas entrer le nom FQDN (Fully Qualified Domain Name) ici. Cette information sera mise dans le fichier /etc/hosts plus tard.


Création du fichier /etc/hosts

Si une carte réseau doit être configurée, vous devez choisir l'adresse IP, le nom de domaine pleinement qualifié et les alias possibles à déclarer dans le fichier /etc/hosts. Par exemple:

<mon-IP> mon-hôte.mon-domaine.org aliases

Vous devez vous assurer que l'adresse IP se trouve dans la plage d'adresses réservée aux réseaux provés. Les plages valides sont:

	Classes Réseaux
	A     10.0.0.0
	B     172.16.0.0 à 172.31.0.0
	C     192.168.0.0 à 192.168.255.0

Une adresse IP valide pourrait être 192.168.1.1. Un nom de domaine pleinement qualifié pour cette adresse IP pourrait être www.linuxfromscratch.org

Si vous ne possédez pas de carte réseau, vous devez néanmoins déclarer un nom de domaine pleinement qualifié. Cela est nécessaire à certains programmes tels Sendmail pour fonctionner correctement (en réalité ; Sendmail ne fonctionnera pas avant qu'un nom de domaine pleinement qualifié ne soit déclaré).

Si aucune carte réseau ne doit être configurée, un nouveau fichier /etc/hosts peut être créé par:

cat > /etc/hosts << "EOF"
# Début de /etc/hosts (version sans carte réseau)

127.0.0.1 www.mon-domaine.com <nom d'hôte> localhost

# Fin de /etc/hosts (version sans carte réseau)
EOF

Pour un fichier /etc/hosts avec une carte réseau à configurer, faire:

cat > /etc/hosts << "EOF"
# Début de /etc/hosts (version avec carte réseau)

127.0.0.1 localhost.localdomain localhost
192.168.1.1 www.mon-domaine.org <nom d'hôte>

# Fin de /etc/hosts (version avec carte réseau)
EOF

Bien évidemment, les valeurs 192.168.1.1 et www.mon-domaine.org doivent être changées selon vos souhaits (ou selon les valeurs données par l'administrateur système/réseau si cette machine doit être connectée à un réseau existant).


Créer un script ethnet

Cette section ne concerne que l'utilisateur voulant configurer une carte réseau. Si ce n'est pas le cas, cette section peut être passée.

Créez le script /etc/init.d/ethnet en exécutant la commande suivante:

cat > /etc/init.d/ethnet << "EOF"
#!/bin/sh
# Début de /etc/init.d/ethnet
#
# Script original de Gerard Beekmans - gerard@linuxfromscratch.org
# GATEWAY adapté par Jean-François Le Ray - jfleray@club-internet.fr
# "Specify which IF to use to reach default GATEWAY" de 
#     Graham Cantin - gcantin@pacbell.net
#

#
# Inclut les fonctions declarées dans le fichier /etc/init.d/functions 
# et les variables du fichier /etc/sysconfig/network.
#

source /etc/init.d/functions
source /etc/sysconfig/network

case "$1" in
        start)

#
# Recherche tous les fichiers de configuration de cartes réseau
#

        for interface in $(/bin/ls /etc/sysconfig/nic-config/ifcfg* | \
            grep -v ifcfg-lo)
        do
#
# Charge les variables contenues dans ce fichier
#

            source $interface
#
# Si la variable ONBOOT est positionnée à yes, exécute ce fichier et active l'
# interface.
#

            if [ "$ONBOOT" == yes ]
            then
                echo -n "Bringing up the $DEVICE interface..."
                /sbin/ifconfig $DEVICE $IP broadcast $BROADCAST \
                    netmask $NETMASK
                evaluate_retval
            fi
        done

#
# Si le fichier /etc/sysconfig/network contient une variable GATEWAY, initialise
# la passerelle par défaut et l'interface par laquelle la passerelle peut être atteinte.
#

            if [ "$GATEWAY" != "" ]; then
                echo -n "Setting up routing for $GATEWAY_IF interface..."
                /sbin/route add default gateway $GATEWAY \
                        metric 1 dev $GATEWAY_IF
                evaluate_retval
            fi
                ;;

        stop)

#
# Recherche tous les fichiers de configuration de cartes réseau
#

        for interface in $(/bin/ls /etc/sysconfig/nic-config/ifcfg* | \
            grep -v ifcfg-lo)
        do
#
# Charge les variables contenues dans ce fichier
#

            source $interface
#
# Si la variable ONBOOT est positionnée à yes, exécute le fichier et désactive l'
# interface.
#

            if [ $ONBOOT == yes ]
            then
                echo -n "Bringing down the $DEVICE interface..."
                /sbin/ifconfig $DEVICE down
                evaluate_retval
            fi
        done
                ;;

        restart)
                $0 stop
                sleep 1
                $0 start
                ;;
        *)
                echo "Usage: $0 {start|stop|restart}"
                exit 1
                ;;
esac

# Fin de /etc/init.d/ethnet
EOF


Ajouter une passerelle par défaut dans /etc/sysconfig/network

Pour déclarer une passerelle par défaut, la commande suivante peut être utilisée:

cat >> /etc/sysconfig/network << "EOF"
GATEWAY=192.168.1.2
GATEWAY_IF=eth0
EOF

GATEWAY et GATEWAY_IF doivent être initialisées selon votre configuration réseau. GATEWAY contient l'adresse de la passerelle par défaut, et GATEWAY_IF l'interface réseau qui permet d'accéder à cette passerelle.


Créer les fichiers de configuration NIC

L'activation et la désactivation des interfaces par le script ethnet dépend des fichiers situés dans le répertoire /etc/sysconfig/nic-config. Ce répertoire devrait contenir des fichiers de la forme ifcfg-x où x est un numéro d'identification (ou tout ce que l'on veut).

Tout d'abord, le répertoire nic-config est créé par:

mkdir /etc/sysconfig/nic-config

Ensuite, les nouveaux fichiers sont créés dans ce répertoire. La commande qui suit crée un fichier d'exemple nommé ifcfg-eth0:

cat > /etc/sysconfig/nic-config/ifcfg-eth0 << "EOF"
ONBOOT=yes
DEVICE=eth0
IP=192.168.1.1
NETMASK=255.255.255.0
BROADCAST=192.168.1.255
EOF

Bien évidemment, les valeurs de ces quatre variables doivent être changées en fonction de votre propre configuration. Habituellement, NETMASK et BROADCAST seront identiques, et seules les variables DEVICE et IP changeront pour les différentes interfaces réseau. Si la variable ONBOOT est positionnée à yes, le script ethnet l'activera lors du démarrage du système. Si elle contient autre chose que yes, le script ethnet l'ignorera et l'interface ne sera pas activée.


Mise en place des liens symboliques et des droits

Ces fichiers auront les bons droits et les liens symboliques nécessaires en lançant les commandes suivantes. Si vous n'avez pas créé les scripts loadkeys et/ou setclock, assurez-vous de ne pas les taper dans la commande ci-dessous.

Une précision importante: tous les liens symboliques (qui commencent par un S ou un K) doivent être de la forme Sxxxnom où xxx sont les trois chiffres précisant l'ordre dans lequel le script est exécuté ( Plus le nombre est petit, le plus tôt il est exécuté). Si vous vous sentez le besoin d'utiliser moins de trois chiffres, assurez-vous de compléter par des zéros au début. Cela veut dire que vous ne devez pas utiliser S20mondemon, mais S020mondemon. Et n'utilisez pas K2autredemon, mais plutôt K002autredemon.

cd /etc/init.d &&
chmod 754 rc rcS functions checkfs halt loadkeys mountfs reboot &&
chmod 754 sendsignals setclock sysklogd template &&
chmod 754 localnet ethnet &&
cd ../rc0.d &&
ln -sf ../init.d/ethnet K800ethnet &&
ln -sf ../init.d/sysklogd K900sysklogd &&
ln -sf ../init.d/sendsignals S800sendsignals &&
ln -sf ../init.d/mountfs S900mountfs &&
ln -sf ../init.d/halt S999halt &&
cd ../rc6.d &&
ln -sf ../init.d/ethnet K800ethnet &&
ln -sf ../init.d/sysklogd K900sysklogd &&
ln -sf ../init.d/sendsignals S800sendsignals &&
ln -sf ../init.d/mountfs S900mountfs &&
ln -sf ../init.d/reboot S999reboot &&
cd ../rcS.d &&
ln -sf ../init.d/localnet S100localnet &&
ln -sf ../init.d/checkfs S200checkfs &&
ln -sf ../init.d/mountfs S300mountfs &&
ln -sf ../init.d/setclock S400setclock &&
ln -sf ../init.d/loadkeys S500loadkeys &&
cd ../rc1.d &&
ln -sf ../init.d/ethnet K800ethnet &&
ln -sf ../init.d/sysklogd K900sysklogd &&
cd ../rc2.d &&
ln -sf ../init.d/sysklogd S100sysklogd &&
ln -sf ../init.d/ethnet K800ethnet &&
cd ../rc3.d &&
ln -sf ../init.d/sysklogd S100sysklogd &&
ln -sf ../init.d/ethnet S200ethnet &&
cd ../rc4.d &&
ln -sf ../init.d/sysklogd S100sysklogd &&
ln -sf ../init.d/ethnet S200ethnet &&
cd ../rc5.d &&
ln -sf ../init.d/sysklogd S100sysklogd &&
ln -sf ../init.d/ethnet S200ethnet


Chapitre 8. Rendre le système LFS démarrable


Introduction

Ce chapitre permettra de rendre LFS démarrable. Ce chapitre traite de la création d'un nouveau fichier fstab, construire un nouveau noyau pour le nouveau système LFS et ajouter les entrées propres à LILO afin que le système LFS puisse être sélectionné lors du démarrage de LILO.


Creation du fichier /etc/fstab

On utilise le fichier /etc/fstab afin que certains programmes puissent déterminer où certaines partitions sont supposées être montées par défaut. Créez un nouveau fichier /etc/fstab contenant ce qui suit:

cat > /etc/fstab << "EOF"
# Commencement /etc/fstab

# emplacement du système de fichier	point de montage	fs-type		options

/dev/*périphérique partition-LFS*	/			*fs-type*	defaults 1 1
/dev/*périphérique partition-swap*  	swap 			swap		defaults 0 0
proc 					/proc 			proc 		defaults 0 0

# Fin /etc/fstab
EOF

*périphérique partition-LFS*, *périphérique partition-swap* et *fs-type* doit être remplacé par les valeurs adéquates (/dev/hda2, /dev/hda5 et reiserfs par exemple).

Lorsqu'on ajoute un partition reiserfs, le 1 1 à la fin de la ligne doit être remplacé par 0 0.

Pour plus d'informations sur les différents champs présents dans le fichier fstab, voir man 5 fstab.

Il y a d'autres lignes que vous pourriez ajouter à votre fichier fstab. Un exemple est la ligne que vous devriez avoir si vous utilisez devpts:

devpts		/dev/pts	devpts   gid=4,mode=620  0 0

Un autre exemple est la ligne à utiliser pour employer des périphériques USB:

usbdevfs		/proc/bus/usb	usbdevfs defaults        0 0

Ces deux options ne fonctionneront que si vous avez compilé le support adéquat dans votre noyau.


Installation du noyau

Temps de création estimé:           Depends on options selected
Espace disque requis estimé:  Depends on options selected

Construire un noyau implique quelques étapes: le configurer et le compiler. Il y a plusieurs façons de configurer un noyau. Si la manière décrite dans ce livre ne vous convient pas, lisez le fichier README qui est inclus dans l'arborescence des sources du noyau, et cherchez à quoi servent les autres options.

Une chose que vous pourriez faire, est de prendre le fichier .config des sources du noyau de votre distribution hôte et le copier dans $LFS/usr/src/linux. De cette façon vous n'avez pas à configurer l'entièreté du noyau depuis le début et pouvez utiliser vos valeurs actuelles. Si vous choisissez de le faire, commencez par faire la commande make mrproper, ensuite copiez le fichier .config par dessus, ensuite faites make menuconfig (make oldconfig peut être préférable dans certaines situations. Voir le fichier README pour plus de détails sur l'utilisation du make oldconfig).

Les commandes suivantes sont utilisées pour construire le noyau:

cd /usr/src/linux &&
make mrproper &&
make menuconfig &&
make dep &&
make bzImage &&
make modules &&
make modules_install &&
cp arch/i386/boot/bzImage /boot/lfskernel &&
cp System.map /boot

Note: le chemin arch/i386/boot/bzImage peut varier suivant la plateforme.


Dependencies

Linux-2.4.8 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package
objcopy from the binutils package

chown from the fileutils package
cp from the fileutils package
ln from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

find from the findutils package
xargs from the findutils package

gcc from the gcc package

grep from the grep package

make from the make package

awk from the mawk package

depmod from the modutils package
genksyms from the modutils package

hostname from the net-tools package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package
expr from the sh-utils package
pwd from the sh-utils package
uname from the sh-utils package
whoami from the sh-utils package
yes from the sh-utils package

cat from the textutils package
md5sum from the textutils package
sort from the textutils package
tail from the textutils package
touch from the textutils package
tr from the textutils package


Mettre son système LFS démarrable

Afin de pouvoir démarrer son système LFS, nous avons besoin de mettre à jour notre chargeur de démarrage. Nous avons supposé que votre système hôte utilise LILO (car c'est le chargeur le plus commun pour le moment).

Nous n'allans pas lancer le programme LILO à l'intérieur du chroot. Lancer lilo à l'intérieur du chroot peut avoir comme conséquence de rendre votre MBR inutile et vous auriez besoin d'une disquette de démarrage pour être capable de lancer tout système Linux (le système hôte ainsi que le système LFS).

Premièrement nous sortirons du chroot et copirons le fichier lfskernel sur le système hôte:

logout
cp $LFS/boot/lfskernel /boot

L'étape suivante est d'ajouter l'entrée dans /etc/lilo.conf ce qui nous permettra de choisir LFS lorsque nous démarrerons l'ordinateur:

cat >> /etc/lilo.conf << "EOF"
image=/boot/lfskernel
        label=lfs
        root=<partition>
        read-only
EOF

<partition> doit être remplacé par l'emplacement de la partition.

Notez également que si vous utilisez reiserfs comme partition racine, la ligne read-only devra être changée en read-write.

Maintenant, mettez à jour le chargeur en lancant:

/sbin/lilo

La dernière étape est la synchronisation des fichiers de configuration du système hôte avec ceux du système LFS:

cp /etc/lilo.conf $LFS/etc &&
cp <kernel images> $LFS/boot

Pour savoir laquelle des images du noyau est utilisée, regardez dans le fichier /etc/lilo.conf les lignes commencant par image=. Si votre système hôte à ses fichiers noyau ailleurs que dans le répertoire /boot, soyez certain de mettre à jour les chemins dans le fichier $LFS/etc/lilo.conf afin qu'il puisse les trouver dans le répertoire /boot.


Chapitre 9. The End


La fin

Bien joué! Vous avez terminé d'installer votre système LFS. Cela vous a peut-être pris du temps, mais c'est un bonne chose que de l'avoir fait. Nous vous souhaitons de bien vous amuser avec votre nouveau système Linux rutilant.

Maintenant c'est le bon moment pour nettoyer les binaires de tous les symboles de débogage sur votre système LFS. Si vous n'êtes pas une programmeur et ne prévoyez pas de déboguer vos logiciels, alors vous serez certainement content de savoir que l'on peut gagner quelques dizaines de megas en enlevant les symboles de débogage. Ce processus n'a pas d'autre inconvénient que de vous empêcher de deboguer votre logiciel à l'avenir, ce qui n'a pas d'importance si vous ne saviez pas comment faire.

Précision: 98% des personnes qui utilisent la commande ci-dessous n'ont jamais eu de problème. Mais faites une sauvegarde de votre système LFS avant de lancer cette commande. Il y a une chance infime que cela se retourne contre vous et rende votre système instable (essentiellement en détruisant les modules du noyau et les librairies dynamiques partagées). Cela est plus souvent dû à des erreurs de frappes qu'à des problèmes avec les commandes utilisées.

Cela étant dit, l'optiont --strip-debug que nous utilisons est plutôt sans dommage dans des circonstances normales. Cela ne débarasse pas les fichiers de quoique ce soit de vital. Il n'est sûr d'utiliser --strip-all que sur des programmes classiques (ne pas utiliser sur des librairies - elles seraient détruites) mais pas aussi sûr et l'espace gagné n'est pas plus grand. Mais si vous êtes limité en espace disque, quelques octets de plus peuvent aider, alors décidez vous-même. Référez vous, s'il vous plait à la page de man pour d'autres options de strip que vous pourriez utiliser. L'idée générale est de ne pas lancer strip sur des librairies (autre que --strip-debug) pour rester su côté sûr.

find $LFS/{,usr,usr/local}/{bin,sbin,lib} -type f \
   -exec /usr/bin/strip --strip-debug '{}' ';'

Cela peut être une bonne idée de créer le fichier $LFS/etc/lfs-3.1. Avec ce fichier, il devient très facile pour vous (et pour nous si vous venez à nous demander de l'aide sur quelque chose quelque part) de trouver quelle version de LFS vous avez d'installée sur votre système. Cela peut être un fichier vide en lançant:

touch $LFS/etc/lfs-3.1


Get Counted

Vous voulez être enregistré comme utilisateur de LFS maintenant que vous avez terminé le livre? Allez directement à http://linuxfromscratch.org/cgi-bin/lfscounter.cgi et enregistrez vous comme utilisateur LFS en entrant votre nom et la première version de LFS que vous ayiez utilisée.

Redémarrons donc maintenant dans LFS...


Redémarrer le système

Maintenant que tous les logiciels ont été installés, les scripts de démarrage créés, il est temps de redémarrer l'ordinateur. Avant de redémarrer, démontons $LFS/proc et la partition LFS elle-même en exécutant:

umount $LFS/proc &&
umount $LFS

Et vous pouvez redémarrer votre système en lançant quelque chose comme:

/sbin/shutdown -r now

Au prompt LILO: assurez-vous que vous lui dites de démarrer lfs et pas l'option par défaut qui redémarrera votre système hôte.

Après avoir redémarré, votre système LFS est prêt à l'emploi et vous pouvez commencer à ajouter vos propres logiciels.

Une dernière chose que vous voudriez peu-etre faire est de lancer lilo, maintenant que vous avez démarré avec LFS. Ainsi vous placerez la version LFS de LILO dans le MBR plutôt que celle qu'il y a sur votre sysème hôte. En fonction de l'âge de la distribution de votre hôte, la version LFS peut disposer de fonctionnalités plus avancées que vous pourriez/devriez utiliser.

Dans tous les cas, lancer ce qui suit pour activer la version LFS de lilo:

/sbin/lilo

Si vous vous demandez: "Bien, où aller maintenant?" vous serez heureux d'apprendre que quelqu'un à écrit un topo LFS sur le sujet à http://hints.linuxfromscratch.org/hints/afterlfs.txt. Sur la même note, si vous n'êtes pas seulement débutant avec LFS, mais aussi débutant Linux en général, vous pouvez trouver un topo très intéressant pour débutant à: http://hints.linuxfromscratch.org/hints/newbie.txt

N'oubliez pas qu'il y a plusieurs listes de diffusions LFS auxquelles vous pouvez vous inscrire en cas de besoin d'aide, conseils, etc. Pour plus d'informations, se référer à Chapter 1 - Mailing lists and archives

Nous vous remercions encore d'avoir utilisé le livre LFS et espérons que vous l'avez trouvé utile et qu'il vous a fait gagner du temps.

III. Troisième Partie - Annexes


Annexe A. Package descriptions


Introduction

This appendix describes the following aspects of every package that is installed in this book:

  • What the package contains.

  • What each program from a package does.

The packages are listed in the same order as they are installed in chapter 5 and chapter 6.

Most information about these packages (especially the descriptions of them) come from the man pages from those packages. We are not going to print the entire man page, just the core elements to make it possible to understand what a program does. To get knowledge of all details on a program, we suggest you start by reading the complete man page in addition to this appendix.

Certain packages are documented in more depth than others, because we just happen to know more about certain packages than I know about others. If anything should be added to the following descriptions, please don't hesitate to email the mailing lists. We intend that the list should contain an in-depth description of every package installed, but we can't do it without help.

Please note that currently only what a package does is described and not why it needs to be installed. This may be added later.


Bash


Contents

The Bash package contains the bash program


Description

Bash is the Bourne-Again SHell, which is a widely used command interpreter on Unix systems. Bash is a program that reads from standard input, the keyboard. A user types something and the program will evaluate what he has typed and do something with it, like running a program.


Binutils


Contents

The Binutils package contains the addr2line, as, ar, c++filt, gasp, gprof, ld, nm, objcopy, objdump, ranlib, readelf, size, strings and strip programs


Description

addr2line

addr2line translates program addresses into file names and line numbers. Given an address and an executable, it uses the debugging information in the executable to figure out which file name and line number are associated with a given address.


as

as is primarily intended to assemble the output of the GNU C compiler gcc for use by the linker ld.


ar

The ar program creates, modifies, and extracts from archives. An archive is a single file holding a collection of other files in a structure that makes it possible to retrieve the original individual files (called members of the archive).


c++filt

The C++ language provides function overloading, which means that it is possible to write many functions with the same name (providing each takes parameters of different types). All C++ function names are encoded into a low-level assembly label (this process is known as mangling). The c++filt program does the inverse mapping: it decodes (demangles) low-level names into user-level names so that the linker can keep these overloaded functions from clashing.


gasp

Gasp is the Assembler Macro Preprocessor.


gprof

gprof displays call graph profile data.


ld

ld combines a number of object and archive files, relocates their data and ties up symbol references. Often the last step in building a new compiled program to run is a call to ld.


nm

nm lists the symbols from object files.


objcopy

objcopy utility copies the contents of an object file to another. objcopy uses the GNU BFD Library to read and write the object files. It can write the destination object file in a format different from that of the source object file.


objdump

objdump displays information about one or more object files. The options control what particular information to display. This information is mostly useful to programmers who are working on the compilation tools, as opposed to programmers who just want their program to compile and work.


ranlib

ranlib generates an index to the contents of an archive, and stores it in the archive. The index lists each symbol defined by a member of an archive that is a relocatable object file.


readelf

readelf displays information about elf type binaries.


size

size lists the section sizes --and the total size-- for each of the object files objfile in its argument list. By default, one line of output is generated for each object file or each module in an archive.


strings

For each file given, strings prints the printable character sequences that are at least 4 characters long (or the number specified with an option to the program) and are followed by an unprintable character. By default, it only prints the strings from the initialized and loaded sections of object files; for other types of files, it prints the strings from the whole file.

strings is mainly useful for determining the contents of non-text files.


strip

strip discards all or specific symbols from object files. The list of object files may include archives. At least one object file must be given. strip modifies the files named in its argument, rather than writing modified copies under different names.


Bzip2


Contents

The Bzip2 packages contains the bunzip2, bzcat, bzip2 and bzip2recover programs.


Description

bunzip2

Bunzip2 decompresses files that are compressed with bzip2.


bzcat

bzcat (or bzip2 -dc) decompresses all specified files to the standard output.


bzip2

bzip2 compresses files using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. Compression is generally considerably better than that achieved by more conventional LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors.


bzip2recover

bzip2recover recovers data from damaged bzip2 files.


Diffutils


Contents

The Diffutils package contains the cmp, diff, diff3 and sdiff programs.


Description

cmp and diff

cmp and diff both compare two files and report their differences. Both programs have extra options which compare files in different situations.


diff3

The difference between diff and diff3 is that diff compares 2 files, diff3 compares 3 files.


sdiff

sdiff merges two files and interactively outputs the results.


Fileutils


Contents

The Fileutils package contains the chgrp, chmod, chown, cp, dd, df, dir, dircolors, du, install, ln, ls, mkdir, mkfifo, mknod, mv, rm, rmdir, shred, sync, touch and vdir programs.


Description

chgrp

chgrp changes the group ownership of each given file to the named group, which can be either a group name or a numeric group ID.


chmod

chmod changes the permissions of each given file according to mode, which can be either a symbolic representation of changes to make, or an octal number representing the bit pattern for the new permissions.


chown

chown changes the user and/or group ownership of each given file.


cp

cp copies files from one place to another.


dd

dd copies a file (from the standard input to the standard output, by default) with a user-selectable blocksize, while optionally performing conversions on it.


df

df displays the amount of disk space available on the filesystem containing each file name argument. If no file name is given, the space available on all currently mounted filesystems is shown.


dir, ls and vdir

dir and vdir are versions of ls with different default output formats. These programs list each given file or directory name. Directory contents are sorted alphabetically. For ls, files are by default listed in columns, sorted vertically, if the standard output is a terminal; otherwise they are listed one per line. For dir, files are by default listed in columns, sorted vertically. For vdir, files are by default listed in long format.


dircolors

dircolors outputs commands to set the LS_COLOR environment variable. The LS_COLOR variable is use to change the default color scheme used by ls and related utilities.


du

du displays the amount of disk space used by each argument and for each subdirectory of directory arguments.


install

install copies files and sets their permission modes and, if possible, their owner and group.


ln

ln makes hard or soft (symbolic) links between files.


mkdir

mkdir creates directories with a given name.


mkfifo

mkfifo creates a FIFO with each given name.


mknod

mknod creates a FIFO, character special file, or block special file with the given file name.


mv

mv moves files from one directory to another or renames files, depending on the arguments given to mv.


rm

rm removes files or directories.


rmdir

rmdir removes directories, if they are empty.


shred

shred deletes a file securely, overwriting it first so that its contents can't be recovered.


sync

sync forces changed blocks to disk and updates the super block.


touch

touch changes the access and modification times of each given file to the current time. Files that do not exist are created empty.


GCC


Contents

The GCC package contains compilers, preprocessors and the GNU C++ Library.


Description

Compiler

A compiler translates source code in text format to a format that a computer understands. After a source code file is compiled into an object file, a linker will create an executable file from one or more of these compiler generated object files.


Preprocessor

A preprocessor pre-processes a source file, such as including the contents of header files into the source file. It's a good idea to not do this manually to save a lot of time. Someone just inserts a line like #include <filename>. The preprocessor inserts the contents of that file into the source file. That's one of the things a preprocessor does.


C++ Library

The C++ library is used by C++ programs. The C++ library contains functions that are frequently used in C++ programs. This way the programmer doesn't have to write certain functions (such as writing a string of text to the screen) from scratch every time he creates a program.


Grep


Contents

The grep package contains the egrep, fgrep and grep programs.


Description

egrep

egrep prints lines from files matching an extended regular expression pattern.


fgrep

fgrep prints lines from files matching a list of fixed strings, separated by newlines, any of which is to be matched.


grep

grep prints lines from files matching a basic regular expression pattern.


Gzip


Contents

The Gzip package contains the compress, gunzip, gzexe, gzip, uncompress, zcat, zcmp, zdiff, zforce, zgrep, zmore and znew programs.


Description

gunzip, uncompress

gunzip and uncompress decompress files which are compressed with gzip.


gzexe

gzexe allows you to compress executables in place and have them automatically uncompress and execute when they are run (at a penalty in performance).


gzip

gzip reduces the size of the named files using Lempel-Ziv coding (LZ77).


zcat

zcat uncompresses either a list of files on the command line or its standard input and writes the uncompressed data on standard output


zcmp

zcmp invokes the cmp program on compressed files.


zdiff

zdiff invokes the diff program on compressed files.


zforce

zforce forces a .gz extension on all gzip files so that gzip will not compress them twice. This can be useful for files with names truncated after a file transfer.


zgrep

zgrep invokes the grep program on compressed files.


zmore

zmore is a filter which allows examination of compressed or plain text files one screen at a time on a soft-copy terminal (similar to the more program).


znew

znew re-compresses files from .Z (compress) format to .gz (gzip) format.


Linux kernel


Contents

The Linux kernel package contains the Linux kernel.


Description

The Linux kernel is at the core of every Linux system. It's what makes Linux tick. When a computer is turned on and boots a Linux system, the very first piece of Linux software that gets loaded is the kernel. The kernel initializes the system's hardware components such as serial ports, parallel ports, sound cards, network cards, IDE controllers, SCSI controllers and a lot more. In a nutshell the kernel makes the hardware available so that the software can run.


Make


Contents

The Make package contains the make program.


Description

make determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them.


Mawk


Contents

The Mawk package contains the mawk program.


Description

mawk

Mawk is an interpreter for the AWK Programming Language. The AWK language is useful for manipulation of data files, text retrieval and processing, and for prototyping and experimenting with algorithms.


Patch


Contents

The Patch package contains the patch program.


Description

The patch program modifies a file according to a patch file. A patch file usually is a list created by the diff program that contains instructions on how an original file needs to be modified. Patch is used a lot for source code patches since it saves time and space. Imagine a package that is 1MB in size. The next version of that package only has changes in two files of the first version. It can be shipped as an entirely new package of 1MB or just as a patch file of 1KB which will update the first version to make it identical to the second version. So if the first version was downloaded already, a patch file avoids a second large download.


Sed


Contents

The Sed package contains the sed program.


Description

sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline).


Sh-utils


Contents

The Sh-utils package contains the basename, chroot, date, dirname, echo, env, expr, factor, false, groups, hostid, hostname, id, logname, nice, nohup, pathchk, pinky, printenv, printf, pwd, seq, sleep, stty, su, tee, test, true, tty, uname, uptime, users, who, whoami and yes programs.


Description

basename

basename strips directory and suffixes from filenames.


chroot

chroot runs a command or interactive shell with special root directory.


date

date displays the current time in a specified format, or sets the system date.


dirname

dirname strips non-directory suffixes from file name.


echo

echo displays a line of text.


env

env runs a program in a modified environment.


expr

expr evaluates expressions.


factor

factor prints the prime factors of all specified integer numbers.


false

false always exits with a status code indicating failure.


groups

groups prints the groups a user is in.


hostid

hostid prints the numeric identifier (in hexadecimal) for the current host.


hostname

hostname sets or prints the name of the current host system


id

id prints the real and effective UIDs and GIDs of a user or the current user.


logname

logname prints the current user's login name.


nice

nice runs a program with modified scheduling priority.


nohup

nohup runs a command immune to hangups, with output to a non-tty


pathchk

pathchk checks whether file names are valid or portable.


pinky

pinky is a lightweight finger utility which retrieves information about a certain user


printenv

printenv prints all or part of the environment.


printf

printf formats and prints data (the same as the printf C function).


pwd

pwd prints the name of the current/working directory


seq

seq prints numbers in a certain range with a certain increment.


sleep

sleep delays for a specified amount of time.


stty

stty changes and prints terminal line settings.


su

su runs a shell with substitute user and group IDs


tee

tee reads from standard input and writes to standard output and files.


test

test checks file types and compares values.


true

True always exits with a status code indicating success.


tty

tty prints the file name of the terminal connected to standard input.


uname

uname prints system information.


uptime

uptime tells how long the system has been running.


users

users prints the user names of users currently logged in to the current host.


who

who shows who is logged on.


whoami

whoami prints the user's effective userid.


yes

yes outputs a string repeatedly until killed.


Tar


Contents

The tar package contains the rmt and tar programs.


Description

rmt

rmt is a program used by the remote dump and restore programs in manipulating a magnetic tape drive through an interprocess communication connection.


tar

tar is an archiving program designed to store and extract files from an archive file known as a tar file.


Texinfo


Contents

The Texinfo package contains the info, install-info, makeinfo, texi2dvi and texindex programs


Description

info

The info program reads Info documents, usually contained in the /usr/doc/info directory. Info documents are like man(ual) pages, but they tend to be more in depth than just explaining the options to a program.


install-info

The install-info program updates the info entries. When the info program is run a list with available topics (ie: available info documents) will be presented. The install-info program is used to maintain this list of available topics. If info files are removed manually, it is also necessary to delete the topic in the index file as well. This program is used for that. It also works the other way around when info documents are added.


makeinfo

The makeinfo program translates Texinfo source documents into various formats. Available formats are: info files, plain text and HTML.


texi2dvi

The texi2dvi program prints Texinfo documents


texindex

The texindex program is used to sort Texinfo index files.


Textutils


Contents

The Textutils package contains the cat, cksum, comm, csplit, cut, expand, fmt, fold, head, join, md5sum, nl, od, paste, pr, ptx, sort, split, sum, tac, tail, tr, tsort, unexpand, uniq and wc programs.


Description

cat

cat concatenates file(s) or standard input to standard output.


cksum

cksum prints CRC checksum and byte counts of each specified file.


comm

comm compares two sorted files line by line.


csplit

csplit outputs pieces of a file separated by (a) pattern(s) to files xx01, xx02, ..., and outputs byte counts of each piece to standard output.


cut

cut prints selected parts of lines from specified files to standard output.


expand

expand converts tabs in files to spaces, writing to standard output.


fmt

fmt reformats each paragraph in the specified file(s), writing to standard output.


fold

fold wraps input lines in each specified file (standard input by default), writing to standard output.


head

Print first xx (10 by default) lines of each specified file to standard output.


join

join joins lines of two files on a common field.


md5sum

md5sum prints or checks MD5 checksums.


nl

nl writes each specified file to standard output, with line numbers added.


od

od writes an unambiguous representation, octal bytes by default, of a specified file to standard output.


paste

paste writes lines consisting of the sequentially corresponding lines from each specified file, separated by TABs, to standard output.


pr

pr paginates or columnates files for printing.


ptx

ptx produces a permuted index of file contents.


sort

sort writes sorted concatenation of files to standard output.


split

split outputs fixed-size pieces of an input file to PREFIXaa, PREFIXab, ...


sum

sum prints checksum and block counts for each specified file.


tac

tac writes each specified file to standard output, last line first.


tail

tail print the last xx (10 by default) lines of each specified file to standard output.


tr

tr translates, squeezes, and/or deletes characters from standard input, writing to standard output.


tsort

tsort writes totally ordered lists consistent with the partial ordering in specified files.


unexpand

unexpand converts spaces in each file to tabs, writing to standard output.


uniq

Uniq removes duplicate lines from a sorted file.


wc

wc prints line, word, and byte counts for each specified file, and a total line if more than one file is specified.


Glibc


Contents

The Glibc package contains the GNU C Library.


Description

The C Library is a collection of commonly used functions in programs. This way a programmer doesn't need to create his own functions for every single task. The most common things like writing a string to the screen are already present and at the disposal of the programmer.

The C library (actually almost every library) come in two flavors: dynamic ones and static ones. In short when a program uses a static C library, the code from the C library will be copied into the executable file. When a program uses a dynamic library, that executable will not contain the code from the C library, but instead a routine that loads the functions from the library at the time the program is run. This means a significant decrease in the file size of a program. The documentation that comes with the C Library describes this in more detail, as it is too complicated to explain here in one or two lines.


MAKEDEV


Contents

The MAKEDEV package contains the MAKEDEV script.


Description

MAKEDEV is a script that can help in creating the necessary static device files that usually reside in the /dev directory.


Man-pages


Contents

The Man-pages package contains various manual pages that don't come with the packages.


Description

Examples of provided manual pages are the manual pages describing all the C and C++ functions, few important /dev/ files and more.


Findutils


Contents

The Findutils package contains the bigram, code, find, frcode, locate, updatedb and xargs programs.


Description

bigram

bigram is used together with code to produce older-style locate databases. To learn more about these last three programs, read the locatedb.5 manual page.


code

code is the ancestor of frcode. It was used in older-style locate databases.


find

The find program searches for files in a directory hierarchy which match a certain criteria. If no criteria is given, it lists all files in the current directory and its subdirectories.


frcode

updatedb runs a program called frcode to compress the list of file names using front-compression, which reduces the database size by a factor of 4 to 5.


locate

Locate scans a database which contain all files and directories on a filesystem. This program lists the files and directories in this database matching a certain criteria. If a user is looking for a file this program will scan the database and tell him exactly where the files he requested are located. This only makes sense if the locate database is fairly up-to-date else it will provide out-of-date information.


updatedb

The updatedb program updates the locate database. It scans the entire file system (including other file system that are currently mounted unless it is told not to do so) and puts every directory and file it finds into the database that's used by the locate program which retrieves this information. It's good practice to update this database once a day to have it up-to-date whenever it is needed.


xargs

The xargs command applies a command to a list of files. If there is a need to perform the same command on multiple files, a file can be created that contains all these files (one per line) and use xargs to perform that command on the list.


Ncurses


Contents

The Ncurses package contains the ncurses, panel, menu and form libraries. It also contains the clear, infocmp, tic, toe, tput and tset programs.


Description

The libraries

The libraries that make up the Ncurses library are used to display text (often in a fancy way) on the screen. An example where ncurses is used is in the kernel's << make menuconfig>>  process. The libraries contain routines to create panels, menu's, form and general text display routines.


clear

The clear program clears the screen if this is possible. It looks in the environment for the terminal type and then in the terminfo database to figure out how to clear the screen.


infocmp

The infocmp program can be used to compare a binary terminfo entry with other terminfo entries, rewrite a terminfo description to take advantage of the use= terminfo field, or print out a terminfo description from the binary file (term) in a variety of formats (the opposite of what tic does).


tic

Tic is the terminfo entry-description compiler. The program translates a terminfo file from source format into the binary format for use with the ncurses library routines. Terminfo files contain information about the capabilities of a terminal.


toe

The toe program lists all available terminal types by primary name with descriptions.


tput

The tput program uses the terminfo database to make the values of terminal-dependent capabilities and information available to the shell, to initialize or reset the terminal, or return the long name of the requested terminal type.


tset

The Tset program initializes terminals so they can be used, but it's not widely used anymore. It's provided for 4.4BSD compatibility.


Vim


Contents

The Vim package contains the ex, gview, gvim, rgview, rgvim, rview, rvim, view, vim, vimtutor and xxd programs.


Description

ex

ex starts vim in Ex mode.


gview

gview is the GUI version of view.


gvim

gvim is the GUI version of vim.


rgview

rgview is the GUI version of rview.


rgvim

rgvim is the GUI version of rvim.


rview

rview is a restricted version of view. No shell commands can be started and Vim can't be suspended.


rvim

rvim is the restricted version of vim. No shell commands can be started and Vim can't be suspended.


view

view starts vim in read-only mode.


vim

vim starts vim in the normal, default way.


vimtutor

vimtutor starts the Vim tutor.


xxd

xxd makes a hexdump or does the reverse.


Bison


Contents

The Bison package contains the bison program.


Description

Bison is a parser generator, a replacement for YACC. YACC stands for Yet Another Compiler Compiler. What is Bison then? It is a program that generates a program that analyzes the structure of a text file. Instead of writing the actual program a user specifies how things should be connected and with those rules a program is constructed that analyzes the text file.

There are a lot of examples where structure is needed and one of them is the calculator.

Given the string :

        1 + 2 * 3

A human can easily come to the result 7. Why? Because of the structure. Our brain knows how to interpret the string. The computer doesn't know that and Bison is a tool to help it understand by presenting the string in the following way to the compiler:

            +
           / \
          *   1
         / \
        2   3

Starting at the bottom of a tree and coming across the numbers 2 and 3 which are joined by the multiplication symbol, the computer multiplies 2 and 3. The result of that multiplication is remembered and the next thing that the computer sees is the result of 2*3 and the number 1 which are joined by the add symbol. Adding 1 to the previous result makes 7. In calculating the most complex calculations can be broken down in this tree format and the computer just starts at the bottom and works its way up to the top and comes with the correct answer. Of course, Bison isn't only used for calculators alone.


Less


Contents

The Less package contains the less program


Description

The less program is a file pager (or text viewer). It displays the contents of a file with the ability to scroll. Less is an improvement on the common pager called << more>> . Less has the ability to scroll backwards through files as well and it doesn't need to read the entire file when it starts, which makes it faster when reading large files.


Groff


Contents

The Groff packages contains the addftinfo, afmtodit, eqn, grodvi, groff, grog, grohtml, grolj4, grops, grotty, hpftodit, indxbib, lkbib, lookbib, neqn, nroff, pfbtops, pic, psbb, refer, soelim, tbl, tfmtodit and troff programs.


Description

addftinfo

addftinfo reads a troff font file and adds some additional font-metric information that is used by the groff system.


afmtodit

afmtodit creates a font file for use with groff and grops.


eqn

eqn compiles descriptions of equations embedded within troff input files into commands that are understood by troff.


grodvi

grodvi is a driver for groff that produces TeX dvi format.


groff

groff is a front-end to the groff document formatting system. Normally it runs the troff program and a post-processor appropriate for the selected device.


grog

grog reads files and guesses which of the groff options -e, -man, -me, -mm, -ms, -p, -s, and -t are required for printing files, and prints the groff command including those options on the standard output.


grohtml

grohtml translates the output of GNU troff to html


grolj4

grolj4 is a driver for groff that produces output in PCL5 format suitable for an HP Laserjet 4 printer.


grops

grops translates the output of GNU troff to Postscript.


grotty

grotty translates the output of GNU troff into a form suitable for typewriter-like devices.


hpftodit

hpftodit creates a font file for use with groff -Tlj4 from an HP tagged font metric file.


indxbib

indxbib makes an inverted index for the bibliographic databases a specified file for use with refer, lookbib, and lkbib.


lkbib

lkbib searches bibliographic databases for references that contain specified keys and prints any references found on the standard output.


lookbib

lookbib prints a prompt on the standard error (unless the standard input is not a terminal), reads from the standard input a line containing a set of keywords, searches the bibliographic databases in a specified file for references containing those keywords, prints any references found on the standard output, and repeats this process until the end of input.


neqn

The neqn script formats equations for ascii output.


nroff

The nroff script emulates the nroff command using groff.


pfbtops

pfbtops translates a Postscript font in .pfb format to ASCII.


pic

pic compiles descriptions of pictures embedded within troff or TeX input files into commands that are understood by TeX or troff.


psbb

psbb reads a file which should be a Postscript document conforming to the Document Structuring conventions and looks for a %%BoundingBox comment.


refer

refer copies the contents of a file to the standard output, except that lines between .[ and .] are interpreted as citations, and lines between .R1 and .R2 are interpreted as commands about how citations are to be processed.


soelim

soelim reads files and replaces lines of the form .so file by the contents of file.


tbl

tbl compiles descriptions of tables embedded within troff input files into commands that are understood by troff.


tfmtodit

tfmtodit creates a font file for use with groff -Tdvi


troff

troff is highly compatible with Unix troff. Usually it should be invoked using the groff command, which will also run preprocessors and post-processors in the appropriate order and with the appropriate options.


Man


Contents

The Man package contains the apropos, makewhatis, man and whatis programs.


Description

apropos

apropos searches a set of database files containing short descriptions of system commands for keywords and displays the result on the standard output.


makewhatis

makewhatis reads all the manual pages contained in given sections of manpath or the pre-formatted pages contained in the given sections of catpath. For each page, it writes a line in the whatis database; each line consists of the name of the page and a short description, separated by a dash. The description is extracted using the content of the NAME section of the manual page.


man

man formats and displays the on-line manual pages.


whatis

whatis searches a set of database files containing short descriptions of system commands for keywords and displays the result on the standard output. Only complete word matches are displayed.


Perl


Contents

The Perl package contains Perl - Practical Extraction and Report Language


Description

Perl combines the features and capabilities of C, awk, sed and sh into one powerful programming language.


M4


Contents

The M4 package contains the M4 processor


Description

M4 is a macro processor. It copies input to output expanding macros as it goes. Macros are either built-in or user-defined and can take any number of arguments. Besides just doing macro expansion m4 has built-in functions for including named files, running UNIX commands, doing integer arithmetic, manipulating text in various ways, recursion, etc. M4 can be used either as a front-end to a compiler or as a macro processor in its own right.


Autoconf


Contents

The Autoconf package contains the autoconf, autoheader, autoreconf, autoscan, autoupdate and ifnames programs


Description

autoconf

Autoconf is a tool for producing shell scripts that automatically configure software source code packages to adapt to many kinds of UNIX-like systems. The configuration scripts produced by Autoconf are independent of Autoconf when they are run, so their users do not need to have Autoconf.


autoheader

The autoheader program can create a template file of C #define statements for configure to use


autoreconf

If there are a lot of Autoconf-generated configure scripts, the autoreconf program can save some work. It runs autoconf (and autoheader, where appropriate) repeatedly to remake the Autoconf configure scripts and configuration header templates in the directory tree rooted at the current directory.


autoscan

The autoscan program can help to create a configure.in file for a software package. autoscan examines source files in the directory tree rooted at a directory given as a command line argument, or the current directory if none is given. It searches the source files for common portability problems and creates a file configure.scan which is a preliminary configure.in for that package.


autoupdate

The autoupdate program updates a configure.in file that calls Autoconf macros by their old names to use the current macro names.


ifnames

ifnames can help when writing a configure.in for a software package. It prints the identifiers that the package already uses in C preprocessor conditionals. If a package has already been set up to have some portability, this program can help to figure out what its configure needs to check for. It may help fill in some gaps in a configure.in generated by autoscan.


Automake


Contents

The Automake package contains the aclocal and automake programs


Description

aclocal

Automake includes a number of Autoconf macros which can be used in packages; some of them are actually required by Automake in certain situations. These macros must be defined in the aclocal.m4-file; otherwise they will not be seen by autoconf.

The aclocal program will automatically generate aclocal.m4 files based on the contents of configure.in. This provides a convenient way to get Automake-provided macros, without having to search around. Also, the aclocal mechanism is extensible for use by other packages.


automake

To create all the Makefile.in's for a package, run the automake program in the top level directory, with no arguments. automake will automatically find each appropriate Makefile.am (by scanning configure.in) and generate the corresponding Makefile.in.


Flex


Contents

The Flex package contains the flex program


Description

Flex is a tool for generating programs which recognize patterns in text. Pattern recognition is very useful in many applications. A user sets up rules what to look for and flex will make a program that looks for those patterns. The reason people use flex is that it is much easier to sets up rules for what to look for than to write the actual program that finds the text.


File


Contents

The File package contains the file program.


Description

File tests each specified file in an attempt to classify it. There are three sets of tests, performed in this order: filesystem tests, magic number tests, and language tests. The first test that succeeds causes the file type to be printed.


Libtool


Contents

The Libtool package contains the libtool and libtoolize programs. It also contains the ltdl library.


Description

libtool

Libtool provides generalized library-building support services.


libtoolize

libtoolize provides a standard way to add libtool support to a package.


ltdl library

Libtool provides a small library, called `libltdl', that aims at hiding the various difficulties of dlopening libraries from programmers.


Bin86


Contents

The Bin86 contains the as86, as86_encap, ld86, objdump86, nm86 and size86 programs.


Description

as86

as86 is an assembler for the 8086...80386 processors.


as86_encap

as86_encap is a shell script to call as86 and convert the created binary into a C file prog.v to be included in or linked with programs like boot block installers.


ld86

ld86 understands only the object files produced by the as86 assembler, it can link them into either an impure or a separate I&D executable.


objdump86

No description available.


nm86

No description available.


size86

No description available.


Ed


Contents

The Ed package contains the ed program.


Description

Ed is a line-oriented text editor. It is used to create, display, modify and otherwise manipulate text files.


Gettext


Contents

The gettext package contains the gettext, gettextize, msgcmp, msgcomm, msgfmt, msgmerge, msgunfmt and xgettext programs.


Description

gettext

The gettext package is used for internationalization (also known as i18n) and for localization (also known as l10n). Programs can be compiled with Native Language Support (NLS) which enable them to output messages in the users native language rather than in the default English language.


gettextize

No description is currently available for this program.


msgcmp

No description is currently available for this program.


msgcomm

No description is currently available for this program.


msgfmt

No description is currently available for this program.


msgmerge

No description is currently available for this program.


msgunfmt

No description is currently available for this program.


xgettext

No description is currently available for this program.


Kbd


Contents

The Kbd package contains the chvt, deallocvt, dumpkeys, fgconsole, getkeycodes, kbd_mode, kbdrate, loadkeys, loadunimap, mapscrn, psfxtable, resizecons, screendump, setfont, setkeycodes, setleds, setmetamode, setvesablank, showfont, showkey, unicode_start, and unicode_stop programs. There are some other programs that don't get installed by default, as they are very optional. Take a look at the Kbd package contents if you have trouble with your console.


Description

chvt

chvt changes foreground virtual terminal.


deallocvt

deallocvt deallocates unused virtual terminals.


dumpkeys

dumpkeys dumps keyboard translation tables.


fgconsole

fgconsole prints the number of the active virtual terminal.


getkeycodes

getkeycodes prints the kernel scancode-to-keycode mapping table.


kbd_mode

kbd_mode reports or sets the keyboard mode.


kbdrate

kbdrate sets the keyboard repeat and delay rates.


loadkeys

loadkeys loads keyboard translation tables.


loadunimap

loadunimap loads the kernel unicode-to-font mapping table.


mapscrn

mapscrn loads a user defined output character mapping table into the console driver. Note that it is obsolete and that its features are built into setfont.


psfxtable

psfxtable is a tool for handling Unicode character tables for console fonts.


resizecons

resizecons changes the kernel idea of the console size.


screendump

A screen shot utility for the console.


setfont

This lets you change the EGA/VGA fonts in console.


setkeycodes

setkeycodes loads kernel scancode-to-keycode mapping table entries.


setleds

setleds sets the keyboard LEDs. Many people find it useful to have numlock enabled by default, and it is by using this program that you can achieve this.


setmetamode

setmetamode defines the keyboard meta key handling.


setvesablank

This lets you fiddle with the built-in hardware screensaver (not toasters, only a blank screen).


showfont

showfont displays data about a font. The information shown includes font information, font properties, character metrics, and character bitmaps.


showkey

showkey examines the scancodes and keycodes sent by the keyboard.


unicode_start

unicode_start puts the console in Unicode mode.


unicode_stop

unicode_stop reverts keyboard and console from unicode mode.


E2fsprogs


Contents

The e2fsprogs package contains the badblocks, chattr, debugfs, dumpe2fs, e2fsck, e2label, fsck, fsck.ext2, lsattr, mke2fs, mkfs.ext2, mklost+found, tune2fs and uuidgen programs.


Description

badblocks

badblocks is used to search for bad blocks on a device (usually a disk partition).


chattr

chattr changes the file attributes on a Linux second extended file system.


debugfs

The debugfs program is a file system debugger. It can be used to examine and change the state of an ext2 file system.


dumpe2fs

dumpe2fs prints the super block and blocks group information for the filesystem present on a specified device.


e2fsck and fsck.ext2

e2fsck is used to check a Linux second extended file system. fsck.ext2 does the same as e2fsck.


e2label

e2label will display or change the filesystem label on the ext2 filesystem located on the specified device.


fsck

fsck is used to check and optionally repair a Linux file system.


lsattr

lsattr lists the file attributes on a second extended file system.


mke2fs and mkfs.ext2

mke2fs is used to create a Linux second extended file system on a device (usually a disk partition). mkfs.ext2 does the same as mke2fs.


mklost+found

mklost+found is used to create a lost+found directory in the current working directory on a Linux second extended file system. mklost+found pre-allocates disk blocks to the directory to make it usable by e2fsck.


tune2fs

tune2fs adjusts tunable filesystem parameters on a Linux second extended filesystem.


uuidgen

The uuidgen program creates a new universally unique identifier (UUID) using the libuuid library. The new UUID can reasonably be considered unique among all UUIDs created on the local system, and among UUIDs created on other systems in the past and in the future.


Lilo


Contents

The Lilo package contains the lilo program.


Description

lilo installs the Linux boot loader which is used to start a Linux system.


Modutils


Contents

The Modutils package contains the depmod, genksyms, insmod, insmod_ksymoops_clean, kerneld, kernelversion, ksyms, lsmod, modinfo, modprobe and rmmod programs.


Description

depmod

depmod handles dependency descriptions for loadable kernel modules.


genksyms

genksyms reads (on standard input) the output from gcc -E source.c and generates a file containing version information.


insmod

insmod installs a loadable module in the running kernel.


insmod_ksymoops_clean

insmod_ksymoops_clean deletes saved ksyms and modules not accessed in 2 days.


kerneld

kerneld performs kernel action in user space (such as on-demand loading of modules)


kernelversion

kernelversion reports the major version of the running kernel.


ksyms

ksyms displays exported kernel symbols.


lsmod

lsmod shows information about all loaded modules.


modinfo

modinfo examines an object file associated with a kernel module and displays any information that it can glean.


modprobe

Modprobe uses a Makefile-like dependency file, created by depmod, to automatically load the relevant module(s) from the set of modules available in predefined directory trees.


rmmod

rmmod unloads loadable modules from the running kernel.


Procinfo


Contents

The Procinfo package contains the procinfo program.


Description

procinfo gathers some system data from the /proc directory and prints it nicely formatted on the standard output device.


Procps


Contents

The Procps package contains the free, kill, oldps, ps, skill, snice, sysctl, tload, top, uptime, vmstat, w and watch programs.


Description

free

free displays the total amount of free and used physical and swap memory in the system, as well as the shared memory and buffers used by the kernel.


kill

kills sends signals to processes.


oldps and ps

ps gives a snapshot of the current processes.


skill

skill sends signals to process matching a criteria.


snice

snice changes the scheduling priority for process matching a criteria.


sysctl

sysctl modifies kernel parameters at runtime.


tload

tload prints a graph of the current system load average to the specified tty (or the tty of the tload process if none is specified).


top

top provides an ongoing look at processor activity in real time.


uptime

uptime gives a one line display of the following information: the current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.


vmstat

vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity.


w

w displays information about the users currently on the machine, and their processes.


watch

watch runs command repeatedly, displaying its output (the first screen full).


Psmisc


Contents

The Psmisc package contains the fuser, killall, pidof and pstree programs.


Description

fuser

fuser displays the PIDs of processes using the specified files or file systems.


killall

killall sends a signal to all processes running any of the specified commands.


pidof

Pidof finds the process id's (pids) of the named programs and prints those id's on standard output.


pstree

pstree shows running processes as a tree.


Reiserfsprogs


Contents

The reiserfsprogs package contains the debugreiserfs, mkreiserfs, reiserfsck, resize_reiserfs and unpack programs.


Description

debugreiserfs

debugreiserfs can sometimes help to solve problems with reiserfs filesystems. If it is called without options it prints the super block of any reiserfs filesystem found on the device.


mkreiserfs

mkreiserfs creates a reiserfs file system.


reiserfsck

reiserfsck checks a reiserfs file system.


resize_reiserfs

resize_reiserfs is used to resize an unmounted reiserfs file system


unpack

No description is currently available for unpack.


Shadow Password Suite


Contents

The Shadow Password Suite contains the chage, chfn, chpasswd, chsh, dpasswd, expiry, faillog, gpasswd, groupadd, groupdel, groupmod, grpck, grpconv, grpunconv, lastlog, login, newgrp, passwd, sg, su, logoutd, mkpasswd, newusers, pwck, pwconv, pwunconv, useradd, userdel, usermod, vigr and vipw programs.


Description

chage

chage changes the number of days between password changes and the date of the last password change.


chfn

chfn changes user full name, office number, office extension, and home phone number information for a user's account.


chpasswd

chpasswd reads a file of user name and password pairs from standard input and uses this information to update a group of existing users.


chsh

chsh changes the user login shell.


dpasswd

dpasswd adds, deletes, and updates dial-up passwords for user login shells.


expiry

Checks and enforces password expiration policy.


faillog

faillog formats the contents of the failure log,/var/log/faillog, and maintains failure counts and limits.


gpasswd

gpasswd is used to administer the /etc/group file


groupadd

The groupadd command creates a new group account using the values specified on the command line and the default values from the system.


groupdel

The groupdel command modifies the system account files, deleting all entries that refer to group.


groupmod

The groupmod command modifies the system account files to reflect the changes that are specified on the command line.


grpck

grpck verifies the integrity of the system authentication information.


grpconv

grpunconv converts to shadow group files from normal group files.


grpunconv

grpunconv converts from shadow group files to normal group files.


lastlog

lastlog formats and prints the contents of the last login log, /var/log/lastlog. The login-name, port, and last login time will be printed.


login

login is used to establish a new session with the system.


newgrp

newgrp is used to change the current group ID during a login session.


passwd

passwd changes passwords for user and group accounts.


sg

sg executes command as a different group ID.


su

Change the effective user id and group id to that of a user. This replaces the su programs that's installed from the Shellutils package.


logoutd

logoutd enforces the login time and port restrictions specified in /etc/porttime.


mkpasswd

mkpasswd reads a file in the format given by the flags and converts it to the corresponding database file format.


newusers

newusers reads a file of user name and clear text password pairs and uses this information to update a group of existing users or to create new users.


pwck

pwck verifies the integrity of the system authentication information.


pwconv

pwconv converts to shadow passwd files from normal passwd files.


pwunconv

pwunconv converts from shadow passwd files to normal files.


useradd

useradd creates a new user or update default new user information.


userdel

userdel modifies the system account files, deleting all entries that refer to a specified login name.


usermod

usermod modifies the system account files to reflect the changes that are specified on the command line.


vipw and vigr

vipw and vigr will edit the files /etc/passwd and /etc/group, respectively. With the -s flag, they will edit the shadow versions of those files, /etc/shadow and /etc/gshadow, respectively.


Sysklogd


Contents

The Sysklogd package contains the klogd and syslogd programs.


Description

klogd

klogd is a system daemon which intercepts and logs Linux kernel messages.


syslogd

Syslogd provides a kind of logging that many modern programs use. Every logged message contains at least a time and a hostname field, normally a program name field, too, but that depends on how trusty the logging program is.


Sysvinit


Contents

The Sysvinit package contains the halt, init, killall5, last, lastb, mesg, pidof, poweroff, reboot, runlevel, shutdown, sulogin, telinit, utmpdump, wall,


Description

halt

Halt notes that the system is being brought down in the file /var/log/wtmp, and then either tells the kernel to halt, reboot or poweroff the system. If halt or reboot is called when the system is not in runlevel 0 or 6, shutdown will be invoked instead (with the flag -h or -r).


init

Init is the parent of all processes. Its primary role is to create processes from a script stored in the file /etc/inittab. This file usually has entries which cause init to spawn gettys on each line that users can log in. It also controls autonomous processes required by any particular system.


killall5

killall5 is the SystemV killall command. It sends a signal to all processes except the processes in its own session, so it won't kill the shell that is running the script it was called from.


last

last searches back through the file /var/log/wtmp (or the file designated by the -f flag) and displays a list of all users logged in (and out) since that file was created.


lastb

lastb is the same as last, except that by default it shows a log of the file /var/log/btmp, which contains all the bad login attempts.


mesg

Mesg controls the access to the users terminal by others. It's typically used to allow or disallow other users to write to his terminal.


pidof

Pidof finds the process id's (pids) of the named programs and prints those id's on standard output.


poweroff

poweroff is equivalent to shutdown -h -p now. It halts the computer and switches off the computer (when using an APM compliant BIOS and APM is enabled in the kernel).


reboot

reboot is equivalent to shutdown -r now. It reboots the computer.


runlevel

Runlevel reads the system utmp file (typically /var/run/utmp) to locate the runlevel record, and then prints the previous and current system runlevel on its standard output, separated by a single space.


shutdown

shutdown brings the system down in a secure way. All logged-in users are notified that the system is going down, and login is blocked.


sulogin

sulogin is invoked by init when the system goes into single user mode (this is done through an entry in /etc/inittab). Init also tries to execute sulogin when it is passed the -b flag from the boot loader (eg, LILO).


telinit

telinit sends appropriate signals to init, telling it which runlevel to change to.


utmpdump

utmpdumps prints the content of a file (usually /var/run/utmp) on standard output in a user friendly format.


wall

Wall sends a message to everybody logged in with their mesg permission set to yes.


Util Linux


Contents

The Util-linux package contains the agetty, arch, blockdev, cal, cfdisk, chkdupexe, col, colcrt, colrm, column, ctrlaltdel, cytune, ddate, dmesg, elvtune, fdformat, fdisk, fsck.minix, getopt, hexdump, hwclock, ipcrm, ipcs, kill, logger, look, losetup, mcookie, mkfs, mkfs.bfs, mkfs.minix, mkswap, more, mount, namei, umount, ramsize, rdev, readprofile, rename, renice, rev, rootflags, script, setfdprm, setsid, setterm, sfdisk, swapdev, swapoff, swapon, tunelp, ul, vidmode, whereis, and write programs.


Description

agetty

agetty opens a tty port, prompts for a login name and invokes the /bin/login command.


arch

arch prints the machine architecture.


blockdev

blockdev allows to call block device ioctls from the command line


cal

cal displays a simple calender.


cfdisk

cfdisk is an libncurses based disk partition table manipulator.


chkdupexe

chkdupexe finds duplicate executables.


col

col filters reverse line feeds from input.


colcrt

colcrt filters nroff output for CRT previewing.


colrm

colrm removes columns from a file.


column

column columnates lists.


ctrlaltdel

ctrlaltdel sets the function of the CTRL+ALT+DEL key combination (hard or soft reset).


cytune

cytune queries and modifies the interruption threshold for the Cyclades driver.


ddate

ddate converts Gregorian dates to Discordian dates.


dmesg

dmesg is used to examine or control the kernel ring buffer (boot messages from the kernel).


elvtune

elvtune allows to tune the I/O elevator per block device queue basis.


fdformat

fdformat low-level formats a floppy disk.


fdisk

fdisk is a disk partition table manipulator.


fsck.minix

fsck.minix performs a consistency check for the Linux MINIX filesystem.


getopt

getops parses command options the same way as the getopt C command.


hexdump

hexdump displays specified files, or standard input, in a user specified format (ascii, decimal, hexadecimal, octal).


hwclock

hwclock queries and sets the hardware clock (Also called the RTC or BIOS clock).


ipcrm

ipcrm removes a specified resource.


ipcs

ipcs provides information on IPC facilities.


kill

kill sends a specified signal to the specified process.


logger

logger makes entries in the system log.


look

look displays lines beginning with a given string.


losetup

losetup sets up and controls loop devices.


mcookie

mcookie generates magic cookies for xauth.


mkfs

mkfs builds a Linux filesystem on a device, usually a harddisk partition.


mkfs.bfs

mkfs.bfs creates a SCO bfs file system on a device, usually a harddisk partition.


mkfs.minix

mkfs.minix creates a Linux MINIX filesystem on a device, usually a harddisk partition.


mkswap

mkswap sets up a Linux swap area on a device or in a file.


more

more is a filter for paging through text one screen full at a time.


mount

mount mounts a filesystem from a device to a directory (mount point).


namei

namei follows a pathname until a terminal point is found.


umount

umount unmounts a mounted filesystem.


ramsize

ramsize queries and sets RAM disk size.


rdev

rdev queries and sets image root device, swap device, RAM disk size, or video mode.


readprofile

readprofile reads kernel profiling information.


rename

rename renames files.


renice

renice alters priority of running processes.


rev

rev reverses lines of a file.


rootflags

rootflags queries and sets extra information used when mounting root.


script

script makes typescript of terminal session.


setfdprm

setfdprm sets user-provides floppy disk parameters.


setsid

setsid runs programs in a new session.


setterm

setterm sets terminal attributes.


sfdisk

sfdisk is a disk partition table manipulator.


swapdev

swapdev queries and sets swap device.


swapoff

swapoff disables devices and files for paging and swapping.


swapon

swapon enables devices and files for paging and swapping.


tunelp

tunelp sets various parameters for the LP device.


ul

ul reads a file and translates occurrences of underscores to the sequence which indicates underlining for the terminal in use.


vidmode

vidmode queries and sets the video mode.


whereis

whereis locates a binary, source and manual page for a command.


write

write sends a message to another user.


Netkit-base


Contents

The Netkit-base package contains the inetd and ping programs.


Description

inetd

inetd is the mother of all daemons. It listens for connections, and transfers the call to the appropriate daemon.


ping

ping sends ICMP ECHO_REQUEST packets to a host and determines its response time.


Net-tools


Contents

The Net-tools package contains the arp, hostname, ifconfig, netstat, plipconfig, rarp, route, and slattach programs.


Description

arp

arp is used to manipulate the kernel's ARP cache, usually to add or delete an entry, or to dump the ARP cache.


hostname

hostname, with its symlinks domainname, dnsdomainname, nisdomainname, ypdomainname, and nodename, is used to set or show the system's hostname (or other, depending on the symlink used).


ifconfig

The ifconfig command is the general command used to configure network interfaces.


netstat

netstat is a multi-purpose tool used to print the network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.


plipconfig

plipconfig is used to fine-tune the PLIP device parameters, hopefully making it faster.


rarp

Akin to the arp program, the rarp program manipulates the system's RARP table.


route

route is the general utility which is used to manipulate the IP routing table.


slattach

slattach attaches a network interface to a serial line, i.e.. puts a normal terminal line into one of several "network" modes.


Annexe B. Dependencies


Introduction

This appendix lists all the installation dependencies for all the packages that are installed in this book. The listings will include which programs from which packages are needed to successfully compile the package to be installed.

These are not running dependencies, meaning they don't tell you what programs are needed to use that packages programs. Just the ones needed to compile it.

The dependency list can be, from time to time, outdated in regards to the current used package version. Checking dependencies takes quite a bit of work, so they may lag behind a bit on the package update. But often with minor package updates, the installation dependencies hardly change, so they'll be current in most cases. If we upgrade to a major new release, we'll make sure the dependencies are checked too at the same time.


Bash-2.05


Dependencies

Bash-2.05 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
size from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mv from the fileutils package

rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
echo from the sh-utils package
expr from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Binutils-2.11.2


Dependencies

Binutils-2.11.2 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package
ranlib from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
rmdir from the fileutils package
touch from the fileutils package

gcc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

makeinfo from the texinfo package

cat from the textutils package
sort from the textutils package
tail from the textutils package
tr from the textutils package
true from the sh-utils package
uniq from the textutils package


Bzip2-1.0.1


Dependencies

Bzip2-1.0.1 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cp from the fileutils package
ln from the fileutils package
rm from the fileutils package

gcc from the gcc package

make from the make package


Diffutils-2.7


Dependencies

Diffutils-2.7 needs the following to be installed:


sh from the bash package

ld from the binutils package
as from the binutils package

chmod from the fileutils package
cp from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package

cat from the textutils package
tr from the textutils package


Fileutils-4.1


Dependencies

Fileutils-4.1 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
install from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package
uniq from the textutils package


GCC-2.95.3


Dependencies

GCC-2.95.3 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package
ranlib from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
touch from the fileutils package

find from the find package

gcc from the gcc package
cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

mawk from the mawk package

sed from the sed package

basename from the sh-utils package
echo from the sh-util package
expr from the sh-utils package
sleep from the sh-utils package
true from the sh-utils package
uname from the sh-utils package

tar from the tar package

makeinfo from the texinfo package

cat from the textutils package
head from the textutils package
sort from the textutils package
tail from the textutils package
tr from the textutils package
uniq from the textutils package


Grep-2.4.2


Dependencies

Grep-2.4.2 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Gzip-1.2.4a


Dependencies

Gzip-1.2.4a needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package
nm from the binutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

grep from the grep package

make from the make package

sed from the sed package

cat from the textutils package
tr from the textutils package


Linux-2.4.8


Dependencies

Linux-2.4.8 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package
objcopy from the binutils package

chown from the fileutils package
cp from the fileutils package
ln from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

find from the findutils package
xargs from the findutils package

gcc from the gcc package

grep from the grep package

make from the make package

awk from the mawk package

depmod from the modutils package
genksyms from the modutils package

hostname from the net-tools package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package
expr from the sh-utils package
pwd from the sh-utils package
uname from the sh-utils package
whoami from the sh-utils package
yes from the sh-utils package

cat from the textutils package
md5sum from the textutils package
sort from the textutils package
tail from the textutils package
touch from the textutils package
tr from the textutils package


Make-3.79.1


Dependencies

Make-3.79.1 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

cmp from the diffutils package

chgrp from the fileutils package
chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package
egrep from the grep package

grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Mawk-1.3.3


Dependencies

Mawk-1.3.3 needs the following to be installed:


chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
rm from the fileutils package

as from the binutils package
ld from the binutils package

cmp from the diffutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

tee from the sh-utils package

cat from the textutils package
tr from the textutils package


Patch-2.5.4


Dependencies

Patch-2.5.4 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Sed-3.02


Dependencies

Sed-3.02 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package

cat from the textutils package
tr from the textutils package


Sh-utils-2.0


Dependencies

Sh-utils-2.0 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
chown from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Tar-1.13


Dependencies

Tar-1.13 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

patch from the patch package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Texinfo-4.0


Dependencies

Texinfo-4.0 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Textutils-2.0


Dependencies

Textutils-2.0 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Chroot


Dependencies

Chroot needs the following to be installed:


bash from the bash package

env from the sh-utils package


Glibc-2.2.4


Dependencies

Glibc-2.2.4 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
ranlib from the binutils  package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
mknod from the fileutils package
mv from the fileutils package
mkdir from the fileutils package
rm from the fileutils package
touch from the fileutils package

cpp from the gcc package
gcc from the gcc package

egrep from the grep package
grep from the grep package

gzip from the gzip package

make from the make package

mawk from the mawk package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
pwd from the sh-utils package
uname from the sh-utils package

cat from the textutils package
sort from the textutils package
tr from the textutils package


Makedev-1.4


Dependencies

MAKEDEV-1.4 needs the following to be installed:


sh from the bash package

chmod from the fileutils package
chown from the fileutils package
cp from the fileutils package
ln from the fileutils package
mknod from the fileutils package
mv from the fileutils package
rm from the fileutils package

grep from the grep package

expr from the sh-utils package


Man-pages-1.39


Dependencies

Man-pages-1.39 needs the following to be installed:


sh from the bash package

install from the fileutils package

make from the make package

patch from the patch package


Findutils-4.1


Dependencies

Findutils-4.1 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

chmod from the fileutils package
cp from the fileutils package
mv from the fileutils package
rm from the fileutils package

grep from the grep package

cc from the gcc package

make from the make package

patch from the patch package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package

cat from the textutils package
tr from the textutils package


Ncurses-5.2


Dependencies

Ncurses-5.2 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

c++ from the gcc package
gcc from the gcc package

egrep from the grep package
fgrep from the grep package
grep from the grep package

make from the make package

mawk from the mawk package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package
echo from the sh-utils package
expr from the sh-utils package
test from the sh-utils package
uname from the sh-utils package

cat from the textutils package
sort from the textutils package
tr from the textutils package
wc from the textutils package


Vim-5.8


Dependencies

Vim-5.8 needs the following to be installed:


sh from the bash package

ld from the binutils package
as from the binutils package

cmp from the diffutils package
diff from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
touch from the fileutils package

find from the find package

cc from the gcc package

grep from the grep package

make from the make package

hostname from the net-tools package

sed from the sed package

echo from the sh-utils package
expr from the sh-utils package
uname from the sh-utils package
whoami from the sh-utils package

cat from the textutils package
tr from the textutils package
wc from the textutils package


Bison-1.28


Dependencies

Bison-1.28 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

rm from the fileutils package
cp from the fileutils package
mkdir from the fileutils package
ls from the fileutils package
chmod from the fileutils package
mv from the fileutils package
ln from the fileutils package

cc from the gcc package

grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package

tr from the textutils package
cat from the textutils package


Less-358


Dependencies

Less-358 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
mv from the fileutils package
rm from the fileutils package
touch from the fileutils package

grep from the grep package

cc from the gcc package

make from the make package

sed from the sed package

dirname from the sh-utils package
expr from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Groff-1.17.2


Dependencies

Groff-1.17.2 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

bison from the bison package
yacc from the bison package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package
c++ from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

awk from the mawk package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package
echo from the sh-utils package
expr from the sh-utils package
uname from the sh-utils package

cat from the textutils package
touch from the fileutils package
tr from the textutils package


Man-1.5i2


Dependencies

Man-1.5i2 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

bzip2 from the bzip2 package

chmod from the fileutils package
cp from the fileutils package
install from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

gcc from the gcc package

grep from the grep package

gunzip from the gzip package
zcat from the gzip package

make from the make package

awk from the mawk package

sed from the sed package

echo from the sh-utils package
cat from the textutils package


Perl-5.6.1


Dependencies

Perl-5.6.1 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package

bison from the bison package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
touch from the fileutils package

gcc from the gcc package

egrep from the grep package
grep from the grep package

nroff from the groff package

gzip from the gzip package

less from the less package

make from the make package

awk from the mawk package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package
echo from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
tee from the sh-utils package
test from the sh-utils package
true from the sh-utils package
uname from the sh-utils package

cat from the textutils package
comm from the textutils package
sort from the textutils package
split from the textutils package
tr from the textutils package
uniq from the textutils package
wc from the textutils package


M4-1.4


Dependencies

M4-1.4 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

chmod from the fileutils package
cp from the fileutils package
mv from the fileutils package
rm from the fileutils package

make from the make package

cc from the gcc package

egrep from the grep package
grep from the grep package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package

cat from the textutils package
tr from the textutils package


Autoconf-2.52


Dependencies

Autoconf-2.52 needs the following to be installed:


sh from the bash package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

m4 from the m4 package

make from the make package

perl from the perl package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package

cat from the textutils package
tr from the textutils package


Automake-1.5


Dependencies

Automake-1.5 needs the following to be installed:


sh from the bash package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

grep from the grep package

make from the make package

perl from the perl package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package

cat from the textutils package
tr from the textutils package


Flex-2.5.4a


Dependencies

Flex-2.5.4a needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

bison from the bison package
yacc from the bison package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
mv from the fileutils package
rm from the fileutils package
touch from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

dirname from the sh-utils package

cat from the textutils package
tr from the textutils package


File-3.36


Dependencies

File-3.36 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package

cat from the textutils package
tr from the textutils package


Libtool-1.4


Dependencies

Libtool-1.4 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
rmdir from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Bin86-0.16.0


Dependencies

Bin86-0.16.0 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package
strip from the binutils package

chmod from the fileutils package
install from the fileutils package
ln from the fileutils package
mv from the fileutils package

cc from the gcc package

make from the make package

sed from the sed package


Ed-0.2


Dependencies

Ed-0.2 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
mv from the fileutils package
rm from the fileutils package
touch from the fileutils package

cc from the gcc package

grep from the grep package
egrep from the grep package

make from the make package

sed from the sed package

cat from the textutils package
tr from the textutils package


Gettext-0.10.39


Dependencies

Gettext-0.10.39 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
rmdir from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
echo from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
sort from the textutils package
tr from the textutils package
uniq from the textutils package


Kbd-1.06


Dependencies

Kbd-1.06 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package
strip from the binutils package

bison from the bison package

cp from the fileutils package
install from the fileutils package
ln from the fileutils package
mv from the fileutils package
rm from the fileutils package

flex from the flex package

cpp from the gcc package
gcc from the gcc package

gunzip from the gzip package
gzip from the gzip package

make from the make package

sed from the sed package

uname from the sh-utils package


E2fsprogs-1.22


Dependencies

E2fsprogs-1.22 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
sync from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

gzip from the gzip package

make from the make package

awk from the mawk package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
uname from the sh-utils package

makeinfo from the texinfo package

cat from the textutils package
tr from the textutils package


Lilo-21.7.5


Dependencies

Lilo-21.7.5 needs the following to be installed:


sh from the bash package

as86 from the bin86 package
ld86 from the bin86 package

as from the binutils package
ld from the binutils package
strip from the binutils package

cp from the fileutils package
dd from the fileutils package
ln from the fileutils package
mv from the fileutils package

cc from the gcc package

make from the make package

sed from the sed package

cat from the textutils package


Modutils-2.4.7


Dependencies

Modutils-2.4.7 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
strip from the binutils package

bison from the bison package

cmp from the diffutils package

chmod from the fileutils package
install from the fileutils package
ln from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

flex from the flex package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

expr from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Netkit-base-0.17


Dependencies

Netkit-base-0.17 needs the following to be installed:


sh rom the bash package

as rom the binutils package
ld rom the binutils package
strip rom the binutils package

cp rom the fileutils package
install from the fileutils package
rm rom the fileutils package

make rom the make package

cc rom the gcc package

sed rom the sed package

date from the sh-utils package

cat from the textutils package


Procinfo-18


Dependencies

Procinfo-18 needs the following to be installed:


as from the binutils package
ld from the binutils package

install from the fileutils package
mkdir from the fileutils package

make from the make package

sed from the sed package


Procps-2.0.7


Dependencies

Procps-2.0.7 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package
strip from the binutils package

install from the fileutils package
ln from the fileutils package
mv from the fileutils package
rm from the fileutils package

gcc from the gcc package

grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
pwd from the sh-utils package

sort from the textutils package
tr from the textutils package


Psmisc-20.1


Dependencies

Psmisc-20.1 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ls from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
tr from the textutils package


Reiserfs-N/A


Dependencies

Reiserfs-N/A needs the following to be installed:


TO BE DETERMINED


Net-tools-1.60


Dependencies

Net-tools-1.60 needs the following to be installed:


bash from the bash package
sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package

install from the fileutils package
ln from the fileutils package
rm from the fileutils package

msgfmt from the gettext package

cc from the gcc package

make from the make package

basename from the sh-utils package
echo from the sh-utils package
env from the sh-utils package


Shadow-20001016


Dependencies

Shadow-20001016 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
rmdir from the fileutils package

cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

sed from the sed package

basename from the sh-utils package
expr from the sh-utils package
sleep from the sh-utils package
uname from the sh-utils package

cat from the textutils package
sort from the textutils package
uniq from the textutils package


Sysklogd-1.4.1


Dependencies

Sysklogd-1.4.1 needs the following to be installed:


as from the binutils package
ld from the binutils package
strip from the binutils package

install from the fileutils package

gcc rom the gcc package

make from the make package


Sysvinit-2.82


Dependencies

Sysvinit-2.82 needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

chown from the fileutils package
install from the fileutils package
ln from the fileutils package
mknod from the fileutils package
rm from the fileutils package

cc from the gcc package

make from the make package

patch from the patch package


Util-linux-2.11h


Dependencies

Util-linux-2.11h needs the following to be installed:


sh from the bash package

as from the binutils package
ld from the binutils package

chgrp from the fileutils package
chmod from the fileutils package
cp from the fileutils package
install from the fileutils package
ln from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

cc from the gcc package
cpp from the gcc package

rpcgen from the glibc package

grep from the grep package

make from the make package

sed from the sed package

unam  from the sh-utils package
whoami from the sh-utils package

cat from the textutils package


Annexe C. Ressources


Introduction

Une liste de livres, d'HOWTOs et d'autres documents susceptibles d'être utile à télécharger ou acheter. Cette liste n'est qu'un début. Nous espèrons être capable de l'agrandir au fur et à mesure que nous rencontrerons d'autres documents ou d'autres livres.


Livres

  • Linux Network Administrator's Guide publié par O'Reilly. ISBN: 1-56502-087-2

  • Running Linux publié par O'Reilly. ISBN: 1-56592-151-8


HOWTOs and Guides

Tous les HOWTOs suivants peuvent être téléchargés depuis le site du Linux Documentation Project (http://www.linuxdoc.org).

  • Linux Network Administrator's Guide

  • From-PowerUp-To-Bash-Prompt-HOWTO


Other

  • Les différentes pages de man qui vont de paire avec les paquets.


Annexe D. Sites de téléchargements officiels


Official download locations

Voici la liste des packages du chapitre 3 avec leurs sites officiels de téléchargements. Elle pourra peut-être vous aider à trouver une nouvelle version d'un package plus rapidement.


Bash (2.05a):
ftp://ftp.gnu.org/gnu/bash/


Binutils (2.11.2):
ftp://ftp.gnu.org/gnu/binutils/


Bzip2 (1.0.1):
ftp://sourceware.cygnus.com/pub/bzip2/


Diff Utils (2.7):
ftp://ftp.gnu.org/gnu/diffutils/


File Utils (4.1):
ftp://ftp.gnu.org/gnu/fileutils/


GCC (2.95.3):
ftp://ftp.gnu.org/pub/gnu/gcc/


GCC Patch (2.95.3-2):
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/
http://ftp.linuxfromscratch.org/lfs-packages/3.1/


Grep (2.4.2):
ftp://ftp.gnu.org/gnu/grep/


Gzip (1.2.4a):
ftp://ftp.gnu.org/gnu/gzip/


Gzip Patch (1.2.4a):
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/
http://ftp.linuxfromscratch.org/lfs-packages/3.1/


Linux Kernel (2.4.16):
ftp://ftp.kernel.org/pub/linux/kernel/


Make (3.79.1):
ftp://ftp.gnu.org/gnu/make/


Mawk (1.3.3):
ftp://ftp.whidbey.net/pub/brennan/


Patch (2.5.4):
ftp://ftp.gnu.org/gnu/patch/


Sed (3.02):
ftp://ftp.gnu.org/gnu/sed/


Sh-utils (2.0):
ftp://ftp.gnu.org/gnu/sh-utils/


Sh-utils Patch (2.0):
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/
http://ftp.linuxfromscratch.org/lfs-packages/3.1/


Tar (1.13):
ftp://ftp.gnu.org/gnu/tar/


Tar Patch (1.13):
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/
http://ftp.linuxfromscratch.org/lfs-packages/3.1/

Texinfo (4.0):
ftp://ftp.gnu.org/gnu/texinfo/


Text Utils (2.0):
ftp://ftp.gnu.org/gnu/textutils/


Glibc (2.2.4):
ftp://ftp.gnu.org/gnu/glibc/


Glibc-linuxthreads (2.2.4):
ftp://ftp.gnu.org/gnu/glibc/


MAKEDEV (1.4):
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/
http://ftp.linuxfromscratch.org/lfs-packages/3.1/


Man-pages (1.43):
ftp://ftp.win.tue.nl/pub/linux-local/manpages/


Man-pages Patch (1.43):
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/
http://ftp.linuxfromscratch.org/lfs-packages/3.1/


Find Utils (4.1):
ftp://ftp.gnu.org/gnu/findutils/


Find Utils Patch (4.1):
ftp://ftp.linuxfromscratch.org/lfs-packages/3.1/
http://ftp.linuxfromscratch.org/lfs-packages/3.1/


Ncurses (5.2):
ftp://ftp.gnu.org/gnu/ncurses/


Vim (6.0):
ftp://ftp.vim.org/pub/editors/vim/unix/


Bison (1.28):
ftp://ftp.gnu.org/gnu/bison/


Less (358):
ftp://ftp.gnu.org/gnu/less/


Groff (1.17.2):
ftp://ftp.gnu.org/gnu/groff/


Man (1.5j):
ftp://ftp.win.tue.nl/pub/linux-local/utils/man/


Perl (5.6.1):
http://www.perl.com/

M4 (1.4):
ftp://ftp.gnu.org/gnu/m4/


Autoconf (2.52):
ftp://ftp.gnu.org/gnu/autoconf/


Automake (1.5):
ftp://ftp.gnu.org/gnu/automake/

Flex (2.5.4a):
ftp://ftp.gnu.org/non-gnu/flex/


File (3.36):
ftp://ftp.gw.com/mirrors/pub/unix/file/


Libtool (1.4.2):
ftp://ftp.gnu.org/gnu/libtool/


Bin86 (0.16.0):
http://www.cix.co.uk/~mayday/


Ed (0.2):
ftp://ftp.gnu.org/gnu/ed/


Gettext (0.10.40):
ftp://ftp.gnu.org/gnu/gettext/


Kbd (1.06):
ftp://ftp.win.tue.nl/pub/linux-local/utils/kbd/


E2fsprogs (1.25):
ftp://download.sourceforge.net/pub/sourceforge/e2fsprogs/
http://download.sourceforge.net/e2fsprogs/


Lilo (22.1):
ftp://metalab.unc.edu/pub/Linux/system/boot/lilo/


Modutils (2.4.12):
ftp://ftp.kernel.org/pub/linux/utils/kernel/modutils/


Procinfo (18):
ftp://ftp.cistron.nl/pub/people/svm/


Procps (2.0.7):
ftp://people.redhat.com/johnsonm/procps/


Psmisc (20.1):
http://download.sourceforge.net/psmisc/
ftp://download.sourceforge.net/pub/sourceforge/psmisc/


Reiserfs (3.x.0j):
ftp://ftp.namesys.com/pub/reiserfsprogs/

Shadow Password Suite (20001016):
ftp://ftp.pld.org.pl/software/shadow/


Sysklogd (1.4.1):
ftp://ftp.ibiblio.org/pub/Linux/system/daemons/


Sysvinit (2.83):
ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/


Util Linux (2.11m):
ftp://ftp.win.tue.nl/pub/linux-local/utils/util-linux/


Netkit-base (0.17):
ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/


Net-tools (1.60):
http://www.tazenda.demon.co.uk/phil/net-tools/