[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 8bf7f0e 03/12: Extract block into sub-script

From: Greg Chicares
Subject: [lmi-commits] [lmi] master 8bf7f0e 03/12: Extract block into sub-script #29
Date: Thu, 11 Jun 2020 20:58:32 -0400 (EDT)

branch: master
commit 8bf7f0e24a8d20a2ad724b65ab64bd7ec5b2f33d
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Extract block into sub-script #29
    Made the creation of lmi's directories a separate stanza.
    This naturally must precede higher-numbered scripts, and must follow the
    creation of $NORMAL_USER.
    Stanza #29 formerly preceded #25, but now follows it, which is okay
    because they're independent.
 lmi_setup_00.sh |  1 +
 lmi_setup_21.sh | 14 +-------------
 lmi_setup_29.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 51 insertions(+), 13 deletions(-)

diff --git a/lmi_setup_00.sh b/lmi_setup_00.sh
index 9d0046f..55210a5 100755
--- a/lmi_setup_00.sh
+++ b/lmi_setup_00.sh
@@ -86,6 +86,7 @@ wget -N -nv "${GIT_URL_BASE}"/lmi_setup_13c.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_25.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_29.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
diff --git a/lmi_setup_21.sh b/lmi_setup_21.sh
index d324fe8..90593e3 100755
--- a/lmi_setup_21.sh
+++ b/lmi_setup_21.sh
@@ -58,22 +58,10 @@ usermod -aG sudo "${NORMAL_USER}" || echo "Oops."
 getent group 1001 || groupadd --gid=1001 lmi || echo "Oops."
 usermod -aG lmi "${NORMAL_USER}" || echo "Oops."
-mkdir --parents /opt/lmi
-chmod g=u+s     /opt/lmi
-chown "${NORMAL_USER}":"${NORMAL_GROUP}" /opt/lmi
-mkdir --parents /etc/opt/lmi
-chmod g=u+s     /etc/opt/lmi
-chown "${NORMAL_USER}":"${NORMAL_GROUP}" /etc/opt/lmi
-mkdir --parents /var/opt/lmi
-chmod g=u+s     /var/opt/lmi
-chown "${NORMAL_USER}":"${NORMAL_GROUP}" /var/opt/lmi
-mkdir --parents /srv/cache_for_lmi
-chmod g=u+s     /srv/cache_for_lmi
-chown "${NORMAL_USER}":"${NORMAL_GROUP}" /srv/cache_for_lmi
 chsh -s /bin/zsh "${NORMAL_USER}"
 # Repair /usr/share/libtool/.../ltmain.sh as indicated here:
 #   https://lists.gnu.org/archive/html/libtool-patches/2011-06/msg00001.html
diff --git a/lmi_setup_29.sh b/lmi_setup_29.sh
new file mode 100755
index 0000000..6bdcb83
--- /dev/null
+++ b/lmi_setup_29.sh
@@ -0,0 +1,49 @@
+# Create a chroot for cross-building "Let me illustrate...".
+# Copyright (C) 2016, 2017, 2018, 2019, 2020 Gregory W. Chicares.
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+# http://savannah.nongnu.org/projects/lmi
+# email: <gchicares@sbcglobal.net>
+# snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
+. ./lmi_setup_inc.sh
+. /tmp/schroot_env
+set -evx
+# Create directories required by lmi. Only root can create all these
+# directories, but they must be owned by a normal user.
+mkdir --parents /opt/lmi
+chmod g=u+s     /opt/lmi
+chown "${NORMAL_USER}":"${NORMAL_GROUP}" /opt/lmi
+mkdir --parents /etc/opt/lmi
+chmod g=u+s     /etc/opt/lmi
+chown "${NORMAL_USER}":"${NORMAL_GROUP}" /etc/opt/lmi
+mkdir --parents /var/opt/lmi
+chmod g=u+s     /var/opt/lmi
+chown "${NORMAL_USER}":"${NORMAL_GROUP}" /var/opt/lmi
+mkdir --parents /srv/cache_for_lmi
+chmod g=u+s     /srv/cache_for_lmi
+chown "${NORMAL_USER}":"${NORMAL_GROUP}" /srv/cache_for_lmi
+stamp=$(date -u +'%Y%m%dT%H%M%SZ')
+echo "$stamp $0: Created lmi directories."  | tee /dev/tty

reply via email to

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