LFS – Construction du système LFS

LFS

Site officiel : Linux From Scratch



Cette phase doit absolument être exécutée en tant que super-utilisateur root.


Préparation des systèmes de fichiers virtuels du noyau

Source : 6.2. Préparer les systèmes de fichiers virtuels du noyau

Ces systèmes de fichiers sont virtuels du fait qu’aucun espace disque n’est utilisé pour eux.
Le contenu de ces systèmes de fichiers réside en mémoire.

mkdir -pv $LFS/{dev,proc,sys,run}
mkdir: created directory '/mnt/lfs/dev'
mkdir: created directory '/mnt/lfs/proc'
mkdir: created directory '/mnt/lfs/sys'
mkdir: created directory '/mnt/lfs/run'
mknod -m 600 $LFS/dev/console c 5 1
mknod -m 666 $LFS/dev/null c 1 3
mount -v --bind /dev $LFS/dev
mount: /dev bound on /mnt/lfs/dev.
mount -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620
mount: devpts mounted on /mnt/lfs/dev/pts.
mount -vt proc proc $LFS/proc
mount: proc mounted on /mnt/lfs/proc.
mount -vt sysfs sysfs $LFS/sys
mount: sysfs mounted on /mnt/lfs/sys.
mount -vt tmpfs tmpfs $LFS/run
mount: tmpfs mounted on /mnt/lfs/run.
if [ -h $LFS/dev/shm ]; then
    mkdir -pv $LFS/$(readlink $LFS/dev/shm)
fi

Entrer dans l’environnement chroot

Source : 6.4. Entrer dans l’environnement chroot

chroot "$LFS" /tools/bin/env -i \
    HOME=/root                  \
    TERM="$TERM"                \
    PS1='(lfs chroot) \u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
    /tools/bin/bash --login +h
(lfs chroot) I have no name!:/#
env
PWD=/
HOME=/root
TERM=xterm-256color
SHLVL=1
PS1=(lfs chroot) \u:\w\$ 
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin
_=/tools/bin/env
pwd
/
ls -l
total 29
drwxr-xr-x   3    0 0  1024 May 30 12:28 boot
drwxr-xr-x  17    0 0  3160 Jun  4 06:48 dev
drwxr-xr-x   3    0 0  4096 May 30 12:29 home
drwx------   2    0 0 16384 May 30 12:29 lost+found
dr-xr-xr-x 161    0 0     0 Jun  4 06:48 proc
drwxrwxrwt   2    0 0    40 Jun  4 15:58 run
drwxrwxrwt   2 1001 0  4096 Jun  4 14:04 sources
dr-xr-xr-x  13    0 0     0 Jun  4 06:48 sys
drwxr-xr-x  12    0 0  4096 Jun  4 14:25 tools
mkdir -pv /{bin,boot,etc/{opt,sysconfig},home,lib/firmware,mnt,opt}
mkdir: created directory '/bin'
mkdir: created directory '/etc'
mkdir: created directory '/etc/opt'
mkdir: created directory '/etc/sysconfig'
mkdir: created directory '/lib'
mkdir: created directory '/lib/firmware'
mkdir: created directory '/mnt'
mkdir: created directory '/opt'
mkdir -pv /{media/{floppy,cdrom},sbin,srv,var}
mkdir: created directory '/media'
mkdir: created directory '/media/floppy'
mkdir: created directory '/media/cdrom'
mkdir: created directory '/sbin'
mkdir: created directory '/srv'
mkdir: created directory '/var'
install -dv -m 0750 /root
install: creating directory '/root'
install -dv -m 1777 /tmp /var/tmp
install: creating directory '/tmp'
install: creating directory '/var/tmp'
mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src}
mkdir: created directory '/usr'
mkdir: created directory '/usr/bin'
mkdir: created directory '/usr/include'
mkdir: created directory '/usr/lib'
mkdir: created directory '/usr/sbin'
mkdir: created directory '/usr/src'
mkdir: created directory '/usr/local'
mkdir: created directory '/usr/local/bin'
mkdir: created directory '/usr/local/include'
mkdir: created directory '/usr/local/lib'
mkdir: created directory '/usr/local/sbin'
mkdir: created directory '/usr/local/src'
mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man}
mkdir: created directory '/usr/share'
mkdir: created directory '/usr/share/color'
mkdir: created directory '/usr/share/dict'
mkdir: created directory '/usr/share/doc'
mkdir: created directory '/usr/share/info'
mkdir: created directory '/usr/share/locale'
mkdir: created directory '/usr/share/man'
mkdir: created directory '/usr/local/share'
mkdir: created directory '/usr/local/share/color'
mkdir: created directory '/usr/local/share/dict'
mkdir: created directory '/usr/local/share/doc'
mkdir: created directory '/usr/local/share/info'
mkdir: created directory '/usr/local/share/locale'
mkdir: created directory '/usr/local/share/man'
mkdir -v  /usr/{,local/}share/{misc,terminfo,zoneinfo}
mkdir: created directory '/usr/share/misc'
mkdir: created directory '/usr/share/terminfo'
mkdir: created directory '/usr/share/zoneinfo'
mkdir: created directory '/usr/local/share/misc'
mkdir: created directory '/usr/local/share/terminfo'
mkdir: created directory '/usr/local/share/zoneinfo'
mkdir -v  /usr/libexec
mkdir: created directory '/usr/libexec'
mkdir -pv /usr/{,local/}share/man/man{1..8}
mkdir: created directory '/usr/share/man/man1'
mkdir: created directory '/usr/share/man/man2'
mkdir: created directory '/usr/share/man/man3'
mkdir: created directory '/usr/share/man/man4'
mkdir: created directory '/usr/share/man/man5'
mkdir: created directory '/usr/share/man/man6'
mkdir: created directory '/usr/share/man/man7'
mkdir: created directory '/usr/share/man/man8'
mkdir: created directory '/usr/local/share/man/man1'
mkdir: created directory '/usr/local/share/man/man2'
mkdir: created directory '/usr/local/share/man/man3'
mkdir: created directory '/usr/local/share/man/man4'
mkdir: created directory '/usr/local/share/man/man5'
mkdir: created directory '/usr/local/share/man/man6'
mkdir: created directory '/usr/local/share/man/man7'
mkdir: created directory '/usr/local/share/man/man8'
case $(uname -m) in
    x86_64) mkdir -v /lib64 ;;
esac
mkdir: created directory '/lib64'
mkdir -v /var/{log,mail,spool}
mkdir: created directory '/var/log'
mkdir: created directory '/var/mail'
mkdir: created directory '/var/spool'
ln -sv /run /var/run
'/var/run' -> '/run'
ln -sv /run/lock /var/lock
'/var/lock' -> '/run/lock'
mkdir -pv /var/{opt,cache,lib/{color,misc,locate},local}
mkdir: created directory '/var/opt'
mkdir: created directory '/var/cache'
mkdir: created directory '/var/lib'
mkdir: created directory '/var/lib/color'
mkdir: created directory '/var/lib/misc'
mkdir: created directory '/var/lib/locate'
mkdir: created directory '/var/local'
ls -l
total 81
drwxr-xr-x   2    0 0  4096 Jun  4 23:17 bin
drwxr-xr-x   3    0 0  1024 May 30 12:28 boot
drwxr-xr-x  17    0 0  3160 Jun  4 06:48 dev
drwxr-xr-x   4    0 0  4096 Jun  4 23:17 etc
drwxr-xr-x   3    0 0  4096 May 30 12:29 home
drwxr-xr-x   3    0 0  4096 Jun  4 23:17 lib
drwxr-xr-x   2    0 0  4096 Jun  4 23:31 lib64
drwx------   2    0 0 16384 May 30 12:29 lost+found
drwxr-xr-x   4    0 0  4096 Jun  4 23:18 media
drwxr-xr-x   2    0 0  4096 Jun  4 23:17 mnt
drwxr-xr-x   2    0 0  4096 Jun  4 23:17 opt
dr-xr-xr-x 161    0 0     0 Jun  4 06:48 proc
drwxr-x---   2    0 0  4096 Jun  4 23:20 root
drwxrwxrwt   2    0 0    40 Jun  4 15:58 run
drwxr-xr-x   2    0 0  4096 Jun  4 23:18 sbin
drwxrwxrwt   2 1001 0  4096 Jun  4 14:04 sources
drwxr-xr-x   2    0 0  4096 Jun  4 23:18 srv
dr-xr-xr-x  13    0 0     0 Jun  4 06:48 sys
drwxrwxrwt   2    0 0  4096 Jun  4 23:22 tmp
drwxr-xr-x  12    0 0  4096 Jun  4 14:25 tools
drwxr-xr-x  10    0 0  4096 Jun  4 23:27 usr
drwxr-xr-x  10    0 0  4096 Jun  4 23:35 var

Création des fichiers et des liens symboliques essentiels

Source : 6.6. Créer les fichiers et les liens symboliques essentiels

ln -sv /tools/bin/{bash,cat,chmod,dd,echo,ln,mkdir,pwd,rm,stty,touch} /bin
'/bin/bash' -> '/tools/bin/bash'
'/bin/cat' -> '/tools/bin/cat'
'/bin/chmod' -> '/tools/bin/chmod'
'/bin/dd' -> '/tools/bin/dd'
'/bin/echo' -> '/tools/bin/echo'
'/bin/ln' -> '/tools/bin/ln'
'/bin/mkdir' -> '/tools/bin/mkdir'
'/bin/pwd' -> '/tools/bin/pwd'
'/bin/rm' -> '/tools/bin/rm'
'/bin/stty' -> '/tools/bin/stty'
'/bin/touch' -> '/tools/bin/touch'
ln -sv /tools/bin/{env,install,perl,printf}         /usr/bin
'/usr/bin/env' -> '/tools/bin/env'
'/usr/bin/install' -> '/tools/bin/install'
'/usr/bin/perl' -> '/tools/bin/perl'
'/usr/bin/printf' -> '/tools/bin/printf'
ln -sv /tools/lib/libgcc_s.so{,.1}                  /usr/lib
'/usr/lib/libgcc_s.so' -> '/tools/lib/libgcc_s.so'
'/usr/lib/libgcc_s.so.1' -> '/tools/lib/libgcc_s.so.1'
ln -sv /tools/lib/libstdc++.{a,so{,.6}}             /usr/lib
'/usr/lib/libstdc++.a' -> '/tools/lib/libstdc++.a'
'/usr/lib/libstdc++.so' -> '/tools/lib/libstdc++.so'
'/usr/lib/libstdc++.so.6' -> '/tools/lib/libstdc++.so.6'
install -vdm755 /usr/lib/pkgconfig
install: creating directory '/usr/lib/pkgconfig'
ln -sv bash /bin/sh
'/bin/sh' -> 'bash'
ln -sv /proc/self/mounts /etc/mtab
'/etc/mtab' -> '/proc/self/mounts'
cat > /etc/passwd << "EOF"
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/dev/null:/bin/false
daemon:x:6:6:Daemon User:/dev/null:/bin/false
messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false
systemd-bus-proxy:x:72:72:systemd Bus Proxy:/:/bin/false
systemd-journal-gateway:x:73:73:systemd Journal Gateway:/:/bin/false
systemd-journal-remote:x:74:74:systemd Journal Remote:/:/bin/false
systemd-journal-upload:x:75:75:systemd Journal Upload:/:/bin/false
systemd-network:x:76:76:systemd Network Management:/:/bin/false
systemd-resolve:x:77:77:systemd Resolver:/:/bin/false
systemd-timesync:x:78:78:systemd Time Synchronization:/:/bin/false
systemd-coredump:x:79:79:systemd Core Dumper:/:/bin/false
nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
EOF
ls -l
total 81
drwxr-xr-x   2 root 0  4096 Jun  4 23:50 bin
drwxr-xr-x   3 root 0  1024 May 30 12:28 boot
drwxr-xr-x  17 root 0  3160 Jun  4 06:48 dev
drwxr-xr-x   4 root 0  4096 Jun  5 00:00 etc
drwxr-xr-x   3 root 0  4096 May 30 12:29 home
drwxr-xr-x   3 root 0  4096 Jun  4 23:17 lib
drwxr-xr-x   2 root 0  4096 Jun  4 23:31 lib64
drwx------   2 root 0 16384 May 30 12:29 lost+found
drwxr-xr-x   4 root 0  4096 Jun  4 23:18 media
drwxr-xr-x   2 root 0  4096 Jun  4 23:17 mnt
drwxr-xr-x   2 root 0  4096 Jun  4 23:17 opt
dr-xr-xr-x 161 root 0     0 Jun  4 06:48 proc
drwxr-x---   2 root 0  4096 Jun  4 23:20 root
drwxrwxrwt   2 root 0    40 Jun  4 15:58 run
drwxr-xr-x   2 root 0  4096 Jun  4 23:18 sbin
drwxrwxrwt   2 1001 0  4096 Jun  4 14:04 sources
drwxr-xr-x   2 root 0  4096 Jun  4 23:18 srv
dr-xr-xr-x  13 root 0     0 Jun  4 06:48 sys
drwxrwxrwt   2 root 0  4096 Jun  5 00:00 tmp
drwxr-xr-x  12 root 0  4096 Jun  4 14:25 tools
drwxr-xr-x  10 root 0  4096 Jun  4 23:27 usr
drwxr-xr-x  10 root 0  4096 Jun  4 23:35 var
cat > /etc/group << "EOF"
root:x:0:
bin:x:1:daemon
sys:x:2:
kmem:x:3:
tape:x:4:
tty:x:5:
daemon:x:6:
floppy:x:7:
disk:x:8:
lp:x:9:
dialout:x:10:
audio:x:11:
video:x:12:
utmp:x:13:
usb:x:14:
cdrom:x:15:
adm:x:16:
messagebus:x:18:
systemd-journal:x:23:
input:x:24:
mail:x:34:
kvm:x:61:
systemd-bus-proxy:x:72:
systemd-journal-gateway:x:73:
systemd-journal-remote:x:74:
systemd-journal-upload:x:75:
systemd-network:x:76:
systemd-resolve:x:77:
systemd-timesync:x:78:
systemd-coredump:x:79:
wheel:x:97:
nogroup:x:99:
users:x:999:
EOF
ls -l
total 81
drwxr-xr-x   2 root root  4096 Jun  4 23:50 bin
drwxr-xr-x   3 root root  1024 May 30 12:28 boot
drwxr-xr-x  17 root root  3160 Jun  4 06:48 dev
drwxr-xr-x   4 root root  4096 Jun  5 00:04 etc
drwxr-xr-x   3 root root  4096 May 30 12:29 home
drwxr-xr-x   3 root root  4096 Jun  4 23:17 lib
drwxr-xr-x   2 root root  4096 Jun  4 23:31 lib64
drwx------   2 root root 16384 May 30 12:29 lost+found
drwxr-xr-x   4 root root  4096 Jun  4 23:18 media
drwxr-xr-x   2 root root  4096 Jun  4 23:17 mnt
drwxr-xr-x   2 root root  4096 Jun  4 23:17 opt
dr-xr-xr-x 161 root root     0 Jun  4 06:48 proc
drwxr-x---   2 root root  4096 Jun  4 23:20 root
drwxrwxrwt   2 root root    40 Jun  4 15:58 run
drwxr-xr-x   2 root root  4096 Jun  4 23:18 sbin
drwxrwxrwt   2 1001 root  4096 Jun  4 14:04 sources
drwxr-xr-x   2 root root  4096 Jun  4 23:18 srv
dr-xr-xr-x  13 root root     0 Jun  4 06:48 sys
drwxrwxrwt   2 root root  4096 Jun  5 00:04 tmp
drwxr-xr-x  12 root root  4096 Jun  4 14:25 tools
drwxr-xr-x  10 root root  4096 Jun  4 23:27 usr
drwxr-xr-x  10 root root  4096 Jun  4 23:35 var
touch /var/log/{btmp,lastlog,faillog,wtmp}
chgrp -v utmp /var/log/lastlog
changed group of '/var/log/lastlog' from root to utmp
chmod -v 664  /var/log/lastlog
mode of '/var/log/lastlog' changed from 0644 (rw-r--r--) to 0664 (rw-rw-r--)
chmod -v 600  /var/log/btmp
mode of '/var/log/btmp' changed from 0644 (rw-r--r--) to 0600 (rw-------)

