[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
- [lmi-commits] [lmi] master updated (5ae814c -> 9023b1f), Greg Chicares, 2019/09/27
- [lmi-commits] [lmi] master 4eed78d 1/6: Make downloaded scripts executable, Greg Chicares, 2019/09/27
- [lmi-commits] [lmi] master 4cb8695 5/6: Conserve bandwidth when creating multiple chroots,
Greg Chicares <=
- [lmi-commits] [lmi] master 9023b1f 6/6: Create a normal user non-interactively, Greg Chicares, 2019/09/27
- [lmi-commits] [lmi] master 5080462 4/6: Expunge a redundant comment, Greg Chicares, 2019/09/27
- [lmi-commits] [lmi] master 3581cf4 3/6: Use '--assume-yes' with scripted apt-get, Greg Chicares, 2019/09/27
- [lmi-commits] [lmi] master 4223506 2/6: Replace 'bsdtar' package with 'libarchive-tools', Greg Chicares, 2019/09/27