[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 05d51fe 3/9: Change the meaning of "chrooted"
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 05d51fe 3/9: Change the meaning of "chrooted" assertions |
Date: |
Wed, 20 May 2020 18:14:04 -0400 (EDT) |
branch: master
commit 05d51fea824fc9c130e8ec5700db9f5390e8acb2
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Change the meaning of "chrooted" assertions
Treat these two use cases the same:
create debian-testing chroot on redhat host
create debian-testing chroot in centos chroot hosted on debian-stable
---
install_centos_1.sh | 2 +-
install_centos_2.sh | 2 +-
lmi_setup_inc.sh | 7 +++++--
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/install_centos_1.sh b/install_centos_1.sh
index 1c6fd73..19efc4d 100755
--- a/install_centos_1.sh
+++ b/install_centos_1.sh
@@ -27,7 +27,7 @@
set -evx
assert_su
-assert_chrooted
+assert_not_chrooted
# A _normal_ file /dev/null seems to be created automatically:
# -rw-r--r-- 1 root root 0 Oct 1 15:44 /dev/null
diff --git a/install_centos_2.sh b/install_centos_2.sh
index db944ce..8957085 100755
--- a/install_centos_2.sh
+++ b/install_centos_2.sh
@@ -27,7 +27,7 @@
set -vx
assert_su
-assert_chrooted
+assert_not_chrooted
echo "Adapted from 'lmi_setup_00.sh'."
diff --git a/lmi_setup_inc.sh b/lmi_setup_inc.sh
index c4b2ab9..5e2b134 100755
--- a/lmi_setup_inc.sh
+++ b/lmi_setup_inc.sh
@@ -56,9 +56,12 @@ if [ "$(id -u)" -eq 0 ]; then
fi
}
+# Test for the ultimate chroot wherein lmi is built, ignoring any
+# intermediate level in a chain of chroots.
+
assert_chrooted()
{
-if [ -z "$SCHROOT_CHROOT_NAME" ]; then
+if [ "$CHRTNAME" != "$SCHROOT_CHROOT_NAME" ]; then
echo "Must be run in chroot."
exit 1
fi
@@ -66,7 +69,7 @@ fi
assert_not_chrooted()
{
-if [ -n "$SCHROOT_CHROOT_NAME" ]; then
+if [ "$CHRTNAME" = "$SCHROOT_CHROOT_NAME" ]; then
echo "Must not be run in chroot."
exit 1
fi
- [lmi-commits] [lmi] master updated (c193ba1 -> 71eeb9b), Greg Chicares, 2020/05/20
- [lmi-commits] [lmi] master 4b512a0 1/9: Adjust copyright notices, Greg Chicares, 2020/05/20
- [lmi-commits] [lmi] master 05d51fe 3/9: Change the meaning of "chrooted" assertions,
Greg Chicares <=
- [lmi-commits] [lmi] master 237f11e 2/9: Refactor a too-complex script, Greg Chicares, 2020/05/20
- [lmi-commits] [lmi] master eb7edf5 6/9: Perform dynamic configuration earlier, Greg Chicares, 2020/05/20
- [lmi-commits] [lmi] master 0125e0f 8/9: Extract marked blocks into sub-scripts #05, Greg Chicares, 2020/05/20
- [lmi-commits] [lmi] master 71eeb9b 9/9: Extract marked blocks into sub-scripts #07, Greg Chicares, 2020/05/20
- [lmi-commits] [lmi] master 32da141 5/9: Mark script blocks for extraction into sub-scripts, Greg Chicares, 2020/05/20
- [lmi-commits] [lmi] master 70a5c91 4/9: Remove a gratuitous difference in 'yum' commands, Greg Chicares, 2020/05/20
- [lmi-commits] [lmi] master 7583624 7/9: Extract marked blocks into sub-scripts #02, Greg Chicares, 2020/05/20