Linux API Headers – Construction du système LFS

Source : 6.7. Linux-4.20.12 API Headers

Les Linux API Headers montrent l’API du noyau pour qu’il soit utilisé par Glibc.

cd /sources/
tar Jxvf linux-4.20.12.tar.xz
cd linux-4.20.12/
make mrproper
make INSTALL_HDR_PATH=dest headers_install
find dest/include \( -name .install -o -name ..install.cmd \) -delete
cp -rv dest/include/* /usr/include
cd ..
rm -rf linux-4.20.12/

Man-pages – Construction du système LFS

Source : 6.8. Man-pages-4.16

cd sources/
tar Jxvf man-pages-4.16.tar.xz
cd man-pages-4.16/
make install
cd ..
rm -rf man-pages-4.16/

Glibc – Construction du système LFS

Source : 6.9. 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 sources/
tar Jxvf glibc-2.29.tar.xz
cd glibc-2.29/
patch -Np1 -i ../glibc-2.29-fhs-1.patch
patching file Makeconfig
Hunk #1 succeeded at 245 (offset -5 lines).
patching file nscd/nscd.h
Hunk #1 succeeded at 161 (offset 49 lines).
patching file nss/db-Makefile
patching file sysdeps/generic/paths.h
patching file sysdeps/unix/sysv/linux/paths.h
ln -sfv /tools/lib/gcc /usr/lib
'/usr/lib/gcc' -> '/tools/lib/gcc'
case $(uname -m) in
    i?86)   GCC_INCDIR=/usr/lib/gcc/$(uname -m)-pc-linux-gnu/8.2.0/include
            ln -sfv ld-linux.so.2 /lib/ld-lsb.so.3
    ;;
    x86_64) GCC_INCDIR=/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/include
            ln -sfv ../lib/ld-linux-x86-64.so.2 /lib64
            ln -sfv ../lib/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3
    ;;
esac
'/lib64/ld-linux-x86-64.so.2' -> '../lib/ld-linux-x86-64.so.2'
'/lib64/ld-lsb-x86-64.so.3' -> '../lib/ld-linux-x86-64.so.2'
rm -f /usr/include/limits.h
mkdir -v build
mkdir: created directory 'build'
cd build/
CC="gcc -isystem $GCC_INCDIR -isystem /usr/include" \
../configure --prefix=/usr                          \
             --disable-werror                       \
             --enable-kernel=3.2                    \
             --enable-stack-protector=strong        \
             libc_cv_slibdir=/lib
unset GCC_INCDIR
make
case $(uname -m) in
    i?86)   ln -sfnv $PWD/elf/ld-linux.so.2        /lib ;;
    x86_64) ln -sfnv $PWD/elf/ld-linux-x86-64.so.2 /lib ;;
esac
'/lib/ld-linux-x86-64.so.2' -> '/sources/glibc-2.29/build/elf/ld-linux-x86-64.so.2'
make check
Summary of test results:
      1 FAIL
   5962 PASS
     19 UNSUPPORTED
     17 XFAIL
      2 XPASS
touch /etc/ld.so.conf
sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
make install
cp -v ../nscd/nscd.conf /etc/nscd.conf
'../nscd/nscd.conf' -> '/etc/nscd.conf'
mkdir -pv /var/cache/nscd
mkdir: created directory '/var/cache/nscd'
install -v -Dm644 ../nscd/nscd.tmpfiles /usr/lib/tmpfiles.d/nscd.conf
install: creating directory '/usr/lib/tmpfiles.d'
'../nscd/nscd.tmpfiles' -> '/usr/lib/tmpfiles.d/nscd.conf'
install -v -Dm644 ../nscd/nscd.service /lib/systemd/system/nscd.service
install: creating directory '/lib/systemd'
install: creating directory '/lib/systemd/system'
'../nscd/nscd.service' -> '/lib/systemd/system/nscd.service'
mkdir -pv /usr/lib/locale
mkdir: created directory '/usr/lib/locale'
localedef -i POSIX -f UTF-8 C.UTF-8 2> /dev/null || true
localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8
localedef -i de_DE -f ISO-8859-1 de_DE
localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
localedef -i de_DE -f UTF-8 de_DE.UTF-8
localedef -i el_GR -f ISO-8859-7 el_GR
localedef -i en_GB -f UTF-8 en_GB.UTF-8
localedef -i en_HK -f ISO-8859-1 en_HK
localedef -i en_PH -f ISO-8859-1 en_PH
localedef -i en_US -f ISO-8859-1 en_US
localedef -i en_US -f UTF-8 en_US.UTF-8
localedef -i es_MX -f ISO-8859-1 es_MX
localedef -i fa_IR -f UTF-8 fa_IR
localedef -i fr_FR -f ISO-8859-1 fr_FR
localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
localedef -i fr_FR -f UTF-8 fr_FR.UTF-8
localedef -i it_IT -f ISO-8859-1 it_IT
localedef -i it_IT -f UTF-8 it_IT.UTF-8
localedef -i ja_JP -f EUC-JP ja_JP
localedef -i ja_JP -f SHIFT_JIS ja_JP.SIJS 2> /dev/null || true
localedef -i ja_JP -f UTF-8 ja_JP.UTF-8
localedef -i ru_RU -f KOI8-R ru_RU.KOI8-R
localedef -i ru_RU -f UTF-8 ru_RU.UTF-8
localedef -i tr_TR -f UTF-8 tr_TR.UTF-8
localedef -i zh_CN -f GB18030 zh_CN.GB18030
localedef -i zh_HK -f BIG5-HKSCS zh_HK.BIG5-HKSCS

Équivalent à :

make localedata/install-locales
cat > /etc/nsswitch.conf << "EOF"
# Begin /etc/nsswitch.conf

passwd: files
group: files
shadow: files

hosts: files dns
networks: files

protocols: files
services: files
ethers: files
rpc: files

# End /etc/nsswitch.conf
EOF
tar -zxvf ../../tzdata2018i.tar.gz
ZONEINFO=/usr/share/zoneinfo
mkdir -pv $ZONEINFO/{posix,right}
mkdir: created directory '/usr/share/zoneinfo/posix'
mkdir: created directory '/usr/share/zoneinfo/right'
for tz in etcetera southamerica northamerica europe africa antarctica  \
          asia australasia backward pacificnew systemv; do
    zic -L /dev/null   -d $ZONEINFO       ${tz}
    zic -L /dev/null   -d $ZONEINFO/posix ${tz}
    zic -L leapseconds -d $ZONEINFO/right ${tz}
done
cp -v zone.tab zone1970.tab iso3166.tab $ZONEINFO
'zone.tab' -> '/usr/share/zoneinfo/zone.tab'
'zone1970.tab' -> '/usr/share/zoneinfo/zone1970.tab'
'iso3166.tab' -> '/usr/share/zoneinfo/iso3166.tab'
zic -d $ZONEINFO -p America/New_York
unset ZONEINFO
tzselect
ln -sfv /usr/share/zoneinfo/Europe/Paris /etc/localtime
'/etc/localtime' -> '/usr/share/zoneinfo/Europe/Paris'
cat > /etc/ld.so.conf << "EOF"
# Debut de /etc/ld.so.conf
/usr/local/lib
/opt/lib

EOF
cat >> /etc/ld.so.conf << "EOF"
# Ajout d'un repertoire include
include /etc/ld.so.conf.d/*.conf

EOF
mkdir -pv /etc/ld.so.conf.d
mkdir: created directory '/etc/ld.so.conf.d'
cd ../..
rm -rf glibc-2.29/

Ajustement de la chaîne d’outils – Construction du système LFS

Source : 6.10. Ajustement de la chaîne d’outils

mv -v /tools/bin/{ld,ld-old}
renamed '/tools/bin/ld' -> '/tools/bin/ld-old'
mv -v /tools/$(uname -m)-pc-linux-gnu/bin/{ld,ld-old}
renamed '/tools/x86_64-pc-linux-gnu/bin/ld' -> '/tools/x86_64-pc-linux-gnu/bin/ld-old'
mv -v /tools/bin/{ld-new,ld}
renamed '/tools/bin/ld-new' -> '/tools/bin/ld'
ln -sv /tools/bin/ld /tools/$(uname -m)-pc-linux-gnu/bin/ld
'/tools/x86_64-pc-linux-gnu/bin/ld' -> '/tools/bin/ld'
gcc -dumpspecs | sed -e 's@/tools@@g'                   \
    -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
    -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' >      \
    `dirname $(gcc --print-libgcc-file-name)`/specs
echo 'int main(){}' > dummy.c
cc dummy.c -v -Wl,--verbose &> dummy.log
readelf -l a.out | grep ': /lib'
      [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log
/usr/lib/../lib/crt1.o succeeded
/usr/lib/../lib/crti.o succeeded
/usr/lib/../lib/crtn.o succeeded
grep -B1 '^ /usr/include' dummy.log
#include <...> search starts here:
 /usr/include
grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
SEARCH_DIR("=/tools/x86_64-pc-linux-gnu/lib64")
SEARCH_DIR("/usr/lib")
SEARCH_DIR("/lib")
SEARCH_DIR("=/tools/x86_64-pc-linux-gnu/lib");
grep "/lib.*/libc.so.6 " dummy.log
attempt to open /lib/libc.so.6 succeeded
grep found dummy.log
found ld-linux-x86-64.so.2 at /lib/ld-linux-x86-64.so.2
rm -v dummy.c a.out dummy.log
removed 'dummy.c'
removed 'a.out'
removed 'dummy.log'

Zlib – Construction du système LFS

Source : 6.11. Zlib-1.2.11

cd /sources/
tar Jxvf zlib-1.2.11.tar.xz
cd zlib-1.2.11/
./configure --prefix=/usr
make
make check
		*** zlib test OK ***
		*** zlib shared test OK ***
		*** zlib 64-bit test OK ***
