10-bootstrap.sh
48 lines
| 1.4 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" | ||||
# Use non-free Debian packages if needed | ||||
if [ "$ENABLE_NONFREE" = true ] ; then | ||||
drtyhlpr
|
r226 | COMPONENTS="main,non-free,contrib" | ||
drtyhlpr
|
r91 | 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 | ||
Gérard Vidal
|
r627 | |||
drtyhlpr
|
r92 | # Exclude packages if required by Debian release | ||
r156 | if [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then | |||
r152 | EXCLUDES="--exclude=init,systemd-sysv" | |||
fi | ||||
Gérard Vidal
|
r627 | |||
drtyhlpr
|
r91 | # Base debootstrap (unpack only) | ||
Unknown
|
r375 | http_proxy=${APT_PROXY} debootstrap ${APT_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 | ||
r152 | install -m 755 -o root -g root "${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 | ||||