lfs-scripts/scripts/main.sh

1221 lines
20 KiB
Bash
Raw Normal View History

2023-01-05 06:17:49 +00:00
#!/bin/bash
2023-01-05 09:26:40 +00:00
# Set SU
2023-01-06 08:59:14 +00:00
# ======
command -v sudo > /dev/null
2023-01-05 09:26:40 +00:00
if [ $? -eq 1 ]
then
SU=doas
else
SU=sudo
fi
2023-01-06 08:59:14 +00:00
# Exit on error
# =============
2023-01-05 06:17:49 +00:00
exit_status=0
function check_exit_code() {
if [ $? -ne 0 ]
then
exit_status=1
else
exit_status=0
fi
}
function stop_script() {
echo "Script failed in $(pwd)/$1"
exit 1
}
2023-01-06 08:59:14 +00:00
# Chapter 2
# =========
2023-01-05 06:17:49 +00:00
echo "Chapter 2"
bash ./chapter2/main.sh
2023-01-05 06:17:49 +00:00
2023-01-06 08:59:14 +00:00
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
2023-01-22 14:30:07 +00:00
stop_script "Stopped in chapter 2"
2023-01-06 08:59:14 +00:00
fi
# Set LFS variable
# ================
export LFS=/mnt/lfs
echo "LFS is $LFS"
2023-01-06 04:55:59 +00:00
2023-01-06 08:59:14 +00:00
# Chapter 3
# =========
2023-01-06 04:55:59 +00:00
echo "Chapter 3"
bash ./chapter3/main.sh
2023-01-06 04:55:59 +00:00
2023-01-06 08:59:14 +00:00
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "Stopped in chapter 3"
2023-01-06 08:59:14 +00:00
fi
# Chapter 4
# =========
2023-01-06 04:55:59 +00:00
echo "Chapter 4"
bash ./chapter4/main.sh
2023-01-06 08:59:14 +00:00
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "Stopped in chapter 4"
2023-01-06 08:59:14 +00:00
fi
2023-01-06 09:13:50 +00:00
# Chapter 5
# =========
2023-01-09 05:17:03 +00:00
echo "Chapter 5"
bash ./chapter5/main.sh
2023-01-06 09:13:50 +00:00
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "Stopped in chapter 5"
2023-01-09 04:53:36 +00:00
fi
# Chapter 6
# =========
2023-01-09 05:17:03 +00:00
echo "Chapter 6"
bash ./chapter6/main.sh
2023-01-09 10:13:43 +00:00
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "Stopped in chapter 6"
2023-01-09 10:13:43 +00:00
fi
2023-01-09 10:18:17 +00:00
# Chapter 7.2
# ===========
echo "Chapter 7"
bash ./chapter7/main-prechroot.sh
2023-01-09 10:18:17 +00:00
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "Stopped in chapter 7"
fi
2023-01-10 04:45:45 +00:00
# Chapter 7.4
# ===========
echo "Entering the Chroot Environment"
#su -c "bash $PWD/chapter7/7.4-enter-chroot.sh"
2023-01-10 04:45:45 +00:00
# Exit on error
# check_exit_code
# if [ $exit_status -ne 0 ]
# then
# stop_script "chapter7/7.4-enter-chroot.sh"
# fi
# If I think it is what it is, then it should not be executed as a child script as it would exit chroot. However, I wouldn't know unless I run it. I will keep it commented for now.
chroot "$LFS" /usr/bin/env -i \
HOME=/root \
TERM="$TERM" \
PS1='(lfs chroot) \u:\w\$ ' \
PATH=/usr/bin:/usr/sbin \
/bin/bash --login
PWD=$(pwd)
# I don't think $PWD is important at this point since the chroot will drop us in $LFS, treated as /. We lost the location of this script. Here's hoping the user puts this repo in $LFS/sources. So much for avoiding hardcoded paths...all goes out the window.
export SCRIPT=/sources/lfs-scripts
2023-01-10 04:45:45 +00:00
2023-01-10 04:48:20 +00:00
# Chapter 7.5
# ===========
bash ./chapter7/main-postchroot.sh
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "Stopped in chapter 7, post chroot"
fi
# Exit chroot
exit
2023-01-10 05:25:53 +00:00
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "Stopped in chapter 7, post chroot"
2023-01-10 05:25:53 +00:00
fi
# Unmount virtual filesystems
umount $LFS/dev/pts
umount $LFS/{sys,proc,run,dev}
# Create backup
cd $LFS
tar -cJpf $HOME/lfs-temp-tools-11.2.tar.xz .
# Entering chroot
echo "Preparing virtual kernel filesystems"
su -c "bash $PWD/chapter7/7.3-prepare-virtual-fs.sh"
echo "Entering the 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
export SCRIPT=/sources/lfs-scripts
2023-01-10 09:15:50 +00:00
# Chapter 8.3
# ===========
echo "Chapter 8"
echo "Building man-pages"
su -c "bash $SCRIPT/chapter8/8.3-man-pages.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.3-man-pages.sh"
fi
2023-01-10 09:18:22 +00:00
# Chapter 8.4
# ===========
echo "Building iana-etc"
su -c "bash $SCRIPT/chapter8/8.4-iana-etc.sh"
2023-01-10 09:27:58 +00:00
# Chapter 8.5
# ===========
echo "Building glibc"
su -c "bash $SCRIPT/chapter8/8.5-glibc.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.5-glibc.sh"
fi
2023-01-10 09:31:02 +00:00
# Chapter 8.6
# ===========
echo "Building zlib"
su -c "bash $SCRIPT/chapter8/8.6-zlib.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.6-zlib.sh"
fi
2023-01-10 09:18:22 +00:00
2023-01-10 09:34:58 +00:00
# Chapter 8.7
# ===========
echo "Building bzip2"
su -c "bash $SCRIPT/chapter8/8.7-bzip.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.7-bzip.sh"
fi
2023-01-10 09:38:11 +00:00
# Chapter 8.8
# ===========
echo "Building xz"
su -c "bash $SCRIPT/chapter8/8.8-xz.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.8-xz.sh"
fi
2023-01-10 09:42:09 +00:00
# Chapter 8.9
# ===========
echo "Building zstd"
su -c "bash $SCRIPT/chapter8/8.9-zstd.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.9-zstd.sh"
fi
2023-01-10 09:38:11 +00:00
2023-01-10 09:48:48 +00:00
# Chapter 8.10
# ============
echo "Building file"
su -c "bash $SCRIPT/chapter8/8.10-file.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.10-file.sh"
fi
2023-01-10 09:54:05 +00:00
# Chapter 8.11
# ============
echo "Building readline"
su -c "bash $SCRIPT/chapter8/8.11-readline.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.11-readline.sh"
fi
2023-01-10 09:48:48 +00:00
2023-01-10 09:56:58 +00:00
# Chapter 8.12
# ============
echo "Building m4"
su -c "bash $SCRIPT/chapter8/8.12-m4.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.12-m4.sh"
fi
2023-01-10 10:00:40 +00:00
# Chapter 8.13
# ============
echo "Building bc"
su -c "bash $SCRIPT/chapter8/8.13-bc.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.13-bc.sh"
fi
2023-01-10 10:04:10 +00:00
# Chapter 8.14
# ============
echo "Building flex"
su -c "bash $SCRIPT/chapter8/8.14-flex.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.14-flex.sh"
fi
2023-01-10 10:08:55 +00:00
# Chapter 8.15
# ============
echo "Building tcl"
su -c "bash $SCRIPT/chapter8/8.15-tcl.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.15-tcl.sh"
fi
2023-01-10 10:13:29 +00:00
# Chapter 8.16
# ============
echo "Building expect"
su -c "bash $SCRIPT/chapter8/8.16-expect.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
exit 1
fi
2023-01-10 10:16:58 +00:00
# Chapter 8.17
# ============
echo "Building dejagnu"
su -c "bash $SCRIPT/chapter8/8.17-dejagnu.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.17-dejagnu.sh"
fi
2023-01-11 05:50:15 +00:00
# Chapter 8.18
# ============
echo "Building binutils"
su -c "bash $SCRIPT/chapter8/8.18-binutils.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.18-binutils.sh"
fi
2023-01-11 05:53:44 +00:00
# Chapter 8.19
# ============
echo "Building GMP"
su -c "bash $SCRIPT/chapter8/8.19-gmp.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.19-gmp.sh"
fi
2023-01-11 05:50:15 +00:00
2023-01-11 06:02:57 +00:00
# Chapter 8.20
# ============
echo "Building MPFR"
su -c "bash $SCRIPT/chapter8/8.20-mpfr.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.20-mpfr.sh"
fi
2023-01-11 06:07:12 +00:00
# Chapter 8.21
# ============
echo "Building MPC"
su -c "bash $SCRIPT/chapter8/8.21-mpc.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.21-mpc.sh"
fi
2023-01-11 06:11:03 +00:00
# Chapter 8.22
# ============
echo "Building attr"
su -c "bash $SCRIPT/chapter8/8.22-attr.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.22-attr.sh"
fi
2023-01-11 06:15:33 +00:00
# Chapter 8.23
# ============
echo "Building acl"
su -c "bash $SCRIPT/chapter8/8.23-acl.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.23-acl.sh"
fi
2023-01-11 06:19:43 +00:00
# Chapter 8.24
# ============
echo "Building libcap"
su -c "bash $SCRIPT/chapter8/8.24-libcap.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.24-libcap.sh"
fi
2023-01-11 06:24:40 +00:00
# Chapter 8.25
# ============
echo "Building shadow"
su -c "bash $SCRIPT/chapter8/8.25-shadow.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.25-shadow.sh"
fi
2023-01-11 09:08:35 +00:00
# Chapter 8.26
# ============
echo "Building gcc"
su -c "bash $SCRIPT/chapter8/8.26-gcc.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.26-gcc.sh"
fi
2023-01-11 09:14:14 +00:00
# Chapter 8.27
# ============
echo "Building pkg-config.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.27-pkg-config.sh"
fi
2023-01-11 09:51:48 +00:00
# Chapter 8.28
# ============
echo "Building ncurses"
su -c "bash $SCRIPT/chapter8/8/28-ncurses.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.28-ncurses.sh"
fi
2023-01-11 09:58:21 +00:00
# Chapter 8.29
# ============
echo "Building sed"
su -c "bash $SCRIPT/chapter8/8.29-sed.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.29-sed.sh"
fi
2023-01-11 10:03:28 +00:00
# Chapter 8.30
# ============
echo "Building psmisc"
su -c "bash $SCRIPT/chapter8/8.30-psmisc.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.30-psmisc.sh"
fi
2023-01-11 10:10:05 +00:00
# Chapter 8.31
# ============
echo "Building gettext"
su -c "bash $SCRIPT/chapter8/8.31-gettext.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.31-gettext.sh"
fi
2023-01-11 10:13:49 +00:00
# Chapter 8.32
# ============
echo "Building bison"
su -c "bash $SCRIPT/chapter8/8.32-bison.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.32-bison.sh"
fi
2023-01-11 10:17:22 +00:00
# Chapter 8.33
# ============
echo "Building grep"
su -c "bash $SCRIPT/chapter8/8.33-grep.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.33-grep.sh"
fi
2023-01-11 10:22:14 +00:00
# Chapter 8.34
# ============
echo "Building bash"
su -c "bash $SCRIPT/chapter8/8.34-bash.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.34-bash.sh"
fi
2023-01-12 05:34:34 +00:00
# Chapter 8.35
# ============
echo "Building libtool"
su -c "bash $SCRIPT/chapter8/8.35-libtool.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.35-libtool.sh"
fi
2023-01-12 05:37:34 +00:00
# Chapter 8.36
# ============
echo "Building GDBM"
su -c "bash $SCRIPT/chapter8/8.36-gdbm.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.36-gdbm.sh"
fi
2023-01-12 05:42:12 +00:00
# Chapter 8.37
# ============
echo "Building gperf"
su -c "bash $SCRIPT/chapter8/8.37-gperf.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.37-gperf.sh"
fi
2023-01-12 05:47:27 +00:00
# Chapter 8.38
# ============
echo "Building expat"
su -c "bash $SCRIPT/chapter8/8.38-expat.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.38-expat.sh"
fi
2023-01-12 05:55:28 +00:00
# A thousand lines already
# But I know it won't work
# for I know the flaws in my ways
# Why am I still doing it?
# Chapter 8.39
# ============
echo "Building inetutils"
su -c "bash $SCRIPT/chapter8/8.39-inetutils.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.39-inetutils.sh"
fi
2023-01-12 06:07:15 +00:00
# Chapter 8.40
# ============
echo "Building less"
su -c "bash $SCRIPT/chapter8/8.40-less.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.40-less.sh"
fi
2023-01-12 06:10:51 +00:00
# Chapter 8.41
# ============
echo "Building perl"
su -c "bash $SCRIPT/chapter8/8.41-perl.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.41-perl.sh"
fi
2023-01-12 06:16:55 +00:00
# Chapter 8.42
# ============
echo "Building XML::Parser"
su -c "bash $SCRIPT/chapter8/8.42-xml-parser.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.42-xml-parser.sh"
fi
2023-01-12 06:20:29 +00:00
# Chapter 8.43
# ============
echo "Building intltool"
su -c "bash $SCRIPT/chapter8/8.43-intltool.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.43-intltool.sh"
fi
2023-01-12 06:24:18 +00:00
# Chapter 8.44
# ============
echo "Building autoconf"
su -c "bash $SCRIPT/8.44-autoconf.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.44-autoconf.sh"
fi
2023-01-12 08:42:53 +00:00
# Chapter 8.45
# ============
echo "Building automake"
su -c "bash $SCRIPT/chapter8/8.45-automake.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.45-automake.sh"
fi
2023-01-12 08:46:25 +00:00
# Chapter 8.46
# ============
echo "Building openssl"
su -c "bash $SCRIPT/chapter8/8.45-openssl.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
exit 1
fi
2023-01-12 08:49:36 +00:00
# Chapter 8.47
# ============
echo "Building kmod"
su -c "bash $SCRIPT/chapter8/8.47-kmod.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.47-kmod.sh"
fi
2023-01-12 08:52:47 +00:00
# Chapter 8.48
# ============
echo "Building libelf"
su -c "bash $SCRIPT/chapter8/8.48-libelf.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.48-libelf.sh"
fi
2023-01-12 08:55:30 +00:00
# Chapter 8.49
# ============
echo "Building libffi"
su -c "bash $SCRIPT/chapter8/8.49-libffi.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.49-libffi.sh"
fi
2023-01-12 09:00:17 +00:00
# Chapter 8.50
echo "Building Python"
su -c "bash $SCRIPT/chapter8/8.50-python.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.50-python.sh"
fi
2023-01-12 09:04:00 +00:00
# Chapter 8.51
# ============
echo "Building wheel"
su -c "bash $SCRIPT/chapter8/8.51-wheel.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.51-wheel.sh"
fi
2023-01-12 09:07:49 +00:00
# Chapter 8.52
# ============
echo "Building ninja"
su -c "bash $SCRIPT/chapter8/8.52-ninja.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.52-ninja.sh"
fi
2023-01-12 09:16:02 +00:00
# Chapter 8.53
# ============
echo "Building meson"
su -c "bash $SCRIPT/chapter8/8.53-meson.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.53-meson.sh"
fi
2023-01-12 09:22:05 +00:00
# Chapter 8.54
# ============
echo "Building coreutils"
su -c "bash $SCRIPT/chapter8/8.54-coreutils.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "bash $SCRIPT/chapter8/8.54-coreutils.sh"
fi
2023-01-12 09:51:59 +00:00
# Chapter 8.55
# ============
echo "Building check"
2023-01-14 15:55:30 +00:00
su -c "bash $SCRIPT/chapter8/8.55-check.sh"
2023-01-12 09:51:59 +00:00
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.55-check.sh"
fi
# Chapter 8.56
# ============
echo "Building diffutils"
su -c "bash $SCRIPT/chapter8/8.56-diffutils.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.56-diffutils.sh"
fi
2023-01-12 09:59:59 +00:00
# Chapter 8.57
# ============
echo "Building gawk"
su -c "bash $SCRIPT/chapter8/8.57-gawk.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.57-gawk.sh"
fi
2023-01-12 10:03:01 +00:00
# Chapter 8.58
# ============
echo "Building findutils"
su -c "bash $SCRIPT/chapter8/8.58-findutils.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.58-findutils.sh"
fi
2023-01-12 10:12:31 +00:00
# Chapter 8.59
# ============
echo "Building groff"
su -c "bash $SCRIPT/chapter8/8.59-groff.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.59-groff.sh"
fi
2023-01-12 10:16:04 +00:00
# Chapter 8.60
# ============
echo "Building grub"
su -c "bash $SCRIPT/chapter8/8.60-bash.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.60-bash.sh"
fi
2023-01-12 13:35:19 +00:00
# Chapter 8.61
# ============
echo "Building gzip"
2023-01-12 13:46:36 +00:00
su -c "bash $SCRIPT/chapter8/8.61-gzip.sh"
2023-01-12 13:35:19 +00:00
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
2023-01-12 13:46:36 +00:00
stop_script "chapter8/8.61-gzip.sh"
2023-01-12 13:35:19 +00:00
fi
2023-01-12 13:42:28 +00:00
# Chapter 8.62
# ============
echo "Building iproute2"
2023-01-12 13:46:36 +00:00
su -c "bash $SCRIPT/chapter8/8.62-iproute2.sh"
2023-01-12 13:42:28 +00:00
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
2023-01-12 13:46:36 +00:00
stop_script "chapter8/8.62-iproute2.sh"
fi
# Chapter 8.63
# ============
echo "Building kbd"
su -c "bash $SCRIPT/chapter8/8.63-kbd.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.63-kbd"
2023-01-12 13:42:28 +00:00
fi
2023-01-12 13:50:07 +00:00
# Chapter 8.64
# ============
echo "Building libpipeline"
su -c "bash $SCRIPT/chapter8/8.64-libpipeline.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.64-libpipeline.sh"
fi
2023-01-12 13:54:37 +00:00
# Chapter 8.65
# ============
echo "Building make"
su -c "bash $SCRIPT/chapter8/8.65-make.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.65-make.sh"
fi
2023-01-12 13:57:30 +00:00
# Chapter 8.66
# ============
echo "Building patch"
su -c "bash $SCRIPT/chapter8/8.66-patch.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.66-patch.sh"
fi
2023-01-12 14:02:24 +00:00
# Chapter 8.67
# ============
echo "Building tar"
su -c "bash $SCRIPT/chapter8/8.67-tar.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
exit 1
fi
2023-01-12 14:05:55 +00:00
# Chapter 8.68
# ============
echo "Building texinfo"
su -c "bash $SCRIPT/chapter8/8.68-texinfo.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.68-texinfo.sh"
fi
2023-01-12 14:09:51 +00:00
# Chapter 8.69
# ============
echo "Building vim"
su -c "bash $SCRIPT/chapter8/8.69-vim.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
exit 1
fi
2023-01-12 14:14:27 +00:00
# Chapter 8.70
# ============
echo "Building eudev"
su -c "bash $SCRIPT/chapter8/8.70-eudev.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.70-eudev.sh"
fi
2023-01-12 14:18:49 +00:00
# Chapter 8.71
# ============
echo "Building man-db"
su -c "bash $SCRIPT/chapter8/8.71-man-db.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.71-man-db.sh"
fi
2023-01-12 14:22:13 +00:00
# Chapter 8.72
# ============
echo "Building procps-ng"
su -c "bash $SCRIPT/chapter8/8.72-procps-ng.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.72-procps-ng.sh"
fi
2023-01-12 14:26:44 +00:00
# Chapter 8.73
# ============
echo "Building util-linux"
su -c "bash $SCRIPT/chapter8/8.73-util-linux.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.73-util-linux.sh"
fi
2023-01-12 14:30:40 +00:00
# Chapter 8.74
# ============
echo "Building e2fsprogs"
su -c "bash $SCRIPT/chapter8/8.74-e2fsprogs.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.74-e2fsprogs.sh"
fi
2023-01-14 15:55:03 +00:00
# chapter8.75
# ===========
echo "Building sysklogd"
su -c "bash $SCRIPT/chapter8/8.75-sysklogd.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.75-sysklogd.sh"
fi
# Chapter 8.76
# ============
echo "Building sysvinit"
su -c "bash $SCRIPT/chapter8/8.76-sysvinit.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.76-sysvinit.sh"
fi
2023-01-12 14:30:40 +00:00
2023-01-14 15:59:19 +00:00
# Chapter 8.78
# ============
echo "Stripping debug symbols"
su -c "bash $SCRIPT/chapter8/8.78-stripping.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.78-stripping.sh"
fi
2023-01-14 16:01:44 +00:00
# Chapter 8.79
# ============
echo "Cleaning up extra files"
su -c "bash $SCRIPT/chapter8/8.79-cleanup.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter8/8.79-cleanup.sh"
fi
2023-01-14 16:05:44 +00:00
# Chapter 9.2
# ===========
echo "Chapter 9"
echo "Installing LFS bootscripts"
su -c "SCRIPT/chapter9/9.2-lfs-bootscripts.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter9/9.2-lfs-bootscripts.sh"
fi
2023-01-14 16:17:51 +00:00
# Chapter 9.6
# ===========
echo "Configuring sysvinit"
su -c "bash $SCRIPT/chapter9/9.6-configure-sysvinit.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter9/9.6-configure-sysvinit.sh"
fi
2023-01-14 16:21:13 +00:00
# Chapter 9.7
# ===========
echo "Configurintg shell startup files"
su -c "bash $SCRIPT/chapter9/9.7-shell-startup.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter9/9.7-shell-startup.sh"
fi
2023-01-14 16:23:46 +00:00
# Chapter 9.8
# ===========
echo "Creating /etc/inputrc"
su -c "bash $SCRIPT/chapter9/9.8-inputrc.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter9/9.8-inputrc.sh"
fi
2023-01-14 16:26:44 +00:00
# Chapter 9.9
# ===========
echo "Creating /etc/shells"
su -c "bash $SCRIPT/chapter9/9.9-shells.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter9/9.9-shells.sh"
fi
2023-01-14 16:30:50 +00:00
# Chapter 10.2
# ============
echo "Chapter 10"
echo "Creating /etc/fstab"
su -c "bash $SCRIPT/chapter10/10.2-fstab.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter10/10.2-fstab.sh"
fi
2023-01-14 16:37:25 +00:00
# Chapter 10.3
# ============
echo "Building kernel"
su -c "bash $SCRIPT/chapter10/10.3-kernel.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter10/10.3-kernel.sh"
fi
2023-01-14 16:44:19 +00:00
# Chapter 10.4
# ============
echo "Installng grub"
su -c "bash $SCRIPT/chapter10/10.4-grub.sh"
# Exit on error
check_exit_code
if [ $exit_status -ne 0 ]
then
stop_script "chapter10/10.4-grub.sh"
fi
2023-01-14 16:47:22 +00:00
# Chapter 11.1
# ============
echo "Chapter 11"
echo "Finishing up"
echo 11.2 > /etc/lfs-release
cat > /etc/lsb-release << "EOF"
DISTRIB_ID="Linux From Scratch"
DISTRIB_RELEASE="11.2"
DISTRIB_CODENAME="summer2023"
DISTRIB_DESCRIPTION="Linux From Scratch"
EOF
cat > /etc/os-release << "EOF"
NAME="Linux From Scratch"
VERSION="11.2"
ID=lfs
PRETTY_NAME="Linux From Scratch 11.2"
VERSION_CODENAME="summer2023"
EOF
2023-01-14 16:49:52 +00:00
# Exit chroot
logout
# Unmount filesystems
2023-01-14 17:05:54 +00:00
su -c "umount -v $LFS/dev/pts"
su -c "umount -v $LFS/dev"
su -c "umount -v $LFS/run"
su -c "umount -v $LFS/proc"
su -c "umount -v $LFS/sys"
su -c "umount -v $LFS"
2023-01-14 16:49:52 +00:00