make install
mv -v /usr/lib/libz.so.* /lib
renamed '/usr/lib/libz.so.1' -> '/lib/libz.so.1'
renamed '/usr/lib/libz.so.1.2.11' -> '/lib/libz.so.1.2.11'
ln -sfv ../../lib/$(readlink /usr/lib/libz.so) /usr/lib/libz.so
'/usr/lib/libz.so' -> '../../lib/libz.so.1.2.11'
cd ..
rm -rf zlib-1.2.11/

File – Construction du système LFS

Source : 6.12. File-5.36

Le paquet File contient un outil pour déterminer le type d’un fichier ou des fichiers donnés.

cd /sources/
tar zxvf file-5.36.tar.gz
cd file-5.36/
./configure --prefix=/usr
make
make check
make install
cd ..
rm -rf file-5.36/

Readline – Construction du système LFS

Source : 6.13. Readline-8.0

Le paquet Readline est un ensemble de bibliothèques qui offrent des fonctionnalités d’édition de la ligne de commande et d’historique.

cd /sources/
tar zxvf readline-8.0.tar.gz
cd readline-8.0/
sed -i '/MV.*old/d' Makefile.in
sed -i '/{OLDSUFF}/c:' support/shlib-install
./configure --prefix=/usr    \
            --disable-static \
            --docdir=/usr/share/doc/readline-8.0
make SHLIB_LIBS="-L/tools/lib -lncursesw"
make SHLIB_LIBS="-L/tools/lib -lncursesw" install
mv -v /usr/lib/lib{readline,history}.so.* /lib
renamed '/usr/lib/libreadline.so.8' -> '/lib/libreadline.so.8'
renamed '/usr/lib/libreadline.so.8.0' -> '/lib/libreadline.so.8.0'
renamed '/usr/lib/libhistory.so.8' -> '/lib/libhistory.so.8'
renamed '/usr/lib/libhistory.so.8.0' -> '/lib/libhistory.so.8.0'
chmod -v u+w /lib/lib{readline,history}.so.*
mode of '/lib/libreadline.so.8' retained as 0755 (rwxr-xr-x)
mode of '/lib/libreadline.so.8.0' retained as 0755 (rwxr-xr-x)
mode of '/lib/libhistory.so.8' retained as 0755 (rwxr-xr-x)
mode of '/lib/libhistory.so.8.0' retained as 0755 (rwxr-xr-x)
ln -sfv ../../lib/$(readlink /usr/lib/libreadline.so) /usr/lib/libreadline.so
'/usr/lib/libreadline.so' -> '../../lib/libreadline.so.8'
ln -sfv ../../lib/$(readlink /usr/lib/libhistory.so ) /usr/lib/libhistory.so
'/usr/lib/libreadline.so' -> '../../lib/libreadline.so.8'
install -v -m644 doc/*.{ps,pdf,html,dvi} /usr/share/doc/readline-8.0
'doc/history.ps' -> '/usr/share/doc/readline-8.0/history.ps'
'doc/history_3.ps' -> '/usr/share/doc/readline-8.0/history_3.ps'
'doc/readline.ps' -> '/usr/share/doc/readline-8.0/readline.ps'
'doc/readline_3.ps' -> '/usr/share/doc/readline-8.0/readline_3.ps'
'doc/rluserman.ps' -> '/usr/share/doc/readline-8.0/rluserman.ps'
'doc/history.pdf' -> '/usr/share/doc/readline-8.0/history.pdf'
'doc/readline.pdf' -> '/usr/share/doc/readline-8.0/readline.pdf'
'doc/rluserman.pdf' -> '/usr/share/doc/readline-8.0/rluserman.pdf'
'doc/history.html' -> '/usr/share/doc/readline-8.0/history.html'
'doc/readline.html' -> '/usr/share/doc/readline-8.0/readline.html'
'doc/rluserman.html' -> '/usr/share/doc/readline-8.0/rluserman.html'
'doc/history.dvi' -> '/usr/share/doc/readline-8.0/history.dvi'
'doc/readline.dvi' -> '/usr/share/doc/readline-8.0/readline.dvi'
'doc/rluserman.dvi' -> '/usr/share/doc/readline-8.0/rluserman.dvi'
cd ..
rm -rf readline-8.0/

M4 – Construction du système LFS

Source : 6.14. M4-1.4.18

Le paquet M4 contient un processeur de macros.

cd /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
./configure --prefix=/usr
make
make check
============================================================================
Testsuite summary for GNU M4 1.4.18
============================================================================
# TOTAL: 170
# PASS:  157
# SKIP:  13
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make install
cd ..
rm -rf m4-1.4.18/

Bc – Construction du système LFS

Source : 6.15. Bc-1.07.1

Le paquet Bc contient un langage de traitement des nombres à la précision de votre choix.

cd /sources/
tar zxvf bc-1.07.1.tar.gz
cd bc-1.07.1/
cat > bc/fix-libmath_h << "EOF"
#! /bin/bash
sed -e '1   s/^/{"/' \
    -e     's/$/",/' \
    -e '2,$ s/^/"/'  \
    -e   '$ d'       \
    -i libmath.h

sed -e '$ s/$/0}/' \
    -i libmath.h
EOF
ln -sv /tools/lib/libncursesw.so.6 /usr/lib/libncursesw.so.6
'/usr/lib/libncursesw.so.6' -> '/tools/lib/libncursesw.so.6'
ln -sfv libncursesw.so.6 /usr/lib/libncurses.so
'/usr/lib/libncurses.so' -> 'libncursesw.so.6'
sed -i -e '/flex/s/as_fn_error/: ;; # &/' configure
./configure --prefix=/usr           \
            --with-readline         \
            --mandir=/usr/share/man \
            --infodir=/usr/share/info
make
echo "quit" | ./bc/bc -l Test/checklib.b
make install
cd ..
rm -rf bc-1.07.1/

Binutils – Construction du système LFS

Source : 6.16. Binutils-2.32

Le paquet Binutils contient un éditeur de liens, un assembleur et d’autres outils pour gérer des fichiers objets.

cd /sources/
tar Jxvf binutils-2.32.tar.xz
cd binutils-2.32/
expect -c "spawn ls"
spawn ls
mkdir -v build
mkdir: created directory 'build'
cd build/
../configure --prefix=/usr       \
             --enable-gold       \
             --enable-ld=default \
             --enable-plugins    \
             --enable-shared     \
             --disable-werror    \
             --enable-64-bit-bfd \
             --with-system-zlib
make tooldir=/usr
make -k check
		=== ld Summary ===

# of expected passes		2340
# of unexpected failures	1
# of expected failures		57
# of untested testcases		1
# of unsupported tests		39
make tooldir=/usr install
cd ../..
rm -rf binutils-2.32/

GMP – Construction du système LFS

Source : 6.17. GMP-6.1.2

Le paquet GMP contient des bibliothèques de maths. Elles contiennent des fonctions utiles pour l’arithmétique à précision arbitraire.

cd /sources/
tar Jxvf gmp-6.1.2.tar.xz
cd gmp-6.1.2/
./configure --prefix=/usr    \
            --enable-cxx     \
            --disable-static \
            --docdir=/usr/share/doc/gmp-6.1.2
  Version:           GNU MP 6.1.2
  Host type:         sandybridge-pc-linux-gnu
  ABI:               64
  Install prefix:    /usr
  Compiler:          gcc
  Static libraries:  no
  Shared libraries:  yes
make
make html
make check 2>&1 | tee gmp-check-log
awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log
190
make install
make install-html
cd ..
rm -rf gmp-6.1.2/

MPFR – Construction du système LFS

Source : 6.18. MPFR-4.0.2

Le paquet MPFR contient des fonctions pour des maths à précision multiple.

cd /sources/
tar Jxvf mpfr-4.0.2.tar.xz
cd mpfr-4.0.2/
./configure --prefix=/usr        \
            --disable-static     \
            --enable-thread-safe \
            --docdir=/usr/share/doc/mpfr-4.0.2
make
make html
make check
make install
make install-html
cd ..
rm -rf mpfr-4.0.2/

MPC – Construction du système LFS

Source : 6.19. MPC-1.1.0

Le paquet MPC contient une bibliothèque pour le calcul arithmétique de nombres complexes avec une haute précision au choix et l’arrondissement correct du résultat.

cd /sources/
tar zxvf mpc-1.1.0.tar.gz
cd mpc-1.1.0/
./configure --prefix=/usr    \
            --disable-static \
            --docdir=/usr/share/doc/mpc-1.1.0
make
make html
make check
============================================================================
Testsuite summary for mpc 1.1.0
============================================================================
# TOTAL: 67
# PASS:  67
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make install
make install-html
cd ..
rm -rf mpc-1.1.0/

Shadow – Construction du système LFS

Source : 6.20. Shadow-4.6

Le paquet Shadow contient des programmes de gestion de mots de passe d’une façon sécurisée.

cd /sources/
tar Jxvf shadow-4.6.tar.xz
cd shadow-4.6/
sed -i 's/groups$(EXEEXT) //' src/Makefile.in
find man -name Makefile.in -exec sed -i 's/groups\.1 / /'   {} \;
find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \;
find man -name Makefile.in -exec sed -i 's/passwd\.5 / /'   {} \;
sed -i -e 's@#ENCRYPT_METHOD DES@ENCRYPT_METHOD SHA512@' \
       -e 's@/var/spool/mail@/var/mail@' etc/login.defs
sed -i 's/1000/999/' etc/useradd
2c2
< GROUP=1000
---
> GROUP=999
./configure --sysconfdir=/etc --with-group-name-max-length=32
shadow will be compiled with the following features:

	auditing support:		no
	CrackLib support:		no
	PAM support:			no
	SELinux support:		no
	ACL support:			no
	Extended Attributes support:	no
	tcb support (incomplete):	no
	shadow group support:		yes
	S/Key support:			no
	SHA passwords encryption:	yes
	nscd support:			yes
	subordinate IDs support:	yes
make
make install
mv -v /usr/bin/passwd /bin
renamed '/usr/bin/passwd' -> '/bin/passwd'
pwconv
grpconv
passwd root
Changing password for root
Enter the new password (minimum of 5 characters)
Please use a combination of upper and lower case letters and numbers.
New password: 
Bad password: too short.  
Warning: weak password (enter it again to use it anyway).
New password: 
Re-enter new password: 
passwd: password changed.
cd ..
rm -rf shadow-4.6/

GCC – Construction du système LFS

Source : 6.21. GCC-8.2.0

Le paquet GCC contient la collection de compilateurs GNU, qui inclut les compilateurs C et C++.

cd /sources/
tar Jxvf gcc-8.2.0.tar.xz
cd gcc-8.2.0/
case $(uname -m) in
    x86_64) sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64 ;;
esac
36c36
< MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
---
> MULTILIB_OSDIRNAMES = m64=../lib$(call if_multiarch,:x86_64-linux-gnu)
rm -f /usr/lib/gcc
mkdir -v build
mkdir: created directory 'build'
cd build/
SED=sed                               \
../configure --prefix=/usr            \
             --enable-languages=c,c++ \
             --disable-multilib       \
             --disable-bootstrap      \
             --disable-libmpx         \
             --with-system-zlib
make
ulimit -s 32768
rm ../gcc/testsuite/g++.dg/pr83239.C
chown -Rv nobody . 
su nobody -s /bin/bash -c "PATH=$PATH make -k check"
../contrib/test_summary
../contrib/test_summary | grep -A7 Summ
		=== g++ Summary ===

# of expected passes		125327
# of expected failures		 504
# of unsupported tests		4931

		=== gcc Summary ===

# of expected passes		130959
# of unexpected failures	     1
# of expected failures		 393
# of unsupported tests		2094

		=== libatomic Summary ===

# of expected passes		    54

		=== libgomp Summary ===

# of expected passes		  1837
# of unsupported tests		 192

		=== libitm Summary ===

# of expected passes		    42
# of expected failures		   3
# of unsupported tests		   1

		=== libstdc++ Summary ===

# of expected passes		 12193
# of unexpected failures	     6
# of expected failures		  71
# of unsupported tests		 306

Compiler version: 8.2.0 (GCC)
make install
ln -sv ../usr/bin/cpp /lib
'/lib/cpp' -> '../usr/bin/cpp'
ln -sv gcc /usr/bin/cc
'/usr/bin/cc' -> 'gcc'
install -v -dm755 /usr/lib/bfd-plugins
install: creating directory '/usr/lib/bfd-plugins'
ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/8.2.0/liblto_plugin.so \
        /usr/lib/bfd-plugins/
'/usr/lib/bfd-plugins/liblto_plugin.so' -> '../../libexec/gcc/x86_64-pc-linux-gnu/8.2.0/liblto_plugin.so'
echo 'int main(){}' > dummy.c
cc dummy.c -v -Wl,--verbose &> dummy.log
readelf -l a.out | grep ': /lib'
      [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../lib/crt1.o succeeded
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../lib/crti.o succeeded
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../lib/crtn.o succeeded
grep -B4 '^ /usr/include' dummy.log
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/include
 /usr/local/include
 /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/include-fixed
 /usr/include
grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64")
SEARCH_DIR("/usr/local/lib64")
SEARCH_DIR("/lib64")
SEARCH_DIR("/usr/lib64")
SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib")
SEARCH_DIR("/usr/local/lib")
SEARCH_DIR("/lib")
SEARCH_DIR("/usr/lib");
grep "/lib.*/libc.so.6 " dummy.log
attempt to open /lib/libc.so.6 succeeded
grep found dummy.log
found ld-linux-x86-64.so.2 at /lib/ld-linux-x86-64.so.2
rm -v dummy.c a.out dummy.log
removed 'dummy.c'
removed 'a.out'
removed 'dummy.log'
mkdir -pv /usr/share/gdb/auto-load/usr/lib
mkdir: created directory '/usr/share/gdb'
mkdir: created directory '/usr/share/gdb/auto-load'
mkdir: created directory '/usr/share/gdb/auto-load/usr'
mkdir: created directory '/usr/share/gdb/auto-load/usr/lib'
mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib
renamed '/usr/lib/libstdc++.so.6.0.25-gdb.py' -> '/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.25-gdb.py'
cd ../..
rm -rf gcc-8.2.0/

