mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Add support for rootfs / toolchain bind (u)mount (#3342)
* Add support for rootfs / toolchain bind (u)mount * Bugfixes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user