Add support for rootfs / toolchain bind (u)mount (#3342)

* Add support for rootfs / toolchain bind (u)mount

* Bugfixes
This commit is contained in:
Igor Pečovnik
2021-12-12 17:41:03 +01:00
committed by GitHub
parent 2e5d928057
commit 06c931c9c2
3 changed files with 17 additions and 1 deletions

View File

@@ -35,6 +35,12 @@ debootstrap_ng()
rm -rf $SDCARD $MOUNT
mkdir -p $SDCARD $MOUNT $DEST/images $SRC/cache/rootfs
# bind mount rootfs if defined
if [[ -d "${ARMBIAN_CACHE_ROOTFS_PATH}" ]]; then
mountpoint -q "${SRC}"/cache/rootfs && umount -l "${SRC}"/cache/toolchain
mount --bind "${ARMBIAN_CACHE_ROOTFS_PATH}" "${SRC}"/cache/rootfs
fi
# stage: verify tmpfs configuration and mount
# CLI needs ~1.5GiB, desktop - ~3.5GiB
# calculate and set tmpfs mount to use 9/10 of available RAM+SWAP

View File

@@ -1423,6 +1423,13 @@ prepare_host()
# build aarch64
if [[ $(dpkg --print-architecture) == amd64 ]]; then
if [[ "${SKIP_EXTERNAL_TOOLCHAINS}" != "yes" ]]; then
# bind mount toolchain if defined
if [[ -d "${ARMBIAN_CACHE_TOOLCHAIN_PATH}" ]]; then
mountpoint -q "${SRC}"/cache/toolchain && umount -l "${SRC}"/cache/toolchain
mount --bind "${ARMBIAN_CACHE_TOOLCHAIN_PATH}" "${SRC}"/cache/toolchain
fi
display_alert "Checking for external GCC compilers" "" "info"
# download external Linaro compiler and missing special dependencies since they are needed for certain sources

View File

@@ -80,8 +80,11 @@ unmount_on_exit()
display_alert "ERROR_DEBUG_SHELL=yes, starting a shell." "ERROR_DEBUG_SHELL" "err"
bash < /dev/tty || true
fi
umount_chroot "${SDCARD}/"
mountpoint -q "${SRC}"/cache/toolchain && umount -l "${SRC}"/cache/toolchain
mountpoint -q "${SRC}"/cache/rootfs && umount -l "${SRC}"/cache/rootfs
unset ARMBIAN_CACHE_TOOLCHAIN_PATH ARMBIAN_CACHE_ROOTFS_PATH
umount -l "${SDCARD}"/tmp >/dev/null 2>&1
umount -l "${SDCARD}" >/dev/null 2>&1
umount -l "${MOUNT}"/boot >/dev/null 2>&1