aboutsummaryrefslogtreecommitdiffstats
path: root/insidechroot.sh
blob: 3c365cbf4c11ffea98a1f804769b990600df5b60 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
set -e

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
	printf "%b" "${GRN}Configuring bootscript related files${RST}\n"
	source chapter9/bootscriptconf.sh
	printf "%b" "${GRN}Configuring locale settings${RST}\n"
	source chapter9/bashprofile.sh
	printf "%b" "${GRN}Configuring inputrc${RST}\n"
	source chapter9/inputrc.sh
	printf "%b" "${GRN}Configuring system shells${RST}\n"
	source chapter9/shells.sh

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

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

	printf "%b" "${GRN}Creating fstab configuration${RST}\n"
	source chapter10/fstab.sh
	source packageinstall.sh 10 linux
	retval=$?
	if [[ "${retval}" -ne 0 ]]; then
		exit 1
	fi

else
	printf "%b" "Do \"The End\" stuff here.\n"
fi