aboutsummaryrefslogtreecommitdiffstats
path: root/insidechroot.sh
blob: 197658ccc858b2ec7aac671729c00c750b0c233e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash

CHAPTER="$1"

# shellcheck source=colors.sh
source /sources/colors.sh
# shellcheck source=functions.sh
source /sources/functions.sh

printf "%b" "${CYN}SUCCESSFULLY ENTERED ${RED}CHROOT${RST}!\n"

pushd /sources >/dev/null || exit 1

if [[ "${CHAPTER}" -eq 7 ]]; then

	# Chapter 7
    printf "%b" "\n${IWHT}============ ${IGRN}Building ${IYLW}Chapter 7${IWHT} \
============${RST}\n"

	for package in libstdc++ gettext bison perl python texinfo util-linux; do
		source packageinstall.sh 7 $package
		retval=$?
		if [[ "${retval}" -ne 0 ]]; then
			exit 1
		fi
	done

elif [[ "${CHAPTER}" -eq 8 ]]; then

	# Chapter 8
    printf "%b" "\n${IWHT}============ ${IGRN}Building ${IYLW}Chapter 8${IWHT} \
============${RST}\n"

	for package in man-pages iana-etc glibc zlib bzip2 xz zstd file readline m4 bc flex tcl expect dejagnu binutils gmp mpfr mpc isl attr acl libcap shadow gcc pkg-config ncurses sed psmisc gettext bison grep bash libtool gdbm gperf expat inetutils perl xml-parser intltool autoconf automake kmod libelf libffi openssl python ninja meson coreutils check diffutils gawk findutils groff grub less gzip iproute2 kbd libpipeline make patch man-db tar texinfo vim eudev procps-ng util-linux e2fsprogs sysklogd sysvinit; do
		source packageinstall.sh 8 $package
		retval=$?
		if [[ "${retval}" -ne 0 ]]; then
			exit 1
		fi
	done

elif [[ "${CHAPTER}" -eq 9 ]]; then

	# Chapter 9
    printf "%b" "\n${IWHT}============ ${IGRN}Building ${IYLW}Chapter 9${IWHT} \
============${RST}\n"

	source packageinstall.sh 9 lfs-bootscripts
	retval=$?
	if [[ "${retval}" -ne 0 ]]; then
		exit 1
	fi

	printf "%b" "${GRN}Configuring network related files${RST}\n"
	source chapter9/network.sh

else
	printf "%b" "Do Chapter 10 stuff here.\n"
fi