lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 0a7c3d2 05/14: Create apt cache directory on


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 0a7c3d2 05/14: Create apt cache directory on host before running debootstrap
Date: Tue, 5 May 2020 09:03:27 -0400 (EDT)

branch: master
commit 0a7c3d2e69cb08ae2e9dc04e46b5d3cf1b272576
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Create apt cache directory on host before running debootstrap
    
    Previously, the files that debootstrap downloaded were saved in a
    directory that was later obscured by a mount, so that they weren't
    preserved across reinstallations (as demonstrated by running 'du'
    before mounting). Now, downloads are cached on the host (i.e., the
    ultimate debian-stable host for a
      debian-testing within centos within debian-stable
    chroot chain). This seems to save a minute or two on each post-
    initial run of 'install_centos.sh'. This partial diff of logs
    before (-) and after (+) this change...
    
     debootstrap "bullseye" /srv/chroot/"lmi_bullseye_1" http:[...]
    [...]
    -I: Retrieving libacl1 2.2.53-6
    -I: Validating libacl1 2.2.53-6
    +I: Validating libacl1 2.2.53-8
    [...the newer libacl1 had already been retrieved...]
    -I: Retrieving adduser 3.118
     I: Validating adduser 3.118
    -I: Retrieving libapparmor1 2.13.4-1+b1
     I: Validating libapparmor1 2.13.4-1+b1
    [...snip one hundred fifty-one others...]
    -I: Retrieving liblzma5 5.2.4-1+b1
     I: Validating liblzma5 5.2.4-1+b1
    -I: Retrieving zlib1g 1:1.2.11.dfsg-2
     I: Validating zlib1g 1:1.2.11.dfsg-2
    
    ...demonstrates that packages previously retrieved are now taken
    from cache rather than retrieved again.
---
 install_centos.sh | 10 +++++-----
 install_redhat.sh | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/install_centos.sh b/install_centos.sh
index a227a97..af171a2 100755
--- a/install_centos.sh
+++ b/install_centos.sh
@@ -94,6 +94,11 @@ mkdir -p /srv/chroot/centos7lmi/var/cache/yum
 # 'rbind' seems necessary because centos uses subdirs
 mount --rbind /var/cache/centos_lmi /srv/chroot/centos7lmi/var/cache/yum
 
+mkdir -p /var/cache/"${CODENAME}"
+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 /var/cache/"${CODENAME}" 
/srv/chroot/centos7lmi/srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
+
 cat >/srv/chroot/centos7lmi/tmp/setup0.sh <<EOF
 #!/bin/sh
 set -evx
@@ -190,11 +195,6 @@ du   -sb 
/srv/chroot/centos7lmi/srv/chroot/"${CHRTNAME}"/cache_for_lmi || echo "
 mkdir -p /srv/chroot/centos7lmi/srv/chroot/"${CHRTNAME}"/cache_for_lmi
 mount --bind /srv/cache_for_lmi 
/srv/chroot/centos7lmi/srv/chroot/"${CHRTNAME}"/cache_for_lmi
 
-mkdir -p /var/cache/"${CODENAME}"
-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 /var/cache/"${CODENAME}" 
/srv/chroot/centos7lmi/srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
-
 cat >/srv/chroot/centos7lmi/tmp/setup1.sh <<EOF
 #!/bin/sh
 set -vx
diff --git a/install_redhat.sh b/install_redhat.sh
index 79dabcf..0bdc940 100755
--- a/install_redhat.sh
+++ b/install_redhat.sh
@@ -81,6 +81,11 @@ umount /srv/chroot
 mount LABEL=lmi /srv/chroot
 findmnt /srv/chroot
 
+mkdir -p /var/cache/"${CODENAME}"
+du   -sb /srv/chroot/"${CHRTNAME}"/var/cache/apt/archives || echo "Okay."
+mkdir -p /srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
+mount --bind /var/cache/"${CODENAME}" 
/srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
+
 # Suppress a nuisance: rh-based distributions provide a default
 # zsh logout file that clears the screen.
 sed -e'/^[^#]/s/^/# SUPPRESSED # /' -i /etc/zlogout
@@ -168,11 +173,6 @@ du   -sb /srv/chroot/"${CHRTNAME}"/cache_for_lmi || echo 
"Okay."
 mkdir -p /srv/chroot/"${CHRTNAME}"/cache_for_lmi
 mount --bind /srv/cache_for_lmi /srv/chroot/"${CHRTNAME}"/cache_for_lmi
 
-mkdir -p /var/cache/"${CODENAME}"
-du   -sb /srv/chroot/"${CHRTNAME}"/var/cache/apt/archives || echo "Okay."
-mkdir -p /srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
-mount --bind /var/cache/"${CODENAME}" 
/srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
-
 # ./lmi_setup_10.sh
 # ./lmi_setup_11.sh
 cp -a lmi_setup_*.sh /tmp/schroot_env /srv/chroot/${CHRTNAME}/tmp



reply via email to

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