Bzip2 – Construction du système LFS

Source : 6.22. 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 /sources/
tar zxvf bzip2-1.0.6.tar.gz
cd bzip2-1.0.6/
patch -Np1 -i ../bzip2-1.0.6-install_docs-1.patch
patching file Makefile
sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
94,95c94,95
< 	ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
< 	ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
---
> 	ln -s -f bzgrep $(PREFIX)/bin/bzegrep
> 	ln -s -f bzgrep $(PREFIX)/bin/bzfgrep
98c98
< 	ln -s -f $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless
---
> 	ln -s -f bzmore $(PREFIX)/bin/bzless
101c101
< 	ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
---
> 	ln -s -f bzdiff $(PREFIX)/bin/bzcmp
sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile
75,76c75,76
< 	if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi
< 	if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi
---
> 	if ( test ! -d $(PREFIX)/share/man ) ; then mkdir -p $(PREFIX)/share/man ; fi
> 	if ( test ! -d $(PREFIX)/share/man/man1 ) ; then mkdir -p $(PREFIX)/share/man/man1 ; fi
87,88c87,88
< 	cp -f bzip2.1 $(PREFIX)/man/man1
< 	chmod a+r $(PREFIX)/man/man1/bzip2.1
---
> 	cp -f bzip2.1 $(PREFIX)/share/man/man1
> 	chmod a+r $(PREFIX)/share/man/man1/bzip2.1
103,110c103,110
< 	cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
< 	chmod a+r $(PREFIX)/man/man1/bzgrep.1
< 	chmod a+r $(PREFIX)/man/man1/bzmore.1
< 	chmod a+r $(PREFIX)/man/man1/bzdiff.1
< 	echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1
< 	echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1
< 	echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1
< 	echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
---
> 	cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/share/man/man1
> 	chmod a+r $(PREFIX)/share/man/man1/bzgrep.1
> 	chmod a+r $(PREFIX)/share/man/man1/bzmore.1
> 	chmod a+r $(PREFIX)/share/man/man1/bzdiff.1
> 	echo ".so man1/bzgrep.1" > $(PREFIX)/share/man/man1/bzegrep.1
> 	echo ".so man1/bzgrep.1" > $(PREFIX)/share/man/man1/bzfgrep.1
> 	echo ".so man1/bzmore.1" > $(PREFIX)/share/man/man1/bzless.1
> 	echo ".so man1/bzdiff.1" > $(PREFIX)/share/man/man1/bzcmp.1
make -f Makefile-libbz2_so
make clean
make
make PREFIX=/usr install
cp -v bzip2-shared /bin/bzip2
'bzip2-shared' -> '/bin/bzip2'
cp -av libbz2.so* /lib
'libbz2.so.1.0' -> '/lib/libbz2.so.1.0'
'libbz2.so.1.0.6' -> '/lib/libbz2.so.1.0.6'
ln -sv ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so
'/usr/lib/libbz2.so' -> '../../lib/libbz2.so.1.0'
rm -v /usr/bin/{bunzip2,bzcat,bzip2}
removed '/usr/bin/bunzip2'
removed '/usr/bin/bzcat'
removed '/usr/bin/bzip2'
ln -sv bzip2 /bin/bunzip2
'/bin/bunzip2' -> 'bzip2'
ln -sv bzip2 /bin/bzcat
'/bin/bzcat' -> 'bzip2'
cd ..
rm -rf bzip2-1.0.6/

Pkg-config – Construction du système LFS

Source : 6.23. Pkg-config-0.29.2

Le paquet pkg-config contient un outil pour passer le chemin include et les chemins des bibliothèques afin de construire les outils au moment de l’exécution de configure et de make file.

cd /sources/
tar zxvf pkg-config-0.29.2.tar.gz
cd pkg-config-0.29.2/
./configure --prefix=/usr              \
            --with-internal-glib       \
            --disable-host-tool        \
            --docdir=/usr/share/doc/pkg-config-0.29.2
make
make check
===================
All 30 tests passed
===================
make install
cd ..
rm -rf pkg-config-0.29.2/

Ncurses – Construction du système LFS

Source : 6.24. Ncurses-6.1

Le paquet Ncurses contient les bibliothèques de gestion des écrans type caractère, indépendant des terminaux.

cd /sources/
tar zxvf ncurses-6.1.tar.gz
cd ncurses-6.1/
sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in
65d64
< LIBTOOL_INSTALL	= @LIB_INSTALL@
./configure --prefix=/usr           \
            --mandir=/usr/share/man \
            --with-shared           \
            --without-debug         \
            --without-normal        \
            --enable-pc-files       \
            --enable-widec
** Configuration summary for NCURSES 6.1 20180127:

       extended funcs: yes
       xterm terminfo: xterm-new

        bin directory: /usr/bin
        lib directory: /usr/lib
    include directory: /usr/include
        man directory: /usr/share/man
   terminfo directory: /usr/share/terminfo
 pkg-config directory: /usr/lib/pkgconfig
make
make install
mv -v /usr/lib/libncursesw.so.6* /lib
renamed '/usr/lib/libncursesw.so.6' -> '/lib/libncursesw.so.6'
renamed '/usr/lib/libncursesw.so.6.1' -> '/lib/libncursesw.so.6.1'
ln -sfv ../../lib/$(readlink /usr/lib/libncursesw.so) /usr/lib/libncursesw.so
'/usr/lib/libncursesw.so' -> '../../lib/libncursesw.so.6'
for lib in ncurses form panel menu ; do
    rm -vf                    /usr/lib/lib${lib}.so
    echo "INPUT(-l${lib}w)" > /usr/lib/lib${lib}.so
    ln -sfv ${lib}w.pc        /usr/lib/pkgconfig/${lib}.pc
