[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
- [lmi-commits] [lmi] master updated (45051a5 -> 523d869), Greg Chicares, 2020/05/05
- [lmi-commits] [lmi] master d336f8c 02/14: Fix defect introduced 20200204T2047Z: mistaken chroot level, Greg Chicares, 2020/05/05
- [lmi-commits] [lmi] master 062d21a 01/14: Backpatch centos install script, Greg Chicares, 2020/05/05
- [lmi-commits] [lmi] master 0a7c3d2 05/14: Create apt cache directory on host before running debootstrap,
Greg Chicares <=
- [lmi-commits] [lmi] master 846abd0 04/14: Regularize mounting, Greg Chicares, 2020/05/05
- [lmi-commits] [lmi] master d287cb4 10/14: Don't repeat contents of $prefix literally, Greg Chicares, 2020/05/05
- [lmi-commits] [lmi] master d34e4b6 11/14: Reuse $srcdir instead of attempting to reconstruct it, Greg Chicares, 2020/05/05
- [lmi-commits] [lmi] master d37be91 13/14: Add documentation from 'gui_test.sh' to 'gui_test.ps1', Greg Chicares, 2020/05/05
- [lmi-commits] [lmi] master bbf79d1 06/14: Install 'sudo' in centos chroot, Greg Chicares, 2020/05/05
- [lmi-commits] [lmi] master e4fe79d 09/14: Don't specify a centos mirror for 'rinse', Greg Chicares, 2020/05/05
- [lmi-commits] [lmi] master b812286 12/14: Add a translation of 'gui_test.sh', Greg Chicares, 2020/05/05
- [lmi-commits] [lmi] master 7f282e0 03/14: Let all "lmi" group members use centos chroots, Greg Chicares, 2020/05/05
- [lmi-commits] [lmi] master a61727e 07/14: Install 'less' and 'vim' for centos, Greg Chicares, 2020/05/05
- [lmi-commits] [lmi] master 26182ed 08/14: Reduce gratuitous differences between scripts, Greg Chicares, 2020/05/05