[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 26182ed 08/14: Reduce gratuitous differences
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 26182ed 08/14: Reduce gratuitous differences between scripts |
Date: |
Tue, 5 May 2020 09:03:28 -0400 (EDT) |
branch: master
commit 26182ed6bc57189b8dcc138819aa8bc5c6b3cffa
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Reduce gratuitous differences between scripts
---
install_centos.sh | 48 ++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 40 insertions(+), 8 deletions(-)
diff --git a/install_centos.sh b/install_centos.sh
index d9d0af9..b24c2fe 100755
--- a/install_centos.sh
+++ b/install_centos.sh
@@ -21,12 +21,16 @@
# email: <address@hidden>
# snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
-. ./lmi_setup_inc.sh
+set -evx
-# First, destroy any chroot left by a prior run.
-grep centos /proc/mounts | cut -f2 -d" " | xargs umount
-rm -rf /srv/chroot/centos7lmi
-rm /etc/schroot/chroot.d/centos7lmi.conf
+stamp0=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
+echo "Started: $stamp0"
+
+# Override any too-restrictive default (e.g., 077).
+if [ "$(umask)" -ne 022 ]; then
+ printf "Overriding bogus umask %s\n" "$(umask)"
+ umask 022
+fi
# A known corporate firewall blocks gnu.org even on a GNU/Linux
# server, yet allows github.com:
@@ -36,6 +40,30 @@ else
GIT_URL_BASE=https://github.com/vadz/lmi/raw/master
fi
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_10.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_11.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_20.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_21.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_30.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_40.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_41.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_42.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_43.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_inc.sh
+chmod 0777 lmi_setup_*.sh
+
+. ./lmi_setup_inc.sh
+
+set -evx
+
+assert_su
+assert_not_chrooted
+
+# First, destroy any chroot left by a prior run.
+grep centos /proc/mounts | cut -f2 -d" " | xargs umount
+rm -rf /srv/chroot/centos7lmi
+rm /etc/schroot/chroot.d/centos7lmi.conf
+
# Store dynamic configuration in a temporary file. This method is
# simple and robust, and far better than trying to pass environment
# variables across sudo and schroot barriers.
@@ -67,9 +95,6 @@ chmod 0666 /tmp/schroot_env
set -evx
-stamp0=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
-echo "Started: $stamp0"
-
cat >/etc/schroot/chroot.d/centos7lmi.conf <<EOF
[centos7lmi]
description=centos-7.7
@@ -235,6 +260,13 @@ EOF
chmod +x /srv/chroot/centos7lmi/tmp/setup1.sh
schroot --chroot=centos7lmi --user=root --directory=/tmp ./setup1.sh
+# Copy log files that may be useful for tracking down problems with
+# certain commands whose output is voluminous and often uninteresting.
+# Embed a timestamp in the copies' names (no colons, for portability).
+fstamp=$(date -u +"%Y%m%dT%H%MZ" -d "$stamp0")
+cp -a /srv/chroot/centos7lmi/srv/chroot/${CHRTNAME}/home/"${NORMAL_USER}"/log
/home/"${NORMAL_USER}"/lmi_rhlog_"${fstamp}"
+cp -a
/srv/chroot/centos7lmi/srv/chroot/${CHRTNAME}/tmp/${CHRTNAME}-apt-get-log
/home/"${NORMAL_USER}"/apt-get-log-"${fstamp}"
+
stamp1=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo "Finished: $stamp1"
- [lmi-commits] [lmi] master 0a7c3d2 05/14: Create apt cache directory on host before running debootstrap, (continued)
- [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, 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 <=
- [lmi-commits] [lmi] master 523d869 14/14: Define a variable just before its first use, Greg Chicares, 2020/05/05