done
removed '/usr/lib/libncurses.so'
'/usr/lib/pkgconfig/ncurses.pc' -> 'ncursesw.pc'
'/usr/lib/pkgconfig/form.pc' -> 'formw.pc'
'/usr/lib/pkgconfig/panel.pc' -> 'panelw.pc'
'/usr/lib/pkgconfig/menu.pc' -> 'menuw.pc'
rm -vf /usr/lib/libcursesw.so
echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so
ln -sfv libncurses.so /usr/lib/libcurses.so
'/usr/lib/libcurses.so' -> 'libncurses.so'
mkdir -v /usr/share/doc/ncurses-6.1
mkdir: created directory '/usr/share/doc/ncurses-6.1'
cp -v -R doc/* /usr/share/doc/ncurses-6.1
cd ..
rm -rf ncurses-6.1/

Attr – Construction du système LFS

Source : 6.25. Attr-2.4.48

Le paquet attr contient des outils d’administration des attributs étendus des objets du système de fichier.

cd /sources/
tar zxvf attr-2.4.48.tar.gz
cd attr-2.4.48/
./configure --prefix=/usr     \
            --disable-static  \
            --sysconfdir=/etc \
            --docdir=/usr/share/doc/attr-2.4.48
make
make check
============================================================================
Testsuite summary for attr 2.4.48
============================================================================
# TOTAL: 2
# PASS:  2
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make install
mv -v /usr/lib/libattr.so.* /lib
renamed '/usr/lib/libattr.so.1' -> '/lib/libattr.so.1'
renamed '/usr/lib/libattr.so.1.1.2448' -> '/lib/libattr.so.1.1.2448'
ln -sfv ../../lib/$(readlink /usr/lib/libattr.so) /usr/lib/libattr.so
'/usr/lib/libattr.so' -> '../../lib/libattr.so.1.1.2448'
cd ..
rm -rf attr-2.4.48/

Acl – Construction du système LFS

Source : 6.26. Acl-2.2.53

Le paquet Acl contient des outils d’administration des Access Control Lists (listes de contrôle d’accès) qui sont utilisés pour définir plus finement des droits d’accès de votre choix aux fichiers et aux répertoires.

cd /sources/
tar zxvf acl-2.2.53.tar.gz
cd acl-2.2.53/
./configure --prefix=/usr         \
            --disable-static      \
            --libexecdir=/usr/lib \
            --docdir=/usr/share/doc/acl-2.2.53
make
make install
mv -v /usr/lib/libacl.so.* /lib
renamed '/usr/lib/libacl.so.1' -> '/lib/libacl.so.1'
renamed '/usr/lib/libacl.so.1.1.2253' -> '/lib/libacl.so.1.1.2253'
ln -sfv ../../lib/$(readlink /usr/lib/libacl.so) /usr/lib/libacl.so
'/usr/lib/libacl.so' -> '../../lib/libacl.so.1.1.2253'
cd ..
rm -rf acl-2.2.53/

Libcap – Construction du système LFS

Source : 6.27. Libcap-2.26

Le paquet Libcap implémente les interfaces du niveau utilisateur avec les fonctions POSIX 1003.1e disponibles dans les noyaux Linux. Ces possibilités établissent le partage des pouvoirs avec les privilèges root dans un ensemble de droits distincts.

cd /sources/
tar Jxvf libcap-2.26.tar.xz
cd libcap-2.26/
sed -i '/install.*STALIBNAME/d' libcap/Makefile
make
make RAISE_SETFCAP=no lib=lib prefix=/usr install
chmod -v 755 /usr/lib/libcap.so.2.26
mode of '/usr/lib/libcap.so.2.26' changed from 0644 (rw-r--r--) to 0755 (rwxr-xr-x)
mv -v /usr/lib/libcap.so.* /lib
renamed '/usr/lib/libcap.so.2' -> '/lib/libcap.so.2'
renamed '/usr/lib/libcap.so.2.26' -> '/lib/libcap.so.2.26'
ln -sfv ../../lib/$(readlink /usr/lib/libcap.so) /usr/lib/libcap.so
'/usr/lib/libcap.so' -> '../../lib/libcap.so.2'
cd ..
rm -rf libcap-2.26/

Sed – Construction du système LFS

Source : 6.28. Sed-4.7

Le paquet Sed contient un éditeur de flux.

cd /sources/
tar Jxvf sed-4.7.tar.xz
cd sed-4.7/
sed -i 's/usr/tools/' build-aux/help2man
1c1
< #!/usr/bin/env perl
---
> #!/tools/bin/env perl
sed -i 's/testsuite.panic-tests.sh//' Makefile.in
2075c2075
< 	testsuite/obinary.sh testsuite/panic-tests.sh \
---
> 	testsuite/obinary.sh  \
./configure --prefix=/usr --bindir=/bin
make
make html
make check
============================================================================
Testsuite summary for GNU sed 4.7
============================================================================
# TOTAL: 162
# PASS:  150
# SKIP:  12
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make install
install -d -m755 /usr/share/doc/sed-4.7
install -m644 doc/sed.html /usr/share/doc/sed-4.7
cd ..
rm -rf sed-4.7/

Psmisc – Construction du système LFS

Source : 6.29. Psmisc-23.2

Le paquet Psmisc contient des programmes pour afficher des informations sur les processus en cours d’exécution.

cd /sources/
tar Jxvf psmisc-23.2.tar.xz
cd psmisc-23.2/
./configure --prefix=/usr
make
make install
mv -v /usr/bin/fuser /bin
renamed '/usr/bin/fuser' -> '/bin/fuser'
mv -v /usr/bin/killall /bin
renamed '/usr/bin/killall' -> '/bin/killall'
cd ..
rm -rf psmisc-23.2/

Iana-Etc – Construction du système LFS

Source : 6.30. Iana-Etc-2.30

Le paquet Iana-Etc fournit des données pour les services et protocoles réseau.

cd /sources/
tar jxvf iana-etc-2.30.tar.bz2
cd iana-etc-2.30/
make
make install
cd ..
rm -rf iana-etc-2.30/

Bison – Construction du système LFS

Source : 6.31. Bison-3.3.2

Le paquet Bison contient un générateur d’analyseurs.

cd /sources/
tar Jxvf bison-3.3.2.tar.xz
cd bison-3.3.2/
./configure --prefix=/usr --docdir=/usr/share/doc/bison-3.3.2
make
make install
cd ..
rm -rf bison-3.3.2/

Flex – Construction du système LFS

Source : 6.32. Flex-2.6.4

Le paquet Flex contient un outil de génération de programmes reconnaissant des modèles de texte.

cd /sources/
tar zxvf flex-2.6.4.tar.gz
cd flex-2.6.4/
sed -i "/math.h/a #include <malloc.h>" src/flexdef.h
49a50
> #include <malloc.h>
HELP2MAN=/tools/bin/true \
./configure --prefix=/usr --docdir=/usr/share/doc/flex-2.6.4
make
make check
============================================================================
Testsuite summary for the fast lexical analyser generator 2.6.4
============================================================================
# TOTAL: 114
# PASS:  114
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make install
ln -s flex /usr/bin/lex
cd ..
rm -rf flex-2.6.4/

Grep – Construction du système LFS

Source : 6.33. Grep-3.3

Le paquet Grep contient des programmes de recherche à l’intérieur de fichiers.

cd /sources/
tar Jxvf grep-3.3.tar.xz
cd grep-3.3/
./configure --prefix=/usr --bindir=/bin
make
make -k check
============================================================================
Testsuite summary for GNU grep 3.3
============================================================================
# TOTAL: 173
# PASS:  165
# SKIP:  8
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make install
cd ..
rm -rf grep-3.3/

Bash – Construction du système LFS

Source : 6.34. Bash-5.0

Le paquet Bash contient le shell Bourne-Again.

cd /sources/
tar zxvf bash-5.0.tar.gz
cd bash-5.0/
./configure --prefix=/usr                    \
            --docdir=/usr/share/doc/bash-5.0 \
            --without-bash-malloc            \
            --with-installed-readline
make
chown -Rv nobody .
su nobody -s /bin/bash -c "PATH=$PATH HOME=/home make tests"
make install
mv -vf /usr/bin/bash /bin
renamed '/usr/bin/bash' -> '/bin/bash'
exec /bin/bash --login +h
cd ..
rm -rf bash-5.0/

Libtool – Construction du système LFS

Source : 6.35. Libtool-2.4.6

Le paquet Libtool contient le script de support de bibliothèques génériques GNU. Il emballe la complexité d’utilisation de bibliothèques partagées dans une interface cohérente et portable.

cd /sources/
tar Jxvf libtool-2.4.6.tar.xz
cd libtool-2.4.6/
./configure --prefix=/usr
make
make check
## ------------- ##
## Test results. ##
## ------------- ##

ERROR: 139 tests were run,
64 failed (59 expected failures).
31 tests were skipped.
## -------------------------- ##
## testsuite.log was created. ##
## -------------------------- ##

(Comparaison des logs)

make install
cd ..
rm -rf libtool-2.4.6/

GDBM – Construction du système LFS

Source : 6.36. GDBM-1.18.1

Le paquet GDBM contient le GNU Database Manager (GNU gestionnaire de bases de données) de GNU. C’est une bibliothèque de fonctions de base de données qui utilise du hachage extensible et qui fonctionne comme le dbm standard d’UNIX. La bibliothèque offre les bases pour stocker des pairs clés/données, chercher et extraire les données avec leur clé, effacer celles-ci ainsi que leurs données associées.

cd /sources/
tar zxvf gdbm-1.18.1.tar.gz
cd gdbm-1.18.1/
./configure --prefix=/usr    \
            --disable-static \
            --enable-libgdbm-compat
*******************************************************************
GDBM settings summary:

Compatibility library ......................... yes
Memory mapped I/O ............................. yes
GNU Readline .................................. yes
Debugging support ............................. no
*******************************************************************
make
make check
## ------------- ##
## Test results. ##
## ------------- ##

All 30 tests were successful.
make install
cd ..
rm -rf gdbm-1.18.1/

Gperf – Construction du système LFS

Source : 6.37. Gperf-3.1

Gperf génère une fonction de hachage parfait à partir d’un trousseau.

cd /sources/
tar zxvf gperf-3.1.tar.gz
cd gperf-3.1/
./configure --prefix=/usr --docdir=/usr/share/doc/gperf-3.1
make
make -j1 check
make install
cd ..
rm -rf gperf-3.1/

Expat – Construction du système LFS

Source : 6.38. Expat-2.2.6

Le paquet Expat contient une bibliothèque C orientée flux pour analyser de l’XML.

cd /sources/
tar jxvf expat-2.2.6.tar.bz2
cd expat-2.2.6/
sed -i 's|usr/bin/env |bin/|' run.sh.in
1c1
< #! /usr/bin/env bash
---
> #! /bin/bash
./configure --prefix=/usr    \
            --disable-static \
            --docdir=/usr/share/doc/expat-2.2.6
make
make check
============================================================================
Testsuite summary for expat 2.2.6
============================================================================
# TOTAL: 2
# PASS:  2
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make install
install -v -m644 doc/*.{html,png,css} /usr/share/doc/expat-2.2.6
'doc/reference.html' -> '/usr/share/doc/expat-2.2.6/reference.html'
'doc/expat.png' -> '/usr/share/doc/expat-2.2.6/expat.png'
'doc/valid-xhtml10.png' -> '/usr/share/doc/expat-2.2.6/valid-xhtml10.png'
'doc/style.css' -> '/usr/share/doc/expat-2.2.6/style.css'
cd ..
rm -rf expat-2.2.6/

Inetutils – Construction du système LFS

Source : 6.39. Inetutils-1.9.4

Le paquet Inetutils contient des programmes réseaux basiques.

cd /sources/
tar Jxvf inetutils-1.9.4.tar.xz
cd inetutils-1.9.4/
./configure --prefix=/usr        \
            --localstatedir=/var \
            --disable-logger     \
            --disable-whois      \
            --disable-rcp        \
            --disable-rexec      \
            --disable-rlogin     \
            --disable-rsh        \
            --disable-servers
make
make check
============================================================================
Testsuite summary for GNU inetutils 1.9.4
============================================================================
# TOTAL: 10
# PASS:  10
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make install
mv -v /usr/bin/{hostname,ping,ping6,traceroute} /bin
renamed '/usr/bin/hostname' -> '/bin/hostname'
renamed '/usr/bin/ping' -> '/bin/ping'
renamed '/usr/bin/ping6' -> '/bin/ping6'
renamed '/usr/bin/traceroute' -> '/bin/traceroute'
mv -v /usr/bin/ifconfig /sbin
renamed '/usr/bin/ifconfig' -> '/sbin/ifconfig'
cd ..
rm -rf inetutils-1.9.4/

Perl – Construction du système LFS

Source : 6.40. Perl-5.28.1

Le paquet Perl contient le langage pratique d’extraction et de rapport (Practical Extraction and Report Language).

cd /sources/
tar Jxvf perl-5.28.1.tar.xz
cd perl-5.28.1/
echo "127.0.0.1 localhost $(hostname)" > /etc/hosts
export BUILD_ZLIB=False
export BUILD_BZIP2=0
sh Configure -des -Dprefix=/usr                 \
                  -Dvendorprefix=/usr           \
                  -Dman1dir=/usr/share/man/man1 \
                  -Dman3dir=/usr/share/man/man3 \
                  -Dpager="/usr/bin/less -isR"  \
                  -Duseshrplib                  \
                  -Dusethreads
make
make -k test
[...]
ext/GDBM_File/t/fatal .......................................... #   Failed test 'Trapped error when attempting to write to knobbled GDBM_File'
#   at t/fatal.t line 37.
#          got: '1'
#     expected: undef
#   Failed test 'expected error message from GDBM_File'
#   at t/fatal.t line 46.
#                   ''
#     doesn't match '(?^: at .*\bfatal\.t line \d+\.\n\z)'
# Looks like you failed 2 tests of 8.
FAILED at test 7
[...]
Failed 1 test out of 2542, 99.96% okay.
	../ext/GDBM_File/t/fatal.t
[...]
make install
unset BUILD_ZLIB BUILD_BZIP2
cd ..
rm -rf perl-5.28.1/

XML::Parser – Construction du système LFS

Source : 6.41. XML::Parser-2.44

Le module XML::Parser est une interface Perl avec l’analyseur Expat de James Clark.

cd /sources/
tar zxvf XML-Parser-2.44.tar.gz
cd XML-Parser-2.44/
perl Makefile.PL
Checking if your kit is complete...
Looks good
Warning: prerequisite LWP::UserAgent 0 not found.
Writing MYMETA.yml and MYMETA.json
Generating a Unix-style Makefile
Writing Makefile for XML::Parser
Writing MYMETA.yml and MYMETA.json
make
make test
All tests successful.
Files=15, Tests=141,  2 wallclock secs ( 0.07 usr  0.01 sys +  0.74 cusr  0.05 csys =  0.87 CPU)
Result: PASS
make install
cd ..
rm -rf XML-Parser-2.44/

Intltool – Construction du système LFS

Source : 6.42. Intltool-0.51.0

Le paquet Intltool est un outil d’internationalisation utilisé pour extraire des chaînes traduisibles à partir de fichiers sources.

cd /sources/
tar zxvf intltool-0.51.0.tar.gz
cd intltool-0.51.0/
sed -i 's:\\\${:\\\$\\{:' intltool-update.in
./configure --prefix=/usr
make
make check
============================================================================
Testsuite summary for intltool 0.51.0
============================================================================
# TOTAL: 1
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make install
install -v -Dm644 doc/I18N-HOWTO /usr/share/doc/intltool-0.51.0/I18N-HOWTO
install: creating directory '/usr/share/doc/intltool-0.51.0'
'doc/I18N-HOWTO' -> '/usr/share/doc/intltool-0.51.0/I18N-HOWTO'
cd ..
rm -rf intltool-0.51.0/

Autoconf – Construction du système LFS

Source : 6.43. Autoconf-2.69

Le paquet Autoconf contient des programmes produisant des scripts shell qui configurent automatiquement le code source.

cd /sources/
tar Jxvf autoconf-2.69.tar.xz
cd autoconf-2.69/
sed '361 s/{/\\{/' -i bin/autoscan.in
361c361
<       s/\${[^\}]*}//g;
---
>       s/\$\{[^\}]*}//g;
./configure --prefix=/usr
make
make check
## ------------- ##
## Test results. ##
## ------------- ##

ERROR: 450 tests were run,
137 failed (4 expected failures).
53 tests were skipped.
## -------------------------- ##
## testsuite.log was created. ##
## -------------------------- ##
make install
cd ..
rm -rf autoconf-2.69/

Automake – Construction du système LFS

Source : 6.44. Automake-1.16.1

Le paquet Automake contient des programmes de génération de Makefile à utiliser avec Autoconf.

cd /sources/
tar Jxvf automake-1.16.1.tar.xz
cd automake-1.16.1/
./configure --prefix=/usr --docdir=/usr/share/doc/automake-1.16.1
make
make -j4 check
============================================================================
Testsuite summary for GNU Automake 1.16.1
============================================================================
# TOTAL: 2904
# PASS:  2709
# SKIP:  156
# XFAIL: 39
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make install
cd ..
rm -rf automake-1.16.1/

Xz – Construction du système LFS

Source : 6.45. 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 /sources/
tar Jxvf xz-5.2.4.tar.xz
cd xz-5.2.4/
./configure --prefix=/usr    \
            --disable-static \
            --docdir=/usr/share/doc/xz-5.2.4
make
make check
==================
All 9 tests passed
==================
make install
mv -v /usr/bin/{lzma,unlzma,lzcat,xz,unxz,xzcat} /bin
renamed '/usr/bin/lzma' -> '/bin/lzma'
renamed '/usr/bin/unlzma' -> '/bin/unlzma'
renamed '/usr/bin/lzcat' -> '/bin/lzcat'
renamed '/usr/bin/xz' -> '/bin/xz'
renamed '/usr/bin/unxz' -> '/bin/unxz'
renamed '/usr/bin/xzcat' -> '/bin/xzcat'
mv -v /usr/lib/liblzma.so.* /lib
renamed '/usr/lib/liblzma.so.5' -> '/lib/liblzma.so.5'
renamed '/usr/lib/liblzma.so.5.2.4' -> '/lib/liblzma.so.5.2.4'
ln -svf ../../lib/$(readlink /usr/lib/liblzma.so) /usr/lib/liblzma.so
'/usr/lib/liblzma.so' -> '../../lib/liblzma.so.5.2.4'
cd ..
rm -rf xz-5.2.4/

Kmod – Construction du système LFS

Source : 6.46. Kmod-26

Le paquet Kmod contient des bibliothèques et des outils pour charger des modules du noyau.

cd /sources/
tar Jxvf kmod-26.tar.xz
cd kmod-26/
./configure --prefix=/usr          \
            --bindir=/bin          \
            --sysconfdir=/etc      \
            --with-rootlibdir=/lib \
            --with-xz              \
            --with-zlib
make
make install
for target in depmod insmod lsmod modinfo modprobe rmmod; do
  ln -sfv ../bin/kmod /sbin/$target
done
'/sbin/depmod' -> '../bin/kmod'
'/sbin/insmod' -> '../bin/kmod'
'/sbin/lsmod' -> '../bin/kmod'
'/sbin/modinfo' -> '../bin/kmod'
'/sbin/modprobe' -> '../bin/kmod'
'/sbin/rmmod' -> '../bin/kmod'
ln -sfv kmod /bin/lsmod
'/bin/lsmod' -> 'kmod'
cd ..
rm -rf kmod-26/

Gettext – Construction du système LFS

Source : 6.47. 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 /sources/
tar Jxvf gettext-0.19.8.1.tar.xz
cd gettext-0.19.8.1/
sed -i '/^TESTS =/d' gettext-runtime/tests/Makefile.in &&
sed -i 's/test-lock..EXEEXT.//' gettext-tools/gnulib-tests/Makefile.in
sed -e '/AppData/{N;N;p;s/\.appdata\./.metainfo./}' \
    -i gettext-tools/its/appdata.loc
./configure --prefix=/usr    \
            --disable-static \
            --docdir=/usr/share/doc/gettext-0.19.8.1
make
make check
make install
chmod -v 0755 /usr/lib/preloadable_libintl.so
mode of '/usr/lib/preloadable_libintl.so' changed from 0644 (rw-r--r--) to 0755 (rwxr-xr-x)
cd ..
rm -rf gettext-0.19.8.1/

Libelf – Construction du système LFS

Source : 6.48. Libelf de Elfutils-0.176

Libelf est une bibliothèque pour gérer les fichiers ELF (Executable and Linkable Format).

cd /sources/
tar jxvf elfutils-0.176.tar.bz2
cd elfutils-0.176/
./configure --prefix=/usr
make
make check
============================================================================
Testsuite summary for elfutils 0.176
============================================================================
# TOTAL: 205
# PASS:  202
# SKIP:  3
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make -C libelf install
install -vm644 config/libelf.pc /usr/lib/pkgconfig
'config/libelf.pc' -> '/usr/lib/pkgconfig/libelf.pc'
cd ..
rm -rf elfutils-0.176/

Libffi – Construction du système LFS

Source : 6.49. Libffi-3.2.1

La bibliothèque Libffi fournit une interface portable et haut-niveau pour diverses conventions d’appel. Cela permet au programmeur d’appeler des fonctions spécifiées par une interface d’appel décrite à l’exécution.

cd /sources/
tar zxvf libffi-3.2.1.tar.gz
cd libffi-3.2.1/
sed -e '/^includesdir/ s/$(libdir).*$/$(includedir)/' \
    -i include/Makefile.in
sed -e '/^includedir/ s/=.*$/=@includedir@/' \
    -e 's/^Cflags: -I${includedir}/Cflags:/' \
    -i libffi.pc.in
5c5
< includedir=${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
---
> includedir=@includedir@
11c11
< Cflags: -I${includedir}
---
> Cflags:
./configure --prefix=/usr --disable-static --with-gcc-arch=native
make
make check
		=== libffi Summary ===

# of expected passes		1870
make install
cd ..
rm -rf libffi-3.2.1/

OpenSSL – Construction du système LFS

Source : 6.50. OpenSSL-1.1.1a

Le paquet OpenSSL contient des outils et des bibliothèques de gestion en matière de cryptographie. Ils servent à fournir des fonctions cryptographiques à d’autres paquets, comme OpenSSH, des applications de messagerie électronique et des navigateurs Internet (pour accéder à des sites HTTPS).

cd /sources/
tar zxvf openssl-1.1.1a.tar.gz
cd openssl-1.1.1a/
./config --prefix=/usr         \
         --openssldir=/etc/ssl \
         --libdir=lib          \
         shared                \
         zlib-dynamic
make
make test
All tests successful.
sed -i '/INSTALL_LIBS/s/libcrypto.a libssl.a//' Makefile
38c38
< INSTALL_LIBS=libcrypto.a libssl.a
---
> INSTALL_LIBS=
make MANSUFFIX=ssl install
mv -v /usr/share/doc/openssl /usr/share/doc/openssl-1.1.1a
renamed '/usr/share/doc/openssl' -> '/usr/share/doc/openssl-1.1.1a'
cp -vfr doc/* /usr/share/doc/openssl-1.1.1a
cd ..
rm -rf openssl-1.1.1a/

Python – Construction du système LFS

Source : 6.51. 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 /sources/
tar Jxvf Python-3.7.2.tar.xz
cd Python-3.7.2/
./configure --prefix=/usr       \
            --enable-shared     \
            --with-system-expat \
            --with-system-ffi   \
            --with-ensurepip=yes
make
make install
chmod -v 755 /usr/lib/libpython3.7m.so
mode of '/usr/lib/libpython3.7m.so' changed from 0555 (r-xr-xr-x) to 0755 (rwxr-xr-x)
chmod -v 755 /usr/lib/libpython3.so
mode of '/usr/lib/libpython3.so' changed from 0555 (r-xr-xr-x) to 0755 (rwxr-xr-x)
install -v -dm755 /usr/share/doc/python-3.7.2/html
install: creating directory '/usr/share/doc/python-3.7.2'
install: creating directory '/usr/share/doc/python-3.7.2/html'
tar --strip-components=1  \
    --no-same-owner       \
    --no-same-permissions \
    -C /usr/share/doc/python-3.7.2/html \
    -xvf ../python-3.7.2-docs-html.tar.bz2
cd ..
rm -rf Python-3.7.2/

Ninja – Construction du système LFS

Source : 6.52. Ninja-1.9.0

Ninja est un petit système de construction qui met l’accent sur la rapidité.

cd /sources/
tar zxvf ninja-1.9.0.tar.gz
cd ninja-1.9.0/
export NINJAJOBS=4
sed -i '/int Guess/a \
  int   j = 0;\
  char* jobs = getenv( "NINJAJOBS" );\
  if ( jobs != NULL ) j = atoi( jobs );\
  if ( j > 0 ) return j;\
' src/ninja.cc
227a228,232
>   int   j = 0;
>   char* jobs = getenv( "NINJAJOBS" );
>   if ( jobs != NULL ) j = atoi( jobs );
>   if ( j > 0 ) return j;
> 
python3 configure.py --bootstrap
bootstrapping ninja...
warning: A compatible version of re2c (>= 0.11.3) was not found; changes to src/*.in.cc will not affect your build.
wrote build.ninja.
bootstrap complete.  rebuilding...
[26/26] LINK ninja
python3 configure.py
./ninja ninja_test
[18/18] LINK ninja_test
./ninja_test --gtest_filter=-SubprocessTest.SetWithLots
[245/245] ElideMiddle.ElideInTheMiddle
passed
install -vm755 ninja /usr/bin/
'ninja' -> '/usr/bin/ninja'
install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja
'misc/bash-completion' -> '/usr/share/bash-completion/completions/ninja'
install -vDm644 misc/zsh-completion  /usr/share/zsh/site-functions/_ninja
install: creating directory '/usr/share/zsh'
install: creating directory '/usr/share/zsh/site-functions'
'misc/zsh-completion' -> '/usr/share/zsh/site-functions/_ninja'
cd ..
rm -rf ninja-1.9.0/

Meson – Construction du système LFS

Source : 6.53. Meson-0.49.2

Meson est un système de construction libre destiné à être très rapide et, plus important, aussi facile à utiliser que possible.

cd /sources/
tar zxvf meson-0.49.2.tar.gz
cd meson-0.49.2/
python3 setup.py build
python3 setup.py install --root=dest
cp -rv dest/* /
cd ..
rm -rf meson-0.49.2/

Coreutils – Construction du système LFS

Source : 6.54. Coreutils-8.30

Le paquet Coreutils contient des outils pour afficher et configurer les caractéristiques basiques d’un système.

cd /sources/
tar Jxvf coreutils-8.30.tar.xz
cd coreutils-8.30/
patch -Np1 -i ../coreutils-8.30-i18n-1.patch
sed -i '/test.lock/s/^/#/' gnulib-tests/gnulib.mk
1277,1278c1277,1278
< TESTS += test-rwlock1 test-lock test-once1 test-once2
< check_PROGRAMS += test-rwlock1 test-lock test-once1 test-once2
---
> #TESTS += test-rwlock1 test-lock test-once1 test-once2
> #check_PROGRAMS += test-rwlock1 test-lock test-once1 test-once2
1280c1280
< test_lock_LDADD = $(LDADD) @LIBMULTITHREAD@ @YIELD_LIB@
---
> #test_lock_LDADD = $(LDADD) @LIBMULTITHREAD@ @YIELD_LIB@
1285c1285
< EXTRA_DIST += test-rwlock1.c test-lock.c test-once.c
---
> #EXTRA_DIST += test-rwlock1.c test-lock.c test-once.c
autoreconf -fiv
FORCE_UNSAFE_CONFIGURE=1 ./configure \
            --prefix=/usr            \
            --enable-no-install-program=kill,uptime
FORCE_UNSAFE_CONFIGURE=1 make
make NON_ROOT_USERNAME=nobody check-root
============================================================================
Testsuite summary for GNU coreutils 8.30
============================================================================
# TOTAL: 32
# PASS:  17
# SKIP:  15
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
echo "dummy:x:1000:nobody" >> /etc/group
33a34
> dummy:x:1000:nobody
chown -Rv nobody .
su nobody -s /bin/bash \
          -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check"
============================================================================
Testsuite summary for GNU coreutils 8.30
============================================================================
# TOTAL: 612
# PASS:  482
# SKIP:  129
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See ./tests/test-suite.log
Please report to bug-coreutils@gnu.org
============================================================================
sed -i '/dummy/d' /etc/group
34d33
< dummy:x:1000:nobody
make install
mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
renamed '/usr/bin/cat' -> '/bin/cat'
renamed '/usr/bin/chgrp' -> '/bin/chgrp'
renamed '/usr/bin/chmod' -> '/bin/chmod'
renamed '/usr/bin/chown' -> '/bin/chown'
renamed '/usr/bin/cp' -> '/bin/cp'
renamed '/usr/bin/date' -> '/bin/date'
renamed '/usr/bin/dd' -> '/bin/dd'
renamed '/usr/bin/df' -> '/bin/df'
renamed '/usr/bin/echo' -> '/bin/echo'
mv -v /usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} /bin
renamed '/usr/bin/false' -> '/bin/false'
renamed '/usr/bin/ln' -> '/bin/ln'
renamed '/usr/bin/ls' -> '/bin/ls'
renamed '/usr/bin/mkdir' -> '/bin/mkdir'
renamed '/usr/bin/mknod' -> '/bin/mknod'
renamed '/usr/bin/mv' -> '/bin/mv'
renamed '/usr/bin/pwd' -> '/bin/pwd'
renamed '/usr/bin/rm' -> '/bin/rm'
mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin
renamed '/usr/bin/rmdir' -> '/bin/rmdir'
renamed '/usr/bin/stty' -> '/bin/stty'
renamed '/usr/bin/sync' -> '/bin/sync'
renamed '/usr/bin/true' -> '/bin/true'
renamed '/usr/bin/uname' -> '/bin/uname'
mv -v /usr/bin/chroot /usr/sbin
renamed '/usr/bin/chroot' -> '/usr/sbin/chroot'
mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8
renamed '/usr/share/man/man1/chroot.1' -> '/usr/share/man/man8/chroot.8'
sed -i s/\"1\"/\"8\"/1 /usr/share/man/man8/chroot.8
mv -v /usr/bin/{head,nice,sleep,touch} /bin
renamed '/usr/bin/head' -> '/bin/head'
renamed '/usr/bin/nice' -> '/bin/nice'
renamed '/usr/bin/sleep' -> '/bin/sleep'
renamed '/usr/bin/touch' -> '/bin/touch'
cd ..
rm -rf coreutils-8.30/

Check – Construction du système LFS

Source : 6.55. Check-0.12.0

Check est un environnement de tests unitaires pour C.

cd /sources/
tar zxvf check-0.12.0.tar.gz
cd check-0.12.0/
./configure --prefix=/usr
make
make check
============================================================================
Testsuite summary for Check 0.12.0
============================================================================
# TOTAL: 9
# PASS:  9
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make install
sed -i '1 s/tools/usr/' /usr/bin/checkmk
1c1
< #! /tools/bin/gawk -f
---
> #! /usr/bin/gawk -f
cd ..
rm -rf check-0.12.0/

Diffutils – Construction du système LFS

Source : 6.56. Diffutils-3.7

Le paquet Diffutils contient les programmes montrant les différences entre fichiers ou répertoires.

cd /sources/
tar Jxvf diffutils-3.7.tar.xz
cd diffutils-3.7/
./configure --prefix=/usr
make
make check
============================================================================
Testsuite summary for GNU diffutils 3.7
============================================================================
# TOTAL: 173
# PASS:  160
# SKIP:  13
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make install
cd ..
rm -rf diffutils-3.7/

Gawk – Construction du système LFS

Source : 6.57. Gawk-4.2.1

Le paquet Gawk contient des programmes de manipulation de fichiers texte.

cd /sources/
tar Jxvf gawk-4.2.1.tar.xz
cd gawk-4.2.1/
sed -i 's/extras//' Makefile.in
268c268
< DIST_SUBDIRS = support . extension extras doc awklib po test
---
> DIST_SUBDIRS = support . extension  doc awklib po test
487c487
< SUBDIRS = support . $(am__append_1) extras doc awklib po test
---
> SUBDIRS = support . $(am__append_1)  doc awklib po test
./configure --prefix=/usr
make
make check
ALL TESTS PASSED
make install
mkdir -v /usr/share/doc/gawk-4.2.1
mkdir: created directory '/usr/share/doc/gawk-4.2.1'
cp -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-4.2.1
cd ..
rm -rf gawk-4.2.1/

Findutils – Construction du système LFS

Source : 6.58. 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 /sources/
tar zxvf findutils-4.6.0.tar.gz
cd findutils-4.6.0/
sed -i 's/test-lock..EXEEXT.//' tests/Makefile.in
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
./configure --prefix=/usr --localstatedir=/var/lib/locate
make
make check
make install
mv -v /usr/bin/find /bin
renamed '/usr/bin/find' -> '/bin/find'
sed -i 's|find:=${BINDIR}|find:=/bin|' /usr/bin/updatedb
216c216
< : ${find:=${BINDIR}/find}
---
> : ${find:=/bin/find}
cd ..
rm -rf findutils-4.6.0/

Groff – Construction du système LFS

Source : 6.59. Groff-1.22.4

Le paquet Groff contient des programmes de formatage de texte.

cd /sources/
tar zxvf groff-1.22.4.tar.gz
cd groff-1.22.4/
PAGE=A4 ./configure --prefix=/usr
make -j1
make install
cd ..
rm -rf groff-1.22.4/

GRUB – Construction du système LFS

Source : 6.60. GRUB-2.02

Le paquet Grub contient un chargeur de démarrage, le GRand Unified Bootloader.

cd /sources/
tar Jxvf grub-2.02.tar.xz
cd grub-2.02/
./configure --prefix=/usr          \
            --sbindir=/sbin        \
            --sysconfdir=/etc      \
            --disable-efiemu       \
            --disable-werror
*******************************************************
GRUB2 will be compiled with following components:
Platform: i386-pc
With devmapper support: No (need libdevmapper header)
With memory debugging: No
With disk cache statistics: No
With boot time statistics: No
efiemu runtime: No (explicitly disabled)
grub-mkfont: No (need freetype2 library)
grub-mount: No (need FUSE library)
starfield theme: No (No build-time grub-mkfont)
With libzfs support: No (need zfs library)
Build-time grub-mkfont: No (need freetype2 library)
Without unifont (no build-time grub-mkfont)
With liblzma from -llzma (support for XZ-compressed mips images)
*******************************************************
make
make install
mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions
renamed '/etc/bash_completion.d/grub' -> '/usr/share/bash-completion/completions/grub'
cd ..
rm -rf grub-2.02/

Less – Construction du système LFS

Source : 6.61. Less-530

Le paquet Less contient un visualisateur de fichiers texte.

cd /sources/
tar zxvf less-530.tar.gz
cd less-530/
./configure --prefix=/usr --sysconfdir=/etc
make
make install
cd ..
rm -rf less-530/

Gzip – Construction du système LFS

Source : 6.62. Gzip-1.10

Le paquet Gzip contient des programmes de compression et décompression de fichiers.

cd /sources/
tar Jxvf gzip-1.10.tar.xz
cd gzip-1.10/
./configure --prefix=/usr
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
mv -v /usr/bin/gzip /bin
renamed '/usr/bin/gzip' -> '/bin/gzip'
cd ..
rm -rf gzip-1.10/

IPRoute2 – Construction du système LFS

Source : 6.63. IPRoute2-4.20.0

Le paquet IPRoute2 contient des programmes pour le réseau, basique ou avancé, basé sur IPV4.

cd /sources/
tar Jxvf iproute2-4.20.0.tar.xz
cd iproute2-4.20.0/
sed -i /ARPD/d Makefile
25d24
< ARPDDIR?=/var/lib/arpd
93d91
< 	install -m 0755 -d $(DESTDIR)$(ARPDDIR)
rm -fv man/man8/arpd.8
removed 'man/man8/arpd.8'
sed -i 's/.m_ipt.o//' tc/Makefile
make
make DOCDIR=/usr/share/doc/iproute2-4.20.0 install
cd ..
rm -rf iproute2-4.20.0/

Kbd – Construction du système LFS

Source : 6.64. Kbd-2.0.4

Le paquet Kbd contient les fichiers de tables de caractères, les polices de la console et des outils pour le clavier.

cd /sources/
tar Jxvf kbd-2.0.4.tar.xz
cd kbd-2.0.4/
patch -Np1 -i ../kbd-2.0.4-backspace-1.patch
patching file data/keymaps/i386/dvorak/dvorak-l.map
patching file data/keymaps/i386/dvorak/dvorak-r.map
patching file data/keymaps/i386/fgGIod/tr_f-latin5.map
patching file data/keymaps/i386/qwerty/lt.l4.map
patching file data/keymaps/i386/qwerty/lt.map
patching file data/keymaps/i386/qwerty/no-latin1.map
patching file data/keymaps/i386/qwerty/ru1.map
patching file data/keymaps/i386/qwerty/ru2.map
patching file data/keymaps/i386/qwerty/ru-cp1251.map
patching file data/keymaps/i386/qwerty/ru-ms.map
patching file data/keymaps/i386/qwerty/ru_win.map
patching file data/keymaps/i386/qwerty/se-ir209.map
patching file data/keymaps/i386/qwerty/se-lat6.map
patching file data/keymaps/i386/qwerty/tr_q-latin5.map
patching file data/keymaps/i386/qwerty/ua.map
patching file data/keymaps/i386/qwerty/ua-utf.map
patching file data/keymaps/i386/qwerty/ua-utf-ws.map
patching file data/keymaps/i386/qwerty/ua-ws.map
sed -i 's/\(RESIZECONS_PROGS=\)yes/\1no/g' configure
15004,15005c15004,15005
< 	i?86*) RESIZECONS_PROGS=yes ;;
< 	x86_64*) RESIZECONS_PROGS=yes ;;
---
> 	i?86*) RESIZECONS_PROGS=no ;;
> 	x86_64*) RESIZECONS_PROGS=no ;;
sed -i 's/resizecons.8 //' docs/man/man8/Makefile.in
256c256
< dist_man_MANS = getkeycodes.8 kbdrate.8 resizecons.8 setkeycodes.8 \
---
> dist_man_MANS = getkeycodes.8 kbdrate.8 setkeycodes.8 \
PKG_CONFIG_PATH=/tools/lib/pkgconfig ./configure --prefix=/usr --disable-vlock
make
make check
==================
All 7 tests passed
==================
make install
mkdir -v /usr/share/doc/kbd-2.0.4
mkdir: created directory '/usr/share/doc/kbd-2.0.4'
cp -R -v docs/doc/* /usr/share/doc/kbd-2.0.4
cd ..
rm -rf kbd-2.0.4/

Libpipeline – Construction du système LFS

Source : 6.65. Libpipeline-1.5.1

Le paquet Libpipeline contient une bibliothèque pour manipuler des pipelines (tuyaux) de sous-processus de façon flexible et commode.

cd /sources/
tar zxvf libpipeline-1.5.1.tar.gz
cd libpipeline-1.5.1/
./configure --prefix=/usr
make
make check
============================================================================
Testsuite summary for libpipeline 1.5.1
============================================================================
# TOTAL: 7
# PASS:  7
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make install
cd ..
rm -rf libpipeline-1.5.1/

Make – Construction du système LFS

Source : 6.66. Make-4.2.1

Le paquet Make contient un programme pour compiler des paquets.

cd /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
211,217d210
< #if !defined __alloca && !defined __GNU_LIBRARY__
< 
< # ifdef	__GNUC__
< #  undef alloca
< #  define alloca(n)	__builtin_alloca (n)
< # else	/* Not GCC.  */
< #  ifdef HAVE_ALLOCA_H
219,229d211
< #  else	/* Not HAVE_ALLOCA_H.  */
< #   ifndef _AIX
< #    ifdef WINDOWS32
< #     include <malloc.h>
< #    else
< extern char *alloca ();
< #    endif /* WINDOWS32 */
< #   endif /* Not _AIX.  */
< #  endif /* sparc or HAVE_ALLOCA_H.  */
< # endif	/* GCC.  */
< 
232d213
< #endif
./configure --prefix=/usr
make
make PERL5LIB=$PWD/tests/ check
574 Tests in 119 Categories Complete ... No Failures
[...]
========================================================================
 Regression PASSED: GNU Make 4.2.1 (x86_64-pc-linux-gnu) built with gcc 
