lmi-commits
[Top][All Lists]
Advanced

[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



reply via email to

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