10-bootstrap.sh
47 lines
| 1.3 KiB
| application/x-sh
|
BashLexer
/ bootstrap.d / 10-bootstrap.sh
Filip Pytloun
|
r56 | # | ||
# Debootstrap basic system | ||||
# | ||||
Jan Wagner
|
r67 | # Load utility functions | ||
Filip Pytloun
|
r56 | . ./functions.sh | ||
drtyhlpr
|
r91 | VARIANT="" | ||
COMPONENTS="main" | ||||
drtyhlpr
|
r92 | EXCLUDES="" | ||
drtyhlpr
|
r91 | |||
# Use non-free Debian packages if needed | ||||
if [ "$ENABLE_NONFREE" = true ] ; then | ||||
COMPONENTS="main,non-free" | ||||
fi | ||||
# Use minbase bootstrap variant which only includes essential packages | ||||
Filip Pytloun
|
r56 | if [ "$ENABLE_MINBASE" = true ] ; then | ||
drtyhlpr
|
r91 | VARIANT="--variant=minbase" | ||
Filip Pytloun
|
r56 | fi | ||
drtyhlpr
|
r92 | # Exclude packages if required by Debian release | ||
if [ "$RELEASE" = "stretch" ] ; then | ||||
EXCLUDES="--exclude=init,systemd-sysv" | ||||
fi | ||||
drtyhlpr
|
r91 | # Base debootstrap (unpack only) | ||
drtyhlpr
|
r92 | http_proxy=${APT_PROXY} debootstrap ${EXCLUDES} --arch="${RELEASE_ARCH}" --foreign ${VARIANT} --components="${COMPONENTS}" --include="${APT_INCLUDES}" "${RELEASE}" "${R}" "http://${APT_SERVER}/debian" | ||
drtyhlpr
|
r91 | |||
Filip Pytloun
|
r56 | # Copy qemu emulator binary to chroot | ||
Jan Wagner
|
r77 | install_exec "${QEMU_BINARY}" "${R}${QEMU_BINARY}" | ||
Filip Pytloun
|
r56 | |||
# Copy debian-archive-keyring.pgp | ||||
Jan Wagner
|
r82 | mkdir -p "${R}/usr/share/keyrings" | ||
install_readonly /usr/share/keyrings/debian-archive-keyring.gpg "${R}/usr/share/keyrings/debian-archive-keyring.gpg" | ||||
Filip Pytloun
|
r56 | |||
# Complete the bootstrapping process | ||||
chroot_exec /debootstrap/debootstrap --second-stage | ||||
# Mount required filesystems | ||||
Jan Wagner
|
r82 | mount -t proc none "${R}/proc" | ||
mount -t sysfs none "${R}/sys" | ||||
drtyhlpr
|
r92 | |||
# Mount pseudo terminal slave if supported by Debian release | ||||
if [ -d "${R}/dev/pts" ] ; then | ||||
mount --bind /dev/pts "${R}/dev/pts" | ||||
fi | ||||