summaryrefslogtreecommitdiff
path: root/scripts/01-bootstrap.sh
blob: 934737c751f42245381194e17dd286c5de57b380 (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
# scripts/01-bootstrap.sh

Bootstrap ()
{
	if [ -z "${LIVE_ROOTFS}" ]
	then
		# Create chroot directory
		mkdir -p "${LIVE_CHROOT}"

		if [ -z "${LIVE_VERBOSE}" ]
		then
			if [ -x /usr/bin/cdebootstrap ]
			then
				# Bootstrap with cdebootstrap
				cdebootstrap --arch="${LIVE_ARCHITECTURE}" \
					--flavour="${LIVE_FLAVOUR}" \
					"${LIVE_DISTRIBUTION}" \
					"${LIVE_CHROOT}" "${LIVE_MIRROR}"
			elif [ -x /usr/sbin/debootstrap ]
			then
				# Bootstrap with debootstrap
				debootstrap --arch="${LIVE_ARCHITECTURE}" \
					"${LIVE_DISTRIBUTION}" \
					"${LIVE_CHROOT}" "${LIVE_MIRROR}"
			fi
		else
			if [ -x /usr/bin/cdebootstrap ]
			then
				# Bootstrap with cdebootstrap (debug)
				cdebootstrap --arch="${LIVE_ARCHITECTURE}" \
					--debug --flavour="${LIVE_FLAVOUR}" \
					"${LIVE_DISTRIBUTION}" \
					"${LIVE_CHROOT}" "${LIVE_MIRROR}"
			elif [ -x /usr/sbin/debootstrap ]
			then
				# Bootstrap with debootstrap (debug)
				debootstrap --arch="${LIVE_ARCHITECTURE}" \
					--verbose "${LIVE_DISTRIBUTION}" \
					"${LIVE_CHROOT}" "${LIVE_MIRROR}"
			fi
		fi
	fi
}