lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 501ce73 05/10: Merge all chroot package cache


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 501ce73 05/10: Merge all chroot package caches
Date: Fri, 26 Jun 2020 08:05:20 -0400 (EDT)

branch: master
commit 501ce73aeed6d163fbca6be0547bc6e660ba326f
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Merge all chroot package caches
    
    The schroot maintainers have deprecated the 'plain' chroot type in favor
    of 'directory' chroots. The latter can handle mounts automatically,
    which is better than managing them manually (either by modifying the
    host's '/etc/fstab', or by invoking 'mount' whenever a server reboots).
    Using a single package-cache directory with a static name allows one
    custom 'fstab' to work for all chroots, which is far better than
    establishing and maintaining multiple custom 'fstab' files.
    
    Existing cache directories can be merged with commands such as:
      #cp -al /var/cache/bullseye/.   /var/cache/lmi_schroots
      #cp -al /var/cache/centos_lmi/. /var/cache/lmi_schroots
      #cp -al /var/cache/rinse/.      /var/cache/lmi_schroots
    so that the old directories remain available until testing is complete,
    while the new one requires hardly any extra space.
---
 lmi_setup_00c.sh | 2 +-
 lmi_setup_02c.sh | 2 +-
 lmi_setup_11.sh  | 9 +++++++--
 lmi_setup_13c.sh | 2 +-
 4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/lmi_setup_00c.sh b/lmi_setup_00c.sh
index 3f8abe4..db55879 100755
--- a/lmi_setup_00c.sh
+++ b/lmi_setup_00c.sh
@@ -55,7 +55,7 @@ EOF
 # 'x86_64/7/...', so the files remain segregated. Some duplication of
 # '.rpm' files may occur, but that's harmless.
 
-CACHEDIR=/var/cache/centos_lmi
+CACHEDIR=/var/cache/lmi_schroots
 mkdir -p "${CACHEDIR}"
 
 rinse --arch amd64 --distribution centos-7 \
diff --git a/lmi_setup_02c.sh b/lmi_setup_02c.sh
index ba1223c..e3a890c 100755
--- a/lmi_setup_02c.sh
+++ b/lmi_setup_02c.sh
@@ -34,7 +34,7 @@ umount 
/srv/chroot/centos7lmi/srv/chroot/"${CHRTNAME}"/var/cache/apt/archives ||
 umount /srv/chroot/centos7lmi/srv/chroot/"${CHRTNAME}"/dev/pts                
|| true
 umount /srv/chroot/centos7lmi/srv/chroot/"${CHRTNAME}"/proc                   
|| true
 umount /srv/chroot/centos7lmi/srv/cache_for_lmi      || true
-umount /srv/chroot/centos7lmi/var/cache/"${CODENAME}"|| true
+umount /srv/chroot/centos7lmi/var/cache/lmi_schroots || true
 umount /srv/chroot/centos7lmi/var/cache/yum          || true
 umount /srv/chroot/centos7lmi/dev/pts                || true
 umount /srv/chroot/centos7lmi/proc                   || true
diff --git a/lmi_setup_11.sh b/lmi_setup_11.sh
index 5667243..2acd75d 100755
--- a/lmi_setup_11.sh
+++ b/lmi_setup_11.sh
@@ -37,9 +37,14 @@ assert_not_chrooted
 #   - while not chrooted, so that the host filesystem is accessible.
 # The alternative of bind-mounting parent directory var/cache/apt
 # (using a single directory to store '.deb' files for all releases)
-# might be investigated--see:
+# was considered, but seemed too extraordinary--see:
 #   https://lists.nongnu.org/archive/html/lmi/2020-05/msg00028.html
-CACHEDIR=/var/cache/"${CODENAME}"
+# Instead, chroot package downloads are kept in their own directory
+# (distinct from the host's own cache), and commingled there (because
+# they're uniquely named, there's no need to segregate packages by
+# OS release, or to separate '.deb' from '.rpm' files).
+
+CACHEDIR=/var/cache/lmi_schroots
 mkdir -p "${CACHEDIR}"
 
 # Bootstrap a minimal debian system. Options:
diff --git a/lmi_setup_13c.sh b/lmi_setup_13c.sh
index 0f3c108..15bd993 100755
--- a/lmi_setup_13c.sh
+++ b/lmi_setup_13c.sh
@@ -29,7 +29,7 @@ set -evx
 assert_su
 assert_not_chrooted
 
-CACHEDIR=/var/cache/"${CODENAME}"
+CACHEDIR=/var/cache/lmi_schroots
 mkdir -p "${CACHEDIR}"
 mkdir -p /srv/chroot/centos7lmi/"${CACHEDIR}"
 mount --bind "${CACHEDIR}" /srv/chroot/centos7lmi/"${CACHEDIR}"



reply via email to

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