========================================================================
make install
cd ..
rm -rf make-4.2.1/

Patch – Construction du système LFS

Source : 6.67. 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 ..
tar Jxvf patch-2.7.6.tar.xz
cd patch-2.7.6/
./configure --prefix=/usr
make
make check
============================================================================
Testsuite summary for GNU patch 2.7.6
============================================================================
# TOTAL: 44
# PASS:  41
# SKIP:  1
# XFAIL: 2
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make install
cd ..
rm -rf patch-2.7.6/

Man-DB – Construction du système LFS

Source : 6.68. Man-DB-2.8.5

Le paquet Man-DB contient des programmes pour trouver et voir des pages de manuel.

cd /sources/
tar Jxvf man-db-2.8.5.tar.xz
cd man-db-2.8.5/
./configure --prefix=/usr                        \
            --docdir=/usr/share/doc/man-db-2.8.5 \
            --sysconfdir=/etc                    \
            --disable-setuid                     \
            --enable-cache-owner=bin             \
            --with-browser=/usr/bin/lynx         \
            --with-vgrind=/usr/bin/vgrind        \
            --with-grap=/usr/bin/grap
make
make check
============================================================================
Testsuite summary for man-db 2.8.5
============================================================================
# TOTAL: 26
# PASS:  25
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
make install
cd ..
rm -rf man-db-2.8.5/

