Constrution LFS/ostree

Le tableau ci dessous présente le temps requis pour la construction des paquets:

Package Build in seconds Minimal OS Build in seconds LSB Build in seconds
busybox-1.31.1 154,581
dropbear-2019.78 72,529
bridge-utils-1.6 5,029 bridge-utils-1.6 5,029
openssl-1.1.1c 531,769
curl-7.67.0 126,949
curl-nss-7.67.0 111,604 curl-nss-7.67.0 111,604
bash-5.0 123,67 bash-5.0 123,67 @#00BBFF:bash-5.0 123,67
coreutils-8.31 355,416 coreutils-8.31 355,416 @#00BBFF:coreutils-8.31 355,416
Python-3.7.4 448,593
perl-5.30.0
util-linux-2.34 211,277 util-linux-2.34 211,277 @#00BBFF:util-linux-2.34 211,277
vim-8.1.1846 204,475 vim-8.1.1846 204,475 @#bbddee:vim-8.1.1846 204,475
grep-3.3 92,116 grep-3.3 92,116 @#00BBFF:grep-3.3 92,116
sed-4.7 84,366 sed-4.7 84,366 @#00BBFF:sed-4.7 84,366
less-551 20,148 less-551 20,148
file-5.37 32,111 file-5.37 32,111 @#00BBFF:file-5.37 32,111
patch-2.7.6 83,814 patch-2.7.6 83,814
zlib-1.2.11 16,314 zlib-1.2.11 16,314 @#00BBFF:zlib-1.2.11 16,314
bzip2-1.0.8 21,394 bzip2-1.0.8 21,394
unzip60 14,737 unzip60 14,737
lzo-2.10 18,267 lzo-2.10 18,267
gzip-1.10 66,562 gzip-1.10 66,562 @#00BBFF:gzip-1.10 66,562
xz-5.2.4 43,317 xz-5.2.4 43,317
tar-1.32 130,098 tar-1.32 130,098 @#00BBFF:tar-1.32 130,098
libarchive-3.4.1 150,43 libarchive-3.4.1 150,43
shadow-4.7 69,213 shadow-4.7 69,213 @#00BBFF:shadow-4.7 69,213
rsync-3.1.3 77,323 rsync-3.1.3 77,323
iptables-1.8.4 44,379 iptables-1.8.4 44,379
iproute2-5.2.0 59,786 iproute2-5.2.0 59,786
inetutils-1.9.4 104,616 inetutils-1.9.4 104,616
dig-9.14.9 171,893 dig-9.14.9 171,893
squashfs4.4 13,707 squashfs4.4 13,707
LVM2.2.03.07 132,594 LVM2.2.03.07 132,594
btrfs-progs-v5.4 61,701 btrfs-progs-v5.4 61,701
ncurses-6.1 164,067 ncurses-6.1 164,067 @#00BBFF:ncurses-6.1 164,067
lxc-3.2.1.tar.gz 97,26
qemu-4.2.0 363,415
cpio-2.12 97,447 cpio-2.12 97,447 @#bbddee:cpio-2.12 97,447
pax-20161104 7,812 pax-20161104 7,812 @#bbddee:pax-20161104 7,812
wget-1.20.3 85,892 wget-1.20.3 85,892
git-2.24.1 310,392 , git-2.24.1 310,392 ,
libassuan-2.5.3 20,463 libassuan-2.5.3 20,463
gnupg-2.2.17 213,217 gnupg-2.2.17 213,217
systemd-244 166,952 systemd-244 166,952
sysvinit-2.96 6,492
grub-2.04 63,845 grub-2.04 63,845
fuse-3.9.0.tar.gz 40,777 fuse-3.9.0.tar.gz 40,777
gpgme-1.13.1 114,92
libostree-2019.6 174,392 libostree-2019.6 174,392
go1.13.6 316,639
rkt-1.30.0 64,829
conmon
cri-o-1.16.2 53,325 cri-o-1.16.2 53,325
runc-1.0.0-rc9 8,911 runc-1.0.0-rc9 8,911
buildah-1.13.1 51,875
tree-1.8.0 2,088 tree-1.8.0 2,088
time-1.9 21,699 time-1.9 21,699 @#bbddee:time-1.9 21,699
xfsprogs-5.4.0 188,373 , xfsprogs-5.4.0 188,373 ,
Linux-PAM-1.3.1 75,654 Linux-PAM-1.3.1 75,654 @#bbddee:Linux-PAM-1.3.1 75,654
dhcpcd-8.1.5 17,514 dhcpcd-8.1.5 17,514
libtirpc-1.2.5 28,802 libtirpc-1.2.5 28,802
rpcsvc-proto-1.4 8,314 rpcsvc-proto-1.4 8,314
rpcbind-1.2.5 7,928 rpcbind-1.2.5 7,928
nfs-utils-2.4.1 54,51 nfs-utils-2.4.1 54,51
ruby-2.7.0 795,484
dracut-049 3,851 dracut-049 3,851
dbus-1.12.16 76,82 dbus-1.12.16 76,82
elogind-241.4 43,001 elogind-241.4 43,001
libburn-1.5.2 45,394 libburn-1.5.2 45,394
libisofs-1.5.2 56,761 libisofs-1.5.2 56,761
libisoburn-1.5.2 89,87 libisoburn-1.5.2 89,87
lz4-1.9.2 33,082 lz4-1.9.2 33,082
zstd-1.4.4 210,21 zstd-1.4.4 210,21
nspr-4.24 13,751 nspr-4.24 13,751 @#bbddee:nspr-4.24 13,751
nss-3.49.2 808,225 nss-3.49.2 808,225 @#bbddee:nss-3.49.2 808,225
procps-ng-3.3.15 47,67 procps-ng-3.3.15 47,67 @#00BBFF:procps-ng-3.3.15 47,67
psmisc-23.2 13,492 psmisc-23.2 13,492 @#00BBFF:psmisc-23.2 13,492
binutils-2.33.1 1191,644 binutils-2.33.1 1191,644 @#00BBFF:binutils-2.33.1 1191,644
m4-1.4.18 47,783 m4-1.4.18 47,783 @#00BBFF:m4-1.4.18 47,783
bc-2.1.3 18,845 bc-2.1.3 18,845 @#00BBFF:bc-2.1.3 18,845
fcron-3.2.1 18,386 fcron-3.2.1 18,386 @#bbddee:fcron-3.2.1 18,386
gawk-5.0.1 22,531 gawk-5.0.1 22,531 @#00BBFF:gawk-5.0.1 22,531
at_3.1.23 12,187 at_3.1.23 12,187 @#bbddee:at_3.1.23 12,187
attr-2.4.48 15,068 attr-2.4.48 15,068
kmod-26 20,113 kmod-26 20,113
readline-8.0 18,596 readline-8.0 18,596
zfs-0.8.2 865,996 zfs-0.8.2 865,996
dosfstools-4.1 9,016 dosfstools-4.1 9,016
efivar-37 20,934 efivar-37 20,934
popt-1.16 13,252 popt-1.16 13,252
efibootmgr-16 3,411 efibootmgr-16 3,411
nasm-2.14.02 47,888 nasm-2.14.02 47,888
syslinux-6.03 350,09 syslinux-6.03 350,09
linux-5.4.8 13411,521 linux-5.4.8 13411,521 linux-5.4.8 13411,521
@#00BBFF:diffutils
@#00BBFF:findutils
@#bbddee:initd-tools
@#bbddee:lsb_release
@#00BBFF:man-DB
@#00BBFF:sendmail
Total 24508,6891) 22462,2742) 17358,3323)

Légende des composants de l'arbre LSB (Linux Standard Base):

@#00BBFF:LFS @#bbddee:BLFS
# # Constrution de  la structure de répertoire de ostree
 
# ## Ajout de /ostree/repo au système de fichiers:
 
# # Construction des binaires 
 
# ## (BUSYBOX) Compilation de busybox-1.31.1 en 154.581 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de busybox-1.31.1 en %R seconds ...'
time {
wget https://busybox.net/downloads/busybox-1.31.1.tar.bz2 -O ${LFS}/download/busybox-1.31.1.tar.bz2  --no-check-certificate &&
rm -Rf ${LFS}/src/busybox-1.31.1 &&
tar xjf ${LFS}/download/busybox-1.31.1.tar.bz2 -C ${LFS}/src &&
cd ${LFS}/src/busybox-1.31.1 &&
make clean &&
make defconfig && 
make clean && 
make LDFLAGS=-static &&
mkdir -pv _pkg/bin &&
cp -av busybox  _pkg/bin/ &&
chmod 555 _pkg/bin/busybox &&
./busybox --install -s _pkg/bin  -d -m 755 &&
ls _pkg/bin/* -al | grep busybox-1 > ajustlink 
sed -i 's/^.*:.. /!/g' ajustlink 
sed -i 's/^.*$/&!&/g' ajustlink
sed -i 's/!!.*->/&!!!/g' ajustlink
sed -i 's/ ->!!!.*$//g' ajustlink
sed -i 's/!!/ /g' ajustlink
sed -i 's/^.*busybox-1\.31\.1\//ln -sf /g' ajustlink
bash ajustlink 
tar -C _pkg/ -cvf ${LFS}/pkg/busybox-1.31.1.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de dropbear-2019.78 en 72.529 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de dropbear-2019.78 en %R seconds ...'
time {
wget https://matt.ucc.asn.au/dropbear/releases/dropbear-2019.78.tar.bz2 -O ${LFS}/download/dropbear-2019.78.tar.bz2  --no-check-certificate &&
rm -Rf ${LFS}/src/dropbear-2019.78 &&
tar xjf ${LFS}/download/dropbear-2019.78.tar.bz2 -C ${LFS}/src &&
cd ${LFS}/src/dropbear-2019.78 &&
./configure --prefix=/ --enable-static &&
make &&
make scp &&
make DESTDIR=_pkg install &&
cp scp _pkg/bin
strip -v _pkg/bin/*
strip -v _pkg/sbin/* 
tar -C _pkg/ -cvf ${LFS}/pkg/dropbear-2019.78.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de bridge-utils-1.6 en 5.029 seconds ..
 
TIMEFORMAT='(BUSYBOX) Compilation de bridge-utils-1.6 en %R seconds ...'
time {
wget https://www.kernel.org/pub/linux/utils/net/bridge-utils/bridge-utils-1.6.tar.xz -O ${LFS}/download/bridge-utils-1.6.tar.xz --no-check-certificate &&
md5sum -c <<<" 541ae1c50cc268056693608920e6c908 ${LFS}/download/bridge-utils-1.6.tar.xz" &&
wget http://anduin.linuxfromscratch.org/BLFS/blfs-bootscripts/blfs-bootscripts-20191204.tar.xz -O ${LFS}/download/blfs-bootscripts-20191204.tar.xz --no-check-certificate &&
rm -Rf ${LFS}/src/bridge-utils-1.6 &&
tar xf ${LFS}/download/bridge-utils-1.6.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/bridge-utils-1.6 &&
autoconf                  &&
./configure --prefix=/usr &&
make &&
make DESTDIR=$PWD/_pkg install &&
tar xf ${LFS}/download/blfs-bootscripts-20191204.tar.xz -C ${LFS}/src/bridge-utils-1.6 --strip-components=1 &&
make DESTDIR=$PWD/_pkg  install-service-bridge &&
tar -C _pkg/ -cvf ${LFS}/pkg/bridge-utils-1.6.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de openssl-1.1.1c en 531.769 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de openssl-1.1.1c en %R seconds ...'
time {
wget https://www.openssl.org/source/openssl-1.1.1c.tar.gz -O ${LFS}/download/openssl-1.1.1c.tar.gz --no-check-certificate &&
md5sum -c <<<"15e21da6efe8aa0e0768ffd8cd37a5f6 ${LFS}/download/openssl-1.1.1c.tar.gz" &&
rm -Rf ${LFS}/src/openssl-1.1.1c &&
tar xzf ${LFS}/download/openssl-1.1.1c.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/openssl-1.1.1c &&
sed -i '/\} data/s/ =.*$/;\n    memset(\&data, 0, sizeof(data));/' \
  crypto/rand/rand_lib.c &&
./config    --prefix=/usr                     \
            --openssldir=/etc/ssl          \
            --libdir=lib LDFLAGS="-static" &&
make &&
make DESTDIR=_pkg  install &&
tar -C _pkg/ -cvf ${LFS}/pkg/openssl-1.1.1c.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de curl-7.67.0 en 126.949 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de curl-7.67.0 en %R seconds ...'
time {
wget https://curl.haxx.se/download/curl-7.67.0.tar.xz -O ${LFS}/download/curl-7.67.0.tar.xz --no-check-certificate &&
md5sum -c <<<"d55351b88dec558dd3a24dabb2c2d899 ${LFS}/download/curl-7.67.0.tar.xz" &&
rm -Rf ${LFS}/src/curl-7.67.0 &&
tar xf ${LFS}/download/curl-7.67.0.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/curl-7.67.0 &&
./configure --prefix=/usr                        \
            --with-ca-path=/etc/ssl/certs &&
make &&
make prefix=$PWD/_pkg install &&
for library in $(ldd _pkg/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
strip -v _pkg/bin/*
tar -C _pkg/ -cvf ${LFS}/pkg/curl-7.67.0.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de curl-nss-7.67.0 en 111.604 seconds ..
 
TIMEFORMAT='(BUSYBOX) Compilation de curl-nss-7.67.0 en %R seconds ...'
time {
wget https://curl.haxx.se/download/curl-7.67.0.tar.xz -O ${LFS}/download/curl-7.67.0.tar.xz --no-check-certificate &&
md5sum -c <<<"d55351b88dec558dd3a24dabb2c2d899 ${LFS}/download/curl-7.67.0.tar.xz" &&
rm -Rf ${LFS}/src/curl-7.67.0 &&
tar xf ${LFS}/download/curl-7.67.0.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/curl-7.67.0 &&
./configure --prefix=/usr                        \
            --with-ca-path=/etc/ssl/certs        \
            --without-ssl --with-nss &&
make &&
make prefix=$PWD/_pkg install &&
for library in $(ldd _pkg/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
strip -v _pkg/bin/*
tar -C _pkg/ -cvf ${LFS}/pkg/curl-nss-7.67.0.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) (BUSYBOX) Compilation de bash-5.0 en 123.670 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de bash-5.0 en %R seconds ...'
time {
wget http://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz -O ${LFS}/download/bash-5.0.tar.gz --no-check-certificate &&
md5sum -c <<<" 2b44b47b905be16f45709648f671820b ${LFS}/download/bash-5.0.tar.gz" &&
rm -rf ${LFS}/src/bash-5.0 &&
tar xf ${LFS}/download/bash-5.0.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/bash-5.0 &&
./configure --prefix=/usr                    \
            --docdir=/usr/share/doc/bash-5.0 \
            --without-bash-malloc            \
            --with-installed-readline CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install &&
tar -C _pkg/ -cvf ${LFS}/pkg/bash-5.0.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de coreutils-8.31 en 355.416 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de coreutils-8.31 en %R seconds ...'
time {
wget http://ftp.gnu.org/gnu/coreutils/coreutils-8.31.tar.xz -O ${LFS}/download/coreutils-8.31.tar.xz --no-check-certificate &&
md5sum -c <<<" 0009a224d8e288e8ec406ef0161f9293 ${LFS}/download/coreutils-8.31.tar.xz" &&
rm -Rf ${LFS}/src/coreutils-8.31 &&
tar xf ${LFS}/download/coreutils-8.31.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/coreutils-8.31 &&
sed -i '/test.lock/s/^/#/' gnulib-tests/gnulib.mk &&
autoreconf -fiv &&
FORCE_UNSAFE_CONFIGURE=1 ./configure \
            --prefix=/               \
            --enable-no-install-program=kill,uptime CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install
strip -v _pkg/bin/*
tar -C _pkg/ -cvf ${LFS}/pkg/coreutils-8.31.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de Python-3.7.4 en 448.593 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de Python-3.7.4 en %R seconds ...'
time {
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz -O ${LFS}/download/Python-3.7.4.tar.xz --no-check-certificate &&
md5sum -c <<<" d33e4aae66097051c2eca45ee3604803 ${LFS}/download/Python-3.7.4.tar.xz" &&
rm -Rf ${LFS}/src/Python-3.7.4 &&
tar xf ${LFS}/download/Python-3.7.4.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/Python-3.7.4 &&
./configure --prefix=/usr       \
            --enable-shared     \
            --with-system-expat \
            --with-system-ffi   \
            --with-ensurepip=yes CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install &&
chmod -v 755 _pkg/usr/lib/libpython3.7m.so &&
chmod -v 755 _pkg/usr/lib/libpython3.so &&
ln -sfv pip3.7 _pkg/usr/bin/pip3 
for library in $(ldd _pkg/usr/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done
tar -C _pkg/ -cvf ${LFS}/pkg/Python-3.7.4.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de perl-5.30.0
 
TIMEFORMAT='(BUSYBOX) Compilation de perl-5.30.0 en %R seconds ...'
time {
wget https://www.cpan.org/src/5.0/perl-5.30.0.tar.xz -O ${LFS}/download/perl-5.30.0.tar.xz --no-check-certificate &&
md5sum -c <<<" 037c35000550bdcb47552ad0f6d3064d ${LFS}/download/perl-5.30.0.tar.xz" &&
rm -Rf ${LFS}/src/perl-5.30.0 &&
tar xf ${LFS}/download/perl-5.30.0.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/perl-5.30.0 &&
echo "127.0.0.1 localhost $(hostname)" > /etc/hosts &&
sh Configure -des -Dprefix=/usr                 \
                  -Dvendorprefix=/usr           \
                  -Dman1dir=/usr/share/man/man1 \
                  -Dman3dir=/usr/share/man/man3 \
                  -Dpager="/usr/bin/less -isR"  \
                  -Duseshrplib                  \
                  -Dusethreads CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install
for library in $(ldd _pkg/usr/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done
tar -C _pkg/ -cvf ${LFS}/pkg/perl-5.30.0.tar.gz ./
cd "${LFS}/"
}
 
# ## (TARGETFS) Compilation de util-linux-2.34 en 211.277 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de util-linux-2.34 en %R seconds ...'
time {
wget https://www.kernel.org/pub/linux/utils/util-linux/v2.34/util-linux-2.34.tar.xz -O ${LFS}/download/util-linux-2.34.tar.xz --no-check-certificate &&
md5sum -c <<<" a78cbeaed9c39094b96a48ba8f891d50 ${LFS}/download/util-linux-2.34.tar.xz" &&
rm -Rf ${LFS}/src/util-linux-2.34 &&
tar xf ${LFS}/download/util-linux-2.34.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/util-linux-2.34 &&
./configure ADJTIME_PATH=/var/lib/hwclock/adjtime   \
            --docdir=/usr/share/doc/util-linux-2.34 \
            --disable-chfn-chsh  \
            --disable-login      \
            --disable-nologin    \
            --disable-su         \
            --disable-setpriv    \
            --disable-runuser    \
            --disable-pylibmount \
            --without-python CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install
for library in $(ldd _pkg/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done
for library in $(ldd _pkg/sbin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done
tar -C _pkg/ -cvf ${LFS}/pkg/util-linux-2.34.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de ncurses-6.1 en 140.978 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de ncurses-6.1 en %R seconds ...'
time {
wget http://ftp.gnu.org/gnu/ncurses/ncurses-6.1.tar.gz -O ${LFS}/download/ncurses-6.1.tar.gz --no-check-certificate &&
md5sum -c <<<" 98c889aaf8d23910d2b92d65be2e737a ${LFS}/download/ncurses-6.1.tar.gz" &&
rm -Rf ${LFS}/src/ncurses-6.1 &&
tar xzf ${LFS}/download/ncurses-6.1.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/ncurses-6.1 &&
./configure --prefix=/usr           \
            --mandir=/usr/share/man \
            --without-debug         \
            --without-normal        \
            --enable-pc-files       \
            --enable-widec CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install &&
ln -s libncursesw.so _pkg/usr/lib/libncurses.so
tar -C _pkg/ -cvf ${LFS}/pkg/ncurses-6.1.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de vim-8.1.1846 en 204.475 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de vim-8.1.1846 en %R seconds ...'
time {
wget https://github.com/vim/vim/archive/v8.1.1846/vim-8.1.1846.tar.gz -O ${LFS}/download/vim-8.1.1846.tar.gz --no-check-certificate &&
md5sum -c <<<" 4f129a05254d93c739fcede843df87df ${LFS}/download/vim-8.1.1846.tar.gz" &&
rm -Rf ${LFS}/src/vim-8.1.1846 &&
tar xzf ${LFS}/download/vim-8.1.1846.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/vim-8.1.1846 &&
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
./configure --prefix=/usr --with-x=no  --disable-gui LDFLAGS="-L/tools/lib -lncurses -static" &&
make &&
make DESTDIR=$PWD/_pkg install &&
ln -sv vim _pkg/usr/bin/vi
for L in  _pkg/usr/share/man/{,*/}man1/vim.1; do
    ln -sv vim.1 $(dirname $L)/vi.1
