lmi-commits
[Top][All Lists]
Advanced

[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



reply via email to

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