10-bootstrap.sh
42 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" | ||||
# Use non-free Debian packages if needed | ||||
Unknown
|
r732 | # One use variable which is only needed by wifi firmware blob => reworked to use non free in /etc/apt/sources.list - we could just use ENABLE_WIRELESS here | ||
if [ "$ENABLE_WIRELESS" = 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 | ||
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 | ||
Justin Friel
|
r151 | 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 | ||||