├── scripts ├── 8.3-man-pages.sh ├── 8.4-iana-etc.sh ├── 8.70-Jinja2.sh ├── 8.12-m4.sh ├── 8.64-make.sh ├── 8.30-psmisc.sh ├── 7.4-chroot.sh ├── 8.60-gzip.sh ├── 8.10-file.sh ├── 8.14-flex.sh ├── 8.33-grep.sh ├── 8.40-less.sh ├── 8.13-bc.sh ├── 8.42-XML.sh ├── 8.65-patch.sh ├── 6.11-gzip.sh ├── 8.58-groff.sh ├── 8.9-zstd.sh ├── 8.69-MarkupSafe.sh ├── 6.10-grep.sh ├── 6.14-sed.sh ├── 8.44-autoconf.sh ├── 8.55-diffutils.sh ├── 6.6-diffutils.sh ├── 7.9-bison.sh ├── 8.6-zlib.sh ├── 8.63-libpipeline.sh ├── 7.8-gettext.sh ├── 8.32-bison.sh ├── 8.37-gperf.sh ├── 4.2.fish ├── chroot.sh ├── 8.35-libtool.sh ├── 8.54-check.sh ├── 4.3.fish ├── 6.2-m4.sh ├── 8.23-acl.sh ├── 5.4-linux-headers.sh ├── 7.11-python.sh ├── 8.45-automake.sh ├── 8.8-xz.sh ├── 8.36-gdbm.sh ├── 7.12-texinfo.sh ├── 8.66-tar.sh ├── env.fish ├── 6.13-patch.sh ├── 8.57-findutils.sh ├── 6.12-make.sh ├── 6.15-tar.sh ├── 6.9-gawk.sh ├── 8.24-libcap.sh ├── 8.21-mpc.sh ├── 8.22-attr.sh ├── 8.48-libffi.sh ├── 8.31-gettext.sh ├── 8.56-gawk.sh ├── 8.43-intltool.sh ├── 8.67-texinfo.sh ├── 8.29-sed.sh ├── 8.38-expat.sh ├── 8.20-mpfr.sh ├── 6.4-bash.sh ├── 8.59-grub.sh ├── 8.79-cleanup.sh ├── 6.8-findutils.sh ├── 7.3-kernel-file-system.sh ├── 8.27-pkgconfig.sh ├── 5.1-binutils.sh ├── 6.16-xz.sh ├── 8.52-meson.sh ├── 8.61-iproute2.sh ├── 8.47-elfutils.sh ├── 8.16-expect.sh ├── 8.19-gmp.sh ├── 8.74-procps.sh ├── 8.62-kbd.sh ├── 6.7-file.sh ├── 8.46-kmod.sh ├── 8.17-dejagnu.sh ├── 7.7.1-libstdc++.sh ├── 8.11-readline.sh ├── 8.49-openssl.sh ├── 5.6-libstdc++.sh ├── 8.34-bash.sh ├── 6.17-binutils.sh ├── 8.73-man.sh ├── 8.39-inetutils.sh ├── 8.7-bzip2.sh ├── 8.50-Python.sh ├── 8.51-ninja.sh ├── 7.10-perl.sh ├── 8.75-util-linux ├── 7.13-util-linux.sh ├── 8.72-dbus.sh ├── 6.5-coreutils.sh ├── 8.53-coreutils.sh ├── 8.18-binutils.sh ├── 6.3-ncurses.sh ├── 8.76-e2fsprogs.sh ├── 8.68-vim.sh ├── 8.28-ncurses.sh ├── 8.25-shadow.sh ├── 5.5-glibc.sh ├── 8.41-perl.sh ├── 8.15-tcl.sh ├── 8.26-gcc.sh ├── 8.71-systemd.sh ├── 6.18-gcc.sh ├── version-check.sh ├── 5.3-gcc.sh └── 8.5-glibc.sh └── README.md /scripts/8.3-man-pages.sh: -------------------------------------------------------------------------------- 1 | tar -xf sources/man-pages-5.13.tar.xz -C /tmp/ 2 | mv -v /tmp/man-pages-5.13 /tmp/man 3 | cd /tmp/man 4 | 5 | make prefix=/usr install 6 | 7 | rm -rf /tmp/man -------------------------------------------------------------------------------- /scripts/8.4-iana-etc.sh: -------------------------------------------------------------------------------- 1 | tar -xf sources/iana-etc-20210611.tar.gz -C /tmp/ 2 | mv -v /tmp/iana-etc-20210611 /tmp/iana 3 | cd /tmp/iana 4 | 5 | cp services protocols /etc 6 | 7 | rm -rf /tmp/iana -------------------------------------------------------------------------------- /scripts/8.70-Jinja2.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/Jinja2-3.0.1.tar.gz -C /tmp/ 2 | mv -v /tmp/Jinja2-3.0.1 /tmp/Jinja2 3 | cd /tmp/Jinja2 4 | 5 | python3 setup.py install --optimize=1 6 | 7 | rm -rf /tmp/Jinja2 -------------------------------------------------------------------------------- /scripts/8.12-m4.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/m4-1.4.19.tar.xz -C /tmp/ 2 | mv -v /tmp/m4-1.4.19 /tmp/m4 3 | cd /tmp/m4 4 | 5 | ./configure --prefix=/usr 6 | 7 | make 8 | make check 9 | make install 10 | 11 | rm -rf /tmp/m4 -------------------------------------------------------------------------------- /scripts/8.64-make.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/make-4.3.tar.gz -C /tmp/ 2 | mv -v /tmp/make-4.3 /tmp/make 3 | cd /tmp/make 4 | 5 | ./configure --prefix=/usr 6 | make 7 | make check 8 | make install 9 | 10 | rm -rf /tmp/make -------------------------------------------------------------------------------- /scripts/8.30-psmisc.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/psmisc-23.4.tar.xz -C /tmp/ 2 | mv -v /tmp/psmisc-23.4 /tmp/psmisc 3 | cd /tmp/psmisc 4 | 5 | ./configure --prefix=/usr 6 | 7 | make 8 | make install 9 | 10 | rm -rf /tmp/psmisc -------------------------------------------------------------------------------- /scripts/7.4-chroot.sh: -------------------------------------------------------------------------------- 1 | chroot "$LFS" /usr/bin/env -i \ 2 | HOME=/root \ 3 | TERM="$TERM" \ 4 | PS1='(lfs chroot) \u:\w\$ ' \ 5 | PATH=/usr/bin:/usr/sbin \ 6 | /bin/bash --login +h -------------------------------------------------------------------------------- /scripts/8.60-gzip.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/gzip-1.10.tar.xz -C /tmp/ 2 | mv -v /tmp/gzip-1.10 /tmp/gzip 3 | cd /tmp/gzip 4 | 5 | ./configure --prefix=/usr 6 | 7 | make 8 | make check 9 | make install 10 | 11 | rm -rf /tmp/gzip -------------------------------------------------------------------------------- /scripts/8.10-file.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/file-5.40.tar.gz -C /tmp/ 2 | mv -v /tmp/file-5.40 /tmp/file 3 | cd /tmp/file 4 | 5 | ./configure --prefix=/usr 6 | 7 | make 8 | make check 9 | make install 10 | 11 | rm -rf /tmp/file 12 | -------------------------------------------------------------------------------- /scripts/8.14-flex.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/flex-2.6.4.tar.gz -C /tmp/ 2 | mv -v /tmp/flex-2.6.4 /tmp/flex 3 | cd /tmp/flex 4 | 5 | make 6 | make check 7 | make install 8 | 9 | ln -sv flex /usr/bin/lex 10 | 11 | rm -rf /tmp/flex 12 | -------------------------------------------------------------------------------- /scripts/8.33-grep.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/grep-3.7.tar.xz -C /tmp/ 2 | mv -v /tmp/grep-3.7 /tmp/grep 3 | cd /tmp/grep 4 | 5 | ./configure --prefix=/usr 6 | 7 | make 8 | make check 9 | make install 10 | 11 | rm -rf /tmp/grep 12 | -------------------------------------------------------------------------------- /scripts/8.40-less.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/less-590.tar.gz -C /tmp/ 2 | mv -v /tmp/less-590 /tmp/less 3 | cd /tmp/less 4 | 5 | ./configure --prefix=/usr --sysconfdir=/etc 6 | 7 | make 8 | make install 9 | 10 | rm -rf /tmp/less 11 | -------------------------------------------------------------------------------- /scripts/8.13-bc.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/bc-5.0.0.tar.xz -C /tmp/ 2 | mv -v /tmp/bc-5.0.0.tar.xz /tmp/bc 3 | cd /tmp/bc 4 | 5 | CC=gcc ./configure --prefix=/usr -G -O3 6 | 7 | make 8 | make test 9 | make install 10 | 11 | rm -rf /tmp/bc -------------------------------------------------------------------------------- /scripts/8.42-XML.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/XML-Parser-2.46.tar.gz -C /tmp/ 2 | mv -v /tmp/XML-Parser-2.46 /tmp/XML 3 | cd /tmp/XML 4 | 5 | perl Makefile.PL 6 | 7 | make 8 | make test 9 | make install 10 | 11 | rm -rf /tmp/XML 12 | 13 | -------------------------------------------------------------------------------- /scripts/8.65-patch.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/patch-2.7.6.tar.xz -C /tmp/ 2 | mv -v /tmp/patch-2.7.6 /tmp/patch 3 | cd /tmp/patch 4 | 5 | ./configure --prefix=/usr 6 | 7 | make 8 | make check 9 | make install 10 | 11 | rm -rf /tmp/patch -------------------------------------------------------------------------------- /scripts/6.11-gzip.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/gzip-1.10.tar.xz -C /tmp/ 2 | mv -v /tmp/gzip-1.10 /tmp/gzip 3 | cd /tmp/gzip 4 | 5 | ./configure --prefix=/usr --host=$LFS_TGT 6 | 7 | make 8 | make DESTDIR=$LFS install 9 | 10 | rm -rf /tmp/gzip -------------------------------------------------------------------------------- /scripts/8.58-groff.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/groff-1.22.4.tar.gz -C /tmp/ 2 | mv -v /tmp/groff-1.22.4 /tmp/groff 3 | cd /tmp/groff 4 | 5 | PAGE= ./configure --prefix=/usr 6 | 7 | make -j1 8 | make install 9 | 10 | rm -rf /tmp/groff 11 | -------------------------------------------------------------------------------- /scripts/8.9-zstd.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/zstd-1.5.0.tar.gz -C /tmp/ 2 | mv -v /tmp/zstd-1.5.0 /tmp/zstd 3 | cd /tmp/zstd 4 | 5 | make 6 | make check 7 | make prefix=/usr install 8 | 9 | rm -v /usr/lib/libzstd.a 10 | 11 | rm -rf /tmp/zstd 12 | -------------------------------------------------------------------------------- /scripts/8.69-MarkupSafe.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/MarkupSafe-2.0.1.tar.gz -C /tmp/ 2 | mv -v /tmp/MarkupSafe-2.0.1 /tmp/MarkupSafe 3 | cd /tmp/MarkupSafe 4 | 5 | python3 setup.py build 6 | 7 | python3 setup.py install --optimize=1 8 | 9 | rm -rf /tmp/MarkupSafe -------------------------------------------------------------------------------- /scripts/6.10-grep.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/grep-3.7.tar.xz -C /tmp/ 2 | mv -v /tmp/grep-3.7 /tmp/grep 3 | cd /tmp/grep 4 | 5 | ./configure --prefix=/usr \ 6 | --host=$LFS_TGT 7 | 8 | make 9 | make DESTDIR=$LFS install 10 | 11 | rm -rf /tmp/grep -------------------------------------------------------------------------------- /scripts/6.14-sed.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/sed-4.8.tar.xz -C /tmp/ 2 | mv -v /tmp/sed-4.8 /tmp/sed 3 | cd /tmp/sed 4 | 5 | ./configure --prefix=/usr \ 6 | --host=$LFS_TGT 7 | 8 | make 9 | make DESTDIR=$LFS install 10 | 11 | rm -rf /tmp/sed 12 | -------------------------------------------------------------------------------- /scripts/8.44-autoconf.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/autoconf-2.71.tar.xz -C /tmp/ 2 | mv -v /tmp/autoconf-2.71 /tmp/autoconf 3 | cd /tmp/autoconf 4 | 5 | ./configure --prefix=/usr 6 | 7 | make 8 | make check 9 | make install 10 | 11 | rm -rf /tmp/autoconf 12 | -------------------------------------------------------------------------------- /scripts/8.55-diffutils.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/diffutils-3.8.tar.xz -C /tmp/ 2 | mv -v /tmp/diffutils-3.8 /tmp/diffutils 3 | cd /tmp/diffutils 4 | 5 | ./configure --prefix=/usr 6 | 7 | make 8 | make check 9 | make install 10 | 11 | rm -rf /tmp/diffutils -------------------------------------------------------------------------------- /scripts/6.6-diffutils.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/diffutils-3.8.tar.xz -C /tmp/ 2 | mv -v /tmp/diffutils-3.8 /tmp/diffutils 3 | cd /tmp/diffutils 4 | 5 | ./configure --prefix=/usr --host=$LFS_TGT 6 | 7 | make 8 | make DESTDIR=$LFS install 9 | 10 | rm -rf /tmp/diffutils -------------------------------------------------------------------------------- /scripts/7.9-bison.sh: -------------------------------------------------------------------------------- 1 | tar -xf sources/bison-3.7.6.tar.xz -C /tmp/ 2 | mv -v /tmp/bison-3.7.6 /tmp/bison 3 | cd /tmp/bison 4 | 5 | ./configure --prefix=/usr \ 6 | --docdir=/usr/share/doc/bison-3.7.6 7 | 8 | make 9 | make install 10 | 11 | rm -rf /tmp/bison -------------------------------------------------------------------------------- /scripts/8.6-zlib.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/zlib-1.2.11.tar.xz -C /tmp/ 2 | mv -v /tmp/zlib-1.2.11 /tmp/zlib 3 | cd /tmp/zlib 4 | 5 | ./configure --prefix=/usr 6 | 7 | make 8 | make check 9 | make install 10 | 11 | rm -fv /usr/lib/libz.a 12 | 13 | rm -rf /tmp/zlib -------------------------------------------------------------------------------- /scripts/8.63-libpipeline.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/libpipeline-1.5.3.tar.gz -C /tmp/ 2 | mv -v /tmp/libpipeline-1.5.3 /tmp/libpipeline 3 | cd /tmp/libpipeline 4 | 5 | ./configure --prefix=/usr 6 | 7 | make 8 | make check 9 | make install 10 | 11 | rm -rf /tmp/libpipeline -------------------------------------------------------------------------------- /scripts/7.8-gettext.sh: -------------------------------------------------------------------------------- 1 | tar -xf sources/gettext-0.21.tar.xz -C /tmp/ 2 | mv -v /tmp/gettext-0.21 /tmp/gettext 3 | cd /tmp/gettext 4 | 5 | ./configure --disable-shared 6 | 7 | make 8 | 9 | cp -v gettext-tools/src/{msgfmt,msgmerge,xgettext} /usr/bin 10 | 11 | rm -rf /tmp/gettext -------------------------------------------------------------------------------- /scripts/8.32-bison.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/bison-3.7.6.tar.xz -C /tmp/ 2 | mv -v /tmp/bison-3.7.6 /tmp/bison 3 | cd /tmp/bison 4 | 5 | ./configure --prefix=/usr --docdir=/usr/share/doc/bison-3.7.6 6 | 7 | make 8 | make check 9 | make install 10 | 11 | rm -rf /tmp/bison 12 | -------------------------------------------------------------------------------- /scripts/8.37-gperf.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/gperf-3.1.tar.gz -C /tmp/ 2 | mv -v /tmp/gperf-3.1 /tmp/gperf 3 | cd /tmp/gperf 4 | 5 | ./configure --prefix=/usr --docdir=/usr/share/doc/gperf-3.1 6 | 7 | make 8 | make -j1 check 9 | make install 10 | 11 | rm -rf /tmp/gperf 12 | -------------------------------------------------------------------------------- /scripts/4.2.fish: -------------------------------------------------------------------------------- 1 | mkdir -pv $LFS/{etc,var} $LFS/usr/{bin,lib,sbin} 2 | 3 | for i in bin lib sbin 4 | ln -sv usr/$i $LFS/$i 5 | end 6 | 7 | if test (uname -m) = "x86_64" 8 | echo "It is x86_64" 9 | mkdir -pv $LFS/lib64 10 | end 11 | 12 | mkdir -pv $LFS/tools 13 | 14 | 15 | -------------------------------------------------------------------------------- /scripts/chroot.sh: -------------------------------------------------------------------------------- 1 | # this is the chroot command after finishing the build in chapter 8 2 | 3 | chroot "$LFS" /usr/bin/env -i \ 4 | HOME=/root TERM="$TERM" \ 5 | PS1='(lfs chroot) \u:\w\$ ' \ 6 | PATH=/usr/bin:/usr/sbin \ 7 | /bin/bash --login -------------------------------------------------------------------------------- /scripts/8.35-libtool.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/libtool-2.4.6.tar.xz -C /tmp/ 2 | mv -v /tmp/libtool-2.4.6 /tmp/libtool 3 | cd /tmp/libtool 4 | 5 | ./configure --prefix=/usr 6 | 7 | make 8 | make check 9 | make install 10 | 11 | rm -fv /usr/lib/libltdl.a 12 | 13 | rm -rf /tmp/libtool 14 | -------------------------------------------------------------------------------- /scripts/8.54-check.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/check-0.15.2.tar.gz -C /tmp/ 2 | mv -v /tmp/check-0.15.2 /tmp/check 3 | cd /tmp/check 4 | 5 | ./configure --prefix=/usr --disable-static 6 | 7 | make 8 | make check 9 | make docdir=/usr/share/doc/check-0.15.2 install 10 | 11 | rm -rf /tmp/check 12 | -------------------------------------------------------------------------------- /scripts/4.3.fish: -------------------------------------------------------------------------------- 1 | groupadd lfs 2 | useradd -s /bin/bash -g lfs -m -k /dev/null lfs 3 | passwd lfs 4 | 5 | chown -v lfs $LFS/{usr{,/*},lib,var,etc,bin,sbin,tools} 6 | if test (uname -m) = "x86_64" 7 | echo "x86_64" 8 | chown -v lfs $LFS/lib64 9 | else 10 | echo "not x86_64" 11 | end 12 | 13 | -------------------------------------------------------------------------------- /scripts/6.2-m4.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/m4-1.4.19.tar.xz -C /tmp/ 2 | mv -v /tmp/m4-1.4.19 /tmp/m4 3 | cd /tmp/m4 4 | 5 | ./configure --prefix=/usr \ 6 | --host=$LFS_TGT \ 7 | --build=$(build-aux/config.guess) 8 | 9 | make 10 | make DESTDIR=$LFS install 11 | 12 | rm -rf /tmp/m4 -------------------------------------------------------------------------------- /scripts/8.23-acl.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/acl-2.3.1.tar.xz -C /tmp/ 2 | mv -v /tmp/acl-2.3.1 /tmp/acl 3 | cd /tmp/acl 4 | 5 | ./configure --prefix=/usr \ 6 | --disable-static \ 7 | --docdir=/usr/share/doc/acl-2.3.1 8 | 9 | make 10 | make install 11 | 12 | rm -rf /tmp/acl -------------------------------------------------------------------------------- /scripts/5.4-linux-headers.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/linux-5.13.12.tar.xz -C /tmp/ 2 | mv -v /tmp/linux-5.13.12 /tmp/linux 3 | cd /tmp/linux 4 | 5 | make mrproper 6 | 7 | make headers 8 | find usr/include -name '.*' -delete 9 | rm usr/include/Makefile 10 | cp -rv usr/include $LFS/usr 11 | 12 | rm -rf /tmp/linux -------------------------------------------------------------------------------- /scripts/7.11-python.sh: -------------------------------------------------------------------------------- 1 | tar -xf sources/Python-3.9.6.tar.xz -C /tmp/ 2 | mv -v /tmp/Python-3.9.6 /tmp/python 3 | cd /tmp/python 4 | 5 | ./configure --prefix=/usr \ 6 | --enable-shared \ 7 | --without-ensurepip 8 | 9 | make 10 | make install 11 | 12 | rm -rf /tmp/python 13 | 14 | 15 | -------------------------------------------------------------------------------- /scripts/8.45-automake.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/automake-1.16.4.tar.xz -C /tmp/ 2 | mv -v /tmp/automake-1.16.4 /tmp/automake 3 | cd /tmp/automake 4 | 5 | ./configure --prefix=/usr --docdir=/usr/share/doc/automake-1.16.4 6 | 7 | make 8 | make -j4 check 9 | make install 10 | 11 | rm -rf /tmp/automake 12 | 13 | -------------------------------------------------------------------------------- /scripts/8.8-xz.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/xz-5.2.5.tar.xz -C /tmp/ 2 | mv -v /tmp/xz-5.2.5 /tmp/xz 3 | cd /tmp/xz 4 | 5 | ./configure --prefix=/usr \ 6 | --disable-static \ 7 | --docdir=/usr/share/doc/xz-5.2.5 8 | 9 | make 10 | make check 11 | make install 12 | 13 | rm -rf /tmp/xz 14 | -------------------------------------------------------------------------------- /scripts/8.36-gdbm.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/gdbm-1.20.tar.gz -C /tmp/ 2 | mv -v /tmp/gdbm-1.20 /tmp/gdbm 3 | cd /tmp/gdbm 4 | 5 | ./configure --prefix=/usr \ 6 | --disable-static \ 7 | --enable-libgdbm-compat 8 | 9 | make 10 | make -k check 11 | make install 12 | 13 | rm -rf /tmp/gdbm 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Just hotchpotch of scripts to build a lfs in Docker. Use this project just as a reference for scripts; other than that it is not well organized. 2 | 3 | Basic command that starts it all in docker 4 | 5 | ``` 6 | docker run -it --name lfs-systemd --mount type=bind,source=(pwd),target=/lfs --privileged debian:11 7 | ``` 8 | -------------------------------------------------------------------------------- /scripts/7.12-texinfo.sh: -------------------------------------------------------------------------------- 1 | tar -xf sources/texinfo-6.8.tar.xz -C /tmp/ 2 | mv -v /tmp/texinfo-6.8 /tmp/texinfo 3 | cd /tmp/texinfo 4 | 5 | sed -e 's/__attribute_nonnull__/__nonnull/' \ 6 | -i gnulib/lib/malloc/dynarray-skeleton.c 7 | 8 | ./configure --prefix=/usr 9 | 10 | make 11 | make install 12 | 13 | rm -rf /tmp/texinfo -------------------------------------------------------------------------------- /scripts/8.66-tar.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/tar-1.34.tar.xz -C /tmp/ 2 | mv -v /tmp/tar-1.34 /tmp/tar 3 | cd /tmp/tar 4 | 5 | FORCE_UNSAFE_CONFIGURE=1 \ 6 | ./configure --prefix=/usr 7 | 8 | make 9 | make check 10 | make install 11 | 12 | make -C doc install-html docdir=/usr/share/doc/tar-1.34 13 | 14 | rm -rf /tmp/tar 15 | -------------------------------------------------------------------------------- /scripts/env.fish: -------------------------------------------------------------------------------- 1 | set -x LFS /lfs/build 2 | set -x lfs /lfs/build 3 | set -x MAKEFLAGS -j4 4 | set -x LFS_TGT x86_64-lfs-linux-gnu 5 | 6 | ln -s (which gawk) /usr/bin/awk 7 | 8 | if not test -e /root/.vimrc 9 | wget https://raw.githubusercontent.com/amix/vimrc/master/vimrcs/basic.vim -O /root/.vimrc 10 | end 11 | 12 | -------------------------------------------------------------------------------- /scripts/6.13-patch.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/patch-2.7.6.tar.xz -C /tmp/ 2 | mv -v /tmp/patch-2.7.6 /tmp/patch 3 | cd /tmp/patch 4 | 5 | ./configure --prefix=/usr \ 6 | --host=$LFS_TGT \ 7 | --build=$(build-aux/config.guess) 8 | 9 | make 10 | make install DESTDIR=$LFS install 11 | 12 | rm -rf /tmp/patch 13 | -------------------------------------------------------------------------------- /scripts/8.57-findutils.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/findutils-4.8.0.tar.xz -C /tmp/ 2 | mv -v /tmp/findutils-4.8.0 /tmp/findutils 3 | cd /tmp/findutils 4 | 5 | ./configure --prefix=/usr --localstatedir=/var/lib/locate 6 | 7 | make 8 | chown -Rv tester . 9 | su tester -c "PATH=$PATH make check" 10 | make install 11 | 12 | rm -rf /tmp/findutils 13 | -------------------------------------------------------------------------------- /scripts/6.12-make.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/make-4.3.tar.gz -C /tmp/ 2 | mv -v /tmp/make-4.3 /tmp/make 3 | cd /tmp/make 4 | 5 | ./configure --prefix=/usr \ 6 | --without-guile \ 7 | --host=$LFS_TGT \ 8 | --build=$(build-aux/config.guess) 9 | 10 | make 11 | make DESTDIR=$LFS install 12 | 13 | rm -rf /tmp/make 14 | -------------------------------------------------------------------------------- /scripts/6.15-tar.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/tar-1.34.tar.xz -C /tmp/ 2 | mv -v /tmp/tar-1.34 /tmp/tar 3 | cd /tmp/tar 4 | 5 | ./configure --prefix=/usr \ 6 | --host=$LFS_TGT \ 7 | --build=$(build-aux/config.guess) 8 | 9 | make 10 | make DESTDIR=$LFS install 11 | 12 | rm -rf /tmp/tar 13 | -------------------------------------------------------------------------------- /scripts/6.9-gawk.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/gawk-5.1.0.tar.xz -C /tmp/ 2 | mv -v /tmp/gawk-5.1.0 /tmp/gawk 3 | cd /tmp/gawk 4 | 5 | sed -i 's/extras//' Makefile.in 6 | 7 | ./configure --prefix=/usr \ 8 | --host=$LFS_TGT \ 9 | --build=$(./config.guess) 10 | 11 | make 12 | make DESTDIR=$LFS install 13 | 14 | rm -rf /tmp/gawk -------------------------------------------------------------------------------- /scripts/8.24-libcap.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/libcap-2.53.tar.xz -C /tmp/ 2 | mv -v /tmp/libcap-2.53 /tmp/libcap 3 | cd /tmp/libcap 4 | 5 | sed -i '/install -m.*STA/d' libcap/Makefile 6 | 7 | make prefix=/usr lib=lib 8 | 9 | make test 10 | make prefix=/usr lib=lib install 11 | chmod -v 755 /usr/lib/lib{cap,psx}.so.2.53 12 | 13 | rm -rf /tmp/libcap -------------------------------------------------------------------------------- /scripts/8.21-mpc.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/mpc-1.2.1.tar.gz -C /tmp/ 2 | mv -v /tmp/mpc-1.2.1 /tmp/mpc 3 | cd /tmp/mpc 4 | 5 | ./configure --prefix=/usr \ 6 | --disable-static \ 7 | --docdir=/usr/share/doc/mpc-1.2.1 8 | 9 | make 10 | make html 11 | make check 12 | 13 | make install 14 | make install-html 15 | 16 | rm -rf /tmp/mpc 17 | -------------------------------------------------------------------------------- /scripts/8.22-attr.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/attr-2.5.1.tar.gz -C /tmp/ 2 | mv -v /tmp/attr-2.5.1 /tmp/attr 3 | cd /tmp/attr 4 | 5 | ./configure --prefix=/usr \ 6 | --disable-static \ 7 | --sysconfdir=/etc \ 8 | --docdir=/usr/share/doc/attr-2.5.1 9 | 10 | make 11 | make check 12 | make install 13 | 14 | rm -rf /tmp/attr 15 | -------------------------------------------------------------------------------- /scripts/8.48-libffi.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/libffi-3.4.2.tar.gz -C /tmp/ 2 | mv -v /tmp/libffi-3.4.2 /tmp/libffi 3 | cd /tmp/libffi 4 | 5 | ./configure --prefix=/usr \ 6 | --disable-static \ 7 | --with-gcc-arch=native \ 8 | --disable-exec-static-tramp 9 | 10 | make 11 | make check 12 | make install 13 | 14 | rm -rf /tmp/libffi 15 | -------------------------------------------------------------------------------- /scripts/8.31-gettext.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/gettext-0.21.tar.xz -C /tmp/ 2 | mv -v /tmp/gettext-0.21 /tmp/gettext 3 | cd /tmp/gettext 4 | 5 | ./configure --prefix=/usr \ 6 | --disable-static \ 7 | --docdir=/usr/share/doc/gettext-0.21 8 | 9 | make 10 | make check 11 | make install 12 | chmod -v 0755 /usr/lib/preloadable_libintl.so 13 | 14 | rm -rf /tmp/gettext -------------------------------------------------------------------------------- /scripts/8.56-gawk.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/gawk-5.1.0.tar.xz -C /tmp/ 2 | mv -v /tmp/gawk-5.1.0 /tmp/gawk 3 | cd /tmp/gawk 4 | 5 | sed -i 's/extras//' Makefile.in 6 | 7 | ./configure --prefix=/usr 8 | 9 | make 10 | make check 11 | make install 12 | 13 | mkdir -v /usr/share/doc/gawk-5.1.0 14 | cp -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-5.1.0 15 | 16 | rm -rf /tmp/gawk 17 | -------------------------------------------------------------------------------- /scripts/8.43-intltool.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/intltool-0.51.0.tar.gz -C /tmp/ 2 | mv -v /tmp/intltool-0.51.0 /tmp/intltool 3 | cd /tmp/intltool 4 | 5 | sed -i 's:\\\${:\\\$\\{:' intltool-update.in 6 | 7 | ./configure --prefix=/usr 8 | 9 | make 10 | make check 11 | make install 12 | 13 | install -v -Dm644 doc/I18N-HOWTO /usr/share/doc/intltool-0.51.0/I18N-HOWTO 14 | 15 | rm -rf /tmp/intltool 16 | -------------------------------------------------------------------------------- /scripts/8.67-texinfo.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/texinfo-6.8.tar.xz -C /tmp/ 2 | mv -v /tmp/texinfo-6.8 /tmp/texinfo 3 | cd /tmp/texinfo 4 | 5 | ./configure --prefix=/usr 6 | 7 | sed -e 's/__attribute_nonnull__/__nonnull/' \ 8 | -i gnulib/lib/malloc/dynarray-skeleton.c 9 | 10 | make 11 | make check 12 | make install 13 | 14 | make TEXMF=/usr/share/texmf install-tex 15 | 16 | rm -rf /tmp/texinfo -------------------------------------------------------------------------------- /scripts/8.29-sed.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/sed-4.8.tar.xz -C /tmp/ 2 | mv -v /tmp/sed-4.8 /tmp/sed 3 | cd /tmp/sed 4 | 5 | ./configure --prefix=/usr 6 | 7 | make 8 | make html 9 | 10 | chown -Rv tester . 11 | su tester -c "PATH=$PATH make check" 12 | 13 | make install 14 | install -d -m755 /usr/share/doc/sed-4.8 15 | install -m644 doc/sed.html /usr/share/doc/sed-4.8 16 | 17 | rm -rf /tmp/sed -------------------------------------------------------------------------------- /scripts/8.38-expat.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/expat-2.4.1.tar.xz -C /tmp/ 2 | mv -v /tmp/expat-2.4.1 /tmp/expat 3 | cd /tmp/expat 4 | 5 | ./configure --prefix=/usr \ 6 | --disable-static \ 7 | --docdir=/usr/share/doc/expat-2.4.1 8 | 9 | make 10 | make check 11 | make install 12 | 13 | install -v -m644 doc/*.{html,png,css} /usr/share/doc/expat-2.4.1 14 | 15 | rm -rf /tmp/expat -------------------------------------------------------------------------------- /scripts/8.20-mpfr.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/mpfr-4.1.0.tar.xz -C /tmp/ 2 | mv -v /tmp/mpfr-4.1.0 /tmp/mpfr 3 | cd /tmp/mpfr 4 | 5 | ./configure --prefix=/usr \ 6 | --disable-static \ 7 | --enable-thread-safe \ 8 | --docdir=/usr/share/doc/mpfr-4.1.0 9 | 10 | make 11 | make html 12 | 13 | make check 14 | make install 15 | make install-html 16 | 17 | rm -rf /tmp/mpfr -------------------------------------------------------------------------------- /scripts/6.4-bash.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/bash-5.1.8.tar.gz -C /tmp/ 2 | mv -v /tmp/bash-5.1.8 /tmp/bash 3 | cd /tmp/bash 4 | 5 | ./configure --prefix=/usr \ 6 | --build=$(support/config.guess) \ 7 | --host=$LFS_TGT \ 8 | --without-bash-malloc 9 | 10 | make 11 | make DESTDIR=$LFS install 12 | ln -sv bash $LFS/bin/sh 13 | 14 | rm -rf /tmp/bash -------------------------------------------------------------------------------- /scripts/8.59-grub.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/grub-2.06.tar.xz -C /tmp/ 2 | mv -v /tmp/grub-2.06 /tmp/grub 3 | cd /tmp/grub 4 | 5 | ./configure --prefix=/usr \ 6 | --sysconfdir=/etc \ 7 | --disable-efiemu \ 8 | --disable-werror 9 | 10 | make 11 | make install 12 | mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions 13 | 14 | rm -rf /tmp/grub 15 | -------------------------------------------------------------------------------- /scripts/8.79-cleanup.sh: -------------------------------------------------------------------------------- 1 | rm -rf /tmp/* 2 | 3 | logout 4 | 5 | chroot "$LFS" /usr/bin/env -i \ 6 | HOME=/root TERM="$TERM" \ 7 | PS1='(lfs chroot) \u:\w\$ ' \ 8 | PATH=/usr/bin:/usr/sbin \ 9 | /bin/bash --login 10 | 11 | find /usr/lib /usr/libexec -name \*.la -delete 12 | find /usr -depth -name $(uname -m)-lfs-linux-gnu\* | xargs rm -rf 13 | userdel -r tester 14 | -------------------------------------------------------------------------------- /scripts/6.8-findutils.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/findutils-4.8.0.tar.xz -C /tmp/ 2 | mv -v /tmp/findutils-4.8.0 /tmp/findutils 3 | cd /tmp/findutils 4 | 5 | ./configure --prefix=/usr \ 6 | --localstatedir=/var/lib/locate \ 7 | --host=$LFS_TGT \ 8 | --build=$(build-aux/config.guess) 9 | 10 | make 11 | make DESTDIR=$LFS install 12 | 13 | rm -rf /tmp/findutils -------------------------------------------------------------------------------- /scripts/7.3-kernel-file-system.sh: -------------------------------------------------------------------------------- 1 | mkdir -pv $LFS/{dev,proc,sys,run} 2 | 3 | mknod -m 600 $LFS/dev/console c 5 1 4 | mknod -m 666 $LFS/dev/null c 1 3 5 | 6 | mount -v --bind /dev $LFS/dev 7 | 8 | mount -v --bind /dev/pts $LFS/dev/pts 9 | mount -vt proc proc $LFS/proc 10 | mount -vt sysfs sysfs $LFS/sys 11 | mount -vt tmpfs tmpfs $LFS/run 12 | 13 | if [ -h $LFS/dev/shm ]; then 14 | mkdir -pv $LFS/$(readlink $LFS/dev/shm) 15 | fi -------------------------------------------------------------------------------- /scripts/8.27-pkgconfig.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/pkg-config-0.29.2.tar.gz -C /tmp/ 2 | mv -v /tmp/pkg-config-0.29.2 /tmp/pkgconfig 3 | cd /tmp/pkgconfig 4 | 5 | ./configure --prefix=/usr \ 6 | --with-internal-glib \ 7 | --disable-host-tool \ 8 | --docdir=/usr/share/doc/pkg-config-0.29.2 9 | 10 | make 11 | make check 12 | make install 13 | 14 | rm -rf /tmp/pkgconfig 15 | -------------------------------------------------------------------------------- /scripts/5.1-binutils.sh: -------------------------------------------------------------------------------- 1 | 2 | tar -xf $LFS/sources/binutils-2.37.tar.xz -C /tmp/ 3 | mv -v /tmp/binutils-2.37 /tmp/binutils 4 | cd /tmp/binutils 5 | 6 | mkdir -v build 7 | cd build 8 | 9 | ../configure --prefix=$LFS/tools \ 10 | --with-sysroot=$LFS \ 11 | --target=$LFS_TGT \ 12 | --disable-nls \ 13 | --disable-werror 14 | 15 | make 16 | make install -j1 17 | 18 | rm -rf /tmp/binutils -------------------------------------------------------------------------------- /scripts/6.16-xz.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/xz-5.2.5.tar.xz -C /tmp/ 2 | mv -v /tmp/xz-5.2.5 /tmp/xz 3 | cd /tmp/xz 4 | 5 | ./configure --prefix=/usr \ 6 | --host=$LFS_TGT \ 7 | --build=$(build-aux/config.guess) \ 8 | --disable-static \ 9 | --docdir=/usr/share/doc/xz-5.2.5 10 | 11 | make 12 | make DESTDIR=$LFS install 13 | 14 | rm -rf /tmp/xz -------------------------------------------------------------------------------- /scripts/8.52-meson.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/meson-0.59.1.tar.gz -C /tmp/ 2 | mv -v /tmp/meson-0.59.1 /tmp/meson 3 | cd /tmp/meson 4 | 5 | python3 setup.py build 6 | 7 | python3 setup.py install --root=dest 8 | cp -rv dest/* / 9 | install -vDm644 data/shell-completions/bash/meson /usr/share/bash-completion/completions/meson 10 | install -vDm644 data/shell-completions/zsh/_meson /usr/share/zsh/site-functions/_meson 11 | 12 | rm -rf /tmp/meson 13 | -------------------------------------------------------------------------------- /scripts/8.61-iproute2.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/iproute2-5.13.0.tar.xz -C /tmp/ 2 | mv -v /tmp/iproute2-5.13.0 /tmp/iproute2 3 | cd /tmp/iproute2 4 | 5 | sed -i /ARPD/d Makefile 6 | rm -fv man/man8/arpd.8 7 | 8 | sed -i 's/.m_ipt.o//' tc/Makefile 9 | 10 | make 11 | make SBINDIR=/usr/sbin install 12 | 13 | mkdir -v /usr/share/doc/iproute2-5.13.0 14 | cp -v COPYING README* /usr/share/doc/iproute2-5.13.0 15 | 16 | rm -rf /tmp/iproute2 -------------------------------------------------------------------------------- /scripts/8.47-elfutils.sh: -------------------------------------------------------------------------------- 1 | 2 | tar -xf $LFS/sources/elfutils-0.185.tar.bz2 -C /tmp/ 3 | mv -v /tmp/elfutils-0.185 /tmp/elfutils 4 | cd /tmp/elfutils 5 | 6 | ./configure --prefix=/usr \ 7 | --disable-debuginfod \ 8 | --enable-libdebuginfod=dummy 9 | 10 | make 11 | make check 12 | 13 | make -C libelf install 14 | install -vm644 config/libelf.pc /usr/lib/pkgconfig 15 | rm /usr/lib/libelf.a 16 | 17 | rm -rf /tmp/elfutils -------------------------------------------------------------------------------- /scripts/8.16-expect.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/expect5.45.4.tar.gz -C /tmp/ 2 | mv -v /tmp/expect5.45.4 /tmp/expect 3 | cd /tmp/expect 4 | 5 | ./configure --prefix=/usr \ 6 | --with-tcl=/usr/lib \ 7 | --enable-shared \ 8 | --mandir=/usr/share/man \ 9 | --with-tclinclude=/usr/include 10 | 11 | make 12 | make test 13 | make install 14 | ln -svf expect5.45.4/libexpect5.45.4.so /usr/lib 15 | 16 | rm -rf /tmp/expect -------------------------------------------------------------------------------- /scripts/8.19-gmp.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/gmp-6.2.1.tar.xz -C /tmp/ 2 | mv -v /tmp/gmp-6.2.1 /tmp/gmp 3 | cd /tmp/gmp 4 | 5 | ./configure --prefix=/usr \ 6 | --enable-cxx \ 7 | --disable-static \ 8 | --docdir=/usr/share/doc/gmp-6.2.1 9 | 10 | make 11 | make html 12 | 13 | make check 2>&1 | tee gmp-check-log 14 | awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log 15 | 16 | make install 17 | make install-html 18 | 19 | rm -rf /tmp/gmp -------------------------------------------------------------------------------- /scripts/8.74-procps.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/procps-ng-3.3.17.tar.xz -C /tmp/ 2 | mv -v /tmp/procps-ng-3.3.17 /tmp/procps 3 | cd /tmp/procps 4 | 5 | ./configure --prefix=/usr \ 6 | --docdir=/usr/share/doc/procps-ng-3.3.17 \ 7 | --disable-static \ 8 | --disable-kill \ 9 | --with-systemd 10 | 11 | make 12 | make check 13 | make install 14 | 15 | rm -rf /tmp/procps -------------------------------------------------------------------------------- /scripts/8.62-kbd.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/kbd-2.4.0.tar.xz -C /tmp/ 2 | mv -v /tmp/kbd-2.4.0 /tmp/kbd 3 | cd /tmp/kbd 4 | 5 | patch -Np1 -i sources/kbd-2.4.0-backspace-1.patch 6 | sed -i '/RESIZECONS_PROGS=/s/yes/no/' configure 7 | sed -i 's/resizecons.8 //' docs/man/man8/Makefile.in 8 | 9 | ./configure --prefix=/usr --disable-vlock 10 | 11 | make 12 | make check 13 | make install 14 | 15 | mkdir -v /usr/share/doc/kbd-2.4.0 16 | cp -R -v docs/doc/* /usr/share/doc/kbd-2.4.0 17 | 18 | rm -rf /tmp/kbd 19 | -------------------------------------------------------------------------------- /scripts/6.7-file.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/file-5.40.tar.gz -C /tmp/ 2 | mv -v /tmp/file-5.40 /tmp/file 3 | cd /tmp/file 4 | 5 | make build 6 | pushd build 7 | ../configure --disable-bzlib \ 8 | --disable-libseccomp \ 9 | --disable-xzlib \ 10 | --disable-zlib 11 | make 12 | popd 13 | 14 | 15 | ./configure --prefix=/usr --host=$LFS_TGT --build=$(./config.guess) 16 | 17 | make FILE_COMPILE=$(pwd)/build/src/file 18 | make DESTDIR=$LFS install 19 | 20 | rm -rf /tmp/file -------------------------------------------------------------------------------- /scripts/8.46-kmod.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/kmod-29.tar.xz -C /tmp/ 2 | mv -v /tmp/kmod-29 /tmp/kmod 3 | cd /tmp/kmod 4 | 5 | ./configure --prefix=/usr \ 6 | --sysconfdir=/etc \ 7 | --with-xz \ 8 | --with-zstd \ 9 | --with-zlib 10 | 11 | make 12 | make install 13 | 14 | for target in depmod insmod modinfo modprobe rmmod; do 15 | ln -sfv ../bin/kmod /usr/sbin/$target 16 | done 17 | 18 | ln -sfv kmod /usr/bin/lsmod 19 | 20 | rm -rf /tmp/kmod 21 | -------------------------------------------------------------------------------- /scripts/8.17-dejagnu.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/dejagnu-1.6.3.tar.gz -C /tmp/ 2 | mv -v /tmp/dejagnu-1.6.3 /tmp/dejagnu 3 | cd /tmp/dejagnu 4 | 5 | mkdir -v build 6 | cd build 7 | 8 | ../configure --prefix=/usr 9 | makeinfo --html --no-split -o doc/dejagnu.html ../doc/dejagnu.texi 10 | makeinfo --plaintext -o doc/dejagnu.txt ../doc/dejagnu.texi 11 | 12 | make install 13 | install -v -dm755 /usr/share/doc/dejagnu-1.6.3 14 | install -v -m644 doc/dejagnu.{html,txt} /usr/share/doc/dejagnu-1.6.3 15 | 16 | make check 17 | 18 | rm -rf /tmp/dejagnu -------------------------------------------------------------------------------- /scripts/7.7.1-libstdc++.sh: -------------------------------------------------------------------------------- 1 | tar -xf sources/gcc-11.2.0.tar.xz -C /tmp/ 2 | mv -v /tmp/gcc-11.2.0 /tmp/gcc 3 | cd /tmp/gcc 4 | 5 | ln -s gthr-posix.h libgcc/gthr-default.h 6 | 7 | mkdir -v build 8 | cd build 9 | 10 | ../libstdc++-v3/configure \ 11 | CXXFLAGS="-g -O2 -D_GNU_SOURCE" \ 12 | --prefix=/usr \ 13 | --disable-multilib \ 14 | --disable-nls \ 15 | --host=$(uname -m)-lfs-linux-gnu \ 16 | --disable-libstdcxx-pch 17 | 18 | make 19 | make install 20 | 21 | rm -rf /tmp/gcc -------------------------------------------------------------------------------- /scripts/8.11-readline.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/readline-8.1.tar.gz -C /tmp/ 2 | mv -v /tmp/readline-8.1 /tmp/readline 3 | cd /tmp/readline 4 | 5 | sed -i '/MV.*old/d' Makefile.in 6 | sed -i '/{OLDSUFF}/c:' support/shlib-install 7 | 8 | ./configure --prefix=/usr \ 9 | --disable-static \ 10 | --with-curses \ 11 | --docdir=/usr/share/doc/readline-8.1 12 | 13 | make SHLIB_LIBS="-lncursesw" 14 | make SHLIB_LIBS="-lncursesw" install 15 | install -v -m644 doc/*.{ps,pdf,html,dvi} /usr/share/doc/readline-8.1 16 | 17 | rm -rf /tmp/readline 18 | -------------------------------------------------------------------------------- /scripts/8.49-openssl.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/openssl-1.1.1l.tar.gz -C /tmp/ 2 | mv -v /tmp/openssl-1.1.1l /tmp/openssl 3 | cd /tmp/openssl 4 | 5 | ./config --prefix=/usr \ 6 | --openssldir=/etc/ssl \ 7 | --libdir=lib \ 8 | shared \ 9 | zlib-dynamic 10 | 11 | make 12 | make test 13 | sed -i '/INSTALL_LIBS/s/libcrypto.a libssl.a//' Makefile 14 | make MANSUFFIX=ssl install 15 | mv -v /usr/share/doc/openssl /usr/share/doc/openssl-1.1.1l 16 | cp -vfr doc/* /usr/share/doc/openssl-1.1.1l 17 | 18 | rm -rf /tmp/openssl 19 | -------------------------------------------------------------------------------- /scripts/5.6-libstdc++.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/gcc-11.2.0.tar.xz -C /tmp/ 2 | mv -v /tmp/gcc-11.2.0 /tmp/gcc 3 | cd /tmp/gcc 4 | 5 | mkdir -v build 6 | cd build 7 | 8 | ../libstdc++-v3/configure \ 9 | --host=$LFS_TGT \ 10 | --build=$(../config.guess) \ 11 | --prefix=/usr \ 12 | --disable-multilib \ 13 | --disable-nls \ 14 | --disable-libstdcxx-pch \ 15 | --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/11.2.0 16 | 17 | make 18 | make DESTDIR=$LFS install 19 | 20 | rm -rf /tmp/gcc -------------------------------------------------------------------------------- /scripts/8.34-bash.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/bash-5.1.8.tar.gz -C /tmp/ 2 | mv -v /tmp/bash-5.1.8 /tmp/bash 3 | cd /tmp/bash 4 | 5 | ./configure --prefix=/usr \ 6 | --docdir=/usr/share/doc/bash-5.1.8 \ 7 | --without-bash-malloc \ 8 | --with-installed-readline 9 | 10 | make 11 | 12 | chown -Rv tester . 13 | 14 | su -s /usr/bin/expect tester << EOF 15 | set timeout -1 16 | spawn make tests 17 | expect eof 18 | lassign [wait] _ _ _ value 19 | exit $value 20 | EOF 21 | 22 | make install 23 | exec /bin/bash --login +h 24 | 25 | rm -rf /tmp/bash -------------------------------------------------------------------------------- /scripts/6.17-binutils.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/binutils-2.37.tar.xz -C /tmp/ 2 | mv -v /tmp/binutils-2.37 /tmp/binutils 3 | cd /tmp/binutils 4 | 5 | mkdir -v build 6 | cd build 7 | 8 | ../configure \ 9 | --prefix=/usr \ 10 | --build=$(../config.guess) \ 11 | --host=$LFS_TGT \ 12 | --disable-nls \ 13 | --enable-shared \ 14 | --disable-werror \ 15 | --enable-64-bit-bfd 16 | 17 | make 18 | make DESTDIR=$LFS install -j1 19 | install -vm755 libctf/.libs/libctf.so.0.0.0 $LFS/usr/lib 20 | 21 | rm -rf /tmp/binutils 22 | -------------------------------------------------------------------------------- /scripts/8.73-man.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/man-db-2.9.4.tar.xz -C /tmp/ 2 | mv -v /tmp/man-db-2.9.4 /tmp/mandb 3 | cd /tmp/mandb 4 | 5 | ./configure --prefix=/usr \ 6 | --docdir=/usr/share/doc/man-db-2.9.4 \ 7 | --sysconfdir=/etc \ 8 | --disable-setuid \ 9 | --enable-cache-owner=bin \ 10 | --with-browser=/usr/bin/lynx \ 11 | --with-vgrind=/usr/bin/vgrind \ 12 | --with-grap=/usr/bin/grap 13 | 14 | make 15 | make check 16 | make install 17 | 18 | rm -rf /tmp/mandb -------------------------------------------------------------------------------- /scripts/8.39-inetutils.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/inetutils-2.1.tar.xz -C /tmp/ 2 | mv -v /tmp/inetutils-2.1 /tmp/inetutils 3 | cd /tmp/inetutils 4 | 5 | ./configure --prefix=/usr \ 6 | --bindir=/usr/bin \ 7 | --localstatedir=/var \ 8 | --disable-logger \ 9 | --disable-whois \ 10 | --disable-rcp \ 11 | --disable-rexec \ 12 | --disable-rlogin \ 13 | --disable-rsh \ 14 | --disable-servers 15 | 16 | make 17 | make check 18 | make install 19 | 20 | mv -v /usr/{,s}bin/ifconfig 21 | 22 | rm -rf /tmmp/inetutils 23 | -------------------------------------------------------------------------------- /scripts/8.7-bzip2.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/bzip2-1.0.8.tar.gz -C /tmp/ 2 | mv -v /tmp/bzip2-1.0.8 /tmp/bzip2 3 | cd /tmp/bzip2 4 | 5 | patch -Np1 -i scripts/bzip2-1.0.8-install_docs-1.patch 6 | 7 | sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile 8 | sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile 9 | 10 | make -f Makefile-libbz2_so 11 | make clean 12 | 13 | make 14 | make PREFIX=/usr install 15 | 16 | cp -av libbz2.so.* /usr/lib 17 | ln -sv libbz2.so.1.0.8 /usr/lib/libbz2.so 18 | cp -v bzip2-shared /usr/bin/bzip2 19 | for i in /usr/bin/{bzcat,bunzip2}; do 20 | ln -sfv bzip2 $i 21 | done 22 | 23 | rm -fv /usr/lib/libbz2.a 24 | 25 | rm -rf /tmp/bzip2 -------------------------------------------------------------------------------- /scripts/8.50-Python.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/Python-3.9.6.tar.xz -C /tmp/ 2 | mv -v /tmp/Python-3.9.6 /tmp/Python 3 | cd /tmp/Python 4 | 5 | ./configure --prefix=/usr \ 6 | --enable-shared \ 7 | --with-system-expat \ 8 | --with-system-ffi \ 9 | --with-ensurepip=yes \ 10 | --enable-optimizations 11 | 12 | make 13 | make install 14 | install -v -dm755 /usr/share/doc/python-3.9.6/html 15 | 16 | tar --strip-components=1 \ 17 | --no-same-owner \ 18 | --no-same-permissions \ 19 | -C /usr/share/doc/python-3.9.6/html \ 20 | -xvf sources/python-3.9.6-docs-html.tar.bz2 21 | 22 | rm -rf /tmp/Python 23 | -------------------------------------------------------------------------------- /scripts/8.51-ninja.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/ninja-1.10.2.tar.gz -C /tmp/ 2 | mv -v /tmp/ninja-1.10.2 /tmp/ninja 3 | cd /tmp/ninja 4 | 5 | export NINJAJOBS=4 6 | 7 | sed -i '/int Guess/a \ 8 | int j = 0;\ 9 | char* jobs = getenv( "NINJAJOBS" );\ 10 | if ( jobs != NULL ) j = atoi( jobs );\ 11 | if ( j > 0 ) return j;\ 12 | ' src/ninja.cc 13 | 14 | python3 configure.py --bootstrap 15 | 16 | ./ninja ninja_test 17 | ./ninja_test --gtest_filter=-SubprocessTest.SetWithLots 18 | 19 | install -vm755 ninja /usr/bin/ 20 | install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja 21 | install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja 22 | 23 | rm -rf /tmp/ninja 24 | -------------------------------------------------------------------------------- /scripts/7.10-perl.sh: -------------------------------------------------------------------------------- 1 | tar -xf sources/perl-5.34.0.tar.xz -C /tmp/ 2 | mv -v /tmp/perl-5.34.0 /tmp/perl 3 | cd /tmp/perl 4 | 5 | sh Configure -des \ 6 | -Dprefix=/usr \ 7 | -Dvendorprefix=/usr \ 8 | -Dprivlib=/usr/lib/perl5/5.34/core_perl \ 9 | -Darchlib=/usr/lib/perl5/5.34/core_perl \ 10 | -Dsitelib=/usr/lib/perl5/5.34/site_perl \ 11 | -Dsitearch=/usr/lib/perl5/5.34/site_perl \ 12 | -Dvendorlib=/usr/lib/perl5/5.34/vendor_perl \ 13 | -Dvendorarch=/usr/lib/perl5/5.34/vendor_perl 14 | 15 | make 16 | make install 17 | 18 | rm -rf /tmp/perl -------------------------------------------------------------------------------- /scripts/8.75-util-linux: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/util-linux-2.37.2.tar.xz -C /tmp/ 2 | mv -v /tmp/util-linux-2.37.2 /tmp/util-linux 3 | cd /tmp/util-linux 4 | 5 | ./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \ 6 | --libdir=/usr/lib \ 7 | --docdir=/usr/share/doc/util-linux-2.37.2 \ 8 | --disable-chfn-chsh \ 9 | --disable-login \ 10 | --disable-nologin \ 11 | --disable-su \ 12 | --disable-setpriv \ 13 | --disable-runuser \ 14 | --disable-pylibmount \ 15 | --disable-static \ 16 | --without-python \ 17 | runstatedir=/run 18 | 19 | make 20 | make install 21 | 22 | rm -rf /tmp/util-linux -------------------------------------------------------------------------------- /scripts/7.13-util-linux.sh: -------------------------------------------------------------------------------- 1 | tar -xf sources/util-linux-2.37.2.tar.xz -C /tmp/ 2 | mv -v /tmp/util-linux-2.37.2 /tmp/util 3 | cd /tmp/util 4 | 5 | mkdir -pv /var/lib/hwclock 6 | 7 | ./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \ 8 | --libdir=/usr/lib \ 9 | --docdir=/usr/share/doc/util-linux-2.37.2 \ 10 | --disable-chfn-chsh \ 11 | --disable-login \ 12 | --disable-nologin \ 13 | --disable-su \ 14 | --disable-setpriv \ 15 | --disable-runuser \ 16 | --disable-pylibmount \ 17 | --disable-static \ 18 | --without-python \ 19 | runstatedir=/run 20 | 21 | make 22 | make install 23 | 24 | rm -rf /tmp/util -------------------------------------------------------------------------------- /scripts/8.72-dbus.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/dbus-1.12.20.tar.gz -C /tmp/ 2 | mv -v /tmp/dbus-1.12.20 /tmp/dbus 3 | cd /tmp/dbus 4 | 5 | ./configure --prefix=/usr \ 6 | --sysconfdir=/etc \ 7 | --localstatedir=/var \ 8 | --disable-static \ 9 | --disable-doxygen-docs \ 10 | --disable-xml-docs \ 11 | --docdir=/usr/share/doc/dbus-1.12.20 \ 12 | --with-console-auth-dir=/run/console \ 13 | --with-system-pid-file=/run/dbus/pid \ 14 | --with-system-socket=/run/dbus/system_bus_socket 15 | 16 | make 17 | make install 18 | 19 | ln -sfv /etc/machine-id /var/lib/dbus 20 | 21 | rm -rf /tmp/dbus -------------------------------------------------------------------------------- /scripts/6.5-coreutils.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/coreutils-8.32.tar.xz -C /tmp/ 2 | mv -v /tmp/coreutils-8.32 /tmp/coreutils 3 | cd /tmp/coreutils 4 | 5 | ./configure --prefix=/usr \ 6 | --host=$LFS_TGT \ 7 | --build=$(build-aux/config.guess) \ 8 | --enable-install-program=hostname \ 9 | --enable-no-install-program=kill,uptime 10 | 11 | make 12 | make DESTDIR=$LFS install 13 | 14 | mv -v $LFS/usr/bin/chroot $LFS/usr/sbin 15 | mkdir -pv $LFS/usr/share/man/man8 16 | mv -v $LFS/usr/share/man/man1/chroot.1 $LFS/usr/share/man/man8/chroot.8 17 | sed -i 's/"1"/"8"/' $LFS/usr/share/man/man8/chroot.8 18 | 19 | rm -rf /tmp/coreutils -------------------------------------------------------------------------------- /scripts/8.53-coreutils.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/coreutils-8.32.tar.xz -C /tmp/ 2 | mv -v /tmp/coreutils-8.32 /tmp/coreutils 3 | cd /tmp/coreutils 4 | 5 | patch -Np1 -i ../coreutils-8.32-i18n-1.patch 6 | 7 | autoreconf -fiv 8 | FORCE_UNSAFE_CONFIGURE=1 ./configure \ 9 | --prefix=/usr \ 10 | --enable-no-install-program=kill,uptime 11 | 12 | make 13 | make NON_ROOT_USERNAME=tester check-root 14 | 15 | echo "dummy:x:102:tester" >> /etc/group 16 | chown -Rv tester . 17 | su tester -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check" 18 | sed -i '/dummy/d' /etc/group 19 | make install 20 | 21 | mv -v /usr/bin/chroot /usr/sbin 22 | mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8 23 | sed -i 's/"1"/"8"/' /usr/share/man/man8/chroot.8 24 | 25 | rm -rf /tmp/coreutils 26 | -------------------------------------------------------------------------------- /scripts/8.18-binutils.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/binutils-2.37.tar.xz -C /tmp/ 2 | mv -v /tmp/binutils-2.37 /tmp/binutils 3 | cd /tmp/binutils 4 | 5 | expect -c "spawn ls" 6 | 7 | patch -Np1 -i ../binutils-2.37-upstream_fix-1.patch 8 | 9 | sed -i '63d' etc/texi2pod.pl 10 | find -name \*.1 -delete 11 | 12 | mkdir -v build 13 | cd build 14 | 15 | ../configure --prefix=/usr \ 16 | --enable-gold \ 17 | --enable-ld=default \ 18 | --enable-plugins \ 19 | --enable-shared \ 20 | --disable-werror \ 21 | --enable-64-bit-bfd \ 22 | --with-system-zlib 23 | 24 | make tooldir=/usr 25 | make -k check 26 | make tooldir=/usr install -j1 27 | rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes}.a 28 | 29 | rm -rf /tmp/binutils 30 | 31 | 32 | -------------------------------------------------------------------------------- /scripts/6.3-ncurses.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/ncurses-6.2.tar.gz -C /tmp/ 2 | mv -v /tmp/ncurses-6.2 /tmp/ncurses 3 | cd /tmp/ncurses 4 | 5 | sed -i s/mawk// configure 6 | 7 | mkdir build 8 | pushd build 9 | ../configure 10 | make -C include 11 | make -C progs tic 12 | popd 13 | 14 | ./configure --prefix=/usr \ 15 | --host=$LFS_TGT \ 16 | --build=$(./config.guess) \ 17 | --mandir=/usr/share/man \ 18 | --with-manpage-format=normal \ 19 | --with-shared \ 20 | --without-debug \ 21 | --without-ada \ 22 | --without-normal \ 23 | --enable-widec 24 | 25 | make 26 | make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install 27 | 28 | echo "INPUT(-lncursesw)" > $LFS/usr/lib/libncurses.so 29 | 30 | rm -rf /tmp/ncurses -------------------------------------------------------------------------------- /scripts/8.76-e2fsprogs.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/e2fsprogs-1.46.4.tar.gz -C /tmp/ 2 | mv -v /tmp/e2fsprogs-1.46.4 /tmp/e2fsprogs 3 | cd /tmp/e2fsprogs 4 | 5 | mkdir -v build 6 | cd build 7 | 8 | ../configure --prefix=/usr \ 9 | --sysconfdir=/etc \ 10 | --enable-elf-shlibs \ 11 | --disable-libblkid \ 12 | --disable-libuuid \ 13 | --disable-uuidd \ 14 | --disable-fsck 15 | 16 | make 17 | make check 18 | make install 19 | 20 | rm -fv /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a 21 | gunzip -v /usr/share/info/libext2fs.info.gz 22 | install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info 23 | 24 | makeinfo -o doc/com_err.info ../lib/et/com_err.texinfo 25 | install -v -m644 doc/com_err.info /usr/share/info 26 | install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.info 27 | 28 | rm -rf /tmp/e2fsprogs -------------------------------------------------------------------------------- /scripts/8.68-vim.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/vim-8.2.3337.tar.gz -C /tmp/ 2 | mv -v /tmp/vim-8.2.3337 /tmp/vim 3 | cd /tmp/vim 4 | 5 | echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h 6 | 7 | ./configure --prefix=/usr 8 | 9 | make 10 | chown -Rv tester . 11 | su tester -c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log 12 | make install 13 | 14 | ln -sv vim /usr/bin/vi 15 | for L in /usr/share/man/{,*/}man1/vim.1; do 16 | ln -sv vim.1 $(dirname $L)/vi.1 17 | done 18 | 19 | ln -sv ../vim/vim82/doc /usr/share/doc/vim-8.2.3337 20 | 21 | cat > /etc/vimrc << "EOF" 22 | " Begin /etc/vimrc 23 | 24 | " Ensure defaults are set before customizing settings, not after 25 | source $VIMRUNTIME/defaults.vim 26 | let skip_defaults_vim=1 27 | 28 | set nocompatible 29 | set backspace=2 30 | set mouse= 31 | syntax on 32 | if (&term == "xterm") || (&term == "putty") 33 | set background=dark 34 | endif 35 | 36 | " End /etc/vimrc 37 | EOF 38 | 39 | rm -rf /tmp/vim -------------------------------------------------------------------------------- /scripts/8.28-ncurses.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/ncurses-6.2.tar.gz -C /tmp/ 2 | mv -v /tmp/ncurses-6.2 /tmp/ncurses 3 | cd /tmp/ncurses 4 | 5 | ./configure --prefix=/usr \ 6 | --mandir=/usr/share/man \ 7 | --with-shared \ 8 | --without-debug \ 9 | --without-normal \ 10 | --enable-pc-files \ 11 | --enable-widec 12 | 13 | make 14 | make install 15 | for lib in ncurses form panel menu ; do 16 | rm -vf /usr/lib/lib${lib}.so 17 | echo "INPUT(-l${lib}w)" > /usr/lib/lib${lib}.so 18 | ln -sfv ${lib}w.pc /usr/lib/pkgconfig/${lib}.pc 19 | done 20 | 21 | rm -vf /usr/lib/libcursesw.so 22 | echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so 23 | ln -sfv libncurses.so /usr/lib/libcurses.so 24 | 25 | rm -fv /usr/lib/libncurses++w.a 26 | 27 | mkdir -v /usr/share/doc/ncurses-6.2 28 | cp -v -R doc/* /usr/share/doc/ncurses-6.2 29 | 30 | rm -rf /tmp/ncurses -------------------------------------------------------------------------------- /scripts/8.25-shadow.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/shadow-4.9.tar.xz -C /tmp/ 2 | mv -v /tmp/shadow-4.9 /tmp/shadow 3 | cd /tmp/shadow 4 | 5 | sed -i 's/groups$(EXEEXT) //' src/Makefile.in 6 | find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \; 7 | find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \; 8 | find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \; 9 | 10 | sed -e 's:#ENCRYPT_METHOD DES:ENCRYPT_METHOD SHA512:' \ 11 | -e 's:/var/spool/mail:/var/mail:' \ 12 | -e '/PATH=/{s@/sbin:@@;s@/bin:@@}' \ 13 | -i etc/login.defs 14 | 15 | sed -e "224s/rounds/min_rounds/" -i libmisc/salt.c 16 | 17 | touch /usr/bin/passwd 18 | ./configure --sysconfdir=/etc \ 19 | --with-group-name-max-length=32 20 | 21 | make 22 | make exec_prefix=/usr install 23 | make -C man install-man 24 | mkdir -p /etc/default 25 | useradd -D --gid 999 26 | 27 | pwconv 28 | grpconv 29 | 30 | sed -i 's/yes/no/' /etc/default/useradd 31 | passwd root 32 | 33 | rm -rf /tmp/shadow -------------------------------------------------------------------------------- /scripts/5.5-glibc.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/glibc-2.34.tar.xz -C /tmp/ 2 | mv -v /tmp/glibc-2.34 /tmp/glibc 3 | cd /tmp/glibc 4 | 5 | case $(uname -m) in 6 | i?86) ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3 7 | ;; 8 | x86_64) ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64 9 | ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3 10 | ;; 11 | esac 12 | 13 | patch -Np1 -i $LFS/sources/glibc-2.34-fhs-1.patch 14 | 15 | mkdir -v build 16 | cd build 17 | 18 | echo "rootsbindir=/usr/sbin" > configparms 19 | 20 | ../configure \ 21 | --prefix=/usr \ 22 | --host=$LFS_TGT \ 23 | --build=$(../scripts/config.guess) \ 24 | --enable-kernel=3.2 \ 25 | --with-headers=$LFS/usr/include \ 26 | libc_cv_slibdir=/usr/lib 27 | 28 | make 29 | make DESTDIR=$LFS install 30 | 31 | sed '/RTLDLIST=/s@/usr@@g' -i $LFS/usr/bin/ldd 32 | 33 | $LFS/tools/libexec/gcc/$LFS_TGT/11.2.0/install-tools/mkheaders 34 | 35 | rm -rf /tmp/glibc -------------------------------------------------------------------------------- /scripts/8.41-perl.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/perl-5.34.0.tar.xz -C /tmp/ 2 | mv -v /tmp/perl-5.34.0 /tmp/perl 3 | cd /tmp/perl 4 | 5 | patch -Np1 -i $LFS/sources/perl-5.34.0-upstream_fixes-1.patch 6 | 7 | export BUILD_ZLIB=False 8 | export BUILD_BZIP2=0 9 | 10 | sh Configure -des \ 11 | -Dprefix=/usr \ 12 | -Dvendorprefix=/usr \ 13 | -Dprivlib=/usr/lib/perl5/5.34/core_perl \ 14 | -Darchlib=/usr/lib/perl5/5.34/core_perl \ 15 | -Dsitelib=/usr/lib/perl5/5.34/site_perl \ 16 | -Dsitearch=/usr/lib/perl5/5.34/site_perl \ 17 | -Dvendorlib=/usr/lib/perl5/5.34/vendor_perl \ 18 | -Dvendorarch=/usr/lib/perl5/5.34/vendor_perl \ 19 | -Dman1dir=/usr/share/man/man1 \ 20 | -Dman3dir=/usr/share/man/man3 \ 21 | -Dpager="/usr/bin/less -isR" \ 22 | -Duseshrplib \ 23 | -Dusethreads 24 | 25 | make 26 | make test 27 | make install 28 | 29 | unset BUILD_ZLIB BUILD_BZIP2 30 | 31 | rm -rf /tmp/perl 32 | 33 | -------------------------------------------------------------------------------- /scripts/8.15-tcl.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/tcl8.6.11-src.tar.gz -C /tmp/ 2 | mv -v /tmp/tcl8.6.11 /tmp/tcl 3 | cd /tmp/tcl 4 | 5 | tar -xf $LFS/sources/tcl8.6.11-html.tar.gz --strip-components=1 6 | 7 | SRCDIR=$(pwd) 8 | cd unix 9 | ./configure --prefix=/usr \ 10 | --mandir=/usr/share/man \ 11 | $([ "$(uname -m)" = x86_64 ] && echo --enable-64bit) 12 | 13 | make 14 | 15 | sed -e "s|$SRCDIR/unix|/usr/lib|" \ 16 | -e "s|$SRCDIR|/usr/include|" \ 17 | -i tclConfig.sh 18 | 19 | sed -e "s|$SRCDIR/unix/pkgs/tdbc1.1.2|/usr/lib/tdbc1.1.2|" \ 20 | -e "s|$SRCDIR/pkgs/tdbc1.1.2/generic|/usr/include|" \ 21 | -e "s|$SRCDIR/pkgs/tdbc1.1.2/library|/usr/lib/tcl8.6|" \ 22 | -e "s|$SRCDIR/pkgs/tdbc1.1.2|/usr/include|" \ 23 | -i pkgs/tdbc1.1.2/tdbcConfig.sh 24 | 25 | sed -e "s|$SRCDIR/unix/pkgs/itcl4.2.1|/usr/lib/itcl4.2.1|" \ 26 | -e "s|$SRCDIR/pkgs/itcl4.2.1/generic|/usr/include|" \ 27 | -e "s|$SRCDIR/pkgs/itcl4.2.1|/usr/include|" \ 28 | -i pkgs/itcl4.2.1/itclConfig.sh 29 | 30 | unset SRCDIR 31 | 32 | make test 33 | make install 34 | chmod -v u+w /usr/lib/libtcl8.6.so 35 | make install-private-headers 36 | ln -sfv tclsh8.6 /usr/bin/tclsh 37 | mv /usr/share/man/man3/{Thread,Tcl_Thread}.3 38 | 39 | rm -rf /tmp/tcl -------------------------------------------------------------------------------- /scripts/8.26-gcc.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/gcc-11.2.0.tar.xz -C /tmp/ 2 | mv -v /tmp/gcc-11.2.0 /tmp/gcc 3 | cd /tmp/gcc 4 | 5 | sed -e '/static.*SIGSTKSZ/d' \ 6 | -e 's/return kAltStackSize/return SIGSTKSZ * 4/' \ 7 | -i libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp 8 | 9 | case $(uname -m) in 10 | x86_64) 11 | sed -e '/m64=/s/lib64/lib/' \ 12 | -i.orig gcc/config/i386/t-linux64 13 | ;; 14 | esac 15 | 16 | mkdir -v build 17 | cd build 18 | 19 | ../configure --prefix=/usr \ 20 | LD=ld \ 21 | --enable-languages=c,c++ \ 22 | --disable-multilib \ 23 | --disable-bootstrap \ 24 | --with-system-zlib 25 | 26 | make 27 | ulimit -s 32768 28 | chown -Rv tester . 29 | su tester -c "PATH=$PATH make -k check" 30 | ../contrib/test_summary | grep -A7 Summ 31 | # didn't completely run the testing 32 | 33 | make install 34 | # rm -rf /usr/lib/gcc/$(gcc -dumpmachine)/11.2.0/include-fixed/bits/ 35 | 36 | # chown -v -R root:root \ 37 | # /usr/lib/gcc/*linux-gnu/11.2.0/include{,-fixed} 38 | 39 | # ln -svr /usr/bin/cpp /usr/lib 40 | 41 | # ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/11.2.0/liblto_plugin.so \ 42 | # /usr/lib/bfd-plugins/ 43 | 44 | # rm -rf /tmp/gcc -------------------------------------------------------------------------------- /scripts/8.71-systemd.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/systemd-249.tar.gz -C /tmp/ 2 | mv -v /tmp/systemd-249 /tmp/systemd 3 | cd /tmp/systemd 4 | 5 | patch -Np1 -i ../systemd-249-upstream_fixes-1.patch 6 | 7 | sed -i -e 's/GROUP="render"/GROUP="video"/' \ 8 | -e 's/GROUP="sgx", //' rules.d/50-udev-default.rules.in 9 | 10 | mkdir -p build 11 | cd build 12 | 13 | LANG=en_US.UTF-8 \ 14 | meson --prefix=/usr \ 15 | --sysconfdir=/etc \ 16 | --localstatedir=/var \ 17 | --buildtype=release \ 18 | -Dblkid=true \ 19 | -Ddefault-dnssec=no \ 20 | -Dfirstboot=false \ 21 | -Dinstall-tests=false \ 22 | -Dldconfig=false \ 23 | -Dsysusers=false \ 24 | -Db_lto=false \ 25 | -Drpmmacrosdir=no \ 26 | -Dhomed=false \ 27 | -Duserdb=false \ 28 | -Dman=false \ 29 | -Dmode=release \ 30 | -Ddocdir=/usr/share/doc/systemd-249 \ 31 | .. 32 | 33 | LANG=en_US.UTF-8 ninja 34 | LANG=en_US.UTF-8 ninja install 35 | tar -xf sources/systemd-man-pages-249.tar.xz --strip-components=1 -C /usr/share/man 36 | rm -rf /usr/lib/pam.d 37 | systemd-machine-id-setup 38 | systemctl preset-all 39 | systemctl disable systemd-time-wait-sync.service 40 | -------------------------------------------------------------------------------- /scripts/6.18-gcc.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/gcc-11.2.0.tar.xz -C /tmp/ 2 | mv -v /tmp/gcc-11.2.0 /tmp/gcc 3 | cd /tmp/gcc 4 | 5 | tar -xf $LFS/sources/mpfr-4.1.0.tar.xz 6 | mv -v mpfr-4.1.0 mpfr 7 | tar -xf $LFS/sources/gmp-6.2.1.tar.xz 8 | mv -v gmp-6.2.1 gmp 9 | tar -xf $LFS/sources/mpc-1.2.1.tar.gz 10 | mv -v mpc-1.2.1 mpc 11 | 12 | case $(uname -m) in 13 | x86_64) 14 | sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64 15 | ;; 16 | esac 17 | 18 | mkdir -v build 19 | cd build 20 | 21 | mkdir -pv $LFS_TGT/libgcc 22 | ln -s ../../../libgcc/gthr-posix.h $LFS_TGT/libgcc/gthr-default.h 23 | 24 | ../configure \ 25 | --build=$(../config.guess) \ 26 | --host=$LFS_TGT \ 27 | --prefix=/usr \ 28 | CC_FOR_TARGET=$LFS_TGT-gcc \ 29 | --with-build-sysroot=$LFS \ 30 | --enable-initfini-array \ 31 | --disable-nls \ 32 | --disable-multilib \ 33 | --disable-decimal-float \ 34 | --disable-libatomic \ 35 | --disable-libgomp \ 36 | --disable-libquadmath \ 37 | --disable-libssp \ 38 | --disable-libvtv \ 39 | --disable-libstdcxx \ 40 | --enable-languages=c,c++ 41 | 42 | make 43 | make DESTDIR=$LFS install 44 | 45 | ln -sv gcc $LFS/usr/bin/cc 46 | 47 | rm -rf /tmp/gcc 48 | -------------------------------------------------------------------------------- /scripts/version-check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Simple script to list version numbers of critical development tools 3 | export LC_ALL=C 4 | bash --version | head -n1 | cut -d" " -f2-4 5 | MYSH=$(readlink -f /bin/sh) 6 | echo "/bin/sh -> $MYSH" 7 | echo $MYSH | grep -q bash || echo "ERROR: /bin/sh does not point to bash" 8 | unset MYSH 9 | 10 | echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3- 11 | bison --version | head -n1 12 | 13 | if [ -h /usr/bin/yacc ]; then 14 | echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`"; 15 | elif [ -x /usr/bin/yacc ]; then 16 | echo yacc is `/usr/bin/yacc --version | head -n1` 17 | else 18 | echo "yacc not found" 19 | fi 20 | 21 | bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6- 22 | echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2 23 | diff --version | head -n1 24 | find --version | head -n1 25 | gawk --version | head -n1 26 | 27 | if [ -h /usr/bin/awk ]; then 28 | echo "/usr/bin/awk -> `readlink -f /usr/bin/awk`"; 29 | elif [ -x /usr/bin/awk ]; then 30 | echo awk is `/usr/bin/awk --version | head -n1` 31 | else 32 | echo "awk not found" 33 | fi 34 | 35 | gcc --version | head -n1 36 | g++ --version | head -n1 37 | ldd --version | head -n1 | cut -d" " -f2- # glibc version 38 | grep --version | head -n1 39 | gzip --version | head -n1 40 | cat /proc/version 41 | m4 --version | head -n1 42 | make --version | head -n1 43 | patch --version | head -n1 44 | echo Perl `perl -V:version` 45 | python3 --version 46 | sed --version | head -n1 47 | tar --version | head -n1 48 | makeinfo --version | head -n1 # texinfo version 49 | xz --version | head -n1 50 | 51 | echo 'int main(){}' > dummy.c && g++ -o dummy dummy.c 52 | if [ -x dummy ] 53 | then echo "g++ compilation OK"; 54 | else echo "g++ compilation failed"; fi 55 | rm -f dummy.c dummy 56 | -------------------------------------------------------------------------------- /scripts/5.3-gcc.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/gcc-11.2.0.tar.xz -C /tmp/ 2 | mv -v /tmp/gcc-11.2.0 /tmp/gcc 3 | tar -xf $LFS/sources/mpfr-4.1.0.tar.xz -C /tmp/gcc 4 | mv -v /tmp/gcc/mpfr-4.1.0 /tmp/gcc/mpfr 5 | tar -xf $LFS/sources/gmp-6.2.1.tar.xz -C /tmp/gcc 6 | mv -v /tmp/gcc/gmp-6.2.1 /tmp/gcc/gmp 7 | tar -xf $LFS/sources/mpc-1.2.1.tar.gz -C /tmp/gcc 8 | mv -v /tmp/gcc/mpc-1.2.1 /tmp/gcc/mpc 9 | cd /tmp/gcc 10 | 11 | case $(uname -m) in 12 | x86_64) 13 | sed -e '/m64=/s/lib64/lib/' \ 14 | -i.orig gcc/config/i386/t-linux64 15 | 16 | esac 17 | 18 | mkdir -v build 19 | cd build 20 | 21 | ../configure \ 22 | --target=$LFS_TGT \ 23 | --prefix=$LFS/tools \ 24 | --with-glibc-version=2.11 \ 25 | --with-sysroot=$LFS \ 26 | --with-newlib \ 27 | --without-headers \ 28 | --enable-initfini-array \ 29 | --disable-nls \ 30 | --disable-shared \ 31 | --disable-multilib \ 32 | --disable-decimal-float \ 33 | --disable-threads \ 34 | --disable-libatomic \ 35 | --disable-libgomp \ 36 | --disable-libquadmath \ 37 | --disable-libssp \ 38 | --disable-libvtv \ 39 | --disable-libstdcxx \ 40 | --disable-bootstrap \ 41 | --enable-languages=c,c++ 42 | 43 | make 44 | make install 45 | 46 | cd .. 47 | cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \ 48 | `dirname $($LFS/tools/bin/$LFS_TGT-gcc -print-libgcc-file-name)`/install-tools/include/limits.h 49 | 50 | rm -rf /tmp/gcc -------------------------------------------------------------------------------- /scripts/8.5-glibc.sh: -------------------------------------------------------------------------------- 1 | tar -xf $LFS/sources/glibc-2.34.tar.xz -C /tmp/ 2 | mv -v /tmp/glibc-2.34 /tmp/glibc 3 | cd /tmp/glibc 4 | 5 | sed -e '/NOTIFY_REMOVED)/s/)/ \&\& data.attr != NULL)/' \ 6 | -i sysdeps/unix/sysv/linux/mq_notify.c 7 | 8 | patch -Np1 -i scripts/glibc-2.34-fhs-1.patch 9 | 10 | mkdir -v build 11 | cd build 12 | 13 | echo "rootsbindir=/usr/sbin" > configparms 14 | 15 | ../configure --prefix=/usr \ 16 | --disable-werror \ 17 | --enable-kernel=3.2 \ 18 | --enable-stack-protector=strong \ 19 | --with-headers=/usr/include \ 20 | libc_cv_slibdir=/usr/lib 21 | 22 | make 23 | make check 24 | 25 | touch /etc/ld.so.conf 26 | sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile 27 | make install 28 | 29 | sed '/RTLDLIST=/s@/usr@@g' -i /usr/bin/ldd 30 | 31 | cp -v ../nscd/nscd.conf /etc/nscd.conf 32 | mkdir -pv /var/cache/nscd 33 | 34 | install -v -Dm644 ../nscd/nscd.tmpfiles /usr/lib/tmpfiles.d/nscd.conf 35 | install -v -Dm644 ../nscd/nscd.service /usr/lib/systemd/system/nscd.service 36 | 37 | mkdir -pv /usr/lib/locale 38 | localedef -i POSIX -f UTF-8 C.UTF-8 2> /dev/null || true 39 | localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8 40 | localedef -i de_DE -f ISO-8859-1 de_DE 41 | localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro 42 | localedef -i de_DE -f UTF-8 de_DE.UTF-8 43 | localedef -i el_GR -f ISO-8859-7 el_GR 44 | localedef -i en_GB -f ISO-8859-1 en_GB 45 | localedef -i en_GB -f UTF-8 en_GB.UTF-8 46 | localedef -i en_HK -f ISO-8859-1 en_HK 47 | localedef -i en_PH -f ISO-8859-1 en_PH 48 | localedef -i en_US -f ISO-8859-1 en_US 49 | localedef -i en_US -f UTF-8 en_US.UTF-8 50 | localedef -i es_ES -f ISO-8859-15 es_ES@euro 51 | localedef -i es_MX -f ISO-8859-1 es_MX 52 | localedef -i fa_IR -f UTF-8 fa_IR 53 | localedef -i fr_FR -f ISO-8859-1 fr_FR 54 | localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro 55 | localedef -i fr_FR -f UTF-8 fr_FR.UTF-8 56 | localedef -i is_IS -f ISO-8859-1 is_IS 57 | localedef -i is_IS -f UTF-8 is_IS.UTF-8 58 | localedef -i it_IT -f ISO-8859-1 it_IT 59 | localedef -i it_IT -f ISO-8859-15 it_IT@euro 60 | localedef -i it_IT -f UTF-8 it_IT.UTF-8 61 | localedef -i ja_JP -f EUC-JP ja_JP 62 | localedef -i ja_JP -f SHIFT_JIS ja_JP.SIJS 2> /dev/null || true 63 | localedef -i ja_JP -f UTF-8 ja_JP.UTF-8 64 | localedef -i nl_NL@euro -f ISO-8859-15 nl_NL@euro 65 | localedef -i ru_RU -f KOI8-R ru_RU.KOI8-R 66 | localedef -i ru_RU -f UTF-8 ru_RU.UTF-8 67 | localedef -i se_NO -f UTF-8 se_NO.UTF-8 68 | localedef -i ta_IN -f UTF-8 ta_IN.UTF-8 69 | localedef -i tr_TR -f UTF-8 tr_TR.UTF-8 70 | localedef -i zh_CN -f GB18030 zh_CN.GB18030 71 | localedef -i zh_HK -f BIG5-HKSCS zh_HK.BIG5-HKSCS 72 | localedef -i zh_TW -f UTF-8 zh_TW.UTF-8 73 | 74 | make localedata/install-locales 75 | 76 | localedef -i POSIX -f UTF-8 C.UTF-8 2> /dev/null || true 77 | localedef -i ja_JP -f SHIFT_JIS ja_JP.SIJS 2> /dev/null || true 78 | 79 | rm -rf /tmp/glibc --------------------------------------------------------------------------------