Updating to LFS 11.2

This commit is contained in:
Luís Mendes 2022-09-07 12:55:14 -03:00
parent b5c078a5c9
commit 893567d6e5
7 changed files with 364 additions and 385 deletions

View file

@ -1,5 +1,5 @@
# lfs-scripts :penguin:
Instructions and scripts to build Linux From Scratch (LFS), version 11.0, as simply as possible (I know, not that simple, but anyway).
Instructions and scripts to build Linux From Scratch (LFS), version 11.2, as simply as possible (I know, not that simple, but anyway).
![Output of uname -a](https://github.com/luisgbm/lfs-scripts/blob/master/img/uname.png?raw=true)
@ -13,7 +13,7 @@ This build will be accomplished inside a virtual machine. I'll be using Oracle V
My VM has two virtual hard disks: one for the host (Arch Linux itself) and another for building LFS. You could also use a single hard disk with two partitions, that's also up to personal taste. I've decided to use two separate hard disks so I can completely isolate LFS from the host after the build. At the end, you'll be able to create a separate VM and boot from it directly.
The packages needed to build LFS were downloaded from [here](http://ftp.osuosl.org/pub/lfs/lfs-packages/lfs-packages-11.0.tar) (443 MB), other mirrors are available [here](http://linuxfromscratch.org/lfs/download.html) (look for the "LFS HTTP/FTP Sites" section at the bottom, the file you need is lfs-packages-11.0.tar).
The packages needed to build LFS were downloaded from [here](http://ftp.osuosl.org/pub/lfs/lfs-packages/lfs-packages-11.2.tar) (474 MB), other mirrors are available [here](http://linuxfromscratch.org/lfs/download.html) (look for the "LFS HTTP/FTP Sites" section at the bottom, the file you need is lfs-packages-11.0.tar).
# Build instructions
@ -51,9 +51,9 @@ Download all the packages and extract them to $LFS/sources.
```
cd $LFS
cp /<location_of_the_package>/lfs-packages-11.0.tar .
tar xf lfs-packages-11.0.tar
mv 11.0 sources
cp /<location_of_the_package>/lfs-packages-11.2.tar .
tar xf lfs-packages-11.2.tar
mv 11.2-rc1 sources
chmod -v a+wt $LFS/sources
```
@ -154,8 +154,6 @@ Prepare virtual kernel file systems:
```
mkdir -pv $LFS/{dev,proc,sys,run}
mknod -m 600 $LFS/dev/console c 5 1
mknod -m 666 $LFS/dev/null c 1 3
mount -v --bind /dev $LFS/dev
mount -v --bind /dev/pts $LFS/dev/pts
mount -vt proc proc $LFS/proc
@ -174,7 +172,7 @@ chroot "$LFS" /usr/bin/env -i \
TERM="$TERM" \
PS1='(lfs chroot) \u:\w\$ ' \
PATH=/usr/bin:/usr/sbin \
/bin/bash --login +h
/bin/bash --login
```
Create essential directories, files and symlinks:
@ -191,13 +189,10 @@ mkdir -pv /usr/{,local/}share/{misc,terminfo,zoneinfo}
mkdir -pv /usr/{,local/}share/man/man{1..8}
mkdir -pv /var/{cache,local,log,mail,opt,spool}
mkdir -pv /var/lib/{color,misc,locate}
ln -sfv /run /var/run
ln -sfv /run/lock /var/lock
install -dv -m 0750 /root
install -dv -m 1777 /tmp /var/tmp
ln -sv /proc/self/mounts /etc/mtab
cat > /etc/hosts << EOF
@ -207,11 +202,11 @@ EOF
cat > /etc/passwd << "EOF"
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/dev/null:/bin/false
daemon:x:6:6:Daemon User:/dev/null:/bin/false
messagebus:x:18:18:D-Bus Message Daemon User:/run/dbus:/bin/false
uuidd:x:80:80:UUID Generation Daemon User:/dev/null:/bin/false
nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
bin:x:1:1:bin:/dev/null:/usr/bin/false
daemon:x:6:6:Daemon User:/dev/null:/usr/bin/false
messagebus:x:18:18:D-Bus Message Daemon User:/run/dbus:/usr/bin/false
uuidd:x:80:80:UUID Generation Daemon User:/dev/null:/usr/bin/false
nobody:x:65534:65534:Unprivileged User:/dev/null:/usr/bin/false
EOF
cat > /etc/group << "EOF"
@ -238,16 +233,19 @@ mail:x:34:
kvm:x:61:
uuidd:x:80:
wheel:x:97:
nogroup:x:99:
users:x:999:
nogroup:x:65534:
EOF
echo "tester:x:101:101::/home/tester:/bin/bash" >> /etc/passwd
echo "tester:x:101:" >> /etc/group
install -o tester -d /home/tester
touch /var/log/{btmp,lastlog,faillog,wtmp}
chgrp -v utmp /var/log/lastlog
chmod -v 664 /var/log/lastlog
chmod -v 600 /var/log/btmp
exec /bin/bash --login +h
exec /usr/bin/bash --login
```
Run the lfs-chroot.sh script, which will build additional temporary tools:
@ -276,18 +274,6 @@ You must now set a password for the root user (you will have to type a password)
passwd root
```
Logout from the chroot environment and re-enter it with updated configuration:
```
logout
chroot "$LFS" /usr/bin/env -i \
HOME=/root TERM="$TERM" \
PS1='(lfs chroot) \u:\w\$ ' \
PATH=/usr/bin:/usr/sbin \
/bin/bash --login
```
Run the final script to configure the rest of the system:
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Before After
Before After

View file

@ -1,8 +1,8 @@
#!/bin/bash
# LFS 11.0 Build Script
# LFS 11.2 Build Script
# Builds the additional temporary tools from chapter 7
# by Luís Mendes :)
# 10/Sep/2021
# 06/Sep/2022
package_name=""
package_ext=""
@ -11,14 +11,14 @@ begin() {
package_name=$1
package_ext=$2
echo "[lfs-scripts] Starting build of $package_name at $(date)"
echo "[lfs-chroot] Starting build of $package_name at $(date)"
tar xf $package_name.$package_ext
cd $package_name
}
finish() {
echo "[lfs-scripts] Finishing build of $package_name at $(date)"
echo "[lfs-chroot] Finishing build of $package_name at $(date)"
cd /sources
rm -rf $package_name
@ -26,54 +26,38 @@ finish() {
cd /sources
# 7.7. Libstdc++ from GCC-11.2.0, Pass 2
begin gcc-11.2.0 tar.xz
ln -s gthr-posix.h libgcc/gthr-default.h
mkdir -v build
cd build
../libstdc++-v3/configure \
CXXFLAGS="-g -O2 -D_GNU_SOURCE" \
--prefix=/usr \
--disable-multilib \
--disable-nls \
--host=$(uname -m)-lfs-linux-gnu \
--disable-libstdcxx-pch
make
make install
finish
# 7.8. Gettext-0.21
# 7.7. Gettext-0.21
begin gettext-0.21 tar.xz
./configure --disable-shared
make
cp -v gettext-tools/src/{msgfmt,msgmerge,xgettext} /usr/bin
finish
# 7.9. Bison-3.7.6
begin bison-3.7.6 tar.xz
# 7.8. Bison-3.8.2
begin bison-3.8.2 tar.xz
./configure --prefix=/usr \
--docdir=/usr/share/doc/bison-3.7.6
--docdir=/usr/share/doc/bison-3.8.2
make
make install
finish
# 7.10. Perl-5.34.0
begin perl-5.34.0 tar.xz
# 7.9. Perl-5.36.0
begin perl-5.36.0 tar.xz
sh Configure -des \
-Dprefix=/usr \
-Dvendorprefix=/usr \
-Dprivlib=/usr/lib/perl5/5.34/core_perl \
-Darchlib=/usr/lib/perl5/5.34/core_perl \
-Dsitelib=/usr/lib/perl5/5.34/site_perl \
-Dsitearch=/usr/lib/perl5/5.34/site_perl \
-Dvendorlib=/usr/lib/perl5/5.34/vendor_perl \
-Dvendorarch=/usr/lib/perl5/5.34/vendor_perl
-Dprivlib=/usr/lib/perl5/5.36/core_perl \
-Darchlib=/usr/lib/perl5/5.36/core_perl \
-Dsitelib=/usr/lib/perl5/5.36/site_perl \
-Dsitearch=/usr/lib/perl5/5.36/site_perl \
-Dvendorlib=/usr/lib/perl5/5.36/vendor_perl \
-Dvendorarch=/usr/lib/perl5/5.36/vendor_perl
make
make install
finish
# 7.11. Python-3.9.6
begin Python-3.9.6 tar.xz
# 7.10. Python-3.10.6
begin Python-3.10.6 tar.xz
./configure --prefix=/usr \
--enable-shared \
--without-ensurepip
@ -81,21 +65,19 @@ make
make install
finish
# 7.12. Texinfo-6.8
# 7.11. Texinfo-6.8
begin texinfo-6.8 tar.xz
sed -e 's/__attribute_nonnull__/__nonnull/' \
-i gnulib/lib/malloc/dynarray-skeleton.c
./configure --prefix=/usr
make
make install
finish
# 7.13. Util-linux-2.37.2
begin util-linux-2.37.2 tar.xz
# 7.12. Util-linux-2.38.1
begin util-linux-2.38.1 tar.xz
mkdir -pv /var/lib/hwclock
./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \
--libdir=/usr/lib \
--docdir=/usr/share/doc/util-linux-2.37.2 \
--docdir=/usr/share/doc/util-linux-2.38.1 \
--disable-chfn-chsh \
--disable-login \
--disable-nologin \

View file

@ -1,8 +1,8 @@
#!/bin/bash
# LFS 11.0 Build Script
# LFS 11.2 Build Script
# Builds the cross-toolchain and cross compiling temporary tools from chapters 5 and 6
# by Luís Mendes :)
# 08/Sep/2021
# 06/Sep/2022
package_name=""
package_ext=""
@ -11,14 +11,14 @@ begin() {
package_name=$1
package_ext=$2
echo "[lfs-scripts] Starting build of $package_name at $(date)"
echo "[lfs-cross] Starting build of $package_name at $(date)"
tar xf $package_name.$package_ext
cd $package_name
}
finish() {
echo "[lfs-scripts] Finishing build of $package_name at $(date)"
echo "[lfs-cross] Finishing build of $package_name at $(date)"
cd $LFS/sources
rm -rf $package_name
@ -26,21 +26,22 @@ finish() {
cd $LFS/sources
# 5.2. Binutils-2.37 - Pass 1
begin binutils-2.37 tar.xz
# 5.2. Binutils-2.39 - Pass 1
begin binutils-2.39 tar.xz
mkdir -v build
cd build
../configure --prefix=$LFS/tools \
--with-sysroot=$LFS \
--target=$LFS_TGT \
--disable-nls \
--enable-gprofng=no \
--disable-werror
make
make install -j1
make install
finish
# 5.3. GCC-11.2.0 - Pass 1
begin gcc-11.2.0 tar.xz
# 5.3. GCC-12.2.0 - Pass 1
begin gcc-12.2.0 tar.xz
tar -xf ../mpfr-4.1.0.tar.xz
mv -v mpfr-4.1.0 mpfr
tar -xf ../gmp-6.2.1.tar.xz
@ -55,25 +56,24 @@ case $(uname -m) in
esac
mkdir -v build
cd build
../configure \
--target=$LFS_TGT \
--prefix=$LFS/tools \
--with-glibc-version=2.11 \
--with-sysroot=$LFS \
--with-newlib \
--without-headers \
--enable-initfini-array \
--disable-nls \
--disable-shared \
--disable-multilib \
--disable-decimal-float \
--disable-threads \
--disable-libatomic \
--disable-libgomp \
--disable-libquadmath \
--disable-libssp \
--disable-libvtv \
--disable-libstdcxx \
../configure \
--target=$LFS_TGT \
--prefix=$LFS/tools \
--with-glibc-version=2.36 \
--with-sysroot=$LFS \
--with-newlib \
--without-headers \
--disable-nls \
--disable-shared \
--disable-multilib \
--disable-decimal-float \
--disable-threads \
--disable-libatomic \
--disable-libgomp \
--disable-libquadmath \
--disable-libssp \
--disable-libvtv \
--disable-libstdcxx \
--enable-languages=c,c++
make
make install
@ -82,17 +82,16 @@ cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
`dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/install-tools/include/limits.h
finish
# 5.4. Linux-5.13.12 API Headers
begin linux-5.13.12 tar.xz
# 5.4. Linux-5.19.2 API Headers
begin linux-5.19.2 tar.xz
make mrproper
make headers
find usr/include -name '.*' -delete
rm usr/include/Makefile
find usr/include -type f ! -name '*.h' -delete
cp -rv usr/include $LFS/usr
finish
# 5.5. Glibc-2.34
begin glibc-2.34 tar.xz
# 5.5. Glibc-2.36
begin glibc-2.36 tar.xz
case $(uname -m) in
i?86) ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3
;;
@ -100,7 +99,7 @@ case $(uname -m) in
ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3
;;
esac
patch -Np1 -i ../glibc-2.34-fhs-1.patch
patch -Np1 -i ../glibc-2.36-fhs-1.patch
mkdir -v build
cd build
echo "rootsbindir=/usr/sbin" > configparms
@ -114,15 +113,14 @@ echo "rootsbindir=/usr/sbin" > configparms
make
make DESTDIR=$LFS install
sed '/RTLDLIST=/s@/usr@@g' -i $LFS/usr/bin/ldd
echo 'int main(){}' > dummy.c
$LFS_TGT-gcc dummy.c
readelf -l a.out | grep '/ld-linux'
rm -v dummy.c a.out
$LFS/tools/libexec/gcc/$LFS_TGT/11.2.0/install-tools/mkheaders
echo 'int main(){}' | gcc -xc -
readelf -l a.out | grep ld-linux
rm -v a.out
$LFS/tools/libexec/gcc/$LFS_TGT/12.2.0/install-tools/mkheaders
finish
# 5.6. Libstdc++ from GCC-11.2.0, Pass 1
begin gcc-11.2.0 tar.xz
# 5.6. Libstdc++ from GCC-12.2.0
begin gcc-12.2.0 tar.xz
mkdir -v build
cd build
../libstdc++-v3/configure \
@ -132,9 +130,10 @@ cd build
--disable-multilib \
--disable-nls \
--disable-libstdcxx-pch \
--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/11.2.0
--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/12.2.0
make
make DESTDIR=$LFS install
rm -v $LFS/usr/lib/lib{stdc++,stdc++fs,supc++}.la
finish
# 6.2. M4-1.4.19
@ -146,8 +145,8 @@ make
make DESTDIR=$LFS install
finish
# 6.3. Ncurses-6.2
begin ncurses-6.2 tar.gz
# 6.3. Ncurses-6.3
begin ncurses-6.3 tar.gz
sed -i s/mawk// configure
mkdir build
pushd build
@ -161,17 +160,19 @@ popd
--mandir=/usr/share/man \
--with-manpage-format=normal \
--with-shared \
--without-normal \
--with-cxx-shared \
--without-debug \
--without-ada \
--without-normal \
--disable-stripping \
--enable-widec
make
make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install
echo "INPUT(-lncursesw)" > $LFS/usr/lib/libncurses.so
finish
# 6.4. Bash-5.1.8
begin bash-5.1.8 tar.gz
# 6.4. Bash-5.1.16
begin bash-5.1.16 tar.gz
./configure --prefix=/usr \
--build=$(support/config.guess) \
--host=$LFS_TGT \
@ -181,8 +182,8 @@ make DESTDIR=$LFS install
ln -sv bash $LFS/bin/sh
finish
# 6.5. Coreutils-8.32
begin coreutils-8.32 tar.xz
# 6.5. Coreutils-9.1
begin coreutils-9.1 tar.xz
./configure --prefix=/usr \
--host=$LFS_TGT \
--build=$(build-aux/config.guess) \
@ -190,10 +191,10 @@ begin coreutils-8.32 tar.xz
--enable-no-install-program=kill,uptime
make
make DESTDIR=$LFS install
mv -v $LFS/usr/bin/chroot $LFS/usr/sbin
mv -v $LFS/usr/bin/chroot $LFS/usr/sbin
mkdir -pv $LFS/usr/share/man/man8
mv -v $LFS/usr/share/man/man1/chroot.1 $LFS/usr/share/man/man8/chroot.8
sed -i 's/"1"/"8"/' $LFS/usr/share/man/man8/chroot.8
mv -v $LFS/usr/share/man/man1/chroot.1 $LFS/usr/share/man/man8/chroot.8
sed -i 's/"1"/"8"/' $LFS/usr/share/man/man8/chroot.8
finish
# 6.6. Diffutils-3.8
@ -203,8 +204,8 @@ make
make DESTDIR=$LFS install
finish
# 6.7. File-5.40
begin file-5.40 tar.gz
# 6.7. File-5.42
begin file-5.42 tar.gz
mkdir build
pushd build
../configure --disable-bzlib \
@ -216,10 +217,11 @@ popd
./configure --prefix=/usr --host=$LFS_TGT --build=$(./config.guess)
make FILE_COMPILE=$(pwd)/build/src/file
make DESTDIR=$LFS install
rm -v $LFS/usr/lib/libmagic.la
finish
# 6.8. Findutils-4.8.0
begin findutils-4.8.0 tar.xz
# 6.8. Findutils-4.9.0
begin findutils-4.9.0 tar.xz
./configure --prefix=/usr \
--localstatedir=/var/lib/locate \
--host=$LFS_TGT \
@ -228,12 +230,12 @@ make
make DESTDIR=$LFS install
finish
# 6.9. Gawk-5.1.0
begin gawk-5.1.0 tar.xz
# 6.9. Gawk-5.1.1
begin gawk-5.1.1 tar.xz
sed -i 's/extras//' Makefile.in
./configure --prefix=/usr \
--host=$LFS_TGT \
--build=$(./config.guess)
--build=$(build-aux/config.guess)
make
make DESTDIR=$LFS install
finish
@ -246,8 +248,8 @@ make
make DESTDIR=$LFS install
finish
# 6.11. Gzip-1.10
begin gzip-1.10 tar.xz
# 6.11. Gzip-1.12
begin gzip-1.12 tar.xz
./configure --prefix=/usr --host=$LFS_TGT
make
make DESTDIR=$LFS install
@ -289,19 +291,21 @@ make
make DESTDIR=$LFS install
finish
# 6.16. Xz-5.2.5
begin xz-5.2.5 tar.xz
# 6.16. Xz-5.2.6
begin xz-5.2.6 tar.xz
./configure --prefix=/usr \
--host=$LFS_TGT \
--build=$(build-aux/config.guess) \
--disable-static \
--docdir=/usr/share/doc/xz-5.2.5
--docdir=/usr/share/doc/xz-5.2.6
make
make DESTDIR=$LFS install
rm -v $LFS/usr/lib/liblzma.la
finish
# 6.17. Binutils-2.37 - Pass 2
begin binutils-2.37 tar.xz
# 6.17. Binutils-2.39 - Pass 2
begin binutils-2.39 tar.xz
sed '6009s/$add_dir//' -i ltmain.sh
mkdir -v build
cd build
../configure \
@ -310,15 +314,16 @@ cd build
--host=$LFS_TGT \
--disable-nls \
--enable-shared \
--enable-gprofng=no \
--disable-werror \
--enable-64-bit-bfd
make
make DESTDIR=$LFS install -j1
install -vm755 libctf/.libs/libctf.so.0.0.0 $LFS/usr/lib
make DESTDIR=$LFS install
rm -v $LFS/usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes}.{a,la}
finish
# 6.18. GCC-11.2.0 - Pass 2
begin gcc-11.2.0 tar.xz
# 6.18. GCC-12.2.0 - Pass 2
begin gcc-12.2.0 tar.xz
tar -xf ../mpfr-4.1.0.tar.xz
mv -v mpfr-4.1.0 mpfr
tar -xf ../gmp-6.2.1.tar.xz
@ -330,15 +335,16 @@ case $(uname -m) in
sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
;;
esac
sed '/thread_header =/s/@.*@/gthr-posix.h/' \
-i libgcc/Makefile.in libstdc++-v3/include/Makefile.in
mkdir -v build
cd build
mkdir -pv $LFS_TGT/libgcc
ln -s ../../../libgcc/gthr-posix.h $LFS_TGT/libgcc/gthr-default.h
../configure \
--build=$(../config.guess) \
--host=$LFS_TGT \
--target=$LFS_TGT \
LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc \
--prefix=/usr \
CC_FOR_TARGET=$LFS_TGT-gcc \
--with-build-sysroot=$LFS \
--enable-initfini-array \
--disable-nls \
@ -349,7 +355,6 @@ ln -s ../../../libgcc/gthr-posix.h $LFS_TGT/libgcc/gthr-default.h
--disable-libquadmath \
--disable-libssp \
--disable-libvtv \
--disable-libstdcxx \
--enable-languages=c,c++
make
make DESTDIR=$LFS install

View file

@ -1,8 +1,8 @@
#!/bin/bash
# LFS 11.0 Build Script
# LFS 11.2 Build Script
# Final steps to configure the system
# by Luís Mendes :)
# 13/Sep/2021
# 07/Sep/2022
package_name=""
package_ext=""
@ -11,14 +11,14 @@ begin() {
package_name=$1
package_ext=$2
echo "[lfs-scripts] Starting build of $package_name at $(date)"
echo "[lfs-final] Starting build of $package_name at $(date)"
tar xf $package_name.$package_ext
cd $package_name
}
finish() {
echo "[lfs-scripts] Finishing build of $package_name at $(date)"
echo "[lfs-final] Finishing build of $package_name at $(date)"
cd /sources
rm -rf $package_name
@ -26,11 +26,8 @@ finish() {
cd /sources
find /usr/lib /usr/libexec -name \*.la -delete
find /usr -depth -name $(uname -m)-lfs-linux-gnu\* | xargs rm -rf
# 9.2. LFS-Bootscripts-20210608
begin lfs-bootscripts-20210608 tar.xz
# 9.2. LFS-Bootscripts-20220723
begin lfs-bootscripts-20220723 tar.xz
make install
finish
@ -200,17 +197,17 @@ EOF
cd /sources
# 10.3. Linux-5.13.12
begin linux-5.13.12 tar.xz
# 10.3. Linux-5.19.2
begin linux-5.19.2 tar.xz
make mrproper
make defconfig
make
make modules_install
cp -iv arch/x86/boot/bzImage /boot/vmlinuz-5.13.12-lfs-11.0
cp -iv System.map /boot/System.map-5.13.12
cp -iv .config /boot/config-5.13.12
install -d /usr/share/doc/linux-5.13.12
cp -r Documentation/* /usr/share/doc/linux-5.13.12
cp -iv arch/x86/boot/bzImage /boot/vmlinuz-5.19.2-lfs-11.2
cp -iv System.map /boot/System.map-5.19.2
cp -iv .config /boot/config-5.19.2
install -d /usr/share/doc/linux-5.19.2
cp -r Documentation/* /usr/share/doc/linux-5.19.2
finish
# 10.3.2. Configuring Linux Module Load Order
@ -230,27 +227,29 @@ cat > /boot/grub/grub.cfg << "EOF"
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5
insmod ext2
set root=(hd0,1)
menuentry "GNU/Linux, Linux 5.13.12-lfs-11.0" {
linux /boot/vmlinuz-5.13.12-lfs-11.0 root=/dev/sda1 ro
set root=(hd0,2)
menuentry "GNU/Linux, Linux 5.19.2-lfs-11.2" {
linux /boot/vmlinuz-5.19.2-lfs-11.2 root=/dev/sda2 ro
}
EOF
# 11.1. The End
echo 11.0 > /etc/lfs-release
echo 11.2 > /etc/lfs-release
cat > /etc/lsb-release << "EOF"
DISTRIB_ID="Linux From Scratch"
DISTRIB_RELEASE="11.0"
DISTRIB_RELEASE="11.2"
DISTRIB_CODENAME="Linux From Scratch"
DISTRIB_DESCRIPTION="Linux From Scratch"
EOF
cat > /etc/os-release << "EOF"
NAME="Linux From Scratch"
VERSION="11.0"
VERSION="11.2
ID=lfs
PRETTY_NAME="Linux From Scratch 11.0"
PRETTY_NAME="Linux From Scratch 11.2"
VERSION_CODENAME="Linux From Scratch"
EOF
echo "[lfs-scripts] The end"
echo "[lfs-final] The end"

View file

@ -1,8 +1,8 @@
#!/bin/bash
# LFS 11.0 Build Script
# LFS 11.2 Build Script
# Builds the basic system software from chapter 8
# by Luís Mendes :)
# 10/Sep/2021
# 07/Sep/2022
package_name=""
package_ext=""
@ -11,14 +11,14 @@ begin() {
package_name=$1
package_ext=$2
echo "[lfs-scripts] Starting build of $package_name at $(date)"
echo "[lfs-system] Starting build of $package_name at $(date)"
tar xf $package_name.$package_ext
cd $package_name
}
finish() {
echo "[lfs-scripts] Finishing build of $package_name at $(date)"
echo "[lfs-system] Finishing build of $package_name at $(date)"
cd /sources
rm -rf $package_name
@ -31,16 +31,14 @@ begin man-pages-5.13 tar.xz
make prefix=/usr install
finish
# 8.4. Iana-Etc-20210611
begin iana-etc-20210611 tar.gz
# 8.4. Iana-Etc-20220812
begin iana-etc-20220812 tar.gz
cp services protocols /etc
finish
# 8.5. Glibc-2.34
begin glibc-2.34 tar.xz
sed -e '/NOTIFY_REMOVED)/s/)/ \&\& data.attr != NULL)/' \
-i sysdeps/unix/sysv/linux/mq_notify.c
patch -Np1 -i ../glibc-2.34-fhs-1.patch
# 8.5. Glibc-2.36
begin glibc-2.36 tar.xz
patch -Np1 -i ../glibc-2.36-fhs-1.patch
mkdir -v build
cd build
echo "rootsbindir=/usr/sbin" > configparms
@ -61,6 +59,8 @@ mkdir -pv /usr/lib/locale
localedef -i POSIX -f UTF-8 C.UTF-8 2> /dev/null || true
localedef -i en_US -f ISO-8859-1 en_US
localedef -i en_US -f UTF-8 en_US.UTF-8
make localedata/install-locales
cat > /etc/nsswitch.conf << "EOF"
# Begin /etc/nsswitch.conf
@ -78,7 +78,8 @@ rpc: files
# End /etc/nsswitch.conf
EOF
tar -xf ../../tzdata2021a.tar.gz
tar -xf ../../tzdata2022c.tar.gz
ZONEINFO=/usr/share/zoneinfo
mkdir -pv $ZONEINFO/{posix,right}
@ -94,22 +95,25 @@ cp -v zone.tab zone1970.tab iso3166.tab $ZONEINFO
zic -d $ZONEINFO -p America/New_York
unset ZONEINFO
ln -sfv /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
cat > /etc/ld.so.conf << "EOF"
# Begin /etc/ld.so.conf
/usr/local/lib
/opt/lib
EOF
cat >> /etc/ld.so.conf << "EOF"
# Add an include directory
include /etc/ld.so.conf.d/*.conf
EOF
mkdir -pv /etc/ld.so.conf.d
finish
# 8.6. Zlib-1.2.11
begin zlib-1.2.11 tar.xz
# 8.6. Zlib-1.2.12
begin zlib-1.2.12 tar.xz
./configure --prefix=/usr
make
make install
@ -134,39 +138,41 @@ done
rm -fv /usr/lib/libbz2.a
finish
# 8.8. Xz-5.2.5
begin xz-5.2.5 tar.xz
# 8.8. Xz-5.2.6
begin xz-5.2.6 tar.xz
./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/xz-5.2.5
--docdir=/usr/share/doc/xz-5.2.6
make
make install
finish
# 8.9. Zstd-1.5.0
begin zstd-1.5.0 tar.gz
make
# 8.9. Zstd-1.5.2
begin zstd-1.5.2 tar.gz
patch -Np1 -i ../zstd-1.5.2-upstream_fixes-1.patch
make prefix=/usr
make prefix=/usr install
rm -v /usr/lib/libzstd.a
finish
# 8.10. File-5.40
begin file-5.40 tar.gz
# 8.10. File-5.42
begin file-5.42 tar.gz
./configure --prefix=/usr
make
make install
finish
# 8.11. Readline-8.1
begin readline-8.1 tar.gz
# 8.11. Readline-8.1.2
begin readline-8.1.2 tar.gz
sed -i '/MV.*old/d' Makefile.in
sed -i '/{OLDSUFF}/c:' support/shlib-install
./configure --prefix=/usr \
--disable-static \
--with-curses \
--docdir=/usr/share/doc/readline-8.1
--docdir=/usr/share/doc/readline-8.1.2
make SHLIB_LIBS="-lncursesw"
make SHLIB_LIBS="-lncursesw" install
install -v -m644 doc/*.{ps,pdf,html,dvi} /usr/share/doc/readline-8.1.2
finish
# 8.12. M4-1.4.19
@ -176,9 +182,9 @@ make
make install
finish
# 8.13. Bc-5.0.0
begin bc-5.0.0 tar.xz
CC=gcc ./configure --prefix=/usr -G -O3
# 8.13. Bc-6.0.1
begin bc-6.0.1 tar.xz
CC=gcc ./configure --prefix=/usr -G -O3 -r
make
make install
finish
@ -193,31 +199,30 @@ make install
ln -sv flex /usr/bin/lex
finish
# 8.15. Tcl-8.6.11
mv tcl8.6.11-src.tar.gz tcl8.6.11.tar.gz
begin tcl8.6.11 tar.gz
tar -xf ../tcl8.6.11-html.tar.gz --strip-components=1
# 8.15. Tcl-8.6.12
mv tcl8.6.12-src.tar.gz tcl8.6.12.tar.gz
begin tcl8.6.12 tar.gz
tar -xf ../tcl8.6.12-html.tar.gz --strip-components=1
SRCDIR=$(pwd)
cd unix
./configure --prefix=/usr \
--mandir=/usr/share/man \
$([ "$(uname -m)" = x86_64 ] && echo --enable-64bit)
--mandir=/usr/share/man
make
sed -e "s|$SRCDIR/unix|/usr/lib|" \
-e "s|$SRCDIR|/usr/include|" \
-i tclConfig.sh
sed -e "s|$SRCDIR/unix/pkgs/tdbc1.1.2|/usr/lib/tdbc1.1.2|" \
-e "s|$SRCDIR/pkgs/tdbc1.1.2/generic|/usr/include|" \
-e "s|$SRCDIR/pkgs/tdbc1.1.2/library|/usr/lib/tcl8.6|" \
-e "s|$SRCDIR/pkgs/tdbc1.1.2|/usr/include|" \
-i pkgs/tdbc1.1.2/tdbcConfig.sh
sed -e "s|$SRCDIR/unix/pkgs/tdbc1.1.3|/usr/lib/tdbc1.1.3|" \
-e "s|$SRCDIR/pkgs/tdbc1.1.3/generic|/usr/include|" \
-e "s|$SRCDIR/pkgs/tdbc1.1.3/library|/usr/lib/tcl8.6|" \
-e "s|$SRCDIR/pkgs/tdbc1.1.3|/usr/include|" \
-i pkgs/tdbc1.1.3/tdbcConfig.sh
sed -e "s|$SRCDIR/unix/pkgs/itcl4.2.1|/usr/lib/itcl4.2.1|" \
-e "s|$SRCDIR/pkgs/itcl4.2.1/generic|/usr/include|" \
-e "s|$SRCDIR/pkgs/itcl4.2.1|/usr/include|" \
-i pkgs/itcl4.2.1/itclConfig.sh
sed -e "s|$SRCDIR/unix/pkgs/itcl4.2.2|/usr/lib/itcl4.2.2|" \
-e "s|$SRCDIR/pkgs/itcl4.2.2/generic|/usr/include|" \
-e "s|$SRCDIR/pkgs/itcl4.2.2|/usr/include|" \
-i pkgs/itcl4.2.2/itclConfig.sh
unset SRCDIR
make install
@ -225,6 +230,8 @@ chmod -v u+w /usr/lib/libtcl8.6.so
make install-private-headers
ln -sfv tclsh8.6 /usr/bin/tclsh
mv /usr/share/man/man3/{Thread,Tcl_Thread}.3
mkdir -v -p /usr/share/doc/tcl-8.6.12
cp -v -r ../html/* /usr/share/doc/tcl-8.6.12
finish
# 8.16. Expect-5.45.4
@ -251,15 +258,13 @@ install -v -dm755 /usr/share/doc/dejagnu-1.6.3
install -v -m644 doc/dejagnu.{html,txt} /usr/share/doc/dejagnu-1.6.3
finish
# 8.18. Binutils-2.37
begin binutils-2.37 tar.xz
# 8.18. Binutils-2.39
begin binutils-2.39 tar.xz
expect -c "spawn ls"
patch -Np1 -i ../binutils-2.37-upstream_fix-1.patch
sed -i '63d' etc/texi2pod.pl
find -name \*.1 -delete
mkdir -v build
cd build
../configure --prefix=/usr \
--sysconfdir=/etc \
--enable-gold \
--enable-ld=default \
--enable-plugins \
@ -268,7 +273,7 @@ cd build
--enable-64-bit-bfd \
--with-system-zlib
make tooldir=/usr
make tooldir=/usr install -j1
make tooldir=/usr install
rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes}.a
finish
@ -326,16 +331,15 @@ make
make install
finish
# 8.24. Libcap-2.53
begin libcap-2.53 tar.xz
# 8.24. Libcap-2.65
begin libcap-2.65 tar.xz
sed -i '/install -m.*STA/d' libcap/Makefile
make prefix=/usr lib=lib
make prefix=/usr lib=lib install
chmod -v 755 /usr/lib/lib{cap,psx}.so.2.53
finish
# 8.25. Shadow-4.9
begin shadow-4.9 tar.xz
# 8.25. Shadow-4.12.2
begin shadow-4.12.2 tar.xz
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 / /' {} \;
@ -344,24 +348,17 @@ sed -e 's:#ENCRYPT_METHOD DES:ENCRYPT_METHOD SHA512:' \
-e 's:/var/spool/mail:/var/mail:' \
-e '/PATH=/{s@/sbin:@@;s@/bin:@@}' \
-i etc/login.defs
sed -e "224s/rounds/min_rounds/" -i libmisc/salt.c
touch /usr/bin/passwd
./configure --sysconfdir=/etc \
--disable-static \
--with-group-name-max-length=32
make
make exec_prefix=/usr install
make -C man install-man
mkdir -p /etc/default
useradd -D --gid 999
pwconv
grpconv
finish
# 8.26. GCC-11.2.0
begin gcc-11.2.0 tar.xz
sed -e '/static.*SIGSTKSZ/d' \
-e 's/return kAltStackSize/return SIGSTKSZ * 4/' \
-i libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp
# 8.26. GCC-12.2.0
begin gcc-12.2.0 tar.xz
case $(uname -m) in
x86_64)
sed -e '/m64=/s/lib64/lib/' \
@ -378,11 +375,10 @@ cd build
--with-system-zlib
make
make install
rm -rf /usr/lib/gcc/$(gcc -dumpmachine)/11.2.0/include-fixed/bits/
chown -v -R root:root \
/usr/lib/gcc/*linux-gnu/11.2.0/include{,-fixed}
/usr/lib/gcc/$(gcc -dumpmachine)/12.2.0/include{,-fixed}
ln -svr /usr/bin/cpp /usr/lib
ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/11.2.0/liblto_plugin.so \
ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/12.2.0/liblto_plugin.so \
/usr/lib/bfd-plugins/
echo 'int main(){}' > dummy.c
cc dummy.c -v -Wl,--verbose &> dummy.log
@ -407,17 +403,22 @@ make
make install
finish
# 8.28. Ncurses-6.2
begin ncurses-6.2 tar.gz
# 8.28. Ncurses-6.3
begin ncurses-6.3 tar.gz
./configure --prefix=/usr \
--mandir=/usr/share/man \
--with-shared \
--without-debug \
--without-normal \
--with-cxx-shared \
--enable-pc-files \
--enable-widec
--enable-widec \
--with-pkg-config-libdir=/usr/lib/pkgconfig
make
make install
make DESTDIR=$PWD/dest install
install -vm755 dest/usr/lib/libncursesw.so.6.3 /usr/lib
rm -v dest/usr/lib/libncursesw.so.6.3
cp -av dest/* /
for lib in ncurses form panel menu ; do
rm -vf /usr/lib/lib${lib}.so
echo "INPUT(-l${lib}w)" > /usr/lib/lib${lib}.so
@ -426,9 +427,8 @@ done
rm -vf /usr/lib/libcursesw.so
echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so
ln -sfv libncurses.so /usr/lib/libcurses.so
rm -fv /usr/lib/libncurses++w.a
mkdir -v /usr/share/doc/ncurses-6.2
cp -v -R doc/* /usr/share/doc/ncurses-6.2
mkdir -pv /usr/share/doc/ncurses-6.3
cp -v -R doc/* /usr/share/doc/ncurses-6.3
finish
# 8.29. Sed-4.8
@ -441,8 +441,8 @@ install -d -m755 /usr/share/doc/sed-4.8
install -m644 doc/sed.html /usr/share/doc/sed-4.8
finish
# 8.30. Psmisc-23.4
begin psmisc-23.4 tar.xz
# 8.30. Psmisc-23.5
begin psmisc-23.5 tar.xz
./configure --prefix=/usr
make
make install
@ -458,9 +458,9 @@ make install
chmod -v 0755 /usr/lib/preloadable_libintl.so
finish
# 8.32. Bison-3.7.6
begin bison-3.7.6 tar.xz
./configure --prefix=/usr --docdir=/usr/share/doc/bison-3.7.6
# 8.32. Bison-3.8.2
begin bison-3.8.2 tar.xz
./configure --prefix=/usr --docdir=/usr/share/doc/bison-3.8.2
make
make install
finish
@ -472,26 +472,26 @@ make
make install
finish
# 8.34. Bash-5.1.8
begin bash-5.1.8 tar.gz
# 8.34. Bash-5.1.16
begin bash-5.1.16 tar.gz
./configure --prefix=/usr \
--docdir=/usr/share/doc/bash-5.1.8 \
--docdir=/usr/share/doc/bash-5.1.16 \
--without-bash-malloc \
--with-installed-readline
make
make install
finish
# 8.35. Libtool-2.4.6
begin libtool-2.4.6 tar.xz
# 8.35. Libtool-2.4.7
begin libtool-2.4.7 tar.xz
./configure --prefix=/usr
make
make install
rm -fv /usr/lib/libltdl.a
finish
# 8.36. GDBM-1.20
begin gdbm-1.20 tar.gz
# 8.36. GDBM-1.23
begin gdbm-1.23 tar.gz
./configure --prefix=/usr \
--disable-static \
--enable-libgdbm-compat
@ -506,17 +506,18 @@ make
make install
finish
# 8.38. Expat-2.4.1
begin expat-2.4.1 tar.xz
# 8.38. Expat-2.4.8
begin expat-2.4.8 tar.xz
./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/expat-2.4.1
--docdir=/usr/share/doc/expat-2.4.8
make
make install
install -v -m644 doc/*.{html,css} /usr/share/doc/expat-2.4.8
finish
# 8.39. Inetutils-2.1
begin inetutils-2.1 tar.xz
# 8.39. Inetutils-2.3
begin inetutils-2.3 tar.xz
./configure --prefix=/usr \
--bindir=/usr/bin \
--localstatedir=/var \
@ -539,20 +540,19 @@ make
make install
finish
# 8.41. Perl-5.34.0
begin perl-5.34.0 tar.xz
patch -Np1 -i ../perl-5.34.0-upstream_fixes-1.patch
# 8.41. Perl-5.36.0
begin perl-5.36.0 tar.xz
export BUILD_ZLIB=False
export BUILD_BZIP2=0
sh Configure -des \
-Dprefix=/usr \
-Dvendorprefix=/usr \
-Dprivlib=/usr/lib/perl5/5.34/core_perl \
-Darchlib=/usr/lib/perl5/5.34/core_perl \
-Dsitelib=/usr/lib/perl5/5.34/site_perl \
-Dsitearch=/usr/lib/perl5/5.34/site_perl \
-Dvendorlib=/usr/lib/perl5/5.34/vendor_perl \
-Dvendorarch=/usr/lib/perl5/5.34/vendor_perl \
-Dprivlib=/usr/lib/perl5/5.36/core_perl \
-Darchlib=/usr/lib/perl5/5.36/core_perl \
-Dsitelib=/usr/lib/perl5/5.36/site_perl \
-Dsitearch=/usr/lib/perl5/5.36/site_perl \
-Dvendorlib=/usr/lib/perl5/5.36/vendor_perl \
-Dvendorarch=/usr/lib/perl5/5.36/vendor_perl \
-Dman1dir=/usr/share/man/man1 \
-Dman3dir=/usr/share/man/man3 \
-Dpager="/usr/bin/less -isR" \
@ -586,17 +586,32 @@ make
make install
finish
# 8.45. Automake-1.16.4
begin automake-1.16.4 tar.xz
./configure --prefix=/usr --docdir=/usr/share/doc/automake-1.16.4
# 8.45. Automake-1.16.5
begin automake-1.16.5 tar.xz
./configure --prefix=/usr --docdir=/usr/share/doc/automake-1.16.5
make
make install
finish
# 8.46. Kmod-29
begin kmod-29 tar.xz
# 8.46. OpenSSL-3.0.5
begin openssl-3.0.5 tar.gz
./config --prefix=/usr \
--openssldir=/etc/ssl \
--libdir=lib \
shared \
zlib-dynamic
make
sed -i '/INSTALL_LIBS/s/libcrypto.a libssl.a//' Makefile
make MANSUFFIX=ssl install
mv -v /usr/share/doc/openssl /usr/share/doc/openssl-3.0.5
cp -vfr doc/* /usr/share/doc/openssl-3.0.5
finish
# 8.47. Kmod-30
begin kmod-30 tar.xz
./configure --prefix=/usr \
--sysconfdir=/etc \
--with-openssl \
--with-xz \
--with-zstd \
--with-zlib
@ -608,8 +623,8 @@ done
ln -sfv kmod /usr/bin/lsmod
finish
# 8.47. Libelf from Elfutils-0.185
begin elfutils-0.185 tar.bz2
# 8.48. Libelf from Elfutils-0.187
begin elfutils-0.187 tar.bz2
./configure --prefix=/usr \
--disable-debuginfod \
--enable-libdebuginfod=dummy
@ -619,7 +634,7 @@ install -vm644 config/libelf.pc /usr/lib/pkgconfig
rm /usr/lib/libelf.a
finish
# 8.48. Libffi-3.4.2
# 8.49. Libffi-3.4.2
begin libffi-3.4.2 tar.gz
./configure --prefix=/usr \
--disable-static \
@ -629,40 +644,35 @@ make
make install
finish
# 8.49. OpenSSL-1.1.1l
begin openssl-1.1.1l tar.gz
./config --prefix=/usr \
--openssldir=/etc/ssl \
--libdir=lib \
shared \
zlib-dynamic
make
sed -i '/INSTALL_LIBS/s/libcrypto.a libssl.a//' Makefile
make MANSUFFIX=ssl install
mv -v /usr/share/doc/openssl /usr/share/doc/openssl-1.1.1l
cp -vfr doc/* /usr/share/doc/openssl-1.1.1l
finish
# 8.50. Python-3.9.6
begin Python-3.9.6 tar.xz
# 8.50. Python-3.10.6
begin Python-3.10.6 tar.xz
./configure --prefix=/usr \
--enable-shared \
--with-system-expat \
--with-system-ffi \
--with-ensurepip=yes \
--enable-optimizations
make
make install
install -v -dm755 /usr/share/doc/python-3.9.6/html
cat > /etc/pip.conf << EOF
[global]
root-user-action = ignore
disable-pip-version-check = true
EOF
install -v -dm755 /usr/share/doc/python-3.10.6/html
tar --strip-components=1 \
--no-same-owner \
--no-same-permissions \
-C /usr/share/doc/python-3.9.6/html \
-xvf ../python-3.9.6-docs-html.tar.bz2
-C /usr/share/doc/python-3.10.6/html \
-xvf ../python-3.10.6-docs-html.tar.bz2
finish
# 8.51. Ninja-1.10.2
begin ninja-1.10.2 tar.gz
# 8.51. Wheel-0.37.1
begin wheel-0.37.1 tar.gz
pip3 install --no-index $PWD
finish
# 8.52. Ninja-1.11.0
begin ninja-1.11.0 tar.gz
sed -i '/int Guess/a \
int j = 0;\
char* jobs = getenv( "NINJAJOBS" );\
@ -675,18 +685,17 @@ install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninj
install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja
finish
# 8.52. Meson-0.59.1
begin meson-0.59.1 tar.gz
python3 setup.py build
python3 setup.py install --root=dest
cp -rv dest/* /
# 8.53. Meson-0.63.1
begin meson-0.63.1 tar.gz
pip3 wheel -w dist --no-build-isolation --no-deps $PWD
pip3 install --no-index --find-links dist meson
install -vDm644 data/shell-completions/bash/meson /usr/share/bash-completion/completions/meson
install -vDm644 data/shell-completions/zsh/_meson /usr/share/zsh/site-functions/_meson
finish
# 8.53. Coreutils-8.32
begin coreutils-8.32 tar.xz
patch -Np1 -i ../coreutils-8.32-i18n-1.patch
# 8.54. Coreutils-9.1
begin coreutils-9.1 tar.xz
patch -Np1 -i ../coreutils-9.1-i18n-1.patch
autoreconf -fiv
FORCE_UNSAFE_CONFIGURE=1 ./configure \
--prefix=/usr \
@ -698,45 +707,48 @@ mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8
sed -i 's/"1"/"8"/' /usr/share/man/man8/chroot.8
finish
# 8.54. Check-0.15.2
# 8.55. Check-0.15.2
begin check-0.15.2 tar.gz
./configure --prefix=/usr --disable-static
make
make docdir=/usr/share/doc/check-0.15.2 install
finish
# 8.55. Diffutils-3.8
# 8.56. Diffutils-3.8
begin diffutils-3.8 tar.xz
./configure --prefix=/usr
make
make install
finish
# 8.56. Gawk-5.1.0
begin gawk-5.1.0 tar.xz
# 8.57. Gawk-5.1.1
begin gawk-5.1.1 tar.xz
sed -i 's/extras//' Makefile.in
./configure --prefix=/usr
make
make install
mkdir -v /usr/share/doc/gawk-5.1.0
cp -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-5.1.0
mkdir -pv /usr/share/doc/gawk-5.1.1
cp -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-5.1.1
finish
# 8.57. Findutils-4.8.0
begin findutils-4.8.0 tar.xz
./configure --prefix=/usr --localstatedir=/var/lib/locate
# 8.58. Findutils-4.9.0
begin findutils-4.9.0 tar.xz
case $(uname -m) in
i?86) TIME_T_32_BIT_OK=yes ./configure --prefix=/usr --localstatedir=/var/lib/locate ;;
x86_64) ./configure --prefix=/usr --localstatedir=/var/lib/locate ;;
esac
make
make install
finish
# 8.58. Groff-1.22.4
# 8.59. Groff-1.22.4
begin groff-1.22.4 tar.gz
PAGE=A4 ./configure --prefix=/usr
make -j1
make install
finish
# 8.59. GRUB-2.06
# 8.60. GRUB-2.06
begin grub-2.06 tar.xz
./configure --prefix=/usr \
--sysconfdir=/etc \
@ -747,58 +759,53 @@ make install
mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions
finish
# 8.60. Gzip-1.10
begin gzip-1.10 tar.xz
# 8.61. Gzip-1.12
begin gzip-1.12 tar.xz
./configure --prefix=/usr
make
make install
finish
# 8.61. IPRoute2-5.13.0
begin iproute2-5.13.0 tar.xz
# 8.62. IPRoute2-5.19.0
begin iproute2-5.19.0 tar.xz
sed -i /ARPD/d Makefile
rm -fv man/man8/arpd.8
sed -i 's/.m_ipt.o//' tc/Makefile
make
make NETNS_RUN_DIR=/run/netns
make SBINDIR=/usr/sbin install
mkdir -v /usr/share/doc/iproute2-5.13.0
cp -v COPYING README* /usr/share/doc/iproute2-5.13.0
mkdir -pv /usr/share/doc/iproute2-5.19.0
cp -v COPYING README* /usr/share/doc/iproute2-5.19.0
finish
# 8.62. Kbd-2.4.0
begin kbd-2.4.0 tar.xz
patch -Np1 -i ../kbd-2.4.0-backspace-1.patch
# 8.63. Kbd-2.5.1
begin kbd-2.5.1 tar.xz
patch -Np1 -i ../kbd-2.5.1-backspace-1.patch
sed -i '/RESIZECONS_PROGS=/s/yes/no/' configure
sed -i 's/resizecons.8 //' docs/man/man8/Makefile.in
./configure --prefix=/usr --disable-vlock
make
make install
mkdir -v /usr/share/doc/kbd-2.4.0
cp -R -v docs/doc/* /usr/share/doc/kbd-2.4.0
finish
# 8.63. Libpipeline-1.5.3
begin libpipeline-1.5.3 tar.gz
# 8.64. Libpipeline-1.5.6
begin libpipeline-1.5.6 tar.gz
./configure --prefix=/usr
make
make install
finish
# 8.64. Make-4.3
# 8.65. Make-4.3
begin make-4.3 tar.gz
./configure --prefix=/usr
make
make install
finish
# 8.65. Patch-2.7.6
# 8.66. Patch-2.7.6
begin patch-2.7.6 tar.xz
./configure --prefix=/usr
make
make install
finish
# 8.66. Tar-1.34
# 8.67. Tar-1.34
begin tar-1.34 tar.xz
FORCE_UNSAFE_CONFIGURE=1 \
./configure --prefix=/usr
@ -807,11 +814,9 @@ make install
make -C doc install-html docdir=/usr/share/doc/tar-1.34
finish
# 8.67. Texinfo-6.8
# 8.68. Texinfo-6.8
begin texinfo-6.8 tar.xz
./configure --prefix=/usr
sed -e 's/__attribute_nonnull__/__nonnull/' \
-i gnulib/lib/malloc/dynarray-skeleton.c
make
make install
make TEXMF=/usr/share/texmf install-tex
@ -823,8 +828,8 @@ pushd /usr/share/info
popd
finish
# 8.68. Vim-8.2.3337
begin vim-8.2.3337 tar.gz
# 8.69. Vim-9.0.0228
begin vim-9.0.0228 tar.gz
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
./configure --prefix=/usr
make
@ -833,7 +838,7 @@ ln -sv vim /usr/bin/vi
for L in /usr/share/man/{,*/}man1/vim.1; do
ln -sv vim.1 $(dirname $L)/vi.1
done
ln -sv ../vim/vim82/doc /usr/share/doc/vim-8.2.3337
ln -sv ../vim/vim90/doc /usr/share/doc/vim-9.0.0228
cat > /etc/vimrc << "EOF"
" Begin /etc/vimrc
@ -853,8 +858,8 @@ endif
EOF
finish
# 8.69. Eudev-3.2.10
begin eudev-3.2.10 tar.gz
# 8.70. Eudev-3.2.11
begin eudev-3.2.11 tar.gz
./configure --prefix=/usr \
--bindir=/usr/sbin \
--sysconfdir=/etc \
@ -869,38 +874,39 @@ make -f udev-lfs-20171102/Makefile.lfs install
udevadm hwdb --update
finish
# 8.70. Man-DB-2.9.4
begin man-db-2.9.4 tar.xz
./configure --prefix=/usr \
--docdir=/usr/share/doc/man-db-2.9.4 \
--sysconfdir=/etc \
--disable-setuid \
--enable-cache-owner=bin \
--with-browser=/usr/bin/lynx \
--with-vgrind=/usr/bin/vgrind \
--with-grap=/usr/bin/grap \
--with-systemdtmpfilesdir= \
# 8.71. Man-DB-2.10.2
begin man-db-2.10.2 tar.xz
./configure --prefix=/usr \
--docdir=/usr/share/doc/man-db-2.10.2 \
--sysconfdir=/etc \
--disable-setuid \
--enable-cache-owner=bin \
--with-browser=/usr/bin/lynx \
--with-vgrind=/usr/bin/vgrind \
--with-grap=/usr/bin/grap \
--with-systemdtmpfilesdir= \
--with-systemdsystemunitdir=
make
make install
finish
# 8.71. Procps-ng-3.3.17
mv procps-ng-3.3.17.tar.xz procps-3.3.17.tar.xz
begin procps-3.3.17 tar.xz
# 8.72. Procps-ng-4.0.0
begin procps-ng-4.0.0 tar.xz
./configure --prefix=/usr \
--docdir=/usr/share/doc/procps-ng-3.3.17 \
--docdir=/usr/share/doc/procps-ng-4.0.0 \
--disable-static \
--disable-kill
make
make install
finish
# 8.72. Util-linux-2.37.2
begin util-linux-2.37.2 tar.xz
# 8.73. Util-linux-2.38.1
begin util-linux-2.38.1 tar.xz
./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \
--bindir=/usr/bin \
--libdir=/usr/lib \
--docdir=/usr/share/doc/util-linux-2.37.2 \
--sbindir=/usr/sbin \
--docdir=/usr/share/doc/util-linux-2.38.1 \
--disable-chfn-chsh \
--disable-login \
--disable-nologin \
@ -911,14 +917,13 @@ begin util-linux-2.37.2 tar.xz
--disable-static \
--without-python \
--without-systemd \
--without-systemdsystemunitdir \
runstatedir=/run
--without-systemdsystemunitdir
make
make install
finish
# 8.73. E2fsprogs-1.46.4
begin e2fsprogs-1.46.4 tar.gz
# 8.74. E2fsprogs-1.46.5
begin e2fsprogs-1.46.5 tar.gz
mkdir -v build
cd build
../configure --prefix=/usr \
@ -938,7 +943,7 @@ install -v -m644 doc/com_err.info /usr/share/info
install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.info
finish
# 8.74. Sysklogd-1.5.1
# 8.75. Sysklogd-1.5.1
begin sysklogd-1.5.1 tar.gz
sed -i '/Error loading kernel symbols/{n;n;d}' ksym_mod.c
sed -i 's/union wait/int/' syslogd.c
@ -959,19 +964,19 @@ user.* -/var/log/user.log
EOF
finish
# 8.75. Sysvinit-2.99
begin sysvinit-2.99 tar.xz
patch -Np1 -i ../sysvinit-2.99-consolidated-1.patch
# 8.76. Sysvinit-3.04
begin sysvinit-3.04 tar.xz
patch -Np1 -i ../sysvinit-3.04-consolidated-1.patch
make
make install
finish
# 8.77. Stripping
save_usrlib="$(cd /usr/lib; ls ld-linux*)
# 8.78. Stripping
save_usrlib="$(cd /usr/lib; ls ld-linux*[^g])
libc.so.6
libthread_db.so.1
libquadmath.so.0.0.0
libstdc++.so.6.0.29
libstdc++.so.6.0.30
libitm.so.1.0.0
libatomic.so.1.2.0"
@ -987,12 +992,12 @@ for LIB in $save_usrlib; do
done
online_usrbin="bash find strip"
online_usrlib="libbfd-2.37.so
online_usrlib="libbfd-2.39.so
libhistory.so.8.1
libncursesw.so.6.2
libncursesw.so.6.3
libm.so.6
libreadline.so.8.1
libz.so.1.2.11
libz.so.1.2.12
$(cd /usr/lib; find libnss*.so* -type f)"
for BIN in $online_usrbin; do
@ -1024,3 +1029,5 @@ unset BIN LIB save_usrlib online_usrbin online_usrlib
# 8.78. Cleaning Up
rm -rf /tmp/*
find /usr/lib /usr/libexec -name \*.la -delete
find /usr -depth -name $(uname -m)-lfs-linux-gnu\* | xargs rm -rf