Site officiel : Linux From Scratch
Cette phase doit absolument être exécutée en tant que l’utilisateur lfs nouvellement créé.
Binutils : passe 1 – Construire un système temporaire
Source : 5.4. Binutils-2.32 – Passe 1
Le paquet Binutils contient un éditeur de liens, un assembleur et d’autres outils pour gérer des fichiers objets.
cd $LFS/sources/ tar Jxvf binutils-2.32.tar.xz cd binutils-2.32/ mkdir -v build cd build/
../configure --prefix=/tools \ --with-sysroot=$LFS \ --with-lib-path=/tools/lib \ --target=$LFS_TGT \ --disable-nls \ --disable-werror
Ce qui définit entre autres les variables suivantes de construction dans le Makefile :
- target_alias=x86_64-lfs-linux-gnu
- target_vendor=lfs
- target_os=linux-gnu
- target=x86_64-lfs-linux-gnu
- prefix = /tools
- exec_prefix = ${prefix}
- tooldir = ${exec_prefix}/x86_64-lfs-linux-gnu
- build_tooldir = ${exec_prefix}/x86_64-lfs-linux-gnu
- bindir = ${exec_prefix}/bin
- datarootdir = ${prefix}/share
- infodir = ${datarootdir}/info
- mandir = ${datarootdir}/man
- man1dir = $(mandir)/man1
Ce qui génère les fichiers suivants dans le répertoire build (CWD) :
Makefile config.log config.status serdep.tmp
make
Ce qui génère les répertoires suivants dans le répertoire build (CWD) :
Makefile bfd # dir binutils # dir config.log config.status etc # dir gas # dir gprof # dir intl # dir ld # dir libiberty # dir opcodes # dir serdep.tmp zlib # dir
/mnt/lfs/sources/binutils-2.32/build/ ├── bfd │ ├── doc │ └── po ├── binutils │ ├── doc │ └── po ├── etc ├── gas │ ├── config │ ├── doc │ └── po ├── gprof │ └── po ├── intl ├── ld │ ├── ldscripts │ ├── po │ └── tmpdir ├── libiberty │ └── testsuite ├── opcodes │ └── po └── zlib
case $(uname -m) in x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;; esac
mkdir: created directory '/tools/lib' '/tools/lib64' -> 'lib'
Ce qui génère les deux répertoires suivants dans /tools (pointant vers /mnt/lfs/tools) :
lib # chemin de la bibliothèque pour l'éditeur lib64 # lien symbolique vers le répertoire lib ci-dessus
make install
Ce qui génère les répertoires suivants dans /mnt/lfs/tools :
/mnt/lfs/tools/ ├── bin ├── lib ├── lib64 -> lib ├── share │ ├── info │ └── man │ └── man1 └── x86_64-lfs-linux-gnu ├── bin └── lib └── ldscripts 11 directories
Et les binaires suivants dans /mnt/lfs/tools/x86_64-lfs-linux-gnu/bin/ :
ar as ld ld.bfd nm objcopy objdump ranlib readelf strip
Rmq : La construction de binutils fait ici 1 SBU, pour moi 4 min 43 (soit 283 s)
cd ../.. rm -rf binutils-2.32/
GCC : passe 1 – Construire un système temporaire
Source : 5.5. GCC-8.2.0 – Passe 1
Le paquet GCC contient la collection de compilateurs GNU, qui inclut les compilateurs C et C++.
cd $LFS/sources tar Jxvf gcc-8.2.0.tar.xz cd gcc-8.2.0/ tar Jxvf ../mpfr-4.0.2.tar.xz tar Jxvf ../gmp-6.1.2.tar.xz tar zxvf ../mpc-1.1.0.tar.gz mv -v mpfr-4.0.2 mpfr mv -v gmp-6.1.2 gmp mv -v mpc-1.1.0 mpc
for file in gcc/config/{linux,i386/linux{,64}}.h do cp -uv $file{,.orig} sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \ -e 's@/usr@/tools@g' $file.orig > $file echo ' #undef STANDARD_STARTFILE_PREFIX_1 #undef STANDARD_STARTFILE_PREFIX_2 #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/" #define STANDARD_STARTFILE_PREFIX_2 ""' >> $file touch $file.orig done
'gcc/config/linux.h' -> 'gcc/config/linux.h.orig' 'gcc/config/i386/linux.h' -> 'gcc/config/i386/linux.h.orig' 'gcc/config/i386/linux64.h' -> 'gcc/config/i386/linux64.h.orig'
'/lib/ld' -> '/tools/lib/ld' '/lib64/ld' -> '/tools/lib64/ld' '/lib32/ld' -> '/tools/lib32/ld'
'/usr' -> '/tools'
case $(uname -m) in x86_64) sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64 ;; esac
Vérification :
tail -n 4 gcc/config/linux.h gcc/config/i386/linux.h gcc/config/i386/linux64.h
==> gcc/config/linux.h <== #undef STANDARD_STARTFILE_PREFIX_1 #undef STANDARD_STARTFILE_PREFIX_2 #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/" #define STANDARD_STARTFILE_PREFIX_2 "" ==> gcc/config/i386/linux.h <== #undef STANDARD_STARTFILE_PREFIX_1 #undef STANDARD_STARTFILE_PREFIX_2 #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/" #define STANDARD_STARTFILE_PREFIX_2 "" ==> gcc/config/i386/linux64.h <== #undef STANDARD_STARTFILE_PREFIX_1 #undef STANDARD_STARTFILE_PREFIX_2 #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/" #define STANDARD_STARTFILE_PREFIX_2 ""
Vérification :
diff gcc/config/i386/t-linux64 gcc/config/i386/t-linux64.orig
36c36 < MULTILIB_OSDIRNAMES = m64=../lib$(call if_multiarch,:x86_64-linux-gnu) --- > MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
mkdir -v build cd build/
../configure \ --target=$LFS_TGT \ --prefix=/tools \ --with-glibc-version=2.11 \ --with-sysroot=$LFS \ --with-newlib \ --without-headers \ --with-local-prefix=/tools \ --with-native-system-header-dir=/tools/include \ --disable-nls \ --disable-shared \ --disable-multilib \ --disable-decimal-float \ --disable-threads \ --disable-libatomic \ --disable-libgomp \ --disable-libmpx \ --disable-libquadmath \ --disable-libssp \ --disable-libvtv \ --disable-libstdcxx \ --enable-languages=c,c++
make
make install
cd ../.. rm -rf gcc-8.2.0/
Linux API Headers – Construire un système temporaire
Source : 5.6. Linux-4.20.12 API Headers
Les Linux API Headers montrent l’API du noyau pour qu’il soit utilisé par Glibc.
cd $LFS/sources tar Jxvf linux-4.20.12.tar.xz cd linux-4.20.12/ make mrproper make INSTALL_HDR_PATH=dest headers_install cp -rv dest/include/* /tools/include
cd .. rm -rf linux-4.20.12/
Glibc : passe 1 – Construire un système temporaire
Source : 5.7. Glibc-2.29
Le paquet Glibc contient la bibliothèque C principale. Cette bibliothèque fournit toutes les routines basiques pour allouer de la mémoire, rechercher des répertoires, ouvrir et fermer des fichiers, les lire et les écrire, gérer les chaînes, faire correspondre des modèles, faire de l’arithmétique et ainsi de suite.
cd $LFS/sources tar Jxvf glibc-2.29.tar.xz cd glibc-2.29/ mkdir -v build cd build/
../configure \ --prefix=/tools \ --host=$LFS_TGT \ --build=$(../scripts/config.guess) \ --enable-kernel=3.2 \ --with-headers=/tools/include
make
make install
Vérification :
echo 'int main(){}' > dummy.c $LFS_TGT-gcc dummy.c readelf -l a.out | grep ': /tools'
[Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2]
rm -v dummy.c a.out
removed 'dummy.c' removed 'a.out'
cd ../.. rm -rf glibc-2.29/
Libstdc++ – Construire un système temporaire
Source : 5.8. Libstdc++ de GCC-8.2.0
Libstdc++ est la bibliothèque standard de C++. Elle est utilisée pour compiler du code C++ (une partie de GCC est écrit en C++) mais nous avons dû retarder son installation lorsqu’on a construit gcc-pass1 car elle dépend de glibc, qui n’était pas encore disponible dans /tools.
cd $LFS/sources tar Jxvf gcc-8.2.0.tar.xz cd gcc-8.2.0/ mkdir -v build cd build/
../libstdc++-v3/configure \ --host=$LFS_TGT \ --prefix=/tools \ --disable-multilib \ --disable-nls \ --disable-libstdcxx-threads \ --disable-libstdcxx-pch \ --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/8.2.0
make
make install
cd ../.. rm -rf gcc-8.2.0/
Binutils : passe 2 – Construire un système temporaire
Source : 5.9. Binutils-2.32 – Passe 2
Le paquet Binutils contient un éditeur de liens, un assembleur et d’autres outils pour gérer des fichiers objets.
cd $LFS/sources/ tar Jxvf binutils-2.32.tar.xz cd binutils-2.32/ mkdir -v build cd build/
CC=$LFS_TGT-gcc \ AR=$LFS_TGT-ar \ RANLIB=$LFS_TGT-ranlib \ ../configure \ --prefix=/tools \ --disable-nls \ --disable-werror \ --with-lib-path=/tools/lib \ --with-sysroot
make
make install
make -C ld clean make -C ld LIB_PATH=/usr/lib:/lib cp -v ld/ld-new /tools/bin
cd ../.. rm -rf binutils-2.32/
Glibc : passe 2 – Construire un système temporaire
Source : 5.10. GCC-8.2.0 – Passe 2
Le paquet GCC contient la collection de compilateurs GNU, qui inclut les compilateurs C et C++.
cd $LFS/sources tar Jxvf gcc-8.2.0.tar.xz cd gcc-8.2.0/
cat gcc/limitx.h gcc/glimits.h gcc/limity.h > `dirname \ $($LFS_TGT-gcc -print-libgcc-file-name)`/include-fixed/limits.h
for file in gcc/config/{linux,i386/linux{,64}}.h do cp -uv $file{,.orig} sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \ -e 's@/usr@/tools@g' $file.orig > $file echo ' #undef STANDARD_STARTFILE_PREFIX_1 #undef STANDARD_STARTFILE_PREFIX_2 #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/" #define STANDARD_STARTFILE_PREFIX_2 ""' >> $file touch $file.orig done
'gcc/config/linux.h' -> 'gcc/config/linux.h.orig' 'gcc/config/i386/linux.h' -> 'gcc/config/i386/linux.h.orig' 'gcc/config/i386/linux64.h' -> 'gcc/config/i386/linux64.h.orig'
case $(uname -m) in x86_64) sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64 ;; esac
tar Jxvf ../mpfr-4.0.2.tar.xz tar Jxvf ../gmp-6.1.2.tar.xz tar zxvf ../mpc-1.1.0.tar.gz mv -v mpfr-4.0.2 mpfr mv -v gmp-6.1.2 gmp mv -v mpc-1.1.0 mpc
mkdir -v build cd build/
CC=$LFS_TGT-gcc \ CXX=$LFS_TGT-g++ \ AR=$LFS_TGT-ar \ RANLIB=$LFS_TGT-ranlib \ ../configure \ --prefix=/tools \ --with-local-prefix=/tools \ --with-native-system-header-dir=/tools/include \ --enable-languages=c,c++ \ --disable-libstdcxx-pch \ --disable-multilib \ --disable-bootstrap \ --disable-libgomp
make
make install
ln -sv gcc /tools/bin/cc
'/tools/bin/cc' -> 'gcc'
Vérification :
echo 'int main(){}' > dummy.c cc dummy.c readelf -l a.out | grep ': /tools'
[Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2]
rm -v dummy.c a.out
removed 'dummy.c' removed 'a.out'
cd ../.. rm -rf gcc-8.2.0/
Tcl – Construire un système temporaire
Source : 5.11. Tcl-8.6.9
Le paquet Tcl contient le langage de commandes des outils.
cd $LFS/sources tar zxvf tcl8.6.9-src.tar.gz cd tcl8.6.9/ cd unix/
./configure --prefix=/tools
make
TZ=UTC make test
all.tcl: Total 137 Passed 121 Skipped 16 Failed 0
make install
chmod -v u+w /tools/lib/libtcl8.6.so
mode of '/tools/lib/libtcl8.6.so' changed from 0555 (r-xr-xr-x) to 0755 (rwxr-xr-x)
make install-private-headers
Installing private header files to /tools/include/
ln -sv tclsh8.6 /tools/bin/tclsh
'/tools/bin/tclsh' -> 'tclsh8.6'
cd ../.. rm -rf tcl8.6.9/
Expect – Construire un système temporaire
Source : 5.12. Expect-5.45.4
Le paquet Expect contient un programme pour réaliser des dialogues scriptés avec d’autres programmes interactifs.
cd $LFS/sources tar zxvf expect5.45.4.tar.gz cd expect5.45.4/
cp -v configure{,.orig}
'configure' -> 'configure.orig'
sed 's:/usr/local/bin:/bin:' configure.orig > configure
./configure --prefix=/tools \ --with-tcl=/tools/lib \ --with-tclinclude=/tools/include
make
make test
all.tcl: Total 26 Passed 15 Skipped 0 Failed 11
make SCRIPTS="" install
Programme installé: expect Bibliothèque installée: libexpect-5.45.so
cd .. rm -rf expect5.45.4/
DejaGNU – Construire un système temporaire
Source : 5.13. DejaGNU-1.6.2
Le paquet DejaGNU contient un ensemble de travail pour tester d’autres programmes.
cd $LFS/sources tar zxvf dejagnu-1.6.2.tar.gz cd dejagnu-1.6.2/
./configure --prefix=/tools
make install
make check
=== runtest Summary === # of expected passes 77 DejaGnu version 1.6.2 Expect version 5.45.4 Tcl version 8.6
Programme installé: runtest
cd .. rm -rf dejagnu-1.6.2/
M4 – Construire un système temporaire
Source : 5.14. M4-1.4.18
Le paquet M4 contient un processeur de macros.
cd $LFS/sources tar Jxvf m4-1.4.18.tar.xz cd m4-1.4.18/
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
Vérification :
tail -n1 lib/stdio-impl.h
#define _IO_IN_BACKUP 0x100
./configure --prefix=/tools
make
make check
============================================================================ Testsuite summary for GNU M4 1.4.18 ============================================================================ # TOTAL: 170 # PASS: 150 # SKIP: 20 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 ============================================================================
make install
cd .. rm -rf m4-1.4.18/
Ncurses – Construire un système temporaire
Source : 5.15. Ncurses-6.1
Le paquet Ncurses contient les bibliothèques de gestion des écrans type caractère, indépendant des terminaux.
cd $LFS/sources tar zxvf ncurses-6.1.tar.gz cd ncurses-6.1/
sed -i s/mawk// configure
3248c3248 < for ac_prog in gawk nawk awk --- > for ac_prog in mawk gawk nawk awk
./configure --prefix=/tools \ --with-shared \ --without-debug \ --without-ada \ --enable-widec \ --enable-overwrite
** Configuration summary for NCURSES 6.1 20180127: extended funcs: yes xterm terminfo: xterm-new bin directory: /tools/bin lib directory: /tools/lib include directory: /tools/include man directory: /tools/share/man terminfo directory: /tools/share/terminfo
make
make install
ln -s libncursesw.so /tools/lib/libncurses.so
cd .. rm -rf ncurses-6.1/
Bash – Construire un système temporaire
Source : 5.16. Bash-5.0
Le paquet Bash contient le shell Bourne-Again.
cd $LFS/sources tar zxvf bash-5.0.tar.gz cd bash-5.0/
./configure --prefix=/tools --without-bash-malloc
make
make tests
make install
ln -sv bash /tools/bin/sh
'/tools/bin/sh' -> 'bash'
cd .. rm -rf bash-5.0/
Bison – Construire un système temporaire
Source : 5.17. Bison-3.3.2
Le paquet Bison contient un générateur d’analyseurs.
cd $LFS/sources tar Jxvf bison-3.3.2.tar.xz cd bison-3.3.2/
./configure --prefix=/tools
make
make check
Erreur constatée :
g++: error: ./examples/c++/calc++/scanner.cc: No such file or directory g++: fatal error: no input files
make install
cd .. rm -rf bison-3.3.2/
Bzip – Construire un système temporaire
Source : 5.18. Bzip2-1.0.6
Le paquet Bzip2 contient des programmes de compression et décompression de fichiers. Compresser des fichiers texte avec bzip2 permet d’atteindre un taux de compression bien meilleur qu’avec l’outil gzip.
cd $LFS/sources tar zxvf bzip2-1.0.6.tar.gz cd bzip2-1.0.6/
make
make PREFIX=/tools install
cd .. rm -rf bzip2-1.0.6/
Coreutils – Construire un système temporaire
Source : 5.19. Coreutils-8.30
Le paquet Coreutils contient des outils pour afficher et configurer les caractéristiques basiques d’un système.
cd $LFS/sources tar Jxvf coreutils-8.30.tar.xz cd coreutils-8.30/
./configure --prefix=/tools --enable-install-program=hostname
make
make RUN_EXPENSIVE_TESTS=yes check
============================================================================ Testsuite summary for GNU coreutils 8.30 ============================================================================ # TOTAL: 328 # PASS: 292 # SKIP: 36 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 ============================================================================
make install
cd .. rm -rf coreutils-8.30/
Diffutils – Construire un système temporaire
Source : 5.20. Diffutils-3.7
Le paquet Diffutils contient les programmes montrant les différences entre fichiers ou répertoires.
cd $LFS/sources tar Jxvf diffutils-3.7.tar.xz cd diffutils-3.7/
./configure --prefix=/tools
make
make check
============================================================================ Testsuite summary for GNU diffutils 3.7 ============================================================================ # TOTAL: 173 # PASS: 146 # SKIP: 27 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 ============================================================================
make install
cd .. rm -rf diffutils-3.7/
File – Construire un système temporaire
Source : 5.21. File-5.36
Le paquet File contient un outil pour déterminer le type d’un fichier ou des fichiers donnés.
cd $LFS/sources tar zxvf file-5.36.tar.gz cd file-5.36/
./configure --prefix=/tools
make
make check
make install
cd .. rm -rf file-5.36/
Findutils – Construire un système temporaire
Source : 5.22. Findutils-4.6.0
Le paquet Findutils contient des programmes de recherche de fichiers. Ces programmes sont fournis pour rechercher récursivement dans une hiérarchie de répertoires et pour créer, maintenir et chercher dans une base de données (souvent plus rapide que la recherche récursive mais moins fiable si la base de données n’a pas été mise à jour récemment).
cd $LFS/sources tar zxvf findutils-4.6.0.tar.gz cd findutils-4.6.0/
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' gl/lib/*.c sed -i '/unistd/a #include <sys/sysmacros.h>' gl/lib/mountlist.c
echo "#define _IO_IN_BACKUP 0x100" >> gl/lib/stdio-impl.h
tail -n1 gl/lib/stdio-impl.h
#define _IO_IN_BACKUP 0x100
./configure --prefix=/tools
make
make check
============================================================================ Testsuite summary for GNU findutils 4.6.0 ============================================================================ # TOTAL: 225 # PASS: 197 # SKIP: 28 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 ============================================================================
make install
cd .. rm -rf findutils-4.6.0/
Gawk – Construire un système temporaire
Source : 5.23. Gawk-4.2.1
Le paquet Gawk contient des programmes de manipulation de fichiers texte.
cd $LFS/sources tar Jxvf gawk-4.2.1.tar.xz cd gawk-4.2.1/
./configure --prefix=/tools
make
make check
make install
cd .. rm -rf gawk-4.2.1/
Gettext – Construire un système temporaire
Source : 5.24. Gettext-0.19.8.1
Le paquet Gettext contient des outils pour l’internationalisation et la localisation. Ceci permet aux programmes d’être compilés avec le support des langues natives (Native Language Support ou NLS), pour afficher des messages dans la langue native de l’utilisateur.
cd $LFS/sources tar Jxvf gettext-0.19.8.1.tar.xz cd gettext-0.19.8.1/
cd gettext-tools/ EMACS="no" ./configure --prefix=/tools --disable-shared
make -C gnulib-lib make -C intl pluralx.c make -C src msgfmt make -C src msgmerge make -C src xgettext
cp -v src/{msgfmt,msgmerge,xgettext} /tools/bin
'src/msgfmt' -> '/tools/bin/msgfmt' 'src/msgmerge' -> '/tools/bin/msgmerge' 'src/xgettext' -> '/tools/bin/xgettext'
cd ../.. rm -rf gettext-0.19.8.1/
Grep – Construire un système temporaire
Source : 5.25. Grep-3.3
Le paquet Grep contient des programmes de recherche à l’intérieur de fichiers.
cd $LFS/sources tar Jxvf grep-3.3.tar.xz cd grep-3.3/
./configure --prefix=/tools
make
make check
============================================================================ Testsuite summary for GNU grep 3.3 ============================================================================ # TOTAL: 173 # PASS: 155 # SKIP: 18 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 ============================================================================
make install
cd .. rm -rf grep-3.3/
Gzip – Construire un système temporaire
Source : 5.26. Gzip-1.10
Le paquet Gzip contient des programmes de compression et décompression de fichiers.
cd $LFS/sources tar Jxvf gzip-1.10.tar.xz cd gzip-1.10/
./configure --prefix=/tools
make
make check
============================================================================ Testsuite summary for gzip 1.10 ============================================================================ # TOTAL: 22 # PASS: 22 # SKIP: 0 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 ============================================================================
make install
cd .. rm -rf gzip-1.10/
Make – Construire un système temporaire
Source : 5.27. Make-4.2.1
Le paquet Make contient un programme pour compiler des paquets.
cd $LFS/sources tar jxvf make-4.2.1.tar.bz2 cd make-4.2.1/
sed -i '211,217 d; 219,229 d; 232 d' glob/glob.c
./configure --prefix=/tools --without-guile
make
make check
Erreur constatée :
Can't locate test_driver.pl in @INC [...] Makefile:798: recipe for target 'check-recursive' failed make: *** [check-recursive] Error 1
make install
cd .. rm -rf make-4.2.1/
Patch – Construire un système temporaire
Source : 5.28. Patch-2.7.6
Le paquet Patch contient un programme permettant de modifier et de créer des fichiers en appliquant un fichier correctif (appelé habituellement « patch ») créé généralement par le programme diff.
cd $LFS/sources tar Jxvf patch-2.7.6.tar.xz cd patch-2.7.6/
./configure --prefix=/tools
make
make check
============================================================================ Testsuite summary for GNU patch 2.7.6 ============================================================================ # TOTAL: 44 # PASS: 42 # SKIP: 0 # XFAIL: 2 # FAIL: 0 # XPASS: 0 # ERROR: 0 ============================================================================
make install
cd .. rm -rf patch-2.7.6/
Perl – Construire un système temporaire
Source : 5.29. Perl-5.28.1
Le paquet Perl contient le langage pratique d’extraction et de rapport (Practical Extraction and Report Language).
cd $LFS/sources tar Jxvf perl-5.28.1.tar.xz cd perl-5.28.1/
sh Configure -des -Dprefix=/tools -Dlibs=-lm -Uloclibpth -Ulocincpth
make
cp -v perl cpan/podlators/scripts/pod2man /tools/bin
'perl' -> '/tools/bin/perl' 'cpan/podlators/scripts/pod2man' -> '/tools/bin/pod2man'
mkdir -pv /tools/lib/perl5/5.28.1
mkdir: created directory '/tools/lib/perl5' mkdir: created directory '/tools/lib/perl5/5.28.1'
cp -Rv lib/* /tools/lib/perl5/5.28.1
cd .. rm -rf perl-5.28.1/
Python – Construire un système temporaire
Source : 5.30. Python-3.7.2
Le paquet Python 3 contient l’environnement de développement Python. Il est utile pour programmer en orienté-objet, écrire des scripts, prototyper de plus grands programmes ou pour développer des applications complètes.
cd $LFS/sources tar Jxvf Python-3.7.2.tar.xz cd Python-3.7.2/
sed -i '/def add_multiarch_paths/a \ return' setup.py
./configure --prefix=/tools --without-ensurepip
make
make install
cd .. rm -rf Python-3.7.2/
Sed – Construire un système temporaire
Source : 5.31. Sed-4.7
cd $LFS/sources tar Jxvf sed-4.7.tar.xz cd sed-4.7/
./configure --prefix=/tools
make
make check
============================================================================ Testsuite summary for GNU sed 4.7 ============================================================================ # TOTAL: 162 # PASS: 134 # SKIP: 28 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 ============================================================================
make install
cd .. rm -rf sed-4.7/
Tar – Construire un système temporaire
Source : 5.32. Tar-1.31
Le paquet Tar contient un programme d’archivage.
cd $LFS/sources tar Jxvf tar-1.31.tar.xz cd tar-1.31/
./configure --prefix=/tools
make
make check
## ------------- ## ## Test results. ## ## ------------- ## 203 tests were successful. 26 tests were skipped.
make install
cd .. rm -rf tar-1.31/
Texinfo – Construire un système temporaire
Source : 5.33. Texinfo-6.5
Le paquet Texinfo contient des programmes de lecture, écriture et conversion des pages Info.
cd $LFS/sources tar Jxvf texinfo-6.5.tar.xz cd texinfo-6.5/
./configure --prefix=/tools
make
make check
============================================================================ Testsuite summary for GNU Texinfo 6.5 ============================================================================ # TOTAL: 184 # PASS: 0 # SKIP: 13 # XFAIL: 0 # FAIL: 171 # XPASS: 0 # ERROR: 0 ============================================================================ See tp/tests/test-suite.log Please report to bug-texinfo@gnu.org ============================================================================
make install
cd .. rm -rf texinfo-6.5/
Util-linux – Construire un système temporaire
Source : 5.34. Util-linux-2.33.1
Le paquet Util-linux contient différents outils.
cd $LFS/sources tar Jxvf util-linux-2.33.1.tar.xz cd util-linux-2.33.1/
./configure --prefix=/tools \ --without-python \ --disable-makeinstall-chown \ --without-systemdsystemunitdir \ --without-ncurses \ PKG_CONFIG=""
make
make install
cd .. rm -rf util-linux-2.33.1/
Xz – Construire un système temporaire
Source : 5.35. Xz-5.2.4
Le paquet Xz contient des programmes de compression et de décompression de fichiers. Il offre les possibilités des formats lzma et des formats de compression récents. La compression de fichiers textes avec xz donne un meilleur pourcentage de compression qu’avec les commandes gzip ou bzip2 traditionnelles.
cd $LFS/sources tar Jxvf xz-5.2.4.tar.xz cd xz-5.2.4/
./configure --prefix=/tools
make
make check
================== All 9 tests passed ==================
make install
cd .. rm -rf xz-5.2.4/
Suppression des symboles des fichiers objets
Source : 5.36. Supprimer les symboles des fichiers objets
du -sh /tools/lib/
546M /tools/lib/
strip --strip-debug /tools/lib/*
du -sh /tools/lib/
330M /tools/lib/
du -sh /tools/{,s}bin/
354M /tools/bin/ 22M /tools/sbin/
/usr/bin/strip --strip-unneeded /tools/{,s}bin/*
du -sh /tools/{,s}bin/
79M /tools/bin/ 3.9M /tools/sbin/
du -sh /tools/
1.8G /tools/
rm -rf /tools/{,share}/{info,man,doc}
du -sh /tools/
1.7G /tools/
find /tools/{lib,libexec} -name \*.la -delete
Changement de propriétaire
Source : 5.37. Changer de propriétaire
chown -R root:root $LFS/tools