From 9d5639e9a058ea7cfb13500ed71dd97447135069 Mon Sep 17 00:00:00 2001 From: Jan Blunck Date: Fri, 28 Nov 2014 20:53:50 +0100 Subject: Bind local repository into chroot directory. If a local repository path is given as a mirror URL lets bind it into the chroot. The local repository will be unmounted while processing "remove" or latest by the exit function. --- scripts/build/bootstrap_archives | 5 +++++ scripts/build/chroot_archives | 11 +++++++++++ 2 files changed, 16 insertions(+) (limited to 'scripts/build') diff --git a/scripts/build/bootstrap_archives b/scripts/build/bootstrap_archives index c2e37db27..42cb98550 100755 --- a/scripts/build/bootstrap_archives +++ b/scripts/build/bootstrap_archives @@ -59,6 +59,11 @@ Restore_cache cache/packages.chroot # Configure custom sources.list +if echo "${LB_PARENT_MIRROR_CHROOT}" | grep -q '^file:/' +then + Chroot_bind_path chroot "$(echo ${LB_PARENT_MIRROR_CHROOT} | sed -e 's|file:||')" +fi + cat > chroot/etc/apt/${_PARENT_FILE} << EOF deb ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION} ${LIVE_IMAGE_PARENT_ARCHIVE_AREAS} EOF diff --git a/scripts/build/chroot_archives b/scripts/build/chroot_archives index 44483206d..42d18dc58 100755 --- a/scripts/build/chroot_archives +++ b/scripts/build/chroot_archives @@ -60,6 +60,11 @@ case "${1}" in # Configure custom sources.list +if echo "${LB_PARENT_MIRROR_CHROOT}" | grep -q '^file:/' +then + Chroot_bind_path chroot "$(echo ${LB_PARENT_MIRROR_CHROOT} | sed -e 's|file:||')" +fi + cat > chroot/etc/apt/${_PARENT_FILE} << EOF deb ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION} ${LIVE_IMAGE_PARENT_ARCHIVE_AREAS} EOF @@ -534,6 +539,12 @@ EOF mv chroot/etc/apt/sources.list.d/zz-sources.list chroot/etc/apt/sources.list fi + # Unmount local repository +if echo "${LB_PARENT_MIRROR_CHROOT}" | grep -q '^file:/' +then + Chroot_unbind_path chroot "$(echo ${LB_PARENT_MIRROR_CHROOT} | sed -e 's|file:||')" +fi + # Configure generic indices # Don't do anything if it's not required if [ "${LB_PARENT_MIRROR_CHROOT}" = "${LB_PARENT_MIRROR_BINARY}" ] && \ -- cgit v1.2.3