lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 8054eeb 09/18: Don't create chroot's own /var


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 8054eeb 09/18: Don't create chroot's own /var before running debootstrap
Date: Thu, 21 May 2020 19:43:11 -0400 (EDT)

branch: master
commit 8054eeb9a738f696978fadc76329b0149a6f0074
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Don't create chroot's own /var before running debootstrap
    
    Formerly, a chroot's /var was created and bind-mounted before running
    debootstrap, in the hope that archives downloaded by debootstrap would
    thereby be cached on the host. Now, 'debootstrap --cache-dir=' caches
    them there, without abusively altering the unborn chroot.
---
 install_centos.sh   |  6 ------
 install_centos_1.sh |  7 +++++++
 install_redhat.sh   | 11 ++++++++---
 lmi_setup_11.sh     |  2 ++
 4 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/install_centos.sh b/install_centos.sh
index 31439f2..21334ea 100755
--- a/install_centos.sh
+++ b/install_centos.sh
@@ -120,12 +120,6 @@ mount --rbind /var/cache/centos_lmi 
/srv/chroot/centos7lmi/var/cache/yum
 
 echo Installed centos chroot.
 
-CACHEDIR=/var/cache/"${CODENAME}"
-mkdir -p "${CACHEDIR}"
-du   -sb 
/srv/chroot/centos7lmi/srv/chroot/"${CHRTNAME}"/var/cache/apt/archives || echo 
"Okay."
-mkdir -p /srv/chroot/centos7lmi/srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
-mount --bind "${CACHEDIR}" 
/srv/chroot/centos7lmi/srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
-
 cp -a /tmp/schroot_env /srv/chroot/centos7lmi/tmp
 cp -a lmi_setup_*.sh   /srv/chroot/centos7lmi/tmp
 cp -a install_centos_* /srv/chroot/centos7lmi/tmp
diff --git a/install_centos_1.sh b/install_centos_1.sh
index 3a5becc..4fbec9c 100755
--- a/install_centos_1.sh
+++ b/install_centos_1.sh
@@ -61,5 +61,12 @@ debootstrap --arch=amd64 --cache-dir="${CACHEDIR}" \
 # This command should produce no output:
 grep --invert-match '^I:' "${CHRTNAME}"-debootstrap-log
 
+# Experimentally show whether anything's already here:
+du   -sb /srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
+# Bind-mount apt archives for the chroot's debian release. Do this:
+#   - after invoking 'debootstrap', so the chroot's /var exists; and
+#   - before invoking 'apt-get' in the chroot, to save bandwidth; and
+#   - while not chrooted, so that the host filesystem is accessible.
+mount --bind "${CACHEDIR}" /srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
 echo Installed debian "${CODENAME}" chroot.
 # END   ./lmi_setup_11.sh
diff --git a/install_redhat.sh b/install_redhat.sh
index 5795626..2b3a9ef 100755
--- a/install_redhat.sh
+++ b/install_redhat.sh
@@ -105,9 +105,6 @@ yum --assumeyes install debootstrap schroot
 # might be investigated.
 CACHEDIR=/var/cache/"${CODENAME}"
 mkdir -p "${CACHEDIR}"
-du   -sb /srv/chroot/"${CHRTNAME}"/var/cache/apt/archives || echo "Okay."
-mkdir -p /srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
-mount --bind "${CACHEDIR}" /srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
 
 # Bootstrap a minimal debian system. Options:
 #   --include=zsh, because of "shell=/bin/zsh" below
@@ -133,6 +130,14 @@ shell=/bin/zsh
 type=plain
 EOF
 
+# Experimentally show whether anything's already here:
+du   -sb /srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
+# Bind-mount apt archives for the chroot's debian release. Do this:
+#   - after invoking 'debootstrap', so the chroot's /var exists; and
+#   - before invoking 'apt-get' in the chroot, to save bandwidth; and
+#   - while not chrooted, so that the host filesystem is accessible.
+mount --bind "${CACHEDIR}" /srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
+
 mkdir -p /srv/cache_for_lmi
 du   -sb /srv/chroot/"${CHRTNAME}"/srv/cache_for_lmi || echo "Okay."
 mkdir -p /srv/chroot/"${CHRTNAME}"/srv/cache_for_lmi
diff --git a/lmi_setup_11.sh b/lmi_setup_11.sh
index 3c23e73..1d64f7f 100755
--- a/lmi_setup_11.sh
+++ b/lmi_setup_11.sh
@@ -64,6 +64,8 @@ shell=/bin/zsh
 type=plain
 EOF
 
+# Experimentally show whether anything's already here:
+du   -sb /srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
 # Bind-mount apt archives for the chroot's debian release. Do this:
 #   - after invoking 'debootstrap', so the chroot's /var exists; and
 #   - before invoking 'apt-get' in the chroot, to save bandwidth; and



reply via email to

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