lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 4cb8695 5/6: Conserve bandwidth when creating


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 4cb8695 5/6: Conserve bandwidth when creating multiple chroots
Date: Fri, 27 Sep 2019 17:46:04 -0400 (EDT)

branch: master
commit 4cb8695ec51b4c6859538b8662a50324fdf80ec2
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Conserve bandwidth when creating multiple chroots
---
 lmi_setup_11.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lmi_setup_11.sh b/lmi_setup_11.sh
index 2428f59..c84d510 100755
--- a/lmi_setup_11.sh
+++ b/lmi_setup_11.sh
@@ -46,3 +46,14 @@ groups=greg
 root-groups=root
 type=plain
 EOF
+
+# Bind-mount apt archives for the chroot's debian release, to save a
+# great deal of bandwidth if multiple chroots are created with the
+# same release. Do this:
+#   - after invoking 'debootstrap', so that /var exists; and
+#   - before invoking 'apt-get' in the chroot, to save bandwidth; and
+#   - while not chrooted, so that the host filesystem is accessible.
+# The alternative of rbind-mounting parent directory var/cache/apt is
+# not used because it's more complicated and has no benefit.
+mkdir -p /var/cache/"${CODENAME}"
+mount --bind /var/cache/"${CODENAME}" 
/srv/chroot/"${CHRTNAME}"/var/cache/apt/archives



reply via email to

[Prev in Thread] Current Thread [Next in Thread]