Tar – Construction du système LFS

Source : 6.69. Tar-1.31

Le paquet Tar contient un programme d’archivage.

cd /sources/
tar Jxvf tar-1.31.tar.xz
cd tar-1.31/
sed -i 's/abort.*/FALLTHROUGH;/' src/extract.c
790c790
<       abort (); /* notreached */
---
>       FALLTHROUGH;
FORCE_UNSAFE_CONFIGURE=1  \
./configure --prefix=/usr \
            --bindir=/bin
make
make check
## ------------- ##
## Test results. ##
## ------------- ##

209 tests were successful.
20 tests were skipped.
make install
make -C doc install-html docdir=/usr/share/doc/tar-1.31
cd ..
rm -rf tar-1.31/

Texinfo – Construction du système LFS

Source : 6.70. Texinfo-6.5

Le paquet Texinfo contient des programmes de lecture, écriture et conversion des pages Info.

cd /sources/
tar Jxvf texinfo-6.5.tar.xz
cd texinfo-6.5/
sed -i '5481,5485 s/({/(\\{/' tp/Texinfo/Parser.pm
5481c5481
<     if ($line =~ /^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*/) {
---
>     if ($line =~ /^\s+@([[:alnum:]][[:alnum:]\-]*)(\{})?\s*/) {
5485c5485
<       $remaining =~ s/^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*(\@(c|comment)((\@|\s+).*)?)?//;
---
>       $remaining =~ s/^\s+@([[:alnum:]][[:alnum:]\-]*)(\{})?\s*(\@(c|comment)((\@|\s+).*)?)?//;
./configure --prefix=/usr --disable-static
make
make check
============================================================================
Testsuite summary for GNU Texinfo 6.5
============================================================================
# TOTAL: 1
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make install
make TEXMF=/usr/share/texmf install-tex
pushd /usr/share/info
rm -v dir
for f in *
    do install-info $f dir 2>/dev/null
done
popd
cd ..
rm -rf texinfo-6.5/

Vim – Construction du système LFS

Source : 6.71. Vim-8.1

Le paquet Vim contient un puissant éditeur de texte.

cd /sources/
tar jxvf vim-8.1.tar.bz2
cd vim81/
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
1380a1381
> #define SYS_VIMRC_FILE "/etc/vimrc"
./configure --prefix=/usr
make
LANG=en_US.UTF-8 make -j1 test &> vim-test.log
Executed 359 tests

Test results:
ALL DONE
make install
ln -sv vim /usr/bin/vi
'/usr/bin/vi' -> 'vim'
for L in  /usr/share/man/{,*/}man1/vim.1; do
    ln -sv vim.1 $(dirname $L)/vi.1
done
'/usr/share/man/man1/vi.1' -> 'vim.1'
'/usr/share/man/fr.ISO8859-1/man1/vi.1' -> 'vim.1'
'/usr/share/man/fr.UTF-8/man1/vi.1' -> 'vim.1'
'/usr/share/man/fr/man1/vi.1' -> 'vim.1'
'/usr/share/man/it.ISO8859-1/man1/vi.1' -> 'vim.1'
'/usr/share/man/it.UTF-8/man1/vi.1' -> 'vim.1'
'/usr/share/man/it/man1/vi.1' -> 'vim.1'
'/usr/share/man/ja/man1/vi.1' -> 'vim.1'
'/usr/share/man/pl.ISO8859-2/man1/vi.1' -> 'vim.1'
'/usr/share/man/pl.UTF-8/man1/vi.1' -> 'vim.1'
'/usr/share/man/pl/man1/vi.1' -> 'vim.1'
'/usr/share/man/ru.KOI8-R/man1/vi.1' -> 'vim.1'
'/usr/share/man/ru.UTF-8/man1/vi.1' -> 'vim.1'
ln -sv ../vim/vim81/doc /usr/share/doc/vim-8.1
'/usr/share/doc/vim-8.1' -> '../vim/vim81/doc'
cat > /etc/vimrc << "EOF"
" Begin /etc/vimrc

" Ensure defaults are set before customizing settings, not after
source $VIMRUNTIME/defaults.vim
let skip_defaults_vim=1 

set nocompatible
set backspace=2
set mouse=r
syntax on
if (&term == "xterm") || (&term == "putty")
    set background=dark
endif

" End /etc/vimrc
EOF
cd ..
rm -rf vim81/

Systemd – Construction du système LFS

Source : 6.72. Systemd-240

Le paquet Systemd contient des programmes pour contrôler le démarrage, l’exécution et l’arrêt du système.

cd /sources/
tar zxvf systemd-240.tar.gz
cd systemd-240/
patch -Np1 -i ../systemd-240-security_fixes-2.patch
ln -svf /tools/bin/true /usr/bin/xsltproc
'/usr/bin/xsltproc' -> '/tools/bin/true'
for file in /tools/lib/lib{blkid,mount,uuid}*; do
    ln -svf $file /usr/lib/
done
'/usr/lib/libblkid.a' -> '/tools/lib/libblkid.a'
'/usr/lib/libblkid.so' -> '/tools/lib/libblkid.so'
'/usr/lib/libblkid.so.1' -> '/tools/lib/libblkid.so.1'
'/usr/lib/libblkid.so.1.1.0' -> '/tools/lib/libblkid.so.1.1.0'
'/usr/lib/libmount.a' -> '/tools/lib/libmount.a'
'/usr/lib/libmount.so' -> '/tools/lib/libmount.so'
'/usr/lib/libmount.so.1' -> '/tools/lib/libmount.so.1'
'/usr/lib/libmount.so.1.1.0' -> '/tools/lib/libmount.so.1.1.0'
'/usr/lib/libuuid.a' -> '/tools/lib/libuuid.a'
'/usr/lib/libuuid.so' -> '/tools/lib/libuuid.so'
'/usr/lib/libuuid.so.1' -> '/tools/lib/libuuid.so.1'
'/usr/lib/libuuid.so.1.3.0' -> '/tools/lib/libuuid.so.1.3.0'
tar -xvf ../systemd-man-pages-240.tar.xz
sed '177,$ d' -i src/resolve/meson.build
sed -i 's/GROUP="render", //' rules/50-udev-default.rules.in
39,40c39,40
< SUBSYSTEM=="drm", KERNEL=="renderD*", GROUP="render", MODE="@GROUP_RENDER_MODE@"
< SUBSYSTEM=="kfd", GROUP="render", MODE="@GROUP_RENDER_MODE@"
---
> SUBSYSTEM=="drm", KERNEL=="renderD*", MODE="@GROUP_RENDER_MODE@"
> SUBSYSTEM=="kfd", MODE="@GROUP_RENDER_MODE@"
mkdir -p build
cd build/
PKG_CONFIG_PATH="/usr/lib/pkgconfig:/tools/lib/pkgconfig" \
LANG=en_US.UTF-8                   \
meson --prefix=/usr                \
      --sysconfdir=/etc            \
      --localstatedir=/var         \
      -Dblkid=true                 \
      -Dbuildtype=release          \
      -Ddefault-dnssec=no          \
      -Dfirstboot=false            \
      -Dinstall-tests=false        \
      -Dkill-path=/bin/kill        \
      -Dkmod-path=/bin/kmod        \
      -Dldconfig=false             \
      -Dmount-path=/bin/mount      \
      -Drootprefix=                \
      -Drootlibdir=/lib            \
      -Dsplit-usr=true             \
      -Dsulogin-path=/sbin/sulogin \
      -Dsysusers=false             \
      -Dumount-path=/bin/umount    \
      -Db_lto=false                \
      ..
LANG=en_US.UTF-8 ninja
LANG=en_US.UTF-8 ninja install
rm -rfv /usr/lib/rpm
removed '/usr/lib/rpm/macros.d/macros.systemd'
removed directory '/usr/lib/rpm/macros.d'
removed directory '/usr/lib/rpm'
rm -fv /usr/bin/xsltproc
removed '/usr/bin/xsltproc'
systemd-machine-id-setup
Initializing machine ID from random generator.
cat > /lib/systemd/systemd-user-sessions << "EOF"
#!/bin/bash
rm -f /run/nologin
EOF
chmod -v 755 /lib/systemd/systemd-user-sessions
mode of '/lib/systemd/systemd-user-sessions' changed from 0644 (rw-r--r--) to 0755 (rwxr-xr-x)
cd ../..
rm -rf systemd-240/

D-Bus – Construction du système LFS

Source : 6.73. D-Bus-1.12.12

D-Bus est un système de bus de messages, une manière simple pour les applications de se parler. D-Bus fournit un démon système (pour les événements comme « l’ajout de nouveaux matériels » ou le « changement de la file d’impression ») et un démon individuel à chaque utilisateur connecté (pour les besoins généraux de communication entre les processus des applications utilisateur). De plus, le bus des messages est construit sur la base d’un environnement de circulation des messages par communication directe, ce qui peut être utilisé par deux applications pour communiquer directement (sans passer par le démon de bus de messages).

cd /sources/
tar zxvf dbus-1.12.12.tar.gz
cd dbus-1.12.12/
./configure --prefix=/usr                       \
            --sysconfdir=/etc                   \
            --localstatedir=/var                \
            --disable-static                    \
            --disable-doxygen-docs              \
            --disable-xml-docs                  \
            --docdir=/usr/share/doc/dbus-1.12.12 \
            --with-console-auth-dir=/run/console
make
make install
mv -v /usr/lib/libdbus-1.so.* /lib
renamed '/usr/lib/libdbus-1.so.3' -> '/lib/libdbus-1.so.3'
renamed '/usr/lib/libdbus-1.so.3.19.9' -> '/lib/libdbus-1.so.3.19.9'
ln -sfv ../../lib/$(readlink /usr/lib/libdbus-1.so) /usr/lib/libdbus-1.so
'/usr/lib/libdbus-1.so' -> '../../lib/libdbus-1.so.3.19.9'
ln -sv /etc/machine-id /var/lib/dbus
'/var/lib/dbus/machine-id' -> '/etc/machine-id'
cd ..
rm -rf dbus-1.12.12/

Procps – Construction du système LFS

Source : 6.74. Procps-3.3.15

Le paquet Procps-ng contient des programmes pour surveiller les processus.

cd /sources/
tar Jxvf procps-ng-3.3.15.tar.xz
cd procps-ng-3.3.15/
./configure --prefix=/usr                            \
            --exec-prefix=                           \
            --libdir=/usr/lib                        \
            --docdir=/usr/share/doc/procps-ng-3.3.15 \
            --disable-static                         \
            --disable-kill                           \
            --with-systemd
make
sed -i -r 's|(pmap_initname)\\\$|\1|' testsuite/pmap.test/pmap.exp
63c63
< expect_pass $test "$pmap_initname\$"
---
> expect_pass $test "$pmap_initname"
67c67
< expect_pass $test "$pmap_initname\$"
---
> expect_pass $test "$pmap_initname"
sed -i '/set tty/d' testsuite/pkill.test/pkill.exp
12d11
< set tty [ get_tty ]
rm -v testsuite/pgrep.test/pgrep.exp
removed 'testsuite/pgrep.test/pgrep.exp'
make check
============================================================================
Testsuite summary for procps-ng 3.3.15
============================================================================
# TOTAL: 1
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make install
mv -v /usr/lib/libprocps.so.* /lib
renamed '/usr/lib/libprocps.so.7' -> '/lib/libprocps.so.7'
renamed '/usr/lib/libprocps.so.7.1.0' -> '/lib/libprocps.so.7.1.0'
ln -sfv ../../lib/$(readlink /usr/lib/libprocps.so) /usr/lib/libprocps.so
'/usr/lib/libprocps.so' -> '../../lib/libprocps.so.7.1.0'
cd ..
rm -rf procps-ng-3.3.15/

Util-linux – Construction du système LFS

Source : 6.75. Util-linux-2.33.1

Le paquet Util-linux contient différents outils. Parmi eux se trouvent des outils de gestion des systèmes de fichiers, de consoles, de partitions et des messages.

cd /sources/
tar Jxvf util-linux-2.33.1.tar.xz
cd util-linux-2.33.1/
mkdir -pv /var/lib/hwclock
mkdir: created directory '/var/lib/hwclock'
rm -vf /usr/include/{blkid,libmount,uuid}
./configure ADJTIME_PATH=/var/lib/hwclock/adjtime   \
            --docdir=/usr/share/doc/util-linux-2.33.1 \
            --disable-chfn-chsh  \
            --disable-login      \
            --disable-nologin    \
            --disable-su         \
            --disable-setpriv    \
            --disable-runuser    \
            --disable-pylibmount \
            --disable-static     \
            --without-python
make
chown -Rv nobody .
su nobody -s /bin/bash -c "PATH=$PATH make -k check"
---------------------------------------------------------------------
  All 200 tests PASSED
---------------------------------------------------------------------
make install

cd ..
rm -rf util-linux-2.33.1/

E2fsprogs – Construction du système LFS

Source : 6.76. E2fsprogs-1.44.5

Le paquet E2fsprogs contient les outils de gestion du système de fichiers ext2. Il supporte aussi les systèmes de fichiers journalisé ext3 et ext4.

cd /sources/
tar zxvf e2fsprogs-1.44.5.tar.gz
cd e2fsprogs-1.44.5/
mkdir -v build
mkdir: created directory 'build'
cd build/
../configure --prefix=/usr           \
             --bindir=/bin           \
             --with-root-prefix=""   \
             --enable-elf-shlibs     \
             --disable-libblkid      \
             --disable-libuuid       \
             --disable-uuidd         \
             --disable-fsck
make
make check
make install
make install-libs
chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a
mode of '/usr/lib/libcom_err.a' changed from 0444 (r--r--r--) to 0644 (rw-r--r--)
mode of '/usr/lib/libe2p.a' changed from 0444 (r--r--r--) to 0644 (rw-r--r--)
mode of '/usr/lib/libext2fs.a' changed from 0444 (r--r--r--) to 0644 (rw-r--r--)
mode of '/usr/lib/libss.a' changed from 0444 (r--r--r--) to 0644 (rw-r--r--)
gunzip -v /usr/share/info/libext2fs.info.gz
/usr/share/info/libext2fs.info.gz:	 79.7% -- replaced with /usr/share/info/libext2fs.info
install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info
makeinfo -o doc/com_err.info ../lib/et/com_err.texinfo
install -v -m644 doc/com_err.info /usr/share/info
'doc/com_err.info' -> '/usr/share/info/com_err.info'
install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.info
cd ../..
rm -rf e2fsprogs-1.44.5/

Suppression des symboles des fichiers objets

save_lib="ld-2.29.so libc-2.29.so libpthread-2.29.so libthread_db-1.0.so"
cd /lib
for LIB in $save_lib; do
    objcopy --only-keep-debug $LIB $LIB.dbg 
    strip --strip-unneeded $LIB
    objcopy --add-gnu-debuglink=$LIB.dbg $LIB 
done
save_usrlib="libquadmath.so.0.0.0 libstdc++.so.6.0.25
             libitm.so.1.0.0 libatomic.so.1.2.0"
cd /usr/lib
for LIB in $save_usrlib; do
    objcopy --only-keep-debug $LIB $LIB.dbg
    strip --strip-unneeded $LIB
    objcopy --add-gnu-debuglink=$LIB.dbg $LIB
done
unset LIB save_lib save_usrlib
exec /tools/bin/bash
/tools/bin/find /usr/lib -type f -name \*.a \
   -exec /tools/bin/strip --strip-debug {} ';'
/tools/bin/find /lib /usr/lib -type f \( -name \*.so* -a ! -name \*dbg \) \
   -exec /tools/bin/strip --strip-unneeded {} ';'
/tools/bin/find /{bin,sbin} /usr/{bin,sbin,libexec} -type f \
    -exec /tools/bin/strip --strip-all {} ';'

Nettoyage

rm -rf /tmp/*
exit
chroot "$LFS" /usr/bin/env -i          \
    HOME=/root TERM="$TERM"            \
    PS1='(lfs chroot) \u:\w\$ '        \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin \
    /bin/bash --login
rm -rf /tools
rm -f /usr/lib/lib{bfd,opcodes}.a
rm -f /usr/lib/libbz2.a
rm -f /usr/lib/lib{com_err,e2p,ext2fs,ss}.a
rm -f /usr/lib/libltdl.a
rm -f /usr/lib/libfl.a
rm -f /usr/lib/libz.a
find /usr/lib /usr/libexec -name \*.la -delete

Fermer le menu