done &&
ln -sv ../vim/vim81/doc _pkg/usr/share/doc/vim-8.1.1846 &&
mkdir -pv _pkg/etc &&
cat > _pkg/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
 
tar -C _pkg/ -cvf ${LFS}/pkg/vim-8.1.1846.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de grep-3.3 en 92.116 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de grep-3.3 en %R seconds ...'
time {
wget http://ftp.gnu.org/gnu/grep/grep-3.3.tar.xz -O ${LFS}/download/grep-3.3.tar.xz --no-check-certificate &&
md5sum -c <<<" 05d0718a1b7cc706a4bdf8115363f1ed ${LFS}/download/grep-3.3.tar.xz" &&
rm -Rf ${LFS}/src/grep-3.3 &&
tar xf ${LFS}/download/grep-3.3.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/grep-3.3 &&
./configure --prefix=/usr --bindir=/bin CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install &&
tar -C _pkg/ -cvf ${LFS}/pkg/grep-3.3.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de sed-4.7 en 84.366 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de sed-4.7 en %R seconds ...'
time {
wget http://ftp.gnu.org/gnu/sed/sed-4.7.tar.xz -O ${LFS}/download/sed-4.7.tar.xz --no-check-certificate &&
md5sum -c <<<" 777ddfd9d71dd06711fe91f0925e1573 ${LFS}/download/sed-4.7.tar.xz" &&
rm -Rf ${LFS}/src/sed-4.7 &&
tar xf ${LFS}/download/sed-4.7.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/sed-4.7 &&
sed -i 's/usr/tools/'                 build-aux/help2man &&
sed -i 's/testsuite.panic-tests.sh//' Makefile.in &&
./configure --prefix=/usr --bindir=/bin  CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install &&
tar -C _pkg/ -cvf ${LFS}/pkg/sed-4.7.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de less-551 en 20.148 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de less-551 en %R seconds ...'
time {
wget http://www.greenwoodsoftware.com/less/less-551.tar.gz -O ${LFS}/download/less-551.tar.gz --no-check-certificate &&
md5sum -c <<<" 4ad4408b06d7a6626a055cb453f36819 ${LFS}/download/less-551.tar.gz" &&
rm -Rf ${LFS}/src/less-551 &&
tar xzf ${LFS}/download/less-551.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/less-551 &&
./configure --prefix=/usr --sysconfdir=/etc LDFLAGS="-L/tools/lib -lncurses -static"  &&
make &&
make DESTDIR=$PWD/_pkg install &&
tar -C _pkg/ -cvf ${LFS}/pkg/less-551.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de file-5.37 en 32.111 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de file-5.37 en %R seconds ...'
time {
wget http://ftp.astron.com/pub/file/file-5.37.tar.gz -O ${LFS}/download/file-5.37.tar.gz --no-check-certificate &&
md5sum -c <<<" 80c29aca745466c6c24d11f059329075 ${LFS}/download/file-5.37.tar.gz" &&
rm -Rf ${LFS}/src/file-5.37 &&
tar xzf ${LFS}/download/file-5.37.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/file-5.37 &&
./configure --prefix=/usr CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install &&
for library in $(ldd _pkg/usr/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
tar -C _pkg/ -cvf ${LFS}/pkg/file-5.37.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de patch-2.7.6 en 83.814 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de patch-2.7.6 en %R seconds ...'
time {
wget http://ftp.gnu.org/gnu/patch/patch-2.7.6.tar.xz -O ${LFS}/download/patch-2.7.6.tar.xz --no-check-certificate &&
md5sum -c <<<" 78ad9937e4caadcba1526ef1853730d5 ${LFS}/download/patch-2.7.6.tar.xz" &&
rm -Rf ${LFS}/src/patch-2.7.6 &&
tar xf ${LFS}/download/patch-2.7.6.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/patch-2.7.6 &&
./configure --prefix=/usr CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install &&
tar -C _pkg/ -cvf ${LFS}/pkg/patch-2.7.6.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de zlib-1.2.11 en 16.314 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de zlib-1.2.11 en %R seconds ...'
time {
wget https://zlib.net/zlib-1.2.11.tar.xz -O ${LFS}/download/zlib-1.2.11.tar.xz --no-check-certificate &&
md5sum -c <<<" 85adef240c5f370b308da8c938951a68 ${LFS}/download/zlib-1.2.11.tar.xz" &&
rm -Rf ${LFS}/src/zlib-1.2.11 &&
tar xf ${LFS}/download/zlib-1.2.11.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/zlib-1.2.11 &&
./configure --prefix=/usr &&
make &&
make DESTDIR=$PWD/_pkg install &&
mkdir -pv _pkg/{lib,lib64,usr/lib,usr/lib64} &&
mv -v _pkg/usr/lib/libz.so.* /lib &&
ln -sfv ../../lib/$(readlink /usr/lib/libz.so) _pkg/lib/libz.so &&
tar -C _pkg/ -cvf ${LFS}/pkg/zlib-1.2.11.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de bzip2-1.0.8 en 21.394 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de bzip2-1.0.8 en %R seconds ...'
time {
wget https://www.sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz -O ${LFS}/download/bzip2-1.0.8.tar.gz --no-check-certificate &&
md5sum -c <<<" 67e051268d0c475ea773822f7500d0e5 ${LFS}/download/bzip2-1.0.8.tar.gz" &&
wget http://www.linuxfromscratch.org/patches/lfs/9.0/bzip2-1.0.8-install_docs-1.patch -O ${LFS}/download/bzip2-1.0.8-install_docs-1.patch --no-check-certificate &&
md5sum -c <<<" 6a5ac7e89b791aae556de0f745916f7f ${LFS}/download/bzip2-1.0.8-install_docs-1.patch" &&
rm -rf ${LFS}/src/bzip2-1.0.8 &&
tar xzf ${LFS}/download/bzip2-1.0.8.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/bzip2-1.0.8 &&
patch -Np1 -i ${LFS}/download/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 -f Makefile-libbz2_so &&
make clean &&
make &&
make PREFIX=_pkg install &&
cp -v bzip2-shared _pkg/bin/bzip2 &&
cp -av libbz2.so* _pkg/lib &&
ln -sv ../../lib/libbz2.so.1.0 _pkg/lib/libbz2.so &&
rm -v _pkg/bin/{bunzip2,bzcat} &&
ln -sv bzip2 _pkg/bin/bunzip2 &&
ln -sv bzip2 _pkg/bin/bzcat &&
strip -v _pkg/bin/*  
tar -C _pkg/ -cvf ${LFS}/pkg/bzip2-1.0.8.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de unzip60 en 14.737 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de unzip60 en %R seconds ...'
time {
wget https://downloads.sourceforge.net/infozip/unzip60.tar.gz -O ${LFS}/download/unzip60.tar.gz --no-check-certificate &&
md5sum -c <<<" 62b490407489521db863b523a7f86375 ${LFS}/download/unzip60.tar.gz" &&
wget  http://www.linuxfromscratch.org/patches/blfs/svn/unzip-6.0-consolidated_fixes-1.patch -O ${LFS}/download/unzip-6.0-consolidated_fixes-1.patch --no-check-certificate &&
rm -rf ${LFS}/src/unzip60 &&
tar xzf ${LFS}/download/unzip60.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/unzip60 &&
patch -Np1 -i ${LFS}/download/unzip-6.0-consolidated_fixes-1.patch &&
CFLAGS="-static" make -f unix/Makefile generic &&
make prefix=$PWD/_pkg MANDIR=$PWD/_pkg/share/man/man1 \
 -f unix/Makefile install
strip -v _pkg/bin/*
for library in $(ldd _pkg/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
tar -C _pkg/ -cvf ${LFS}/pkg/unzip60.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de lzo-2.10 en 18.267 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de lzo-2.10 en %R seconds ...'
time {
wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz -O ${LFS}/download/lzo-2.10.tar.gz --no-check-certificate &&
md5sum -c <<<" 39d3f3f9c55c87b1e5d6888e1420f4b5 ${LFS}/download/lzo-2.10.tar.gz" &&
tar -xzf ${LFS}/download/lzo-2.10.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/lzo-2.10 &&
./configure --prefix=/usr                    \
            --enable-shared                  \
            --disable-static                 \
            --docdir=/usr/share/doc/lzo-2.10 &&
make &&
make DESTDIR=$PWD/_pkg install
strip -v _pkg/usr/lib/*
tar -C _pkg/ -cvf ${LFS}/pkg/lzo-2.10.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de gzip-1.10 en 66.562 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de gzip-1.10 en %R seconds ...'
time {
wget http://ftp.gnu.org/gnu/gzip/gzip-1.10.tar.xz -O ${LFS}/download/gzip-1.10.tar.xz --no-check-certificate &&
md5sum -c <<<" 691b1221694c3394f1c537df4eee39d3 ${LFS}/download/gzip-1.10.tar.xz" &&
rm -Rf ${LFS}/src/gzip-1.10 &&
tar xf ${LFS}/download/gzip-1.10.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/gzip-1.10 &&
./configure --prefix=/usr CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install
strip -v _pkg/usr/lib/*
mkdir -pv _pkg/{bin,lib,lib64,usr/lib,usr/lib64} &&
mv -v _pkg/usr/bin/gzip _pkg/bin &&
tar -C _pkg/ -cvf ${LFS}/pkg/gzip-1.10.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de xz-5.2.4 en 43.317 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de xz-5.2.4 en %R seconds ...'
time {
wget https://tukaani.org/xz/xz-5.2.4.tar.xz -O ${LFS}/download/xz-5.2.4.tar.xz --no-check-certificate &&
md5sum -c <<<" 003e4d0b1b1899fc6e3000b24feddf7c ${LFS}/download/xz-5.2.4.tar.xz" &&
rm -Rf ${LFS}/src/xz-5.2.4 &&
tar xf ${LFS}/download/xz-5.2.4.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/xz-5.2.4 &&
./configure --prefix=/    \
            --docdir=/share/doc/xz-5.2.4 CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install
for library in $(ldd _pkg/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done
tar -C _pkg/ -cvf ${LFS}/pkg/xz-5.2.4.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de tar-1.32 en 130.098 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de tar-1.32 en %R seconds ...'
time {
wget http://ftp.gnu.org/gnu/tar/tar-1.32.tar.xz -O ${LFS}/download/tar-1.32.tar.xz --no-check-certificate &&
md5sum -c <<<" 83e38700a80a26e30b2df054e69956e5 ${LFS}/download/tar-1.32.tar.xz" &&
rm -Rf ${LFS}/src/tar-1.32 &&
tar xf ${LFS}/download/tar-1.32.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/tar-1.32 &&
FORCE_UNSAFE_CONFIGURE=1  \
./configure --prefix=/usr \
            --bindir=/bin CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install
strip -v _pkg/usr/bin/*
tar -C _pkg/ -cvf ${LFS}/pkg/tar-1.32.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de libarchive-3.4.1 en 150.430 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de libarchive-3.4.1 en %R seconds ...'
time {
wget  https://github.com/libarchive/libarchive/releases/download/v3.4.1/libarchive-3.4.1.tar.xz -O ${LFS}/download/libarchive-3.4.1.tar.xz  --no-check-certificate &&
md5sum -c <<<" 83e38700a80a26e30b2df054e69956e5 ${LFS}/download/tar-1.32.tar.xz" &&
rm -Rf ${LFS}/src/libarchive-3.4.1 &&
tar -xf ${LFS}/download/libarchive-3.4.1.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/libarchive-3.4.1 &&
./configure --prefix=/usr &&
make &&
make DESTDIR=$PWD/_pkg install &&
for library in $(ldd _pkg/usr/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done
strip -v _pkg/usr/bin/*
tar -C _pkg/ -cvf ${LFS}/pkg/libarchive-3.4.1.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de shadow-4.7 en 69.213 seconds ...
 
 
TIMEFORMAT='(BUSYBOX) Compilation de shadow-4.7 en %R seconds ...'
time {
wget https://github.com/shadow-maint/shadow/releases/download/4.7/shadow-4.7.tar.xz -O ${LFS}/download/shadow-4.7.tar.xz --no-check-certificate &&
md5sum -c <<<" f7ce18c8dfd05f1a009266cb604d58b7 ${LFS}/download/shadow-4.7.tar.xz" &&
rm -Rf ${LFS}/src/shadow-4.7 &&
tar xf ${LFS}/download/shadow-4.7.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/shadow-4.7 &&
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 CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install &&
for library in $(ldd _pkg/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
for library in $(ldd _pkg/sbin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
for library in $(ldd _pkg/usr/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
for library in $(ldd _pkg/usr/sbin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
mkdir -pv _pkg/bin &&
mv -v _pkg/usr/bin/passwd _pkg/bin &&
cat > _pkg/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
 
$PWD/_pkg/usr/sbin/pwconv -R $PWD/_pkg &&
$PWD/_pkg/usr/sbin/grpconv -R $PWD/_pkg &&
sed -i 's/yes/no/' _pkg/etc/default/useradd &&
tar -C _pkg/ -cvf ${LFS}/pkg/shadow-4.7.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de rsync-3.1.3 en 77.323 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de rsync-3.1.3 en %R seconds ...'
time {
wget https://www.samba.org/ftp/rsync/src/rsync-3.1.3.tar.gz -O ${LFS}/download/rsync-3.1.3.tar.gz --no-check-certificate &&
md5sum -c <<<" 1581a588fde9d89f6bc6201e8129afaf ${LFS}/download/rsync-3.1.3.tar.gz" &&
rm -Rf ${LFS}/src/rsync-3.1.3 &&
tar xf ${LFS}/download/rsync-3.1.3.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/rsync-3.1.3 &&
./configure LDFLAGS="-static" &&
make &&
make prefix=_pkg install &&
strip -v _pkg/bin/* 
tar -C _pkg/ -cvf ${LFS}/pkg/rsync-3.1.3.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de iptables-1.8.4 en 44.379 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de iptables-1.8.4 en %R seconds ...'
time {
wget  http://www.netfilter.org/projects/iptables/files/iptables-1.8.4.tar.bz2 -O ${LFS}/download/iptables-1.8.4.tar.bz2 --no-check-certificate &&
md5sum -c <<<" 9b201107957fbf62709c3d8226239b0d ${LFS}/download/iptables-1.8.4.tar.bz2" &&
rm -Rf ${LFS}/src/iptables-1.8.4 &&
tar -xf ${LFS}/download/iptables-1.8.4.tar.bz2 -C ${LFS}/src &&
cd ${LFS}/src/iptables-1.8.4 &&
./configure --prefix=/usr      \
            --sbindir=/sbin    \
            --disable-nftables \
            --enable-libipq    \
            --with-xtlibdir=/lib/xtables &&
make &&
make DESTDIR=$PWD/_pkg install
ln -sfv ../../sbin/xtables-legacy-multi _pkg/usr/bin/iptables-xml &&
mkdir -pv _pkg/lib &&
for file in ip4tc ip6tc ipq xtables
do
  mv -v _pkg/usr/lib/lib${file}.so.* _pkg/lib
  ln -sfv ../../lib/$(readlink /rootfs/usr/lib/lib${file}.so) _pkg/usr/lib/lib${file}.so
done
strip -v _pkg/sbin/*
strip -v _pkg/lib/*
for library in $(ldd _pkg/sbin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
tar -C _pkg/ -cvf ${LFS}/pkg/iptables-1.8.4.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de iproute2-5.2.0 en 59.786 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de iproute2-5.2.0 en %R seconds ...'
time {
wget  https://www.kernel.org/pub/linux/utils/net/iproute2/iproute2-5.2.0.tar.xz -O ${LFS}/download/iproute2-5.2.0.tar.xz --no-check-certificate &&
md5sum -c <<<" 0cb2736e7bc2f56254a363d3d23703b7 ${LFS}/download/iproute2-5.2.0.tar.xz" &&
rm -Rf ${LFS}/src/iproute2-5.2.0 &&
tar xf ${LFS}/download/iproute2-5.2.0.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/iproute2-5.2.0 &&
./configure CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip -v _pkg/sbin/*
for library in $(ldd _pkg/sbin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
tar -C _pkg/ -cvf ${LFS}/pkg/iproute2-5.2.0.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de inetutils-1.9.4 en 104.616 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de inetutils-1.9.4 en %R seconds ...'
time {
wget http://ftp.gnu.org/gnu/inetutils/inetutils-1.9.4.tar.xz -O ${LFS}/download/inetutils-1.9.4.tar.xz --no-check-certificate &&
md5sum -c <<<" 87fef1fa3f603aef11c41dcc097af75e ${LFS}/download/inetutils-1.9.4.tar.xz" &&
rm -Rf ${LFS}/src/inetutils-1.9.4 &&
tar xf ${LFS}/download/inetutils-1.9.4.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/inetutils-1.9.4 &&
./configure --prefix=/usr        \
            --localstatedir=/var \
            --disable-logger     \
            --disable-whois &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip -v _pkg/usr/bin/*
for library in $(ldd _pkg/usr/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
tar -C _pkg/ -cvf ${LFS}/pkg/inetutils-1.9.4.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de dig-9.14.9 en 171.893 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de dig-9.14.9 en %R seconds ...'
time {
wget http://ftp.isc.org/isc/bind9/9.14.9/bind-9.14.9.tar.gz -O ${LFS}/download/bind-9.14.9.tar.gz --no-check-certificate &&
md5sum -c <<<" 6a36a93930a11d58c1580765e56dd726 ${LFS}/download/bind-9.14.9.tar.gz" &&
rm -Rf ${LFS}/src/bind-9.14.9 &&
tar -xzf ${LFS}/download/bind-9.14.9.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/bind-9.14.9 &&
./configure --prefix=/usr --without-python &&
make -C lib/dns    &&
make -C lib/isc    &&
make -C lib/bind9  &&
make -C lib/isccfg &&
make -C lib/irs    &&
make -C bin/dig &&
make -C bin/dig DESTDIR=$PWD/_pkg install &&
for library in $(ldd _pkg/usr/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
tar -C _pkg/ -cvf ${LFS}/pkg/dig-9.14.9.tar.gz ./
cd "${LFS}/"
}
 
 
 
 
 
# ## (BUSYBOX) Compilation de squashfs4.4 en 13.707 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de squashfs4.4 en %R seconds ...'
time {
wget http://kent.dl.sourceforge.net/sourceforge/squashfs/squashfs4.4.tar.gz -O ${LFS}/download/squashfs4.4.tar.gz --no-check-certificate &&
rm -Rf ${LFS}/src/squashfs4.4 &&
tar -xf ${LFS}/download/squashfs4.4.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/squashfs4.4/squashfs-tools &&
sed "s/#XZ_SUPPORT/XZ_SUPPORT/" -i Makefile &&
make 
mkdir -pv _pkg/{bin,lib,lib64,usr/lib,usr/lib64}
install -o root -g root -m 755 mksquashfs _pkg/bin
install -o root -g root -m 755 unsquashfs _pkg/bin
strip -v _pkg/bin/*
for library in $(ldd _pkg/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
tar -C _pkg/ -cvf ${LFS}/pkg/squashfs4.4.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de LVM2.2.03.07 en 132.594 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de LVM2.2.03.07 en %R seconds ...'
time {
wget https://sourceware.org/ftp/lvm2/LVM2.2.03.07.tgz -O ${LFS}/download/LVM2.2.03.07.tgz --no-check-certificate &&
md5sum -c <<<" 5c06a01e1adacb96761188d6a8a17a2e ${LFS}/download/LVM2.2.03.07.tgz" &&
rm -Rf ${LFS}/src/LVM2.2.03.07 &&
tar -xzf ${LFS}/download/LVM2.2.03.07.tgz -C ${LFS}/src &&
cd ${LFS}/src/LVM2.2.02.177 &&
./configure --prefix=/usr       \
            --exec-prefix=      \
            --with-confdir=/etc \
            --enable-applib     \
            --enable-cmdlib     \
            --enable-pkgconfig &&
make &&
make DESTDIR=$PWD/_pkg install 
strip -v _pkg/usr/lib/* 
strip -v _pkg/sbin/* 
strip -v _pkg/lib/* 
for library in $(ldd _pkg/sbin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
tar -C _pkg/ -cvf ${LFS}/pkg/LVM2.2.03.07.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de btrfs-progs-v5.4 en 61.701 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de btrfs-progs-v5.4 en %R seconds ...'
time {
wget https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v5.4.1.tar.xz -O ${LFS}/download/btrfs-progs-v5.4.1.tar.xz --no-check-certificate &&
md5sum -c <<<" 4fb3ac57dc4e0afcf723cdf34640179b ${LFS}/download/btrfs-progs-v5.4.1.tar.xz" &&
rm -Rf ${LFS}/src/btrfs-progs-v5.4
tar -xf ${LFS}/download/btrfs-progs-v5.4.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/btrfs-progs-v5.4 &&
./configure --prefix=/usr  \
            --bindir=/bin  \
            --libdir=/lib  \
            --disable-documentation \
            --disable-zstd &&
make &&
make DESTDIR=$PWD/_pkg install &&
for library in $(ldd _pkg/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
mkdir -pv _pkg/{sbin,usr/lib,usr/lib64} &&
ln -sfv ../../lib/$(readlink _pkg/lib/libbtrfs.so) _pkg/usr/lib/libbtrfs.so &&
ln -sfv ../../lib/$(readlink _pkg/lib/libbtrfsutil.so) _pkg/usr/lib/libbtrfsutil.so &&
mv -v _pkg/bin/{mkfs,fsck}.btrfs _pkg/sbin &&
tar -C _pkg/ -cvf ${LFS}/pkg/btrfs-progs-v5.4.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de ncurses-6.1 en 164.067 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de ncurses-6.1 en %R seconds ...'
time {
wget http://ftp.gnu.org/gnu/ncurses/ncurses-6.1.tar.gz -O ${LFS}/download/ncurses-6.1.tar.gz --no-check-certificate &&
md5sum -c <<<" 98c889aaf8d23910d2b92d65be2e737a ${LFS}/download/ncurses-6.1.tar.gz" &&
rm -Rf ${LFS}/src/ncurses-6.1 &&
tar xzf ${LFS}/download/ncurses-6.1.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/ncurses-6.1 &&
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 DESTDIR=$PWD/_pkg install &&
mkdir -pv _pkg/{lib,lib64,usr/lib/pkgconfig,usr/lib64} &&
mv -v _pkg/usr/lib/libncursesw.so.6* _pkg/lib &&
ln -sfv ../../lib/$(readlink /usr/lib/libncursesw.so) _pkg/usr/lib/libncursesw.so &&
for lib in ncurses form panel menu ; do
    rm -vf                    _pkg/usr/lib/lib${lib}.so
    echo "INPUT(-l${lib}w)" > _pkg/usr/lib/lib${lib}.so
    ln -sfv ${lib}w.pc        _pkg/usr/lib/pkgconfig/${lib}.pc
done &&
rm -vf                     _pkg/usr/lib/libcursesw.so &&
echo "INPUT(-lncursesw)" > _pkg/usr/lib/libcursesw.so &&
ln -sfv libncurses.so      _pkg/usr/lib/libcurses.so &&
ln -sfv libncursesw.a      _pkg/usr/lib/libcurses.a &&
make distclean &&
./configure --prefix=/usr    \
            --with-shared    \
            --without-normal \
            --without-debug  \
            --without-cxx-binding \
            --with-abi-version=5 &&
make DESTDIR=$PWD/_pkg sources libs &&
cp -av lib/lib*.so.5* _pkg/usr/lib &&
for library in $(ldd _pkg/usr/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
tar -C _pkg/ -cvf ${LFS}/pkg/ncurses-6.1.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de lxc-3.2.1.tar.gz en 97.260 seconds ..
 
TIMEFORMAT='(BUSYBOX) Compilation de lxc-3.2.1.tar.gz en %R seconds ...'
time {
wget https://linuxcontainers.org/downloads/lxc/lxc-3.2.1.tar.gz -O ${LFS}/download/lxc-3.2.1.tar.gz --no-check-certificate &&
rm -Rf ${LFS}/src/lxc-3.2.1 &&
tar xzf ${LFS}/download/lxc-3.2.1.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/lxc-3.2.1 &&
./autogen.sh &&
./configure CFLAGS="-static -static-libgcc" && 
make &&
mkdir -pv $PWD/_pkg/lib/ &&
touch $PWD/_pkg/lib/liblxc.so &&
make destdir=$PWD/_pkgs  prefix=$PWD/_pkg install &&
strip -v _pkg/bin/*
strip -v _pkg/sbin/*
for library in $(ldd _pkg/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
for library in $(ldd _pkg/sbin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
tar -C _pkg/ -cvf ${LFS}/pkg/lxc-3.2.1.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de qemu-4.2.0 en 363.415 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de qemu-4.2.0 en %R seconds ...'
time {
wget http://download.qemu-project.org/qemu-4.2.0.tar.xz -O ${LFS}/download/qemu-4.2.0.tar.xz --no-check-certificate &&
md5sum -c <<<" 278eeb294e4b497e79af7a57e660cb9a ${LFS}/download/qemu-4.2.0.tar.xz" &&
rm -Rf ${LFS}/src/qemu-4.2.0 &&
tar xf ${LFS}/download/qemu-4.2.0.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/qemu-4.2.0 &&
mkdir -vp build &&
cd        build &&
if [ $(uname -m) = i686 ]; then
   QEMU_ARCH=i386-softmmu
else
   QEMU_ARCH=x86_64-softmmu
fi &&
../configure --disable-bsd-user --disable-guest-agent --disable-strip --disable-werror --disable-gcrypt --disable-debug-info --disable-debug-tcg --disable-tcg-interpreter --enable-attr --disable-brlapi --disable-linux-aio --disable-bluez --disable-cap-ng --disable-curl --disable-fdt --disable-glusterfs --disable-gnutls --disable-nettle --disable-gtk --disable-rdma --disable-libiscsi --disable-vnc-jpeg --disable-lzo --disable-curses --disable-libnfs --disable-numa --disable-opengl --disable-vnc-png --disable-rbd --disable-vnc-sasl --disable-sdl --disable-seccomp --disable-smartcard --disable-snappy --disable-spice --disable-libusb --disable-usb-redir --disable-vde --disable-vhost-net --disable-virglrenderer --disable-virtfs --disable-vnc --disable-vte --disable-xen --disable-xen-pci-passthrough --disable-xfsctl --enable-linux-user --disable-system --disable-blobs  --disable-pie --disable-auth-pam --disable-lzfse --target-list="x86_64-linux-user"  &&
unset QEMU_ARCH &&
LDLAGS="-static -static-libgcc" make &&
make prefix=$PWD/_pkg install &&
strip -v _pkg/bin/*
for library in $(ldd _pkg/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
tar -C _pkg/ -cvf ${LFS}/pkg/qemu-4.2.0.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de cpio-2.12 en 97.447 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de cpio-2.12 en %R seconds ...'
time {
wget https://ftp.gnu.org/gnu/cpio/cpio-2.13.tar.bz2 -O ${LFS}/download/cpio-2.13.tar.bz2 --no-check-certificate &&
md5sum -c <<<" f3438e672e3fa273a7dc26339dd1eed6 ${LFS}/download/cpio-2.13.tar.bz2" &&
rm -rf ${LFS}/src/cpio-2.12 &&
tar xjf ${LFS}/download/cpio-2.12.tar.bz2 -C ${LFS}/src &&
cd ${LFS}/src/cpio-2.12 &&
./configure --prefix=/usr \
            --bindir=/bin \
            --enable-mt   \
            --with-rmt=/usr/libexec/rmt CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install
strip -v _pkg/bin/*
tar -C _pkg/ -cvf ${LFS}/pkg/cpio-2.12.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de pax-20161104 en 7.812 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de pax-20161104 en %R seconds ...'
time {
wget http://pub.allbsd.org/MirOS/dist/mir/cpio/paxmirabilis-20161104.cpio.gz -O ${LFS}/download/paxmirabilis-20161104.cpio.gz --no-check-certificate &&
md5sum -c <<<" 51172547aa7447244ba1db5768cdcdfd  ${LFS}/download/paxmirabilis-20161104.cpio.gz" &&
rm -rf ${LFS}/src/pax &&
cd /src &&
gzip -dck ${LFS}/download/paxmirabilis-20161104.cpio.gz | cpio -mid &&
cd pax &&
sed -i '/stat.h/a #include <sys/sysmacros.h>' cpio.c gen_subs.c tar.c &&
cc -O2 -DLONG_OFF_T -o pax -DPAX_SAFE_PATH=\"/bin\" *.c &&
mkdir -pv $PWD/_pkg/{bin,usr/share/man/man1} &&
install -v pax _pkg/bin &&
install -v pax.1 _pkg/usr/share/man/man1 &&
tar -C _pkg/ -cvf ${LFS}/pkg/pax-20161104.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de wget-1.20.3 en 85.892 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de wget-1.20.3 en %R seconds ...'
time {
wget https://ftp.gnu.org/gnu/wget/wget-1.20.3.tar.gz -O ${LFS}/download/wget-1.20.3.tar.gz --no-check-certificate &&
md5sum -c <<<"db4e6dc7977cbddcd543b240079a4899 ${LFS}/download/wget-1.20.3.tar.gz" &&
rm -Rf ${LFS}/src/wget-1.20.3 &&
tar xzf ${LFS}/download/wget-1.20.3.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/wget-1.20.3 &&
./configure --prefix=/usr      \
            --sysconfdir=/etc  \
            --with-ssl=openssl &&
make &&
make DESTDIR=$PWD/_pkg install &&
mkdir -pv _pkg/{lib,lib64,usr/lib,usr/lib64} &&
for library in $(ldd _pkg/usr/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done
tar -C _pkg/ -cvf ${LFS}/pkg/wget-1.20.3.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de git-2.24.1 en 310.392 seconds .
 
TIMEFORMAT='(BUSYBOX) Compilation de git-2.24.1 en %R seconds ...'
time {
wget https://www.kernel.org/pub/software/scm/git/git-2.24.1.tar.xz -O ${LFS}/download/git-2.24.1.tar.xz --no-check-certificate &&
md5sum -c <<<"42540aa4eabfb831127a801a89c1b6e0 ${LFS}/download/git-2.24.1.tar.xz" &&
rm -Rf ${LFS}/src/git-2.24.1 &&
tar xf ${LFS}/download/git-2.24.1.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/git-2.24.1 &&
./configure --prefix=/usr --with-curl --with-expat --with--with-gitconfig=/etc/gitconfig &&
make &&
make DESTDIR=$PWD/_pkg install &&
for library in $(ldd _pkg/usr/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
tar -C _pkg/ -cvf ${LFS}/pkg/git-2.24.1.tar.gz ./ &&
cd "${LFS}/"
}
 
## (BUSYBOX) Compilation de libassuan-2.5.3 en 20.463 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de libassuan-2.5.3 en %R seconds ...'
time {
wget  https://www.gnupg.org/ftp/gcrypt/libassuan/libassuan-2.5.3.tar.bz2 --no-check-certificate &&
md5sum -c <<<" 226c504ea78a232224bf3b6846b3adb9 ${LFS}/download/libassuan-2.5.3.tar.bz2" &&
rm -Rf ${LFS}/src/libassuan-2.5.3 &&
tar xjf ${LFS}/download/libassuan-2.5.3.tar.bz2 -C ${LFS}/src &&
cd ${LFS}/src/libassuan-2.5.3 &&
./configure --prefix=/usr &&
make                      &&
make DESTDIR=$PWD/_pkg install &&
tar -C _pkg/ -cvf ${LFS}/pkg/libassuan-2.5.3.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de gnupg-2.2.17 en 213.217 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de gnupg-2.2.17 en %R seconds ...'
time {
wget https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.2.19.tar.bz2 -O ${LFS}/download/gnupg-2.2.19.tar.bz2 --no-check-certificate &&
md5sum -c <<<" cb3b373d08ba078c325299945a7f2818 ${LFS}/download/gnupg-2.2.19.tar.bz2" &&
rm -Rf cd ${LFS}/src/gnupg-2.2.17 &&
tar xjf ${LFS}/download/gnupg-2.2.17.tar.bz2 -C ${LFS}/src &&
cd ${LFS}/src/gnupg-2.2.17 &&
sed -e '/noinst_SCRIPTS = gpg-zip/c sbin_SCRIPTS += gpg-zip' \
    -i tools/Makefile.in &&
./configure --prefix=/usr            \
            --enable-symcryptrun     \
            --localstatedir=/var     \
            --docdir=/usr/share/doc/gnupg-2.2.17 &&
make &&
make destdir=$PWD/_pkgs  prefix=$PWD/_pkg install &&
for library in $(ldd _pkg/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done
for library in $(ldd _pkg/sbin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done
tar -C _pkg/ -cvf ${LFS}/pkg/gnupg-2.2.17.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de systemd-244 en 166.952 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de systemd-244 en %R seconds ...'
time {
wget https://github.com/systemd/systemd/archive/v244/systemd-244.tar.gz -O ${LFS}/download/systemd-244.tar.gz --no-check-certificate &&
md5sum -c <<<" 413121fe918b252ae62310f6fc7c4b32 ${LFS}/download/systemd-244.tar.gz" &&
wget http://anduin.linuxfromscratch.org/LFS/systemd-man-pages-244.tar.xz -O ${LFS}/download/systemd-man-pages-244.tar.xz --no-check-certificate &&
md5sum -c <<<" 1839ad557eb376d22853cac54d00de77 ${LFS}/download/systemd-man-pages-244.tar.xz" &&
rm -Rf ${LFS}/src/systemd-244 &&
tar xzf ${LFS}/download/systemd-244.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/systemd-244 &&
tar xf  ${LFS}/download/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=fr_FR.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=fr_FR.UTF-8 ninja &&
LANG=fr_FR.UTF-8 DESTDIR=$PWD/_pkg ninja install
strip _pkg/bin/*
strip _pkg/usr/bin/*
strip _pkg/bin/*
strip _pkg/usr/bin/*
for library in $(ldd _pkg/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
for library in $(ldd _pkg/sbin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
for library in $(ldd _pkg/usr/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
rm -Rf _pkg/_pkg &&
tar -C _pkg/ -cvf ${LFS}/pkg/systemd-244.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de sysvinit-2.96 en 6.492 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de sysvinit-2.96 en %R seconds ...'
time {
wget http://download.savannah.gnu.org/releases/sysvinit/sysvinit-2.96.tar.xz -O ${LFS}/download/sysvinit-2.96.tar.xz  --no-check-certificate &&
md5sum -c <<<" 413121fe918b252ae62310f6fc7c4b32 ${LFS}/download/systemd-244.tar.gz" &&
wget http://www.linuxfromscratch.org/patches/lfs/development/sysvinit-2.96-consolidated-1.patch -O ${LFS}/download/sysvinit-2.96-consolidated-1.patch  --no-check-certificate &&
md5sum -c <<<" 4900322141d493e74020c9cf437b2cdc ${LFS}/download/sysvinit-2.96-consolidated-1.patch" &&
rm -rf ${LFS}/src/sysvinit-2.96 &&
tar xf ${LFS}/download/sysvinit-2.96.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/sysvinit-2.96 &&
patch -Np1 -i ${LFS}/download/sysvinit-2.96-consolidated-1.patch &&
make &&
mkdir -pv _pkg/{bin,sbin,usr/bin,etc,include,share/man}
for i in init halt shutdown runlevel killall5 fstab-decode bootlogd; do \
  install -o root -g root -m 755 src/$i $PWD/_pkg/sbin/ ; \
done && 
# install -m 755 -d ../_pkg/etc/
# install -o root -g root -m 755 ../doc/initscript.sample $PWD/_pkg/etc/
ln -sf halt $PWD/_pkg/sbin/reboot &&
ln -sf halt $PWD/_pkg/sbin/poweroff &&
ln -sf init $PWD/_pkg/sbin/telinit &&
#ln -sf /sbin/killall5 $PWD_pkg/bin/pidof
#if [ ! -f $PWD_pkg/usr/bin/lastb ]; then \
#	ln -sf last $PWD/_pkg/usr/bin/lastb; \
#fi
install -m 755 -d $PWD/_pkg/usr/include/ &&
install -o root -g root -m 644 initreq.h $PWD/_pkg/usr/include/ &&
install -m 755 -d $PWD/_pkg/usr/share/man/man1/ &&
install -m 755 -d $PWD/_pkg/usr/share/man/man5/ &&
install -m 755 -d $PWD/_pkg/usr/share/man/man8/ &&
for man in initscript.5 inittab.5 initctl.5; do \
  install -o root -g root -m 644 man/$man $PWD/_pkg/usr/share/man/man5/; \
  sed -i "1{ s@^\('\\\\\"\)[^\*-]*-\*- coding: [^[:blank:]]\+ -\*-@\1@; }" $PWD/_pkg/usr/share/man/man5/$man ; \
done &&
for man in halt.8 init.8 killall5.8         poweroff.8 reboot.8 runlevel.8 shutdown.8 telinit.8 fstab-decode.8  bootlogd.8; do \
  install -o root -g root -m 644 man/$man $PWD/_pkg/usr/share/man/man8/; \
  sed -i "1{ s@^\('\\\\\"\)[^\*-]*-\*- coding: [^[:blank:]]\+ -\*-@\1@; }" $PWD/_pkg/usr/share/man/man8/$man ; \
done
strip -v _pkg/sbin/*
tar -C _pkg/ -cvf ${LFS}/pkg/sysvinit-2.96.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de grub-2.04 en 63.845 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de grub-2.04 en %R seconds ...'
time {
wget https://ftp.gnu.org/gnu/grub/grub-2.04.tar.xz -O ${LFS}/download/grub-2.04.tar.xz --no-check-certificate &&
md5sum -c <<<" 5aaca6713b47ca2456d8324a58755ac7 ${LFS}/download/grub-2.04.tar.xz" &&
rm -rf ${LFS}/src/grub-2.04 &&
tar xf ${LFS}/download/grub-2.04.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/grub-2.04 &&
./configure --prefix=/usr          \
            --sbindir=/sbin        \
            --sysconfdir=/etc      \
            --disable-efiemu       \
            --with-platform=efi    \
            --disable-werror  CFLAGS="-static -static-libgcc" &&
make &&
make DESTDIR=$PWD/_pkg install &&
mv -v _pkg/etc/bash_completion.d/grub _pkg/usr/share/bash-completion/completions
strip -v _pkg/sbin/*
tar -C _pkg/ -cvf ${LFS}/pkg/grub-2.04.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de fuse-3.9.0.tar.gz en 40.777 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de fuse-3.9.0.tar.gz en %R seconds ...'
time {
wget https://github.com/libfuse/libfuse/releases/download/fuse-3.9.0/fuse-3.9.0.tar.xz -O ${LFS}/download/fuse-3.9.0.tar.xz --no-check-certificate &&
md5sum -c <<<"  5dc2be21c0d06c7eace340996e8a37e2 ${LFS}/download/fuse-3.9.0.tar.xz" &&
rm -Rf ${LFS}/src/fuse-3.9.0 &&
tar xf ${LFS}/download/fuse-3.9.0.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/fuse-3.9.0 &&
sed -i '/^udev/,$ s/^/#/' util/meson.build &&
mkdir build &&
cd    build &&
meson --prefix=/usr ..                                        &&
LANG=fr_FR.UTF-8 ninja &&
LANG=fr_FR.UTF-8 DESTDIR=$PWD/_pkg ninja install              &&
mkdir -pv _pkg/{bin,sbin,lib,usr/share/doc/fuse-3.9.0}        &&
mv -vf   _pkg/usr/lib/libfuse3.so.3*    _pkg/lib              &&
ln -sfvn ../../lib/libfuse3.so.3.9.0 _pkg/usr/lib/libfuse3.so &&
mv -vf _pkg/usr/bin/fusermount3  _pkg/bin                     &&
mv -vf _pkg/usr/sbin/mount.fuse3 _pkg/sbin                    &&
chmod u+s _pkg/bin/fusermount3                                &&
install -v -m755 -d _pkg/usr/share/doc/fuse-3.9.0             &&
install -v -m644    ../doc/{README.NFS,kernel.txt} \
                    _pkg/usr/share/doc/fuse-3.9.0             &&
cp -Rv ../doc/html  _pkg/usr/share/doc/fuse-3.9.0             &&
for library in $(ldd _pkg/sbin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
for library in $(ldd _pkg/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done   
strip -v _pkg/bin/*
strip -v _pkg/sbin/*
tar -C _pkg/ -cvf ${LFS}/pkg/fuse-3.9.0.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de gpgme-1.13.1 en 114.920 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de gpgme-1.13.1 en %R seconds ...'
time {
wget https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-1.13.1.tar.bz2 -O ${LFS}/download/gpgme-1.13.1.tar.bz2 --no-check-certificate &&
md5sum -c <<<" 198f0a908ec3cd8f0ce9a4f3a4489645 ${LFS}/download/gpgme-1.13.1.tar.bz2" &&
tar -xf ${LFS}/download/gpgme-1.13.1.tar.bz2 -C ${LFS}/src &&
cd ${LFS}/src/gpgme-1.13.1 &&
./autogen.sh &&
./configure --prefix=/usr --disable-gpg-test &&
make &&
make DESTDIR=$PWD/_pkg install &&
for library in $(ldd _pkg/usr/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done
strip -v _pkg/usr/bin/*
strip -v _pkg/usr/lib/*
tar -C _pkg/ -cvf ${LFS}/pkg/gpgme-1.13.1.tar.gz ./
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de libostree-2019.6 en 174.392 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de libostree-2019.6 en %R seconds ...'
time {
wget https://github.com/ostreedev/ostree/archive/v2019.6.tar.gz -O ${LFS}/download/libostree-2019.6.tar.gz  --no-check-certificate &&
rm -Rf ${LFS}/src/libostree-2019.6 &&
tar -xf ${LFS}/download/libostree-2019.6.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/libostree-2019.6  &&
./configure --prefix=/usr --without-selinux --with-dracut --with-curl --with-soup=no --enable-man=true &&
make &&
make DESTDIR=$PWD/_pkg install
strip -v _pkg/lib/*
strip -v _pkg/usr/bin/*
strip -v _pkg/usr/lib/*
for library in $(ldd _pkg/usr/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
mv _pkg/usr/etc _pkg/ &&
ln -sfvn ../../usr/libexec/libostree/grub2-15_ostree _pkg/etc/grub.d/15_ostree &&
tar -C _pkg/ -cvf ${LFS}/pkg/libostree-2019.6.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de go1.13.6 en 316.639 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de go1.13.6 en %R seconds ...'
time {
wget https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz -O ${LFS}/download/go1.13.6.linux-amd64.tar.gz --no-check-certificate &&
wget https://github.com/golang/go/archive/go1.13.6.tar.gz -O ${LFS}/download/go1.13.6.tar.gz --no-check-certificate &&
rm -Rf ${LFS}/opt/go &&
tar -xf ${LFS}/download/go1.13.6.linux-amd64.tar.gz -C ${LFS}/opt &&
export PATH=${LFS}/opt/bin:${LFS}/opt/go/bin:$PATH &&
export GOPATH=${LFS}/opt/gopath &&
export GOROOT=${LFS}/opt/go &&
rm -Rf ${LFS}/src/go-go1.13.6 &&
tar -xf ${LFS}/download/go1.13.6.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/go-go1.13.6/src &&
CGO_ENABLED=0 ./make.bash &&
cd ${LFS}/src/go-go1.13.6/ &&
mkdir -pv _pkg/opt/go &&
cp -rav {bin,api,favicon.ico,pkg,test,bin,lib,robots.txt,doc,misc,src} _pkg/opt/go &&
tar -C _pkg/ -cvf ${LFS}/pkg/go-1.13.6.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de rkt-1.30.0 en 64.829 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de rkt-1.30.0 en %R seconds ...'
time {
wget https://github.com/rkt/rkt/archive/v1.30.0.tar.gz -O ${LFS}/download/rkt-1.30.0.tar.gz --no-check-certificate &&
rm -Rf ${LFS}/src/rkt-1.30.0 &&
rm -Rf ${LFS}/opt/gopath/rkt-1.30.0 &&
tar -xf ${LFS}/download/rkt-1.30.0.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/rkt-1.30.0 &&
sed -i 's/\$(MK_TOPLEVEL_ABS_SRCDIR)\/build-/\/opt\/gopath\//' Makefile.in &&
./autogen.sh &&
./configure --enable-tpm=no --with-stage1-flavors=host,fly &&
make V=2 -j &&
mkdir -pv _pkg/{bin,sbin,lib,opt/gopath}            &&
for library in $(ldd /opt/gopath/rkt/target/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
for library in $(ldd /opt/gopath/rkt/target/tools/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
ln -sfv /opt/gopath/rkt-1.30.0/target/bin/rkt _pkg/bin/rkt &&
cp -rv /opt/gopath/rkt-1.30.0/ _pkg/opt/gopath/ &&
tar -C _pkg/ -cvf ${LFS}/pkg/rkt-1.30.0.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de conmon
 
TIMEFORMAT='(BUSYBOX) Compilation de conmon-2.0.7 en %R seconds ...'
time {
wget https://github.com/containers/conmon/archive/v2.0.7.tar.gz -O ${LFS}/download/conmon-2.0.7.tar.gz  --no-check-certificate &&
rm -Rf ${LFS}/src/conmon-2.0.7 &&
tar -xf ${LFS}/download/conmon-2.0.7.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/conmon-2.0.7 &&
make &&
strip -v bin/conmon &&
install  -D -m 755 bin/conmon _pkg/usr/local/bin/conmon &&
tar -C _pkg/ -cvf ${LFS}/pkg/conmon-2.0.7.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de cri-o-1.16.2 en 53.325 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de cri-o-1.16.2 en %R seconds ...'
time {
wget https://github.com/cri-o/cri-o/archive/v1.16.2.tar.gz -O ${LFS}/download/cri-o-1.16.2.tar.gz  --no-check-certificate &&
rm -Rf ${LFS}/src/cri-o-1.16.2 &&
tar -xf ${LFS}/download/cri-o-1.16.2.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/cri-o-1.16.2 &&
make BUILDTAGS="" &&
make DESTDIR=$PWD/_pkg install &&
mkdir -pv _pkg/{bin,sbin,lib,usr/lib} &&
for library in $(ldd _pkg/usr/local/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done
strip -v _pkg/usr/local/bin/*
tar -C _pkg/ -cvf ${LFS}/pkg/cri-o-1.16.2.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de runc-1.0.0-rc9 en 8.911 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de runc-1.0.0-rc9 en %R seconds ...'
time {
mkdir -pv ${LFS}/opt/gopath/src/github.com/opencontainers/ &&
cd ${LFS}/opt/gopath/src/github.com/opencontainers/ &&
rm -Rf runc &&
git clone http://github.com/opencontainers/runc.git &&
cd runc &&
make BUILDTAGS="" &&
make DESTDIR=$PWD/_pkg install &&
install -o root -g root -m 755 -d _pkg/usr/share/containers/oci/hooks.d &&
tar -C _pkg/ -cvf ${LFS}/pkg/runc-1.0.0-rc9.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de buildah-1.13.1 en 51.875 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de buildah-1.13.1 en %R seconds ...'
time {
cd ${LFS}/opt/gopath/ &&
rm -Rf buildah &&
git clone http://github.com/containers/buildah.git &&
cd buildah &&
make BUILDTAGS="" &&
make DESTDIR=$PWD/_pkg install &&
mkdir -pv _pkg/{bin,sbin,lib,usr/lib} &&
for library in $(ldd _pkg/usr/local/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done
strip -v _pkg/usr/local/bin/*
tar -C _pkg/ -cvf ${LFS}/pkg/buildah-1.13.1.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de tree-1.8.0 en 2.088 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de tree-1.8.0 en %R seconds ...'
time {
wget http://mama.indstate.edu/users/ice/tree/src/tree-1.8.0.tgz -O ${LFS}/download/tree-1.8.0.tar.gz  --no-check-certificate &&
md5sum -c <<<" 715191c7f369be377fc7cc8ce0ccd835 ${LFS}/download/tree-1.8.0.tar.gz" &&
rm -Rf ${LFS}/src/tree-1.8.0 &&
tar -xf ${LFS}/download/tree-1.8.0.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/tree-1.8.0 &&
make &&
install -d _pkg/usr/bin &&
install -d _pkg/usr/man/man1 &&
if [ -e tree ]; then \
	install tree _pkg/usr/bin/tree; \
fi &&
install doc/tree.1 _pkg/usr/man/man1/tree.1
strip -v _pkg/usr/bin/*
tar -C _pkg/ -cvf ${LFS}/pkg/tree-1.8.0 .tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de time-1.9 en 21.699 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de time-1.9 en %R seconds ...'
time {
wget https://ftp.gnu.org/gnu/time/time-1.9.tar.gz -O ${LFS}/download/time-1.9.tar.gz --no-check-certificate &&
md5sum -c <<<" d2356e0fe1c0b85285d83c6b2ad51b5f ${LFS}/download/time-1.9.tar.gz" &&
rm -Rf ${LFS}/src/time-1.9 &&
tar -xf ${LFS}/download/time-1.9.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/time-1.9 &&
./configure --prefix=/usr &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip -v _pkg/usr/bin/*
tar -C _pkg/ -cvf ${LFS}/pkg/time-1.9.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de xfsprogs-5.4.0 en 188.373 seconds .
 
TIMEFORMAT='(BUSYBOX) Compilation de xfsprogs-5.4.0 en %R seconds ...'
time {
wget https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-5.4.0.tar.xz -O ${LFS}/download/xfsprogs-5.4.0.tar.xz --no-check-certificate &&
md5sum -c <<<" 61232b1cc453780517d9b0c12ff1699b ${LFS}/download/xfsprogs-5.4.0.tar.xz" &&
rm -Rf ${LFS}/src/xfsprogs-5.4.0 &&
tar -xf ${LFS}/download/xfsprogs-5.4.0.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/xfsprogs-5.4.0 &&
make DEBUG=-DNDEBUG     \
     INSTALL_USER=root  \
     INSTALL_GROUP=root \
     LOCAL_CONFIGURE_OPTIONS="--enable-readline"           &&
make DESTDIR=$PWD/_pkg PKG_DOC_DIR=/usr/share/doc/xfsprogs-5.4.0 install     &&
make DESTDIR=$PWD/_pkg PKG_DOC_DIR=/usr/share/doc/xfsprogs-5.4.0 install-dev &&
for library in $(ldd _pkg/usr/sbin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
sed -i "s@libdir='/lib@libdir='/usr/lib@" /usr/lib/libhandle.la
strip -v _pkg/usr/sbin/*
tar -C _pkg/ -cvf ${LFS}/pkg/xfsprogs-5.4.0.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de Linux-PAM-1.3.1 en 75.654 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de Linux-PAM-1.3.1 en %R seconds ...'
time {
wget https://github.com/linux-pam/linux-pam/releases/download/v1.3.1/Linux-PAM-1.3.1.tar.xz -O ${LFS}/download/Linux-PAM-1.3.1.tar.xz --no-check-certificate &&
md5sum -c <<<" 558ff53b0fc0563ca97f79e911822165  ${LFS}/download/Linux-PAM-1.3.1.tar.xz" &&
rm -Rf ${LFS}/src/Linux-PAM-1.3.1 &&
tar -xf ${LFS}/download/Linux-PAM-1.3.1.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/Linux-PAM-1.3.1 &&
./configure --prefix=/usr                    \
            --sysconfdir=/etc                \
            --libdir=/usr/lib                \
            --enable-securedir=/lib/security \
            --docdir=/usr/share/doc/Linux-PAM-1.3.1 &&
make &&
install -v -m755 -d _pkg/etc/pam.d &&
make DESTDIR=$PWD/_pkg install &&
for library in $(ldd _pkg/sbin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done
strip -v _pkg/sbin/*
chmod -v 4755 _pkg/sbin/unix_chkpwd &&
for file in pam pam_misc pamc
do
  mv -v _pkg/usr/lib/lib${file}.so.* _pkg/lib &&
  ln -sfv ../../lib/$(readlink /usr/lib/lib${file}.so) _pkg/usr/lib/lib${file}.so
done &&
install -vdm755 _pkg/etc/pam.d &&
cat > _pkg/etc/pam.d/system-account << "EOF" &&
# Begin /etc/pam.d/system-account
 
account   required    pam_unix.so
 
# End /etc/pam.d/system-account
EOF
 
cat > _pkg/etc/pam.d/system-auth << "EOF" &&
# Begin /etc/pam.d/system-auth
 
auth      required    pam_unix.so
 
# End /etc/pam.d/system-auth
EOF
 
cat > _pkg/etc/pam.d/system-session << "EOF"
# Begin /etc/pam.d/system-session
 
session   required    pam_unix.so
 
# End /etc/pam.d/system-session
EOF
 
cat > _pkg/etc/pam.d/system-password << "EOF"
# Begin /etc/pam.d/system-password
 
# use sha512 hash for encryption, use shadow, and try to use any previously
# defined authentication token (chosen password) set by any prior module
password  required    pam_unix.so       sha512 shadow try_first_pass
 
# End /etc/pam.d/system-password
EOF
 
tar -C _pkg/ -cvf ${LFS}/pkg/Linux-PAM-1.3.1.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de libcap-2.30 en 15.048 seconds ...
# depend de Linux-PAM-1.3.1
TIMEFORMAT='(BUSYBOX) Compilation de libcap-2.30 en %R seconds ...'
time {
wget https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.30.tar.xz -O ${LFS}/download/libcap-2.30.tar.xz --no-check-certificate &&
md5sum -c <<<" ea531f37a30a61dce8bf8544537a46e3  ${LFS}/download/libcap-2.30.tar.xz" &&
rm -Rf ${LFS}/src/libcap-2.30 &&
tar -xf ${LFS}/download/libcap-2.30.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/libcap-2.30 &&
sed -i '/install.*STACAPLIBNAME/d' libcap/Makefile &&
make lib=lib &&
make  DESTDIR=$PWD/_pkg lib=lib install &&
make -C pam_cap &&
install -vdm755 _pkg/etc/lib/security &&
install -vdm644 _pkg/etc/security &&
install -v -m755 pam_cap/pam_cap.so _pkg/lib/security &&
install -v -m644 pam_cap/capability.conf _pkg/etc/security &&
install -vdm755 _pkg/etc/pam.d &&
cat > _pkg/etc/pam.d/system-auth << "EOF" &&
# Begin /etc/pam.d/system-auth
 
auth      optional    pam_cap.so
auth      required    pam_unix.so
 
# End /etc/pam.d/system-auth
EOF
 
strip -v _pkg/lib/*
strip -v _pkg/sbin/*
chmod -v 755 _pkg/lib/libcap.so.2.30 &&
tar -C _pkg/ -cvf ${LFS}/pkg/libcap-2.30.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de dhcpcd-8.1.5 en 17.514 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de dhcpcd-8.1.5 en %R seconds ...'
time {
wget https://roy.marples.name/downloads/dhcpcd/dhcpcd-8.1.5.tar.xz -O ${LFS}/download/dhcpcd-8.1.5.tar.xz --no-check-certificate &&
md5sum -c <<<" 57fd5dd4ff9722773ec67239db34d3b5 ${LFS}/download/dhcpcd-8.1.5.tar.xz" &&
rm -Rf ${LFS}/src/dhcpcd-8.1.5 &&
tar -xf ${LFS}/download/dhcpcd-8.1.5.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/dhcpcd-8.1.5 &&
./configure --libexecdir=/lib/dhcpcd \
            --dbdir=/var/lib/dhcpcd  &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip -v _pkg/sbin/*
tar -C _pkg/ -cvf ${LFS}/pkg/dhcpcd-8.1.5.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de libtirpc-1.2.5 en 28.802 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de libtirpc-1.2.5 en %R seconds ...'
time {
wget https://downloads.sourceforge.net/libtirpc/libtirpc-1.2.5.tar.bz2 -O ${LFS}/download/libtirpc-1.2.5.tar.bz2 --no-check-certificate &&
md5sum -c <<<" 688787ddff7c6a92ef15ae3f5dc4dfa1 ${LFS}/download/libtirpc-1.2.5.tar.bz2" &&
rm -Rf ${LFS}/src/libtirpc-1.2.5 &&
tar -xf ${LFS}/download/libtirpc-1.2.5.tar.bz2 -C ${LFS}/src &&
cd ${LFS}/src/libtirpc-1.2.5 &&
./configure --prefix=/usr                                   \
            --sysconfdir=/etc                               \
            --disable-static                                \
            --disable-gssapi                                &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip -v _pkg/usr/lib/*
mkdir -pv _pkg/lib &&
mv -v _pkg/usr/lib/libtirpc.so.* _pkg/lib &&
ln -sfv ../../lib/libtirpc.so.3.0.0 _pkg/usr/lib/libtirpc.so &&
tar -C _pkg/ -cvf ${LFS}/pkg/libtirpc-1.2.5.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de rpcsvc-proto-1.4 en 8.314 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de rpcsvc-proto-1.4 en %R seconds ...'
time {
wget https://github.com/thkukuk/rpcsvc-proto/releases/download/v1.4/rpcsvc-proto-1.4.tar.gz -O ${LFS}/download/rpcsvc-proto-1.4.tar.gz --no-check-certificate &&
md5sum -c <<<" df1022ccc5d0aff30b8e505735b4a98b  ${LFS}/download/rpcsvc-proto-1.4.tar.gz" &&
rm -Rf ${LFS}/src/rpcsvc-proto-1.4 &&
tar -xf ${LFS}/download/rpcsvc-proto-1.4.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/rpcsvc-proto-1.4 &&
./configure --sysconfdir=/etc &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip -v _pkg/usr/bin/*
tar -C _pkg/ -cvf ${LFS}/pkg/rpcsvc-proto-1.4.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de rpcbind-1.2.5 en 7.928 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de rpcbind-1.2.5 en %R seconds ...'
time {
wget https://downloads.sourceforge.net/rpcbind/rpcbind-1.2.5.tar.bz2 -O ${LFS}/download/rpcbind-1.2.5.tar.bz2 --no-check-certificate &&
md5sum -c <<<"  ed46f09b9c0fa2d49015f6431bc5ea7b ${LFS}/download/rpcbind-1.2.5.tar.bz2" &&
wget http://www.linuxfromscratch.org/patches/blfs/svn/rpcbind-1.2.5-vulnerability_fixes-1.patch -O ${LFS}/download/rpcbind-1.2.5-vulnerability_fixes-1.patch --no-check-certificate &&
rm -Rf ${LFS}/src/rpcbind-1.2.5 &&
tar -xf ${LFS}/download/rpcbind-1.2.5.tar.bz2 -C ${LFS}/src &&
cd ${LFS}/src/rpcbind-1.2.5 &&
sed -i "/servname/s:rpcbind:sunrpc:" src/rpcbind.c &&
patch -Np1 -i ${LFS}/download/rpcbind-1.2.5-vulnerability_fixes-1.patch &&
./configure --prefix=/usr                                  \
            --bindir=/sbin                                 \
            --sbindir=/sbin                                \
            --with-rpcuser=root                            \
            --enable-warmstarts                            \
            --without-systemdsystemunitdir                 &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip -v _pkg/sbin/*
tar -C _pkg/ -cvf ${LFS}/pkg/rpcbind-1.2.5.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de nfs-utils-2.4.1 en 54.510 seconds ...
#depend de  libtirpc-1.2.5, rpcsvc-proto-1.4 
TIMEFORMAT='(BUSYBOX) Compilation de nfs-utils-2.4.1 en %R seconds ...'
time {
wget https://downloads.sourceforge.net/nfs/nfs-utils-2.4.1.tar.xz -O ${LFS}/download/nfs-utils-2.4.1.tar.xz --no-check-certificate &&
md5sum -c <<<"  ce1921b8f15db54c3a6c840795312242 ${LFS}/download/nfs-utils-2.4.1.tar.xz" &&
rm -Rf ${LFS}/src/nfs-utils-2.4.1 &&
tar -xf ${LFS}/download/nfs-utils-2.4.1.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/nfs-utils-2.4.1 &&
./configure --prefix=/usr          \
            --sysconfdir=/etc      \
            --sbindir=/sbin        \
            --disable-nfsv4        \
            --disable-gss &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip -v _pkg/sbin/*
strip -v _pkg/lib/*
chmod u+w,go+r _pkg/sbin/mount.nfs &&
mkdir -pv _pkg/usr/sbin &&
mv -v _pkg/sbin/start-statd _pkg/usr/sbin &&
chown nobody.nogroup _pkg/var/lib/nfs &&
tar -C _pkg/ -cvf ${LFS}/pkg/nfs-utils-2.4.1.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de ruby-2.7.0 en 795.484 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de ruby-2.7.0 en %R seconds ...'
time {
wget http://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0.tar.xz -O ${LFS}/download/ruby-2.7.0.tar.xz --no-check-certificate &&
md5sum -c <<<" 22262b119bf22ebe6df363c5f1b68944 ${LFS}/download/ruby-2.7.0.tar.xz" &&
rm -Rf ${LFS}/src/ruby-2.7.0 &&
tar -xf ${LFS}/download/ruby-2.7.0.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/ruby-2.7.0 &&
./configure --prefix=/usr   \
            --enable-shared \
            --docdir=/usr/share/doc/ruby-2.7.0 &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip _pkg/usr/bin/*
strip _pkg/usr/lib/*
tar -C _pkg/ -cvf ${LFS}/pkg/ruby-2.7.0.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de dracut-049 en 3.851 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de dracut-049 en %R seconds ...'
time {
wget https://mirrors.edge.kernel.org/pub/linux/utils/boot/dracut/dracut-049.tar.xz -O ${LFS}/download/dracut-049.tar.xz --no-check-certificate &&
rm -Rf ${LFS}/src/dracut-049 &&
tar -xf ${LFS}/download/dracut-049.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/dracut-049 &&
./configure --prefix=/usr &&
make &&
make DESTDIR=$PWD/_pkg install
strip _pkg/usr/bin/*
mv _pkg/usr/etc _pkg/ &&
tar -C _pkg/ -cvf ${LFS}/pkg/dracut-049.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de dbus-1.12.16 en 76.820 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de dbus-1.12.16 en %R seconds ...'
time {
wget https://dbus.freedesktop.org/releases/dbus/dbus-1.12.16.tar.gz -O ${LFS}/download/dbus-1.12.16.tar.gz --no-check-certificate &&
md5sum -c <<<" 2dbeae80dfc9e3632320c6a53d5e8890 ${LFS}/download/dbus-1.12.16.tar.gz" &&
rm -Rf ${LFS}/src/dbus-1.12.16 &&
tar xzf ${LFS}/download/dbus-1.12.16.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/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 DESTDIR=$PWD/_pkg install &&
strip _pkg/usr/bin/*
strip _pkg/usr/lib/*
mkdir -pv _pkg/{lib,var/lib,etc} &&
mv -v _pkg/usr/lib/libdbus-1.so.* _pkg/lib &&
ln -sfv ../../lib/$(readlink /usr/lib/libdbus-1.so) _pkg/usr/lib/libdbus-1.so &&
ln -sv _pkg/etc/machine-id _pkg/var/lib/dbus &&
tar -C _pkg/ -cvf ${LFS}/pkg/dbus-1.12.16.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de elogind-241.4 en 43.001 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de elogind-241.4 en %R seconds ...'
time {
wget https://github.com/elogind/elogind/archive/v241.4/elogind-241.4.tar.gz -O ${LFS}/download/elogind-241.4.tar.gz --no-check-certificate &&
md5sum -c <<<" fb5ba9da1115d68d2b6cdbcd10167b7d ${LFS}/download/elogind-241.4.tar.gz" &&
rm -Rf ${LFS}/src/elogind-241.4 &&
tar xzf ${LFS}/download/elogind-241.4.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/elogind-241.4 &&
sed -e '/dirent-util/a #include "env-file.h"'                            \
    -e '/sessions/{n;n;s/=.*$/= parse_env_file (NULL, p, "UID", \&s);/}' \
    -i src/basic/cgroup-util.c &&
mkdir build &&
cd    build &&
meson --prefix=/usr                        \
      --sysconfdir=/etc                    \
      --localstatedir=/var                 \
      -Dcgroup-controller=elogind          \
      -Ddbuspolicydir=/etc/dbus-1/system.d \
      ..  &&
LANG=fr_FR.UTF-8 ninja &&
LANG=fr_FR.UTF-8 DESTDIR=$PWD/_pkg ninja install &&
ln -sfv  libelogind.pc _pkg/usr/lib/pkgconfig/libsystemd.pc &&
ln -sfvn elogind _pkg/usr/include/systemd &&
strip -v _pkg/bin/*
strip -v _pkg/lib/*
strip -v _pkg/usr/bin/*
strip -v _pkg/usr/lib/*
cat >> _pkg/etc/pam.d/system-session << "EOF" 
# Begin elogind addition
 
session  required    pam_loginuid.so
session  optional    pam_elogind.so
 
# End elogind addition
EOF
cat > /etc/pam.d/elogind-user << "EOF"
# Begin /etc/pam.d/elogind-user
 
account  required    pam_access.so
account  include     system-account
 
session  required    pam_env.so
session  required    pam_limits.so
session  required    pam_unix.so
session  required    pam_loginuid.so
session  optional    pam_keyinit.so force revoke
session  optional    pam_elogind.so
 
auth     required    pam_deny.so
password required    pam_deny.so
 
# End /etc/pam.d/elogind-user
EOF
 
tar -C _pkg/ -cvf ${LFS}/pkg/elogind-241.4.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de libburn-1.5.2 en 45.394 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de libburn-1.5.2 en %R seconds ...'
time {
wget http://files.libburnia-project.org/releases/libburn-1.5.2.tar.gz -O ${LFS}/download/libburn-1.5.2.tar.gz --no-check-certificate &&
md5sum -c <<<" 096f4acfba00f1210a84fb7650f7693d  ${LFS}/download/libburn-1.5.2.tar.gz" &&
rm -Rf ${LFS}/src/libburn-1.5.2 &&
tar -xf ${LFS}/download/libburn-1.5.2.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/libburn-1.5.2 &&
./configure --prefix=/usr &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip -v _pkg/usr/bin/*
strip -v _pkg/usr/lib/*
tar -C _pkg/ -cvf ${LFS}/pkg/libburn-1.5.2.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de libisofs-1.5.2 en 56.761 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de libisofs-1.5.2 en %R seconds ...'
time {
wget http://files.libburnia-project.org/releases/libisofs-1.5.2.tar.gz -O ${LFS}/download/libisofs-1.5.2.tar.gz --no-check-certificate &&
md5sum -c <<<" db86f85c639798b082ab967edfb9ce82 ${LFS}/download/libisofs-1.5.2.tar.gz" &&
rm -Rf ${LFS}/src/libisofs-1.5.2 &&
tar -xf ${LFS}/download/libisofs-1.5.2.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/libisofs-1.5.2 &&
./configure --prefix=/usr &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip -v _pkg/usr/lib/*
tar -C _pkg/ -cvf ${LFS}/pkg/libisofs-1.5.2.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de libisoburn-1.5.2 en 89.870 seconds ...
#depend de  libburn-1.5.2 et libisofs-1.5.2 
TIMEFORMAT='(BUSYBOX) Compilation de libisoburn-1.5.2 en %R seconds ...'
time {
wget  http://files.libburnia-project.org/releases/libisoburn-1.5.2.tar.gz -O ${LFS}/download/libisoburn-1.5.2.tar.gz --no-check-certificate &&
md5sum -c <<<" e14d470d9f859be8750d06d05559ae38 ${LFS}/download/libisoburn-1.5.2.tar.gz" &&
rm -Rf ${LFS}/src/libisoburn-1.5.2 &&
tar -xf ${LFS}/download/libisoburn-1.5.2.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/libisoburn-1.5.2 &&
./configure --prefix=/usr &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip _pkg/usr/bin/*
strip _pkg/usr/lib/*
tar -C _pkg/ -cvf ${LFS}/pkg/libisoburn-1.5.2.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de lz4-1.9.2 en 33.082 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de lz4-1.9.2 en %R seconds ...'
time {
wget https://github.com/lz4/lz4/archive/v1.9.2.tar.gz -O ${LFS}/download/lz4-1.9.2.tar.gz --no-check-certificate &&
rm -Rf ${LFS}/src/lz4-1.9.2 &&
tar -xf ${LFS}/download/lz4-1.9.2.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/lz4-1.9.2 &&
make &&
make DESTDIR=$PWD/_pkg prefix=/usr install &&
mkdir -pv _pkg/lib &&
mv -v _pkg/usr/lib/liblz4.so.* _pkg/lib &&
ln -sfv ../../lib/$(readlink /usr/lib/liblz4.so) _pkg/usr/lib/liblz4.so &&
strip _pkg/usr/bin/*
strip _pkg/usr/lib/*
tar -C _pkg/ -cvf ${LFS}/pkg/lz4-1.9.2.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de zstd-1.4.4 en 210.210 seconds ...
#depend de lz4-1.9.2,Xz-5.2.4, Gzip-1.10
TIMEFORMAT='(BUSYBOX) Compilation de zstd-1.4.4 en %R seconds ...'
time {
wget https://github.com/facebook/zstd/releases/download/v1.4.4/zstd-1.4.4.tar.gz -O ${LFS}/download/zstd-1.4.4.tar.gz --no-check-certificate &&
md5sum -c <<<" 487f7ee1562dee7c1c8adf85e2a63df9 ${LFS}/download/zstd-1.4.4.tar.gz" &&
rm -Rf ${LFS}/src/zstd-1.4.4 &&
tar -xf ${LFS}/download/zstd-1.4.4.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/zstd-1.4.4 &&
make &&
make DESTDIR=$PWD/_pkg prefix=/usr install &&
mkdir -pv _pkg/lib &&
mv -v _pkg/usr/lib/libzstd.so.* _pkg/lib &&
ln -sfv ../../lib/$(readlink /usr/lib/libzstd.so) _pkg/usr/lib/libzstd.so &&
strip _pkg/usr/bin/*
strip _pkg/usr/lib/*
tar -C _pkg/ -cvf ${LFS}/pkg/zstd-1.4.4.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de nspr-4.24 en 13.751 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de nspr-4.24 en %R seconds ...'
time {
wget https://archive.mozilla.org/pub/nspr/releases/v4.24/src/nspr-4.24.tar.gz -O ${LFS}/download/nspr-4.24.tar.gz --no-check-certificate &&
md5sum -c <<<" d630c2111e1db6d2ec2069aad22b4121 ${LFS}/download/nspr-4.24.tar.gz" &&
rm -Rf ${LFS}/src/nspr-4.24 &&
tar -xf ${LFS}/download/nspr-4.24.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/nspr-4.24 &&
cd nspr                                                     &&
./configure --prefix=/usr \
            --with-mozilla \
            --with-pthreads \
            $([ $(uname -m) = x86_64 ] && echo --enable-64bit) &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip _pkg/usr/bin/*
strip _pkg/usr/lib/*
tar -C _pkg/ -cvf ${LFS}/pkg/nspr-4.24.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de nss-3.49.2 en 808.225 seconds ...
#depend de nspr-4.24
TIMEFORMAT='(BUSYBOX) Compilation de nss-3.49.2 en %R seconds ...'
time {
wget http://www.linuxfromscratch.org/patches/blfs/svn/nss-3.49.2-standalone-1.patch -O ${LFS}/download/nss-3.49.2-standalone-1.patch --no-check-certificate &&
wget https://archive.mozilla.org/pub/security/nss/releases/NSS_3_49_2_RTM/src/nss-3.49.2.tar.gz -O ${LFS}/download/nss-3.49.2.tar.gz --no-check-certificate &&
md5sum -c <<<"  25f88e880a5ff8433f9a8c4b5d0a42e5 ${LFS}/download/nss-3.49.2.tar.gz" &&
rm -Rf ${LFS}/src/nss-3.49.2 &&
tar -xf ${LFS}/download/nss-3.49.2.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/nss-3.49.2 &&
patch -Np1 -i ${LFS}/download/nss-3.49.2-standalone-1.patch         &&
cd nss                                                              &&
make -j1 BUILD_OPT=1                  \
  NSPR_INCLUDE_DIR=/usr/include/nspr  \
  USE_SYSTEM_ZLIB=1                   \
  ZLIB_LIBS=-lz                       \
  NSS_ENABLE_WERROR=0                 \
  $([ $(uname -m) = x86_64 ] && echo USE_64=1) \
  $([ -f /usr/include/sqlite3.h ] && echo NSS_USE_SYSTEM_SQLITE=1)      &&
cd ../dist &&           
mkdir -pv ../_pkg/usr/{bin,lib/pkgconfig}                                         &&
install -v -m755 Linux*/lib/*.so             ../_pkg/usr/lib              &&
install -v -m644 Linux*/lib/{*.chk,libcrmf.a} ../_pkg/usr/lib              &&
install -v -m755 -d                           ../_pkg/usr/include/nss      &&
cp -v -RL {public,private}/nss/*              ../_pkg/usr/include/nss      &&
chmod -v 644                                  ../_pkg/usr/include/nss/*    &&
install -v -m755 Linux*/bin/{certutil,nss-config,pk12util} ../_pkg/usr/bin &&
install -v -m644 Linux*/lib/pkgconfig/nss.pc  ../_pkg/usr/lib/pkgconfig    &&
cd ../ &&
strip -v _pkg/usr/lib/*
tar -C _pkg/ -cvf ${LFS}/pkg/nss-3.49.2.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de procps-ng-3.3.15 en 47.670 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de procps-ng-3.3.15 en %R seconds ...'
time {
wget  https://sourceforge.net/projects/procps-ng/files/Production/procps-ng-3.3.15.tar.xz -O ${LFS}/download/procps-ng-3.3.15.tar.xz --no-check-certificate &&
md5sum -c <<<" 2b0717a7cb474b3d6dfdeedfbad2eccc ${LFS}/download/procps-ng-3.3.15.tar.xz" &&
rm -Rf ${LFS}/src/procps-ng-3.3.15 &&
tar -xf ${LFS}/download/procps-ng-3.3.15.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/procps-ng-3.3.15 &&
./configure --prefix=/usr                            \
            --exec-prefix=                           \
            --libdir=/usr/lib                        \
            --docdir=/usr/share/doc/procps-ng-3.3.15 \
            --disable-kill                           \
            --with-systemd &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip _pkg/usr/lib/*
strip _pkg/usr/bin/*
strip _pkg/usr/sbin/*
mkdir -pv _pkg/lib &&
mv -v _pkg/usr/lib/libprocps.so.* _pkg/lib &&
ln -sfv ../../lib/$(readlink _pkg/usr/lib/libprocps.so) _pkg/usr/lib/libprocps.so &&
tar -C _pkg/ -cvf ${LFS}/pkg/procps-ng-3.3.15.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de psmisc-23.2 en 13.492 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de psmisc-23.2 en %R seconds ...'
time {
wget https://sourceforge.net/projects/psmisc/files/psmisc/psmisc-23.2.tar.xz -O ${LFS}/download/psmisc-23.2.tar.xz --no-check-certificate &&
md5sum -c <<<" 0524258861f00be1a02d27d39d8e5e62 ${LFS}/download/psmisc-23.2.tar.xz" &&
rm -Rf ${LFS}/src/psmisc-23.2 &&
tar -xf ${LFS}/download/psmisc-23.2.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/psmisc-23.2 &&
./configure --prefix=/usr &&
make &&
make DESTDIR=$PWD/_pkg install &&
mkdir -pv _pkg/bin
strip _pkg/usr/bin/*
mv -v _pkg/usr/bin/fuser   _pkg/bin &&
mv -v _pkg/usr/bin/killall _pkg/bin &&
tar -C _pkg/ -cvf ${LFS}/pkg/psmisc-23.2.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de binutils-2.33.1 en 1191.644 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de binutils-2.33.1 en %R seconds ...'
time {
wget http://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.xz -O ${LFS}/download/binutils-2.33.1.tar.xz --no-check-certificate &&
md5sum -c <<<" 9406231b7d9dd93731c2d06cefe8aaf1 ${LFS}/download/binutils-2.33.1.tar.xz" &&
rm -Rf ${LFS}/src/binutils-2.33.1 &&
tar xf ${LFS}/download/binutils-2.33.1.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/binutils-2.33.1 &&
sed -i '/@\tincremental_copy/d' gold/testsuite/Makefile.in &&
mkdir -v 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 DESTDIR=$PWD/_pkg tooldir=/usr install &&
strip _pkg/usr/bin/*
strip _pkg/usr/lib/*
tar -C _pkg/ -cvf ${LFS}/pkg/binutils-2.33.1.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de m4-1.4.18 en 47.783 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de m4-1.4.18 en %R seconds ...'
time {
wget http://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.xz -O ${LFS}/download/m4-1.4.18.tar.xz --no-check-certificate &&
md5sum -c <<<" 730bb15d96fffe47e148d1e09235af82 ${LFS}/download/m4-1.4.18.tar.xz" &&
rm -Rf ${LFS}/src/m4-1.4.18 &&
tar xf ${LFS}/download/m4-1.4.18.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/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 DESTDIR=$PWD/_pkg install &&
strip _pkg/usr/bin/*
tar -C _pkg/ -cvf ${LFS}/pkg/m4-1.4.18.tar.gz ./ &&
cd "${LFS}/"
}
 
## (BUSYBOX) Compilation de bc-2.1.3 en 18.845 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de bc-2.5.1 en %R seconds ...'
time {
wget https://github.com/gavinhoward/bc/archive/2.5.1/bc-2.5.1.tar.gz -O ${LFS}/download/bc-2.5.1.tar.gz --no-check-certificate &&
md5sum -c <<<" 039ce0ae1d03cfbf1ff0db4898920d24 ${LFS}/download/bc-2.5.1.tar.gz" &&
rm -Rf ${LFS}/src/bc-2.5.1 &&
tar xzf ${LFS}/download/bc-2.5.1.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/bc-2.5.1 &&
PREFIX=/usr CC=gcc CFLAGS="-std=c99" ./configure.sh -G -O3 &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip _pkg/usr/bin/*
tar -C _pkg/ -cvf ${LFS}/pkg/bc-2.5.1.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de fcron-3.2.1 en 18.386 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de fcron-3.2.1 en %R seconds ...'
time {
wget http://fcron.free.fr/archives/fcron-3.2.1.src.tar.gz -O ${LFS}/download/fcron-3.2.1.src.tar.gz --no-check-certificate &&
md5sum -c <<<" bd4996e941a40327d11efc5e3fd1f839 ${LFS}/download/fcron-3.2.1.src.tar.gz" &&
groupadd -g 22 fcron &&
useradd -d /dev/null -c "Fcron User" -g fcron -s /bin/false -u 22 fcron &&
rm -Rf ${LFS}/src/fcron-3.2.1 &&
tar xzf ${LFS}/download/fcron-3.2.1.src.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/fcron-3.2.1 &&
./configure --prefix=/usr          \
            --sysconfdir=/etc      \
            --localstatedir=/var   \
            --without-sendmail     \
            --with-boot-install=no \
            --with-systemdsystemunitdir=no &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip _pkg/usr/bin/*
strip _pkg/usr/sbin/*
tar -C _pkg/ -cvf ${LFS}/pkg/fcron-3.2.1.tar.gz ./ &&
userdel fcron &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de gawk-5.0.1 en 22.531 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de gawk-5.0.1 en %R seconds ...'
time {
wget http://ftp.gnu.org/gnu/gawk/gawk-5.0.1.tar.xz -O ${LFS}/download/gawk-5.0.1.tar.xz --no-check-certificate &&
md5sum -c <<<" f9db3f6715207c6f13719713abc9c707 ${LFS}/download/gawk-5.0.1.tar.xz" &&
rm -Rf ${LFS}/src/gawk-5.0.11 &&
tar xf ${LFS}/download/gawk-5.0.1.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/gawk-5.0.1 &&
./configure --prefix=/tools &&
make &&
make DESTDIR=$PWD/_pkg install &&
strip _pkg/tools/bin/*
tar -C _pkg/ -cvf ${LFS}/pkg/gawk-5.0.1.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de at_3.1.23 en 12.187 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de at_3.1.23 en %R seconds ...'
time {
wget http://ftp.debian.org/debian/pool/main/a/at/at_3.1.23.orig.tar.gz -O ${LFS}/download/at-3.1.23.tar.gz --no-check-certificate &&
md5sum -c <<<" 1cec945506b5ddf1d776c92c315fc581 ${LFS}/download/at-3.1.23.tar.gz" &&
rm -Rf ${LFS}/src/at-3.1.23 &&
tar xzf ${LFS}/download/at-3.1.23.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/at-3.1.23 &&
sed -i '/docdir/s/=.*/= @docdir@/' Makefile.in &&
groupadd -g 17 atd                                                  &&
useradd -d /dev/null -c "atd daemon" -g atd -s /bin/false -u 17 atd &&
mkdir -pv /var/spool/cron &&
autoreconf &&
./configure --with-daemon_username=atd        \
            --with-daemon_groupname=atd       \
            --with-jobdir=/var/spool/cron     \
            --with-atspool=/var/spool/cron    \
            SENDMAIL=/usr/sbin/sendmail       &&
make -j1 &&
/usr/bin/install -c -g root -o root -m 755 -d _pkg/etc &&
/usr/bin/install -c -g root -o root -m 755 -d _pkg/usr/bin &&
/usr/bin/install -c -g root -o root -m 755 -d _pkg/usr/sbin &&
/usr/bin/install -c -g root -o root -m 755 -d _pkg/usr/share/doc/at-3.1.23 &&
/usr/bin/install -c -g root -o root -m 755 -d _pkg/usr/share/doc/at-3.1.23 &&
/usr/bin/install -c -g atd -o atd -m 755 -d _pkg/var/spool/cron _pkg/var/spool/cron &&
chmod 1770 _pkg/var/spool/cron _pkg/var/spool/cron &&
touch _pkg/var/spool/cron/.SEQ &&
chmod 600 _pkg/var/spool/cron/.SEQ &&
chown atd:atd _pkg/var/spool/cron/.SEQ &&
test -f _pkg/etc/at.allow || test -f _pkg/etc/at.deny || /usr/bin/install -c -o root -g atd -m 640 at.deny _pkg/etc/ &&
/usr/bin/install -c -g atd -o atd -m 6755 at _pkg/usr/bin &&
ln -s -f at _pkg/usr/bin/atq &&
ln -s -f at _pkg/usr/bin/atrm &&
/usr/bin/install -c -g root -o root -m 755 batch _pkg/usr/bin &&
/usr/bin/install -c -d -o root -g root -m 755 _pkg/usr/share/man/man1 &&
/usr/bin/install -c -d -o root -g root -m 755 _pkg/usr/share/man/man5 &&
/usr/bin/install -c -d -o root -g root -m 755 _pkg/usr/share/man/man8 &&
/usr/bin/install -c -g root -o root -m 755 atd _pkg/usr/sbin &&
/usr/bin/install -c -g root -o root -m 755 atrun _pkg/usr/sbin &&
/usr/bin/install -c -g root -o root -m 644 at.1 _pkg/usr/share/man/man1/ &&
cd _pkg/usr/share/man/man1 && 
ln -s -f at.1 atq.1 && 
ln -s -f at.1 batch.1 && 
ln -s -f at.1 atrm.1 &&
cd ${LFS}/src/at-3.1.23/_pkg/usr/share/man/man5 &&
ln -s -f at.allow.5 at.deny.5 &&
cd ${LFS}/src/at-3.1.23 &&
/usr/bin/install -c -g root -o root -m 644 atd.8 ${LFS}/src/at-3.1.23/_pkg/usr/share/man/man8/ &&
sed "s,\${exec_prefix},/usr,g" <atrun.8>tmpman &&
/usr/bin/install -c -g root -o root -m 644 tmpman ${LFS}/src/at-3.1.23/_pkg/usr/share/man/man8/atrun.8 &&
rm -f tmpman &&
/usr/bin/install -c -g root -o root -m 644 at.allow.5 ${LFS}/src/at-3.1.23/_pkg/usr/share/man/man5/ &&
/usr/bin/install -c -g root -o root -m 644 Problems Copyright README ChangeLog timespec ${LFS}/src/at-3.1.23/_pkg/usr/share/doc/at-3.1.23 &&
rm -f ${LFS}/src/at-3.1.23/_pkg/usr/share/man/cat1/at.1* ${LFS}/src/at-3.1.23/_pkg/usr/share/man/cat1/batch.1* &&
rm -f ${LFS}/src/at-3.1.23/_pkg/usr/share/man/cat1/atd.8* &&
if test x"no" != xno; then \
	/usr/bin/install -c -o root -g root -m 755 -d no; \
	/usr/bin/install -c -o root -g root -m 644 atd.service no; \
fi &&
cd ${LFS}/src/at-3.1.23 &&
for library in $(ldd _pkg/usr/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done 
for library in $(ldd _pkg/usr/sbin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done 
strip _pkg/usr/bin/*
strip _pkg/usr/sbin/*
tar -C _pkg/ -cvf ${LFS}/pkg/at-3.1.23.tar.gz ./ &&
userdel atd &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de attr-2.4.48 en 15.068 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de attr-2.4.48 en %R seconds ...'
time {
wget http://download.savannah.gnu.org/releases/attr/attr-2.4.48.tar.gz -O ${LFS}/download/attr-2.4.48.tar.gz --no-check-certificate &&
md5sum -c <<<" bc1e5cb5c96d99b24886f1f527d3bb3d ${LFS}/download/attr-2.4.48.tar.gz" &&
rm -Rf ${LFS}/src/attr-2.4.48 &&
tar xzf ${LFS}/download/attr-2.4.48.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/attr-2.4.48 &&
./configure --prefix=/usr     \
            --sysconfdir=/etc \
            --docdir=/usr/share/doc/attr-2.4.48 &&
make &&
make DESTDIR=$PWD/_pkg install &&
mkdir -pv _pgk/lib &&
mv -v _pkg/usr/lib/libattr.so.* _pkg/lib &&
ln -sfv ../../lib/$(readlink /usr/lib/libattr.so) _pkg/usr/lib/libattr.so &&
strip _pkg/usr/bin/*
tar -C _pkg/ -cvf ${LFS}/pkg/attr-2.4.48.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de kmod-26 en 20.113 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de kmod-26 en %R seconds ...'
time {
wget https://www.kernel.org/pub/linux/utils/kernel/kmod/kmod-26.tar.xz -O ${LFS}/download/kmod-26.tar.xz  --no-check-certificate &&
md5sum -c <<<" 1129c243199bdd7db01b55a61aa19601 ${LFS}/download/kmod-26.tar.xz" &&
rm -Rf ${LFS}/src/kmod-26 &&
tar xf ${LFS}/download/kmod-26.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/kmod-26 &&
./configure --prefix=/usr          \
            --bindir=/bin          \
            --sysconfdir=/etc      \
            --with-rootlibdir=/lib \
            --with-xz              \
            --with-zlib &&
make &&
make DESTDIR=$PWD/_pkg install &&
mkdir -pv _pkg/sbin &&
for target in depmod insmod lsmod modinfo modprobe rmmod; do
  ln -sfv ../bin/kmod _pkg/sbin/$target
done &&
ln -sfv kmod _pkg/bin/lsmod &&
strip _pkg/bin/*
strip _pkg/bin/*
tar -C _pkg/ -cvf ${LFS}/pkg/kmod-26.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de readline-8.0 en 18.596 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de readline-8.0 en %R seconds ...'
time {
wget http://ftp.gnu.org/gnu/readline/readline-8.0.tar.gz -O ${LFS}/download/readline-8.0.tar.gz --no-check-certificate &&
md5sum -c <<<" 7e6c1f16aee3244a69aba6e438295ca3 ${LFS}/download/readline-8.0.tar.gz" &&
rm -Rf ${LFS}/src/readline-8.0 &&
tar xzf ${LFS}/download/readline-8.0.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/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" DESTDIR=$PWD/_pkg install &&
mkdir -pv _pkg/lib &&
mv -v _pkg/usr/lib/lib{readline,history}.so.* _pkg/lib &&
chmod -v u+w _pkg/lib/lib{readline,history}.so.* &&
ln -sfv ../../lib/$(readlink /usr/lib/libreadline.so) _pkg/usr/lib/libreadline.so &&
ln -sfv ../../lib/$(readlink /usr/lib/libhistory.so ) _pkg/usr/lib/libhistory.so &&
tar -C _pkg/ -cvf ${LFS}/pkg/readline-8.0.tar.gz ./ &&
cd "${LFS}/"
}
 
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de zfs-0.8.2 en 865.996 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de zfs-0.8.2 en %R seconds ...'
time {
wget https://github.com/zfsonlinux/zfs/releases/download/zfs-0.8.2/zfs-0.8.2.tar.gz.asc -O ${LFS}/download/zfs-0.8.2.tar.gz.asc --no-check-certificate &&
echo "47608e257c8ecebb918014ef1da6172c3a45d990885891af18e80f5cc28beab8 ${LFS}/download/zfs-0.8.2.tar.gz" | sha256sum --check &&
wget https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.4.8.tar.xz -O ${LFS}/download/linux-5.4.8.tar.xz --no-check-certificate &&
md5sum -c <<<" 2f44c832e1d59ebe766731f9c215aca6 ${LFS}/download/linux-5.4.8.tar.xz" &&
rm -Rf ${LFS}/src/linux-5.4.8 &&
tar -xf ${LFS}/download/linux-5.4.8.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/linux-5.4.8 &&
cp -v /boot/config-* .config
cd /sources/linux-*
cp -v /boot/config-* .config
yes '' |make prepare scripts
rm -Rf ${LFS}/src/zfs-0.8.2 &&
tar -xf ${LFS}/download/zfs-0.8.2.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/zfs-0.8.2 &&
./configure \
    --prefix=/ \
    --libdir=/lib \
    --includedir=/usr/include \
    --datarootdir=/usr/share \
    --enable-linux-builtin=yes \
    --with-linux=${LFS}/src/linux-5.4.8 \
    --with-linux-obj=${LFS}/src/linux-5.4.8 &&
./copy-builtin ${LFS}/src/linux-5.4.8 &&
make &&
make DESTDIR=$PWD/_pkg install &&
for library in $(ldd _pkg/bin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
for library in $(ldd _pkg/sbin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done
cat > _pkg/sbin/fsck.zfs << EOF
#!/bin/sh
exit 0
EOF
 
tar -C _pkg/ -cvf ${LFS}/pkg/zfs-0.8.2.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de dosfstools-4.1 en 9.016 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de dosfstools-4.1 en %R seconds ...'
time {
wget https://github.com/dosfstools/dosfstools/releases/download/v4.1/dosfstools-4.1.tar.xz -O ${LFS}/download/dosfstools-4.1.tar.xz  --no-check-certificate &&
md5sum -c <<<" 07a1050db1a898e9a2e03b0c4569c4bd ${LFS}/download/dosfstools-4.1.tar.xz" &&
rm -Rf ${LFS}/src/dosfstools-4.1 &&
tar xf ${LFS}/download/dosfstools-4.1.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/dosfstools-4.1 &&
./configure --prefix=/               \
            --enable-compat-symlinks \
            --mandir=/usr/share/man  \
            --docdir=/usr/share/doc/dosfstools-4.1 &&
make &&
make DESTDIR=$PWD/_pkg install
for library in $(ldd _pkg/sbin/* | cut -d '>' -f 2 | awk '{print $1}')
do
	cp --verbose --parents "${library}" "_pkg/"
done &&
tar -C _pkg/ -cvf ${LFS}/pkg/dosfstools-4.1.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de efivar-37 en 20.934 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de efivar-37 en %R seconds ...'
time {
wget https://github.com/rhboot/efivar/releases/download/37/efivar-37.tar.bz2 -O ${LFS}/download/efivar-37.tar.bz2  --no-check-certificate &&
wget http://www.linuxfromscratch.org/~xry111/efivar-37-gcc_9-1.patch -O ${LFS}/download/efivar-37-gcc_9-1.patch   --no-check-certificate &&
rm -Rf ${LFS}/src/efivar-37 &&
tar xjf ${LFS}/download/efivar-37.tar.bz2 -C ${LFS}/src &&
cd ${LFS}/src/efivar-37 &&
patch -Np1 -i ${LFS}/download/efivar-37-gcc_9-1.patch &&
make libdir=/usr/lib &&
make DESTDIR=$PWD/_pkg libdir=/usr/lib install &&
ln -s /usr/include/efivar/efiboot.h _pkg/usr/include/ &&
ln -s /usr/include/efivar/efivar.h _pkg/usr/include/ &&
tar -C _pkg/ -cvf ${LFS}/pkg/efivar-37.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de popt-1.16 en 13.252 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de popt-1.16 en %R seconds ...'
time {
wget http://anduin.linuxfromscratch.org/BLFS/popt/popt-1.16.tar.gz -O ${LFS}/download/popt-1.16.tar.gz  --no-check-certificate &&
rm -Rf ${LFS}/src/popt-1.16 &&
tar xf ${LFS}/download/popt-1.16.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/popt-1.16 &&
./configure --prefix=/usr &&
make &&
make DESTDIR=$PWD/_pkg install &&
tar -C _pkg/ -cvf ${LFS}/pkg/popt-1.16.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de efibootmgr-16 en 3.411 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de efibootmgr-16 en %R seconds ...'
time {
wget https://github.com/rhboot/efibootmgr/archive/16.tar.gz -O ${LFS}/download/efibootmgr-16.tar.gz  --no-check-certificate &&
wget http://unifoundry.com/pub/unifont/unifont-12.1.03/font-builds/unifont-12.1.03.pcf.gz -O ${LFS}/download/unifont-12.1.03.pcf.gz --no-check-certificate &&
rm -Rf ${LFS}/src/efibootmgr-16 &&
tar xzf ${LFS}/download/efibootmgr-16.tar.gz -C ${LFS}/src &&
cd ${LFS}/src/efibootmgr-16 &&
make EFIDIR=LFS
mkdir -pv _pkg/usr/{sbin/,usr/share/man/man8/} &&
install -v -D -m0755 src/efibootmgr _pkg/usr/sbin/efibootmgr &&
install -v -D -m0644 src/efibootmgr.8 \
            _pkg/usr/share/man/man8/efibootmgr.8 &&
mkdir -pv _pkg/usr/share/fonts/unifont &&
gunzip -c ${LFS}/download/unifont-12.1.03.pcf.gz > \
 _pkg/usr/share/fonts/unifont/unifont.pc && 
tar -C _pkg/ -cvf ${LFS}/pkg/efibootmgr-16.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de nasm-2.14.02 en 47.888 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de nasm-2.14.02 en %R seconds ...'
time {
wget http://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.xz -O ${LFS}/download/nasm-2.14.02.tar.xz  --no-check-certificate &&
md5sum -c <<<" 6390bd67b07ff1df9fe628b6929c0353  ${LFS}/download/nasm-2.14.02.tar.xz" &&
rm -Rf ${LFS}/src/nasm-2.14.02 &&
tar xf ${LFS}/download/nasm-2.14.02.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/nasm-2.14.02 &&
./configure --prefix=/usr &&
make &&
make DESTDIR=$PWD/_pkg install &&
tar -C _pkg/ -cvf ${LFS}/pkg/nasm-2.14.02.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de syslinux-6.03 en 350.090 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de syslinux-6.03 en %R seconds ...'
time {
wget https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.tar.xz -O ${LFS}/download/syslinux-6.03.tar.xz --no-check-certificate &&
rm -Rf ${LFS}/src/syslinux-6.03 &&
tar xf ${LFS}/download/syslinux-6.03.tar.xz -C ${LFS}/src &&
cd ${LFS}/src/syslinux-6.03 &&
sed #include <sys/vfs.h>
sed -i 's/#include <sys\/vfs.h>/\0\n#include <sys\/sysmacros.h>/' extlinux/main.c &&
make &&
mkdir -pv _pkg &&
INSTALLROOT=$PWD/_pkg make install &&
tar -C _pkg/ -cvf ${LFS}/pkg/syslinux-6.03.tar.gz ./ &&
cd "${LFS}/"
}
 
# ## (BUSYBOX) Compilation de linux-5.4.8 en 13411.521 seconds ...
 
TIMEFORMAT='(BUSYBOX) Compilation de linux-5.4.8 en %R seconds ...'
time {
cd ${LFS}/src/linux-5.4.8 &&
./scripts/config -d CONFIG_SYSFS_DEPRECATED &&
./scripts/config -d CONFIG_SYSFS_DEPRECATED_V2 &&
./scripts/config -e CONFIG_FHANDLE &&
./scripts/config -d CONFIG_AUDIT &&
./scripts/config -e CONFIG_CGROUPS &&
./scripts/config -e CONFIG_SECCOMP &&
./scripts/config -e CONFIG_IPV6 &&
./scripts/config -d CONFIG_UEVENT_HELPER &&
./scripts/config -e CONFIG_DEVTMPFS &&
./scripts/config -d CONFIG_FW_LOADER_USER_HELPER &&
./scripts/config -e CONFIG_DMIID &&
./scripts/config -e CONFIG_INOTIFY_USER &&
./scripts/config -e CONFIG_AUTOFS4_FS &&
./scripts/config -e CONFIG_TMPFS_POSIX_ACL &&
./scripts/config -e CONFIG_TMPFS_XATTR &&
./scripts/config -d CONFIG_UNWINDER_FRAME_POINTER &&
./scripts/config -e CONFIG_EFI_STUB &&
./scripts/config -e CONFIG_FUSE_FS &&
./scripts/config -e CONFIG_BTRFS_FS &&
./scripts/config -e CONFIG_XFS_FS &&
./scripts/config -e CONFIG_NETWORK_FILESYSTEMS &&
./scripts/config -e CONFIG_NFS_FS &&
./scripts/config -e CONFIG_NFSD &&
./scripts/config -e CONFIG_NET &&
./scripts/config -e CONFIG_NETFILTER &&
./scripts/config -e CONFIG_NETFILTER_ADVANCED &&
./scripts/config -e CONFIG_NF_CONNTRACK &&
./scripts/config -e CONFIG_NETFILTER_XTABLES &&
./scripts/config -e CONFIG_NETFILTER_XT_TARGET_LOG &&
./scripts/config -e CONFIG_IP_NF_IPTABLES &&
./scripts/config -e CONFIG_MD &&
./scripts/config -e CONFIG_BLK_DEV_DM &&
./scripts/config -e CONFIG_DM_CRYPT &&
./scripts/config -e CONFIG_DM_SNAPSHOT &&
./scripts/config -e CONFIG_DM_THIN_PROVISIONING &&
./scripts/config -e CONFIG_DM_MIRROR &&
./scripts/config -e CONFIG_MAGIC_SYSRQ &&
./scripts/config -e ONFIG_NET &&
./scripts/config -e CONFIG_BRIDGE &&
./scripts/config -e CONFIG_MSDOS_FS &&
./scripts/config -e CONFIG_VFAT_FS &&
yes '' | LANG=fr_FR.UTF-8 make &&
yes '' | LANG=fr_FR.UTF-8 make modules_install &&
install -d _pkg/usr/share/doc/linux-5.4.8 &&
install -d _pkg/boot/ &&
cp -rvf Documentation/* _pkg/usr/share/doc/linux-5.4.8 &&
cp -avf arch/x86/boot/bzImage "/boot/vmlinuz-`sha256sum "arch/x86/boot/bzImage" | cut -d" " -f1`"
cp -avf arch/x86/boot/bzImage "_pkg/boot/vmlinuz-`sha256sum "arch/x86/boot/bzImage" | cut -d" " -f1`"
cp -avf System.map /boot/System.map-5.4.8 &&
cp -avf System.map _pkg/boot/System.map-5.4.8 &&
cp -avf .config /boot/config-5.4.8 &&
cp -avf .config _pkg/boot/config-5.4.8 &&
lsmod | sed 's/ .*$//g' | sed 's/^.*$/find \/lib\/modules\/5\.4\.8\/ -type f -name &\*/g' >modules-actifs &&
bash modules-actifs | sed 's/^.*$/\/rootfs\/bin\/rsync -Rav  & \/src\/linux-5\.4\.8\/_pkg\/ /g' >modules-list &&
bash modules-list &&
tar -C _pkg/ -cvf ${LFS}/pkg/linux-5.4.8.tar.gz ./ &&
cd "${LFS}/"
}
 
 
# ## (BUSYBOX) Construction du tree en 317.640 seconds ...
 
TIMEFORMAT='(BUSYBOX) Construction du tree en %R seconds ...'
time { 
rm -Rf ${LFS}/build-repo &&
ostree --repo=${LFS}/build-repo init --mode=bare-user &&
mkdir -pv ${LFS}/build-repo  &&
echo -e "curl-nss-7.67.0 \nwget-1.20.3\ngit-2.24.1\ngnupg-2.2.17\nbash-5.0\ncoreutils-8.31\nutil-linux-2.34\nvim-8.1.1846\nncurses-6.1\ngrep-3.3\nsed-4.7\nless-551\npatch-2.7.6\nzlib-1.2.11\nbzip2-1.0.8\nunzip60\nlzo-2.10\ngzip-1.10\nxz-5.2.4\ntar-1.32\nlibarchive-3.4.1\nshadow-4.7\nrsync-3.1.3\niptables-1.8.4\niproute2-5.2.0\ninetutils-1.9.4\ndig-9.14.9\nsquashfs4.4\nLVM2.2.03.07\nbtrfs-progs-v5.4\ncpio-2.12\npax-20161104\nsystemd-244\ngrub-2.04\nfuse-3.9.0\nlibostree-2019.6\nrunc-1.0.0-rc9\nconmon-2.0.7\ncri-o-1.16.2\ntree-1.8.0\ntime-1.9\nlibassuan-2.5.3\nxfsprogs-5.4.0\nLinux-PAM-1.3.1\nlibcap-2.30\nbridge-utils-1.6\ndhcpcd-8.1.5\nlibtirpc-1.2.5\nrpcsvc-proto-1.4\nrpcbind-1.2.5\nlibtirpc-1.2.5\nnfs-utils-2.4.1\ndracut-049\nzfs-0.8.2\ndbus-1.12.16\nelogind-241.4\nlibburn-1.5.2\nlibisofs-1.5.2\nlibisoburn-1.5.2\nreadline-8.0\nlz4-1.9.2\nzstd-1.4.4\nnspr-4.24\nnss-3.49.2\nprocps-ng-3.3.15\npsmisc-23.2\nbinutils-2.33.1\nm4-1.4.18\nbc-2.1.3\nfcron-3.2.1\ngawk-5.0.1\nattr-2.4.48\nkmod-26\nlinux-5.4.8\ndosfstools-4.1\nefivar-37\npopt-1.16\nefibootmgr-16\nnasm-2.14.02\nsyslinux-6.03" > lfsos-pkg-list &&
for package in `cat lfsos-pkg-list`; do
ostree --repo=${LFS}/build-repo commit -b lfsos/x86_64/${package} --tree=tar=${LFS}/pkg/${package}.tar.gz;
done &&
rm -rf lfsos-build &&
for package in `cat lfsos-pkg-list`; do
ostree --repo=${LFS}/build-repo checkout -U --union lfsos/x86_64/${package} lfsos-build;
done &&
cd "${LFS}/"
} 
 
 
# ## (BUSYBOX) Configuration image de base en 0.636 seconds ...
 
TIMEFORMAT='(BUSYBOX) Configuration image de base en %R seconds ...'
time {
# Mise en place d'un point de montage "rofiles-fuse"; cela garantit que tous les processus
# exécutés pour le post-traitement de l'arbre ne corrompent pas les liens physiques.
install -d  ${LFS}/lfsos-mnt
mknod /dev/fuse -m 0666 c 10 229
rofiles-fuse ${LFS}/lfsos-build ${LFS}/lfsos-mnt
cd ${LFS}/lfsos-mnt
ldconfig -r ${LFS}/lfsos-mnt 
# Nommage des périphériques réseau
install -d etc/systemd/network/
cat > etc/systemd/network/10-eth0.link << "EOF"
[Match]
MACAddress= 00:15:17:DC:5E:C8
 
[Link]
Name=eth0
EOF
 
cat > etc/systemd/network/10-eth1.link << "EOF"
[Match]
MACAddress= 00:15:17:DC:5E:C9
 
[Link]
Name=eth1
EOF
 
# Configuration de l'horloge système
cat > etc/adjtime << "EOF"
0.0 0 0.0
0
LOCAL
EOF
 
# Configuration de la Console Linux
cat > etc/vconsole.conf << "EOF"
KEYMAP=fr-latin9
EOF
 
# Création du fichier /etc/inputrc
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
 
# Création du fichier /etc/shells
cat > etc/shells << "EOF"
# Begin /etc/shells
 
/bin/sh
/bin/bash
 
# End /etc/shells
EOF
 
# Désactivation de l'effacement de l'écran durant le démarrage
install -d etc/systemd/system/getty@tty1.service.d
cat > etc/systemd/system/getty@tty1.service.d/noclear.conf << EOF
[Service]
TTYVTDisallocate=no
EOF
 
echo 20200119-systemd > etc/lfs-release
cat > /etc/lsb-release << "EOF"
DISTRIB_ID="Linux From Scratch"
DISTRIB_RELEASE="20200119-systemd"
DISTRIB_CODENAME="<your name here>"
DISTRIB_DESCRIPTION="Linux From Scratch"
EOF
 
cat > etc/os-release << "EOF"
NAME="Linux From Scratch"
VERSION="20200119-systemd"
ID=lfs
PRETTY_NAME="Linux From Scratch 20200119-systemd"
VERSION_CODENAME="lfsos"
EOF
 
cd "${LFS}/"
fusermount -u /lfsos-mnt
}
 
# ## 
 
TIMEFORMAT='(BUSYBOX) Deploiement image de base en %R seconds ...'
time {
mv /sbin/grub-probe /sbin/grub-probe.orig &&
cat > /sbin/grub-probe << "EOF"
#!/bin/bash
#
# A faker script for grub-probe, if your's stops working properly
#
 
# Depends on /root/grub.hack file
 
# . /root/grub.hach
 
arg_is_device=0
target=""
 
# Call Order:
# / --target=device
# --target=fs_uuid /dev/sda1 --device
# /boot --target=device
# --target=fs_uuid /boot --device
# "/" "--target=fs"
# "--target=abstraction" "ext2" "--device"
# "--target=fs" "ext2" "--device"
# "--target=drive" "ext2" "--device"
# "--target=fs_uuid" "ext2" "--device"
# "--target=abstraction" "ext2" "--device"
# "--target=fs" "ext2" "--device"
# "--target=drive" "ext2" "--device"
# "--target=fs_uuid" "ext2" "--device"
# "/" "--target=device"
# "--target=fs_uuid" "ext2" "--device"
# "/boot" "--target=device"
# "--target=fs_uuid" "ext2" "--device"
# "/" "--target=fs"
# "--target=abstraction" "ext2" "--device"
# "--target=fs" "ext2" "--device"
# "--target=drive" "ext2" "--device"
# "--target=fs_uuid" "ext2" "--device"
# "--target=abstraction" "ext2" "--device"
# "--target=fs" "ext2" "--device"
# "--target=drive" "ext2" "--device"
# "--target=fs_uuid" "ext2" "--device"
 
for opt in $@
do
    case "${opt}" in
    --device)
        # Means the thing in $arg is a device
        arg_is_device=1
        ;;
    --target=*)
        # = device, = fs, = fs_uuid
        target=${opt#*=}
        ;;
    *)
        arg=$opt
        ;;
    esac
done
 
set >> /tmp/probe.env
 
case "$target" in
abstraction)
    echo
    ;;
device)
    echo "/dev/sda1"
    ;;
drive)
    echo "(hd0)"
    ;;
fs)
    # Returns the filesystem type
    echo "ext2"
    ;;
fs_uuid)
    tune2fs -l $arg | awk '/Filesystem UUID/ { print $3 }'
    ;;
esac
EOF
 
chmod 0755 /sbin/grub-probe &&
if [ ! -d "/ostree/boot.1" ];then
echo "Création du ostree !";
rm /ostree/ -rf
ostree admin init-fs /
ostree admin os-init lfsos
fi
grub-mkrescue --output=grub-img.iso &&
mv -v /lfsos-build/etc /lfsos-build/usr/ &&
checksum=$(ostree --repo=${LFS}/build-repo commit -b lfsos/x86_64/standard --link-checkout-speedup lfsos-build) &&
ostree --repo=/ostree/repo pull-local /build-repo lfsos/x86_64/standard &&
ostree admin deploy --os=lfsos --karg-proc-cmdline --karg=enforcing=0 lfsos/x86_64/standard &&
mv /sbin/grub-probe.orig /sbin/grub-probe &&
cd "${LFS}/"
}
 
# ##
 
TIMEFORMAT='(BUSYBOX) Customisation os en %R seconds ...'
time {
cd /lfsos-build/usr
# Configuration en IP statique
cat > etc/systemd/network/10-eth0-static.network << "EOF"
[Match]
Name=eth0
 
[Network]
Address=192.168.1.10/24
Gateway=192.168.1.1
EOF
 
cat > etc/systemd/network/10-eth1-static.network << "EOF"
[Match]
Name=eth1
 
[Network]
Address=xx.xx.xxx.xxx/24
Gateway=xx.xx.xxx.xxx
EOF
 
# Création du fichier /etc/resolv.conf
cat > etc/resolv.conf << "EOF"
# Début de /etc/resolv.conf
 
nameserver xx.xx.xxx.xxx
nameserver xx.xx.xxx.xxx
 
# Fin de /etc/resolv.conf
EOF
 
# Configuration du nom d'hôte du système
echo "lfsos" > etc/hostname
# Personnalisation du fichier /etc/hosts
cat > etc/hosts << "EOF"
# Begin /etc/hosts
 
127.0.0.1   master2016 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         master2016 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.127 xml.cisco.com
 
# End /etc/hosts
EOF
 
# copie de  /etc/fstab, /etc/locale.conf, /etc/default/grub, dans le remote ostree:
for i in /etc/fstab /etc/default/grub /etc/locale.conf /etc/ostree/remotes.d/fedora-ws-rawhide.conf ; do cp -vf $i .$i; done
# création des cibles des liens dans /var avec systemd-tmpfiles
cat > etc/tmpfiles.d/00rpm-ostree.conf << "EOF"
d /var/log/journal 0755 root root -
L /var/home - - - - ../sysroot/home
d /var/opt 0755 root root -
d /var/srv 0755 root root -
d /var/roothome 0700 root root -
d /var/mnt 0755 root root -
d /var/lfs 0755 root root -
d /run/media 0755 root root - -
EOF
 
# Copie des fichiers /etc/passwd, /etc/group et /etc/shadow dans le nouvel /etc/, et  ajouter au groupe wheel dans /etc/group. 
groupadd -g 22 fcron
useradd -d /dev/null -c "Fcron User" -g fcron -s /bin/false -u 22 fcron
groupadd -g 17 atd
useradd -d /dev/null -c "atd daemon" -g atd -s /bin/false -u 17 atd
for i in /etc/passwd /etc/group /etc/shadow  ; do cp -vf $i .$i; done
userdel fcron
userdel atd
# Configuration de la synchronisation réseau du temps
cat > etc/systemd/timesyncd.conf << "EOF"
[Time]
NTP=xx.xx.xxx.xxx
EOF
 
# Configuration de fcron
cat >> etc/syslog.conf << "EOF"
# Begin fcron addition to /etc/syslog.conf
 
cron.* -/var/log/cron.log
 
# End fcron addition
EOF
 
cd "${LFS}/"
}
1)
68,079 hours
2)
62,395 hours
3)
48,217 hours