[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
- [lmi-commits] [lmi] master updated (71eeb9b -> 8bc4085), Greg Chicares, 2020/05/21
- [lmi-commits] [lmi] master 932c27b 01/18: Consolidate chroot step #10, Greg Chicares, 2020/05/21
- [lmi-commits] [lmi] master 8d2c26b 03/18: Fold unborn chroot step #12 into step #20, Greg Chicares, 2020/05/21
- [lmi-commits] [lmi] master 90411ba 06/18: Use a variable to reduce literal repetition, Greg Chicares, 2020/05/21
- [lmi-commits] [lmi] master 8054eeb 09/18: Don't create chroot's own /var before running debootstrap,
Greg Chicares <=
- [lmi-commits] [lmi] master 2b00752 10/18: Note some questions for later investigation, Greg Chicares, 2020/05/21
- [lmi-commits] [lmi] master 7f0f5fa 04/18: Announce the installation of each chroot, Greg Chicares, 2020/05/21
- [lmi-commits] [lmi] master 5134131 02/18: Rearrange some independent script blocks, Greg Chicares, 2020/05/21
- [lmi-commits] [lmi] master a779e6f 05/18: Give all group users access to chroot, on debian host, Greg Chicares, 2020/05/21
- [lmi-commits] [lmi] master bfd3dae 07/18: Regularize debootstrap invocations, Greg Chicares, 2020/05/21
- [lmi-commits] [lmi] master 0d9cf29 08/18: Clarify documentation, Greg Chicares, 2020/05/21
- [lmi-commits] [lmi] master 455d59e 11/18: Rearrange some script blocks, Greg Chicares, 2020/05/21
- [lmi-commits] [lmi] master 4a7d356 12/18: Extract marked blocks into sub-scripts #11, Greg Chicares, 2020/05/21
- [lmi-commits] [lmi] master 294b7bb 13/18: Let certain commands fail for the moment, Greg Chicares, 2020/05/21
- [lmi-commits] [lmi] master d496c75 15/18: Move some more script blocks, Greg Chicares, 2020/05/21