[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 846abd0 04/14: Regularize mounting
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 846abd0 04/14: Regularize mounting |
Date: |
Tue, 5 May 2020 09:03:27 -0400 (EDT) |
branch: master
commit 846abd05d9031ebdc79b4e8b0a173de8d8638574
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Regularize mounting
Several cache directories are mounted in chroots, for guest-OS packages
as well as for lmi. Regularized commands to create directories, using
'mkdir -p' in all cases, for robustness: for example,
/var/cache/"${CODENAME}"
had been tacitly assumed to exist, but that assumption is false the
first time the script is run in a pristine environment; instead, that
directory now is explicitly created with 'mkdir -p' to prevent the mount
command from failing. Added commands to show the disk usage of each
mountpoint before mounting: if it isn't pretty much empty, then there
may be something wrong. Where mount commands were previously allowed to
fail (causing cachable files to be written to guest directories only),
now they are prevented from failing (creating host directories for files
that can profitably be cached and shared).
---
install_centos.sh | 10 +++++++++-
install_redhat.sh | 8 ++++++--
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/install_centos.sh b/install_centos.sh
index ceb26d7..a227a97 100755
--- a/install_centos.sh
+++ b/install_centos.sh
@@ -88,6 +88,9 @@ rinse --arch amd64 --distribution centos-7 \
--mirror http://mirror.net.cen.ct.gov/centos/7.7.1908/os/x86_64/Packages \
mkdir -p /var/cache/centos_lmi
+# There are probably a few directories here, with no regular files.
+du -sb /srv/chroot/centos7lmi/var/cache/yum || echo "Oops: rinse didn't
create cache"
+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
@@ -182,9 +185,14 @@ shell=/bin/zsh
type=plain
EOF
-mkdir /srv/chroot/centos7lmi/srv/chroot/"${CHRTNAME}"/cache_for_lmi
+mkdir -p /srv/cache_for_lmi
+du -sb /srv/chroot/centos7lmi/srv/chroot/"${CHRTNAME}"/cache_for_lmi || echo
"Okay."
+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
diff --git a/install_redhat.sh b/install_redhat.sh
index 6a76d2b..79dabcf 100755
--- a/install_redhat.sh
+++ b/install_redhat.sh
@@ -163,11 +163,15 @@ shell=/bin/zsh
type=plain
EOF
+mkdir -p /srv/cache_for_lmi
+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 ||
echo "Oops."
+mount --bind /srv/cache_for_lmi /srv/chroot/"${CHRTNAME}"/cache_for_lmi
mkdir -p /var/cache/"${CODENAME}"
-mount --bind /var/cache/"${CODENAME}"
/srv/chroot/"${CHRTNAME}"/var/cache/apt/archives || echo "Oops."
+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
- [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, 2020/05/05
- [lmi-commits] [lmi] master 846abd0 04/14: Regularize mounting,
Greg Chicares <=
- [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
- [lmi-commits] [lmi] master 523d869 14/14: Define a variable just before its first use, Greg Chicares, 2020/05/05