I don’t have any funny things to show here so just go to the scripts
root
Check mounted or not
findmnt | grep $LFS
Output if LFS IS MOUNTED:
├─/mnt/lfs /dev/sdb2 ext4 rw,relatime
│ ├─/mnt/lfs/dev udev devtmpfs rw,nosuid,relatime,size=1981744k,nr_inodes=495436,mode=755,inode64
│ │ ├─/mnt/lfs/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
│ │ └─/mnt/lfs/dev/shm tmpfs tmpfs rw,nosuid,nodev,relatime,inode64
│ ├─/mnt/lfs/proc proc proc rw,relatime
│ ├─/mnt/lfs/sys sysfs sysfs rw,relatime
│ └─/mnt/lfs/run tmpfs tmpfs rw,relatime,inode64
Output if LFS IS NOT MOUNTED:
├─/mnt/lfs /dev/sdb2 ext4 rw,relatime
Mount virtual filesystem if not mounted
mkdir -pv $LFS/{dev,proc,sys,run}
mount -v --bind /dev $LFS/dev
mount -v --bind /dev/pts $LFS/dev/pts
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
mount -vt tmpfs tmpfs $LFS/run
if [ -h $LFS/dev/shm ]; then
mkdir -pv $LFS/$(readlink $LFS/dev/shm)
else
mount -t tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm
fi
Enter chroot environment
chroot "$LFS" /usr/bin/env -i \
HOME=/root \
TERM="$TERM" \
PS1='(lfs chroot) \u:\w\$ ' \
PATH=/usr/bin:/usr/sbin \
/bin/bash --login
When you want to exit just do this
exit
Make sure you are in
(lfs chroot) root:/# |
Create version-check.sh
(See Section 7.12T on creating version-check.sh
)
Run version-check.sh
to see version requirements(Make sure all is OK)
bash version-check.sh
Check your “NPROC”, and “MAKEFLAGS” environment variables
echo "NPROC=$(nproc) MAKEFLAGS=$MAKEFLAGS"
Set MAKEFLAGS
variable
export MAKEFLAGS='-j4'
See Section 7.13.2 on backing up the LFS system.
Approximate time required: 6.46 SBU
cd /sources/
time {
tar xf openssl*.tar.*
cd openssl*/
./config --prefix=/usr \
--openssldir=/etc/ssl \
--libdir=lib \
shared \
zlib-dynamic
make
make test
}
Expected summary of make test
All tests successful.
Files=252, Tests=3364, 286 wallclock secs ( 4.93 usr 0.28 sys + 234.44 cusr 43.60 csys = 283.25 CPU)
Result: PASS
time {
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.1.2
cp -vfr doc/* /usr/share/doc/openssl-3.1.2
}
cd /sources/
rm -rf openssl*/
Approximate time required: 0.13 SBU
cd /sources/
time {
tar xf kmod*.tar.*
cd kmod*/
./configure --prefix=/usr \
--sysconfdir=/etc \
--with-openssl \
--with-xz \
--with-zstd \
--with-zlib
make
make install
for target in depmod insmod modinfo modprobe rmmod; do
ln -sfv ../bin/kmod /usr/sbin/$target
done
ln -sfv kmod /usr/bin/lsmod
}
cd /sources/
rm -rf kmod*/
Approximate time required: 0.81 SBU
cd /sources/
time {
tar xf elfutils*.tar.*
cd elfutils*/
./configure --prefix=/usr \
--disable-debuginfod \
--enable-libdebuginfod=dummy
make
make check
}
Expected summary of make check
============================================================================
Testsuite summary for elfutils 0.189
============================================================================
# TOTAL: 238
# PASS: 233
# SKIP: 5
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
time {
make -C libelf install
install -vm644 config/libelf.pc /usr/lib/pkgconfig
rm /usr/lib/libelf.a
}
cd /sources/
rm -rf elfutils*/
Approximate time required: 3.22 SBU
cd /sources/
time {
tar xf libffi*.tar.*
cd libffi*/
./configure --prefix=/usr \
--disable-static \
--with-gcc-arch=native
make
make check
}
Expected summary of make check
=== libffi Summary ===
# of expected passes 2366
time {
make install
}
cd /sources/
rm -rf libffi*/
Approximate time required: 3.71 SBU
cd /sources/
time {
tar xf Python*.tar.*
cd Python*/
./configure --prefix=/usr \
--enable-shared \
--with-system-expat \
--with-system-ffi \
--enable-optimizations
make
make install
cat > /etc/pip.conf << EOF
[global]
root-user-action = ignore
disable-pip-version-check = true
EOF
install -v -dm755 /usr/share/doc/python-3.11.4/html
tar --strip-components=1 \
--no-same-owner \
--no-same-permissions \
-C /usr/share/doc/python-3.11.4/html \
-xvf ../python-3.11.4-docs-html.tar.bz2
}
cd /sources/
rm -rf Python*/
Approximate time required: 0.01 SBU
cd /sources/
time {
tar xf flit_core*.tar.*
cd flit_core*/
pip3 wheel -w dist --no-build-isolation --no-deps $PWD
pip3 install --no-index --no-user --find-links dist flit_core
}
cd /sources/
rm -rf flit_core*/
Approximate time required: 0.01 SBU
cd /sources/
time {
tar xf wheel*.tar.*
cd wheel*/
pip3 wheel -w dist --no-build-isolation --no-deps $PWD
pip3 install --no-index --find-links=dist wheel
}
cd /sources/
rm -rf wheel*/
Approximate time required: 0.65 SBU
cd /sources/
time {
tar xf ninja*.tar.*
cd ninja*/
export NINJAJOBS=4
python3 configure.py --bootstrap
./ninja ninja_test
./ninja_test --gtest_filter=-SubprocessTest.SetWithLots
}
Expected summary of ninja_test
passed
time {
install -vm755 ninja /usr/bin/
install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja
install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja
}
cd /sources/
rm -rf ninja*/
Approximate time required: 0.03 SBU
cd /sources/
time {
tar xf meson*.tar.*
cd meson*/
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
}
cd /sources/
rm -rf meson*/
Approximate time required: 3.15 SBU
cd /sources/
time {
tar xf coreutils*.tar.*
cd coreutils*/
patch -Np1 -i ../coreutils-9.3-i18n-1.patch
autoreconf -fiv
FORCE_UNSAFE_CONFIGURE=1 ./configure \
--prefix=/usr \
--enable-no-install-program=kill,uptime
make
make NON_ROOT_USERNAME=tester check-root
groupadd -g 102 dummy -U tester
chown -Rv tester .
su tester -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check"
groupdel dummy
}
Expected summary of make check
============================================================================
Testsuite summary for GNU coreutils 9.3
============================================================================
# TOTAL: 397
# PASS: 373
# SKIP: 24
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
time {
make install
mv -v /usr/bin/chroot /usr/sbin
mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8
sed -i 's/"1"/"8"/' /usr/share/man/man8/chroot.8
}
cd /sources/
rm -rf coreutils*/
Approximate time required: 2.76 SBU
cd /sources/
time {
tar xf check*.tar.*
cd check*/
./configure --prefix=/usr --disable-static
make
make check
}
Expected summary of make check
============================================================================
Testsuite summary for Check 0.15.2
============================================================================
# TOTAL: 9
# PASS: 9
# SKIP: 0
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
time {
make docdir=/usr/share/doc/check-0.15.2 install
}
cd /sources/
rm -rf check*/
Approximate time required: 0.76 SBU
cd /sources/
time {
tar xf diffutils*.tar.*
cd diffutils*/
./configure --prefix=/usr
make
make check
}
Expected summary of make check
============================================================================
Testsuite summary for GNU diffutils 3.10
============================================================================
# TOTAL: 215
# PASS: 199
# SKIP: 16
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
time {
make install
}
cd /sources/
rm -rf diffutils*/
Approximate time required: 0.46 SBU
cd /sources/
time {
tar xf gawk*.tar.*
cd gawk*/
sed -i 's/extras//' Makefile.in
./configure --prefix=/usr
make
chown -Rv tester .
su tester -c "PATH=$PATH make check"
}
Expected summary of make check
make[3]: Entering directory '/sources/gawk-5.2.2/test'
ALL TESTS PASSED
make[3]: Leaving directory '/sources/gawk-5.2.2/test'
time {
make LN='ln -f' install
ln -sv gawk.1 /usr/share/man/man1/awk.1
mkdir -pv /usr/share/doc/gawk-5.2.2
cp -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-5.2.2
}
cd /sources/
rm -rf gawk*/
Approximate time required: 1.45 SBU
cd /sources/
time {
tar xf findutils*.tar.*
cd findutils*/
./configure --prefix=/usr --localstatedir=/var/lib/locate
make
chown -Rv tester .
su tester -c "PATH=$PATH make check"
}
Expected summary of make check
============================================================================
Testsuite summary for GNU findutils 4.9.0
============================================================================
# TOTAL: 262
# PASS: 246
# SKIP: 16
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
...
============================================================================
Testsuite summary for GNU findutils 4.9.0
============================================================================
# TOTAL: 17
# PASS: 15
# SKIP: 2
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
time {
make install
}
cd /sources/
rm -rf findutils*/
Approximate time required: 0.55 SBU
cd /sources/
time {
tar xf groff*.tar.*
cd groff*/
PAGE=A4 ./configure --prefix=/usr
make
make check
}
Expected summary of make check
============================================================================
Testsuite summary for GNU roff 1.23.0
============================================================================
# TOTAL: 164
# PASS: 151
# SKIP: 11
# XFAIL: 2
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
time {
make install
}
cd /sources/
rm -rf groff*/
Approximate time required: 0.96 SBU
cd /sources/
time {
tar xf grub*.tar.*
cd grub*/
unset {C,CPP,CXX,LD}FLAGS
patch -Np1 -i ../grub-2.06-upstream_fixes-1.patch
./configure --prefix=/usr \
--sysconfdir=/etc \
--disable-efiemu \
--disable-werror
make
make install
mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions
}
cd /sources/
rm -rf grub*/
Approximate time required: 0.61 SBU
cd /sources/
time {
tar xf gzip*.tar.*
cd gzip*/
./configure --prefix=/usr
make
make check
}
Expected summary of make check
============================================================================
Testsuite summary for gzip 1.12
============================================================================
# TOTAL: 26
# PASS: 26
# SKIP: 0
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
time {
make install
}
cd /sources/
rm -rf gzip*/
Next section: 8.64 - 8.80