linux:lfs

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
linux:lfs [2020/06/01 20:16] – créée phswlinux:lfs [2021/06/03 21:03] (Version actuelle) – [Linux From Scratch] fix link formatting phsw
Ligne 2: Ligne 2:
  
  
-[[http://fr.linuxfromscratch.org/view/lfs-systemd-stable/index.html]]+http://fr.linuxfromscratch.org/view/lfs-9.1-systemd-fr/index.html
  
 Fonctionnement général: à partir d'un système existant, on construit LFS sur une partition à côté du système existant. On pourra ensuite booter sur LFS situé sur la nouvelle partition. Fonctionnement général: à partir d'un système existant, on construit LFS sur une partition à côté du système existant. On pourra ensuite booter sur LFS situé sur la nouvelle partition.
Ligne 14: Ligne 14:
 ==== Prérequis du système hôte ==== ==== Prérequis du système hôte ====
  
-Exécuter le script fournit [[http://fr.linuxfromscratch.org/view/lfs-systemd-stable/chapter02/hostreqs.html|ici]].+Exécuter le script fournit [[http://fr.linuxfromscratch.org/view/lfs-systemd-stable/chapter02/hostreqs.html#__do_not_save__|ici]].
  
 Correction à apporter: Correction à apporter:
Ligne 45: Ligne 45:
 sudo mkdir -v $LFS/sources sudo mkdir -v $LFS/sources
 sudo chmod -v a+wt $LFS/sources sudo chmod -v a+wt $LFS/sources
-wget http://fr.linuxfromscratch.org/view/lfs-systemd-stable/wget-list+wget http://fr.linuxfromscratch.org/view/lfs-9.1-systemd-fr/wget-list
 sudo wget --input-file=wget-list --continue --directory-prefix=$LFS/sources sudo wget --input-file=wget-list --continue --directory-prefix=$LFS/sources
 </code> </code>
Ligne 93: Ligne 93:
 source ~/.bash_profile source ~/.bash_profile
 </code> </code>
 +
 +Si on redémarre la machine maintenant, il faut monter la partition dans ''$LFS'' et se connecter avec l'utilisateur ''lfs'', tout est déjà défini.
  
  
Ligne 318: Ligne 320:
 </code> </code>
  
 +
 +
 +====  Expect-5.45.4 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv expect5.45.4.tar.gz
 +cd expect5.45.4
 +cp -v 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
 +make SCRIPTS="" install
 +</code>
 +
 +
 +==== DejaGNU-1.6.2 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv dejagnu-1.6.2.tar.gz
 +cd dejagnu-1.6.2
 +./configure --prefix=/tools
 +make install
 +make check
 +</code>
 +
 +
 +==== M4-1.4.18 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv 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=/tools
 +make
 +make check
 +make install
 +</code>
 +
 +
 +==== Ncurses-6.2 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv ncurses-6.2.tar.gz
 +cd ncurses-6.2
 +sed -i s/mawk// configure
 +./configure --prefix=/tools \
 +            --with-shared   \
 +            --without-debug \
 +            --without-ada   \
 +            --enable-widec  \
 +            --enable-overwrite
 +make
 +make install
 +ln -s libncursesw.so /tools/lib/libncurses.so
 +</code>
 +
 +
 +==== Bash-5.0 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv 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
 +</code>
 +
 +
 +==== Bison-3.5.2 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv bison-3.5.2.tar.xz
 +cd bison-3.5.2
 +./configure --prefix=/tools
 +make
 +make check
 +make install
 +</code>
 +
 +
 +==== Bzip2-1.0.8 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv bzip2-1.0.8.tar.gz
 +cd bzip2-1.0.8
 +make -f Makefile-libbz2_so
 +make clean
 +make
 +make PREFIX=/tools install
 +cp -v bzip2-shared /tools/bin/bzip2
 +cp -av libbz2.so* /tools/lib
 +ln -sv libbz2.so.1.0 /tools/lib/libbz2.so
 +</code>
 +
 +
 +==== Coreutils-8.31 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv coreutils-8.31.tar.xz
 +cd coreutils-8.31
 +./configure --prefix=/tools --enable-install-program=hostname
 +make
 +make install
 +</code>
 +
 +
 +==== Diffutils-3.7 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv diffutils-3.7.tar.xz
 +cd diffutils-3.7
 +./configure --prefix=/tools
 +make
 +make install
 +</code>
 +
 +
 +==== File-5.38 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv file-5.38.tar.gz
 +cd file-5.38
 +make
 +make install
 +</code>
 +
 +
 +====  Findutils-4.7.0 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv findutils-4.7.0.tar.xz
 +cd findutils-4.7.0
 +./configure --prefix=/tools
 +make
 +make install
 +</code>
 +
 +
 +==== Gawk-5.0.1 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv gawk-5.0.1.tar.xz
 +cd gawk-5.0.1
 +./configure --prefix=/tools
 +make
 +make install
 +</code>
 +
 +
 +==== Gettext-0.20.1 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv gettext-0.20.1.tar.xz
 +cd gettext-0.20.1
 +make
 +cp -v gettext-tools/src/{msgfmt,msgmerge,xgettext} /tools/bin
 +</code>
 +
 +
 +==== Grep-3.4 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv grep-3.4.tar.xz
 +cd grep-3.4
 +./configure --prefix=/tools
 +make
 +make install
 +</code>
 +
 +
 +==== Gzip-1.10 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv gzip-1.10.tar.xz
 +cd gzip-1.10
 +./configure --prefix=/tools
 +make
 +make install
 +</code>
 +
 +
 +==== Make-4.3 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv make-4.3.tar.gz
 +cd make-4.3
 +./configure --prefix=/tools --without-guile
 +make
 +make install
 +</code>
 +
 +
 +==== Patch-2.7.6 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv patch-2.7.6.tar.xz
 +cd patch-2.7.6
 +./configure --prefix=/tools
 +make
 +make install
 +</code>
 +
 +
 +==== Perl-5.30.1 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv perl-5.30.1.tar.xz
 +cd perl-5.30.1
 +sh Configure -des -Dprefix=/tools -Dlibs=-lm -Uloclibpth -Ulocincpth
 +make
 +cp -v perl cpan/podlators/scripts/pod2man /tools/bin
 +mkdir -pv /tools/lib/perl5/5.30.1
 +cp -Rv lib/* /tools/lib/perl5/5.30.1
 +</code>
 +
 +
 +==== Python-3.8.1 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv Python-3.8.1.tar.xz
 +cd  Python-3.8.1
 +sed -i '/def add_multiarch_paths/a \        return' setup.py
 +./configure --prefix=/tools --without-ensurepip
 +make
 +make install
 +</code>
 +
 +
 +==== Sed-4.8 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv sed-4.8.tar.xz
 +cd sed-4.8
 +./configure --prefix=/tools
 +make
 +make install
 +</code>
 +
 +
 +==== Tar-1.32 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv tar-1.32.tar.xz
 +cd tar-1.32
 +./configure --prefix=/tools
 +make
 +make install
 +</code>
 +
 +
 +====  Texinfo-6.7 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv texinfo-6.7.tar.xz
 +cd texinfo-6.7
 +./configure --prefix=/tools
 +make
 +make install
 +</code>
 +
 +
 +==== Util-linux-2.35.1 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv util-linux-2.35.1.tar.xz
 +cd util-linux-2.35.1
 +./configure --prefix=/tools                \
 +            --without-python               \
 +            --disable-makeinstall-chown    \
 +            --without-systemdsystemunitdir \
 +            --without-ncurses              \
 +            PKG_CONFIG=""
 +make
 +make install
 +</code>
 +
 +
 +==== Xz-5.2.4 ====
 +
 +<code bash>
 +cd $LFS/sources/
 +tar xfv xz-5.2.4.tar.xz
 +cd xz-5.2.4
 +./configure --prefix=/tools
 +make
 +make install
 +</code>
 +
 +
 +==== Supprimer les symboles des fichiers objets ====
 +
 +<code bash>
 +strip --strip-debug /tools/lib/*
 +/usr/bin/strip --strip-unneeded /tools/{,s}bin/*
 +</code>
 +
 +
 +==== Changer de propriétaire ====
 +
 +En tant que root (ne pas oublie ''$LFS'' !)
 +<code bash>
 +chown -R root:root $LFS/tools
 +</code>
 +
 +
 +==== Préparer les systèmes de fichiers virtuels du noyau ====
 +
 +En tant que root:
 +<code bash>
 +mkdir -pv $LFS/{dev,proc,sys,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 -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620
 +mount -vt proc proc $LFS/proc
 +mount -vt sysfs sysfs $LFS/sys
 +mount -vt tmpfs tmpfs $LFS/run
 +</code>
 +
 +
 +==== Entrer dans l'environnement chroot ====
 +
 +<code bash>
 +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
 +</code>
 +
 +
 +====  Créer les répertoires ====
 +
 +<code bash>
 +mkdir -pv /{bin,boot,etc/{opt,sysconfig},home,lib/firmware,mnt,opt}
 +mkdir -pv /{media/{floppy,cdrom},sbin,srv,var}
 +install -dv -m 0750 /root
 +install -dv -m 1777 /tmp /var/tmp
 +mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src}
 +mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man}
 +mkdir -v  /usr/{,local/}share/{misc,terminfo,zoneinfo}
 +mkdir -v  /usr/libexec
 +mkdir -pv /usr/{,local/}share/man/man{1..8}
 +mkdir -v  /usr/lib/pkgconfig
 +
 +case $(uname -m) in
 + x86_64) mkdir -v /lib64 ;;
 +esac
 +
 +mkdir -v /var/{log,mail,spool}
 +ln -sv /run /var/run
 +ln -sv /run/lock /var/lock
 +mkdir -pv /var/{opt,cache,lib/{color,misc,locate},local}
 +</code>
 +
 +
 +==== Créer les fichiers et les liens symboliques essentiels ====
 +
 +<code bash>
 +ln -sv /tools/bin/{bash,cat,chmod,dd,echo,ln,mkdir,pwd,rm,stty,touch} /bin
 +ln -sv /tools/bin/{env,install,perl,printf}         /usr/bin
 +ln -sv /tools/lib/libgcc_s.so{,.1}                  /usr/lib
 +ln -sv /tools/lib/libstdc++.{a,so{,.6}}             /usr/lib
 +ln -sv bash /bin/sh
 +
 +ln -sv /proc/self/mounts /etc/mtab
 +
 +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
 +
 +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
 +
 +exec /tools/bin/bash --login +h
 +
 +touch /var/log/{btmp,lastlog,faillog,wtmp}
 +chgrp -v utmp /var/log/lastlog
 +chmod -v 664  /var/log/lastlog
 +chmod -v 600  /var/log/btmp
 +</code>
 +
 +
 +==== Linux-5.5.3 API Headers ====
 +
 +<code bash>
 +cd /sources/linux-5.5.3
 +make mrproper
 +make headers
 +find usr/include -name '.*' -delete
 +rm usr/include/Makefile
 +cp -rv usr/include/* /usr/include
 +</code>
 +
 +
 +==== Man-pages-5.05 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv man-pages-5.05.tar.xz
 +cd man-pages-5.05
 +make install
 +</code>
 +
 +
 +==== Glibc-2.31 ====
 +
 +<code bash>
 +cd /sources/glibc-2.31/
 +patch -Np1 -i ../glibc-2.31-fhs-1.patch
 +
 +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
 +
 +cd build
 +rm -rf *
 +
 +CC="gcc -ffile-prefix-map=/tools=/usr" \
 +../configure --prefix=/usr                          \
 +             --disable-werror                       \
 +             --enable-kernel=3.2                    \
 +             --enable-stack-protector=strong        \
 +             --with-headers=/usr/include            \
 +             libc_cv_slibdir=/lib
 +
 +make
 +
 +ln -sfnv $PWD/elf/ld-linux-x86-64.so.2 /lib
 +
 +make check
 +
 +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
 +mkdir -pv /var/cache/nscd
 +
 +install -v -Dm644 ../nscd/nscd.tmpfiles /usr/lib/tmpfiles.d/nscd.conf
 +install -v -Dm644 ../nscd/nscd.service /lib/systemd/system/nscd.service
 +
 +mkdir -pv /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
 +
 +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 -xf ../../tzdata2019c.tar.gz
 +ZONEINFO=/usr/share/zoneinfo
 +mkdir -pv $ZONEINFO/{posix,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
 +zic -d $ZONEINFO -p America/New_York
 +unset ZONEINFO
 +tzselect
 +ln -sfv /usr/share/zoneinfo/Europe/Paris /etc/localtime
 +
 +cat > /etc/ld.so.conf << "EOF"
 +# Début de /etc/ld.so.conf
 +/usr/local/lib
 +/opt/lib
 +
 +EOF
 +cat >> /etc/ld.so.conf << "EOF"
 +# Ajout d'un répertoire include
 +include /etc/ld.so.conf.d/*.conf
 +
 +EOF
 +mkdir -pv /etc/ld.so.conf.d
 +</code>
 +
 +
 +==== Ajustement de la chaîne d'outils ====
 +
 +<code bash>
 +mv -v /tools/bin/{ld,ld-old}
 +mv -v /tools/$(uname -m)-pc-linux-gnu/bin/{ld,ld-old}
 +mv -v /tools/bin/{ld-new,ld}
 +ln -sv /tools/bin/ld /tools/$(uname -m)-pc-linux-gnu/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
 +</code>
 +Faire certaines vérifications, cf le manuel.
 +
 +
 +==== Zlib-1.2.11 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv zlib-1.2.11.tar.xz
 +cd zlib-1.2.11
 +./configure --prefix=/usr
 +make
 +make install
 +mv -v /usr/lib/libz.so.* /lib
 +ln -sfv ../../lib/$(readlink /usr/lib/libz.so) /usr/lib/libz.so
 +</code>
 +
 +
 +==== Bzip2-1.0.8 ====
 +
 +<code bash>
 +cd /sources/bzip2-1.0.8/
 +
 +patch -Np1 -i ../bzip2-1.0.8-install_docs-1.patch
 +sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
 +sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile
 +
 +make clean
 +make -f Makefile-libbz2_so
 +make clean
 +make
 +make PREFIX=/usr install
 +
 +cp -v bzip2-shared /bin/bzip2
 +cp -av libbz2.so* /lib
 +ln -sv ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so
 +rm -v /usr/bin/{bunzip2,bzcat,bzip2}
 +ln -sv bzip2 /bin/bunzip2
 +ln -sv bzip2 /bin/bzcat
 +</code>
 +
 +
 +==== Xz-5.2.4 ====
 +
 +<code bash>
 +cd /sources/xz-5.2.4
 +./configure --prefix=/usr    \
 +            --disable-static \
 +            --docdir=/usr/share/doc/xz-5.2.4
 +make
 +make check
 +make install
 +mv -v   /usr/bin/{lzma,unlzma,lzcat,xz,unxz,xzcat} /bin
 +mv -v /usr/lib/liblzma.so.* /lib
 +ln -svf ../../lib/$(readlink /usr/lib/liblzma.so) /usr/lib/liblzma.so
 +</code>
 +
 +
 +==== File-5.38 ====
 +
 +<code bash>
 +cd /sources/file-5.38
 +./configure --prefix=/usr
 +make
 +make check
 +make install
 +</code>
 +
 +
 +====  Readline-8.0 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv 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
 +chmod -v u+w /lib/lib{readline,history}.so.*
 +ln -sfv ../../lib/$(readlink /usr/lib/libreadline.so) /usr/lib/libreadline.so
 +ln -sfv ../../lib/$(readlink /usr/lib/libhistory.so ) /usr/lib/libhistory.so
 +</code>
 +
 +
 +==== M4-1.4.18 ====
 +
 +<code bash>
 +cd /sources/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
 +make install
 +</code>
 +
 +
 +==== Bc-2.5.3 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv bc-2.5.3.tar.gz
 +cd bc-2.5.3
 +
 +PREFIX=/usr CC=gcc CFLAGS="-std=c99" ./configure.sh -G -O3
 +make
 +make test
 +make install
 +</code>
 +
 +
 +==== Binutils-2.34 ====
 +
 +<code bash>
 +cd /sources/binutils-2.34
 +
 +sed -i '/@\tincremental_copy/d' gold/testsuite/Makefile.in
 +
 +cd build/
 +rm -rf *
 +
 +../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
 +make tooldir=/usr install
 +</code>
 +
 +
 +==== GMP-6.2.0 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv gmp-6.2.0.tar.gz
 +cd gmp-6.2.0
 +
 +./configure --prefix=/usr    \
 +            --enable-cxx     \
 +            --disable-static \
 +            --docdir=/usr/share/doc/gmp-6.2.0
 +make
 +make check 2>&1 | tee gmp-check-log
 +awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log # >= 197
 +make install
 +</code>
 +
 +
 +==== MPFR-4.0.2 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv mpfr-4.0.2.tar.gz
 +cd mpfr-4.0.2
 +
 +./configure --prefix=/usr        \
 +            --disable-static     \
 +            --enable-thread-safe \
 +            --docdir=/usr/share/doc/mpfr-4.0.2
 +make
 +make check
 +make install
 +</code>
 +
 +
 +==== MPC-1.1.0 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv 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 check
 +make install
 +</code>
 +
 +
 +==== Attr-2.4.48 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv attr-2.4.48.tar.gz
 +cd attre-2.4.48
 +
 +./configure --prefix=/usr     \
 +            --disable-static  \
 +            --sysconfdir=/etc \
 +            --docdir=/usr/share/doc/attr-2.4.48
 +make
 +make check
 +make install
 +
 +mv -v /usr/lib/libattr.so.* /lib
 +ln -sfv ../../lib/$(readlink /usr/lib/libattr.so) /usr/lib/libattr.so
 +</code>
 +
 +
 +==== Acl-2.2.53 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv 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
 +</code>
 +
 +
 +==== Shadow-4.8.1 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv shadow-4.8.1.tar.gz
 +cd shadow-4.8.1
 +
 +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
 +
 +./configure --sysconfdir=/etc --with-group-name-max-length=32
 +make
 +make install
 +
 +pwconv
 +grpconv
 +
 +passwd root
 +</code>
 +
 +
 +==== GCC-9.2.0 ====
 +
 +<code bash>
 +cd /sources/gcc-9.2.0
 +
 +sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
 +sed -e '1161 s|^|//|' -i libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
 +
 +cd build
 +rm -rf *
 +
 +SED=sed                               \
 +../configure --prefix=/usr            \
 +             --enable-languages=c,c++ \
 +             --disable-multilib       \
 +             --disable-bootstrap      \
 +             --with-system-zlib
 +make
 +
 +ulimit -s 32768
 +chown -Rv nobody . 
 +su nobody -s /bin/bash -c "PATH=$PATH make -k check" # très très très long (plus de 4h), voir la doc pour interpréter le résultat
 +make install
 +rm -rf /usr/lib/gcc/$(gcc -dumpmachine)/9.2.0/include-fixed/bits/
 +chown -v -R root:root /usr/lib/gcc/*linux-gnu/9.2.0/include{,-fixed}
 +ln -sv ../usr/bin/cpp /lib
 +ln -sv gcc /usr/bin/cc
 +install -v -dm755 /usr/lib/bfd-plugins
 +ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/9.2.0/liblto_plugin.so /usr/lib/bfd-plugins/
 +
 +# vérifications, cf le manuel, j'ai eu besoin de faire:
 +gcc -dumpspecs > `dirname $(gcc --print-libgcc-file-name)`/specs
 +# et supprimer tous les '/tools' pour que l'interpréteur soit le bon
 +
 +mkdir -pv /usr/share/gdb/auto-load/usr/lib
 +mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib
 +</code>
 +
 +
 +==== Pkg-config-0.29.2 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv 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
 +make install
 +</code>
 +
 +
 +==== Ncurses-6.2 ====
 +
 +<code bash>
 +cd /sources/ncurses-6.2/
 +sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in
 +./configure --prefix=/usr           \
 +            --mandir=/usr/share/man \
 +            --with-shared           \
 +            --without-debug         \
 +            --without-normal        \
 +            --enable-pc-files       \
 +            --enable-widec
 +make
 +make install
 +
 +mv -v /usr/lib/libncursesw.so.6* /lib
 +ln -sfv ../../lib/$(readlink /usr/lib/libncursesw.so) /usr/lib/libncursesw.so
 +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
 +
 +rm -vf                     /usr/lib/libcursesw.so
 +echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so
 +ln -sfv libncurses.so      /usr/lib/libcurses.so
 +</code>
 +
 +
 +==== Libcap-2.31 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv libcap-2.31.tar.gz
 +cd libcap-2.31
 +
 +sed -i '/install.*STA...LIBNAME/d' libcap/Makefile
 +
 +make lib=lib
 +make test
 +make lib=lib install
 +
 +chmod -v 755 /lib/libcap.so.2.31
 +</code>
 +
 +
 +==== Sed-4.8 ====
 +
 +<code bash>
 +cd /sources/sed-4.8
 +
 +sed -i 's/usr/tools/'                 build-aux/help2man
 +sed -i 's/testsuite.panic-tests.sh//' Makefile.in
 +
 +./configure --prefix=/usr --bindir=/bin
 +make
 +make check
 +make install
 +install -d -m755           /usr/share/doc/sed-4.8
 +</code>
 +
 +
 +==== Psmisc-23.2 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv psmisc-23.2.tar.xz
 +cd psmisc-23.2
 +
 +./configure --prefix=/usr
 +make
 +make install
 +
 +mv -v /usr/bin/fuser   /bin
 +mv -v /usr/bin/killall /bin
 +</code>
 +
 +
 +==== Iana-Etc-2.30 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv iana-etc-2.30.tar.bz2
 +cd iana-etc-2.30/
 +
 +make
 +make install
 +</code>
 +
 +
 +==== Bison-3.5.2 ====
 +
 +<code bash>
 +cd /sources/bison-3.5.2
 +./configure --prefix=/usr --docdir=/usr/share/doc/bison-3.5.2
 +make
 +make install
 +</code>
 +
 +
 +==== Flex-2.6.4 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv flex-2.6.4.tar.gz
 +cd flex-2.6.4/
 +
 +sed -i "/math.h/a #include <malloc.h>" src/flexdef.h
 +
 +HELP2MAN=/tools/bin/true \
 +./configure --prefix=/usr --docdir=/usr/share/doc/flex-2.6.4
 +make
 +make check
 +make install
 +
 +ln -s flex /usr/bin/lex
 +</code>
 +
 +
 +==== Grep-3.4 ====
 +
 +<code bash>
 +cd /sources/grep-3.4
 +./configure --prefix=/usr --bindir=/bin
 +make
 +make check
 +make install
 +</code>
 +
 +
 +==== Bash-5.0 ====
 +
 +<code bash>
 +cd /sources/bash-5.0
 +
 +patch -Np1 -i ../bash-5.0-upstream_fixes-1.patch
 +
 +./configure --prefix=/usr                    \
 +            --docdir=/usr/share/doc/bash-5.0 \
 +            --without-bash-malloc            \
 +            --with-installed-readline
 +make
 +make install
 +mv -vf /usr/bin/bash /bin
 +
 +exec /bin/bash --login +h
 +</code>
 +
 +
 +====  Libtool-2.4.6 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv libtool-2.4.6.tar.xz
 +cd libtool-2.4.6/
 +
 +./configure --prefix=/usr
 +make
 +make install
 +</code>
 +
 +
 +==== GDBM-1.18.1 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv gdbm-1.18.1.tar.xz
 +cd gdbm-1.18.1/
 +
 +./configure --prefix=/usr    \
 +            --disable-static \
 +            --enable-libgdbm-compat
 +make
 +make check
 +make install
 +</code>
 +
 +
 +==== Gperf-3.1 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv 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
 +</code>
 +
 +
 +==== Expat-2.2.9 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv expat-2.2.9.tar.xz
 +cd expat-2.2.9/
 +
 +sed -i 's|usr/bin/env |bin/|' run.sh.in
 +
 +./configure --prefix=/usr    \
 +            --disable-static \
 +            --docdir=/usr/share/doc/expat-2.2.9
 +make
 +make check
 +make install
 +</code>
 +
 +
 +==== Inetutils-1.9.4 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv 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 install
 +
 +mv -v /usr/bin/{hostname,ping,ping6,traceroute} /bin
 +mv -v /usr/bin/ifconfig /sbin
 +</code>
 +
 +
 +==== Perl-5.30.1 ====
 +
 +<code bash>
 +cd /sources/
 +rm -rf perl-5.30.1
 +tar xfv perl-5.30.1.tar.xz
 +cd perl-5.30.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 install
 +unset BUILD_ZLIB BUILD_BZIP2
 +</code>
 +
 +
 +==== XML::Parser-2.46 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv XML-Parser-2.46.tar.gz
 +cd XML-Parser-2.46
 +
 +perl Makefile.PL
 +make
 +make test
 +make install
 +</code>
 +
 +
 +==== Intltool-0.51.0 ==== 
 +
 +<code bash>
 +cd /sources
 +tar xfv intltool-0.51.0.tar.gz
 +cd intltool-0.51.0
 +
 +sed -i 's:\\\${:\\\$\\{:' intltool-update.in
 +
 +./configure --prefix=/usr
 +make
 +make check
 +make install
 +install -v -Dm644 doc/I18N-HOWTO /usr/share/doc/intltool-0.51.0/I18N-HOWTO
 +</code>
 +
 +
 +==== Autoconf-2.69 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv autoconf-2.69.tar.xz
 +cd autoconf-2.69
 +
 +sed '361 s/{/\\{/' -i bin/autoscan.in
 +
 +./configure --prefix=/usr
 +make
 +make install
 +</code>
 +
 +
 +==== Automake-1.16.1 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv automake-1.16.1.tar.xz
 +cd automake-1.16.1
 +
 +./configure --prefix=/usr --docdir=/usr/share/doc/automake-1.16.1
 +make
 +make install
 +</code>
 +
 +
 +==== Kmod-26 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv 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
 +ln -sfv kmod /bin/lsmod
 +</code>
 +
 +
 +==== Gettext-0.20.1 ====
 +
 +<code bash>
 +cd /sources/gettext-0.20.1
 +./configure --prefix=/usr    \
 +            --disable-static \
 +            --docdir=/usr/share/doc/gettext-0.20.1
 +make
 +make install
 +chmod -v 0755 /usr/lib/preloadable_libintl.so
 +</code>
 +
 +
 +==== Libelf de Elfutils-0.178 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv elfutils-0.178.tar.bz2
 +cd elfutils-0.178
 +
 +./configure --prefix=/usr --disable-debuginfod
 +make
 +make -C libelf install
 +install -vm644 config/libelf.pc /usr/lib/pkgconfig
 +rm /usr/lib/libelf.a
 +</code>
 +
 +
 +==== Libffi-3.3 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv libffi-3.3.tar.gz
 +cd libffi-3.3
 +
 +./configure --prefix=/usr --disable-static --with-gcc-arch=native
 +make
 +make install
 +</code>
 +
 +
 +==== OpenSSL-1.1.1d ====
 +
 +<code bash>
 +cd /sources
 +tar xfv openssl-1.1.1.tar.gz
 +cd openssl-1.1.1d
 +
 +./config --prefix=/usr         \
 +         --openssldir=/etc/ssl \
 +         --libdir=lib          \
 +         shared                \
 +         zlib-dynamic
 +make
 +sed -i '/INSTALL_LIBS/s/libcrypto.a libssl.a//' Makefile
 +make MANSUFFIX=ssl install
 +</code>
 +
 +
 +==== Python-3.8.1 ====
 +
 +<code bash>
 +cd /sources/Python-3.8.1
 +./configure --prefix=/usr       \
 +            --enable-shared     \
 +            --with-system-expat \
 +            --with-system-ffi   \
 +            --with-ensurepip=yes
 +make
 +make install
 +chmod -v 755 /usr/lib/libpython3.8.so
 +chmod -v 755 /usr/lib/libpython3.so
 +ln -sfv pip3.8 /usr/bin/pip3
 +</code>
 +
 +
 +==== Ninja-1.10.0 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv ninja-1.10.0.tar.gz
 +cd ninja-1.10.0
 +
 +python3 configure.py --bootstrap
 +
 +install -vm755 ninja /usr/bin/
 +install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja
 +install -vDm644 misc/zsh-completion  /usr/share/zsh/site-functions/_ninja
 +</code>
 +
 +
 +==== Meson-0.53.1 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv meson-0.53.1.tar.gz
 +cd meson-0.53.1
 +
 +python3 setup.py build
 +python3 setup.py install --root=dest
 +cp -rv dest/* /
 +</code>
 +
 +
 +====  Coreutils-8.31 ====
 +
 +<code bash>
 +cd /sources/coreutils-8.31/
 +patch -Np1 -i ../coreutils-8.31-i18n-1.patch
 +sed -i '/test.lock/s/^/#/' gnulib-tests/gnulib.mk
 +autoreconf -fiv
 +
 +FORCE_UNSAFE_CONFIGURE=1 ./configure \
 +            --prefix=/usr            \
 +            --enable-no-install-program=kill,uptime
 +make
 +make install
 +
 +mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
 +mv -v /usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} /bin
 +mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin
 +mv -v /usr/bin/chroot /usr/sbin
 +mv -v /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
 +</code>
 +
 +
 +==== Check-0.14.0 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv check-0.14.0.tar.gz
 +cd check-0.14.0
 +
 +./configure --prefix=/usr
 +make
 +make docdir=/usr/share/doc/check-0.14.0 install &&
 +sed -i '1 s/tools/usr/' /usr/bin/checkmk
 +</code>
 +
 +
 +==== Diffutils-3.7 ====
 +
 +<code bash>
 +cd /sources/diffutils-3.7
 +./configure --prefix=/usr
 +make
 +make check
 +make install
 +</code>
 +
 +
 +==== Gawk-5.0.1 ====
 +
 +<code bash>
 +cd /sources/gawk-5.0.1
 +sed -i 's/extras//' Makefile.in
 +./configure --prefix=/usr
 +make
 +make check
 +make install
 +</code>
 +
 +
 +==== Findutils-4.7.0 ====
 +
 +<code bash>
 +cd /sources/findutils-4.7.0
 +./configure --prefix=/usr --localstatedir=/var/lib/locate
 +make
 +make install
 +
 +mv -v /usr/bin/find /bin
 +sed -i 's|find:=${BINDIR}|find:=/bin|' /usr/bin/updatedb
 +</code>
 +
 +
 +==== Groff-1.22.4 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv groff-1.22.4.tar.gz
 +cd groff-1.22.4
 +
 +PAGE=A4 ./configure --prefix=/usr
 +make -j1
 +make install
 +</code>
 +
 +
 +==== GRUB-2.04 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv grub-2.04.tar.xz
 +cd grub-2.04
 +
 +./configure --prefix=/usr          \
 +            --sbindir=/sbin        \
 +            --sysconfdir=/etc      \
 +            --disable-efiemu       \
 +            --disable-werror
 +make
 +make install
 +mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions
 +</code>
 +
 +
 +==== Less-551 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv less-551.tar.gz
 +cd less-551
 +
 +./configure --prefix=/usr --sysconfdir=/etc
 +make
 +make install
 +</code>
 +
 +
 +==== Gzip-1.10 ====
 +
 +<code bash>
 +cd /sources/gzip-1.10
 +./configure --prefix=/usr
 +make
 +make install
 +mv -v /usr/bin/gzip /bin
 +</code>
 +
 +
 +==== Zstd-1.4.4 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv zstd-1.4.4.tar.gz
 +cd zstd-1.4.4
 +
 +make
 +make prefix=/usr install
 +
 +rm -v /usr/lib/libzstd.a
 +mv -v /usr/lib/libzstd.so.* /lib
 +ln -sfv ../../lib/$(readlink /usr/lib/libzstd.so) /usr/lib/libzstd.so
 +</code>
 +
 +
 +==== IPRoute2-5.5.0 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv iproute2-5.5.0.tar.xz
 +cd iproute2-5.5.0
 +
 +sed -i /ARPD/d Makefile
 +rm -fv man/man8/arpd.8
 +sed -i 's/.m_ipt.o//' tc/Makefile
 +
 +make
 +make DOCDIR=/usr/share/doc/iproute2-5.5.0 install
 +</code>
 +
 +
 +==== Kbd-2.2.0 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv kbd-2.2.0.tar.xz
 +cd kbd-2.2.0
 +
 +patch -Np1 -i ../kbd-2.2.0-backspace-1.patch
 +sed -i 's/\(RESIZECONS_PROGS=\)yes/\1no/g' configure
 +sed -i 's/resizecons.8 //' docs/man/man8/Makefile.in
 +
 +PKG_CONFIG_PATH=/tools/lib/pkgconfig ./configure --prefix=/usr --disable-vlock
 +make
 +make install
 +</code>
 +
 +
 +==== Libpipeline-1.5.2 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv libpipeline-1.5.2.tar.gz
 +cd libpipeline-1.5.2
 +
 +./configure --prefix=/usr
 +make
 +make install
 +</code>
 +
 +
 +==== Make-4.3 ====
 +
 +<code bash>
 +cd /sources/make-4.3/
 +./configure --prefix=/usr
 +make
 +make install
 +</code>
 +
 +
 +==== Patch-2.7.6 ====
 +
 +<code bash>
 +cd /sources/patch-2.7.6
 +./configure --prefix=/usr
 +make
 +make install
 +</code>
 +
 +
 +==== Man-DB-2.9.0 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv man-db-2.9.0.tar.xz
 +cd man-db-2.9.0
 +
 +sed -i '/find/s@/usr@@' init/systemd/man-db.service.in
 +
 +./configure --prefix=/usr                        \
 +            --docdir=/usr/share/doc/man-db-2.9.0 \
 +            --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 install
 +</code>
 +
 +
 +==== Tar-1.32 ====
 +
 +<code bash>
 +cd /sources/tar-1.32
 +FORCE_UNSAFE_CONFIGURE=1  \
 +./configure --prefix=/usr \
 +            --bindir=/bin
 +make
 +make install
 +</code>
 +
 +
 +==== Texinfo-6.7 ====
 +
 +<code bash>
 +cd /sources/texinfo-6.7
 +./configure --prefix=/usr --disable-static
 +make
 +make install
 +</code>
 +
 +
 +==== Vim-8.2.0190 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv vim-8.2.0190.tar.gz
 +cd vim-8.2.0190
 +
 +echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
 +
 +./configure --prefix=/usr
 +make
 +make install
 +
 +ln -sv vim /usr/bin/vi
 +for L in  /usr/share/man/{,*/}man1/vim.1; do
 +    ln -sv vim.1 $(dirname $L)/vi.1
 +done
 +ln -sv ../vim/vim82/doc /usr/share/doc/vim-8.2.0190
 +
 +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=
 +syntax on
 +if (&term == "xterm") || (&term == "putty")
 +  set background=dark
 +endif
 +
 +" End /etc/vimrc
 +EOF
 +</code>
 +
 +
 +==== Systemd-244 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv systemd-244.tar.gz
 +cd systemd-244
 +
 +ln -sf /tools/bin/true /usr/bin/xsltproc
 +for file in /tools/lib/lib{blkid,mount,uuid}.so*; do
 +    ln -sf $file /usr/lib/
 +done
 +tar -xf ../systemd-man-pages-244.tar.xz
 +sed '177,$ d' -i src/resolve/meson.build
 +sed -i 's/GROUP="render", //' rules.d/50-udev-default.rules.in
 +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        \
 +      -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                \
 +      -Drpmmacrosdir=no            \
 +      ..
 +LANG=en_US.UTF-8 ninja
 +LANG=en_US.UTF-8 ninja install
 +
 +rm -f /usr/bin/xsltproc
 +systemd-machine-id-setup
 +systemctl preset-all
 +systemctl disable systemd-time-wait-sync.service
 +rm -fv /usr/lib/lib{blkid,uuid,mount}.so*
 +</code>
 +
 +
 +==== D-Bus-1.12.16 ====
 +
 +<code bash>
 +cd /sources
 +tar xfv dbus-1.12.16.tar.gz
 +cd dbus-1.12.16
 +
 +./configure --prefix=/usr                       \
 +            --sysconfdir=/etc                   \
 +            --localstatedir=/var                \
 +            --disable-static                    \
 +            --disable-doxygen-docs              \
 +            --disable-xml-docs                  \
 +            --docdir=/usr/share/doc/dbus-1.12.16 \
 +            --with-console-auth-dir=/run/console
 +make
 +make install
 +
 +mv -v /usr/lib/libdbus-1.so.* /lib
 +ln -sfv ../../lib/$(readlink /usr/lib/libdbus-1.so) /usr/lib/libdbus-1.so
 +ln -sv /etc/machine-id /var/lib/dbus
 +</code>
 +
 +
 +==== Procps-3.3.15 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv 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
 +make install
 +
 +mv -v /usr/lib/libprocps.so.* /lib
 +ln -sfv ../../lib/$(readlink /usr/lib/libprocps.so) /usr/lib/libprocps.so
 +</code>
 +
 +
 +==== Util-linux-2.35.1 ====
 +
 +<code bash>
 +cd /sources/util-linux-2.35.1
 +
 +mkdir -pv /var/lib/hwclock
 +rm -vf /usr/include/{blkid,libmount,uuid}
 +
 +./configure ADJTIME_PATH=/var/lib/hwclock/adjtime   \
 +            --docdir=/usr/share/doc/util-linux-2.35.1 \
 +            --disable-chfn-chsh  \
 +            --disable-login      \
 +            --disable-nologin    \
 +            --disable-su         \
 +            --disable-setpriv    \
 +            --disable-runuser    \
 +            --disable-pylibmount \
 +            --disable-static     \
 +            --without-python
 +make
 +make install
 +</code>
 +
 +
 +==== E2fsprogs-1.45.5 ====
 +
 +<code bash>
 +cd /sources/
 +tar xfv e2fsprogs-1.45.5.tar.gz
 +cd e2fsprogs-1.45.5
 +mkdir -v build
 +cd       build
 +
 +../configure --prefix=/usr           \
 +             --bindir=/bin           \
 +             --with-root-prefix=""   \
 +             --enable-elf-shlibs     \
 +             --disable-libblkid      \
 +             --disable-libuuid       \
 +             --disable-uuidd         \
 +             --disable-fsck
 +make
 +make install
 +
 +chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a
 +gunzip -v /usr/share/info/libext2fs.info.gz
 +install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info
 +</code>
 +
 +
 +==== Nettoyer ====
 +
 +<code bash>
 +rm -rf /tmp/*
 +logout
 +
 +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 -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
 +</code>
 +
 +
 +
 +==== Configuration générale du réseau ====
 +
 +Pour utiliser un DHCP:
 +<code bash>
 +cat > /etc/systemd/network/10-eth-dhcp.network << "EOF"
 +[Match]
 +Name=<network-device-name>
 +
 +[Network]
 +DHCP=ipv4
 +
 +[DHCP]
 +UseDomains=true
 +EOF
 +cat > /etc/resolv.conf << "EOF"
 +nameserver <Adresse IP du DNS primaire>
 +EOF
 +
 +echo "VIRTUAL-LFS" > /etc/hostname
 +
 +cat > /etc/hosts << "EOF"
 +127.0.0.1       localhost
 +127.0.1.1       VIRUTAL-LFS
 +
 +::1     localhost ip6-localhost ip6-loopback
 +ff02::1 ip6-allnodes
 +ff02::2 ip6-allrouters
 +EOF
 +</code>
 +
 +
 +==== Configurer la Console Linux ====
 +
 +<code bash>
 +cat > /etc/vconsole.conf << "EOF"
 +KEYMAP=fr
 +EOF
 +</code>
 +
 +
 +==== Configuration des paramètres régionaux du système ====
 +
 +<code bash>
 +cat > /etc/locale.conf << "EOF"
 +LANG=fr_FR.ISO-8859-1
 +EOF
 +</code>
 +
 +
 +==== Créer le fichier /etc/inputrc ====
 +
 +<code bash>
 +cat > /etc/inputrc << "EOF"
 +# Début de /etc/inputrc
 +# Modifié par Chris Lynn <roryo@roryo.dynup.net>
 +
 +# Permettre à l'invite de commande d'aller à la ligne
 +set horizontal-scroll-mode Off
 +
 +# Activer l'entrée sur 8 bits
 +set meta-flag On
 +set input-meta On
 +
 +# Ne pas supprimer le 8ème bit
 +set convert-meta Off
 +
 +# Conserver le 8ème bit à l'affichage
 +set output-meta On
 +
 +# none, visible ou audible
 +set bell-style none
 +
 +# Toutes les indications qui suivent font correspondre la séquence
 +# d'échappement contenue dans le 1er argument à la fonction
 +# spécifique de readline
 +"\eOd": backward-word
 +"\eOc": forward-word
 +
 +# Pour la console linux
 +"\e[1~": beginning-of-line
 +"\e[4~": end-of-line
 +"\e[5~": beginning-of-history
 +"\e[6~": end-of-history
 +"\e[3~": delete-char
 +"\e[2~": quoted-insert
 +
 +# pour xterm
 +"\eOH": beginning-of-line
 +"\eOF": end-of-line
 +
 +# pour Konsole
 +"\e[H": beginning-of-line
 +"\e[F": end-of-line
 +
 +# Fin de /etc/inputrc
 +EOF
 +</code>
 +
 +
 +==== Créaction du fichier /etc/shells ====
 +
 +<code bash>
 +cat > /etc/shells << "EOF"
 +# Begin /etc/shells
 +
 +/bin/sh
 +/bin/bash
 +
 +# End /etc/shells
 +EOF
 +</code>
 +
 +
 +==== Utilisation et configuration de Systemd ====
 +
 +<code bash>
 +mkdir -pv /etc/systemd/system/getty@tty1.service.d
 +
 +cat > /etc/systemd/system/getty@tty1.service.d/noclear.conf << EOF
 +[Service]
 +TTYVTDisallocate=no
 +EOF
 +</code>
 +
 +
 +==== Créer le fichier /etc/fstab ====
 +
 +<code bash>
 +cat > /etc/fstab << "EOF"
 +# Begin /etc/fstab
 +
 +# file system  mount-point  type     options             dump  fsck
 +#                                                              order
 +
 +/dev/sda2     /            ext4    defaults            1     1
 +/dev/sda3     swap         swap     pri=1                   0
 +
 +# End /etc/fstab
 +EOF
 +</code>
 +
 +
 +
 +==== Linux-5.5.3 ====
 +
 +<code bash>
 +cd /sources/
 +rm -rf linux-5.5.3
 +tar xfv linux-5.5.3.tar.xz
 +cd linux-5.5.3
 +
 +make mrproper
 +
 +make defconfig
 +make menuconfig # voir la doc pour les options à activer ou désactiver
 +make
 +make modules_install
 +
 +cp -iv arch/x86_64/boot/bzImage /boot/vmlinuz-5.5.3-lfs-9.1-systemd
 +cp -iv System.map /boot/System.map-5.5.3
 +cp -iv .config /boot/config-5.5.3
 +
 +install -v -m755 -d /etc/modprobe.d
 +cat > /etc/modprobe.d/usb.conf << "EOF"
 +# Début de /etc/modprobe.d/usb.conf
 +
 +install ohci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe -i ohci_hcd ; true
 +install uhci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe -i uhci_hcd ; true
 +
 +# Fin de /etc/modprobe.d/usb.conf
 +EOF
 +</code>
 +
 +
 +==== Utiliser GRUB pour paramétrer le processus de démarrage ====
 +
 +Ajouter, sur le système hôte, dans ''/boot/grub/grub.cfg'':
 +<code bash>
 +menuentry "GNU/Linux, Linux 5.5.3-lfs-9.1-systemd" {
 +        insmod ext2
 +        set root=(hd0,2)  # pour sda2
 +        linux   /boot/vmlinuz-5.5.3-lfs-9.1-systemd root=/dev/sda2 ro
 +}
 +</code>
 +
 +
 +==== Fin ====
 +
 +<code bash>
 +echo 9.1-systemd > /etc/lfs-release
 +
 +cat > /etc/lsb-release << "EOF"
 +DISTRIB_ID="Linux From Scratch"
 +DISTRIB_RELEASE="9.1-systemd"
 +DISTRIB_CODENAME="<votre nom ici>"
 +DISTRIB_DESCRIPTION="Linux From Scratch"
 +EOF
 +
 +cat > /etc/os-release << "EOF"
 +NAME="Linux From Scratch"
 +VERSION="9.1-systemd"
 +ID=lfs
 +PRETTY_NAME="Linux From Scratch 9.1-systemd"
 +VERSION_CODENAME="<votre nom ici>"
 +EOF
 +</code>
 +
 +
 +==== Redémarrer le système ====
 +
 +<code bash>
 +logout
 +reboot
 +</code>
  
  • linux/lfs.1591035370.txt.gz
  • Dernière modification : 2021/04/04 17:01
  • (modification externe)