Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (07047b4387c0d2fff909d6a816fdac0b1d24e8b0)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Justin Boffemmyer <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (07047b4387c0d2fff909d6a816fdac0b1d24e8b0)
  • Date: Wed, 21 Feb 2018 03:29:55 +0000

GIT changes to master cauldron by Justin Boffemmyer <flux AT sourcemage.org>:

cauldron/lib/lib.chroot | 11 ++++++-----
enchantment/lib/lib.chroot | 11 ++++++-----
2 files changed, 12 insertions(+), 10 deletions(-)

New commits:
commit 07047b4387c0d2fff909d6a816fdac0b1d24e8b0
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

correct chroot close functions

There were some (logic) typos in the chroot close functions that
prevented them
from working correctly. Namely, the file to grep (/proc/mounts) was
missing
from the grep command, leaving it stuck in an endless loop. Also, there
were
copy-paste errors in the enchant function that referenced cauldron
functions/variables.

diff --git a/cauldron/lib/lib.chroot b/cauldron/lib/lib.chroot
index ad9698f..66855d0 100644
--- a/cauldron/lib/lib.chroot
+++ b/cauldron/lib/lib.chroot
@@ -125,16 +125,17 @@ function cauldron_chroot_close() {

for target in "${chroot[@]}"
do
- local mounts=( $(grep -o "$target[^[:space:]]*" | sort -r) )
- [[ -n "$mounts" ]] || mounts=( sys run dev/pts dev proc )
- cauldron_verbose "closing chroot mounts: ${mounts[@]}"
+ # get a list of all mounted subdirs in the target in reverse order to
ensure
+ # that subdirs are unmounted before their parents
+ local mounts=( $(grep -o "$target[^[:space:]]*" "/proc/mounts" | sort
-r) )

# unmount the chroot mount points
for mnt in "${mounts[@]}"
do
- if grep -q "$mnt" "$target/proc/mounts"
+ if grep -q "$mnt" "/proc/mounts"
then
- "${CAULDRON_CMD_UNMOUNT[@]}" "$target/$mnt" ||
+ cauldron_verbose "umounting in chroot: ${mnt#$target/}"
+ "${CAULDRON_CMD_UNMOUNT[@]}" "$mnt" ||
return $ERR_CHROOT_DONE
fi
done
diff --git a/enchantment/lib/lib.chroot b/enchantment/lib/lib.chroot
index de61ff1..0391e69 100644
--- a/enchantment/lib/lib.chroot
+++ b/enchantment/lib/lib.chroot
@@ -125,16 +125,17 @@ function enchant_chroot_close() {

for target in "${chroot[@]}"
do
- local mounts=( $(grep -o "$target[^[:space:]]*" | sort -r) )
- [[ -n "$mounts" ]] || mounts=( sys run dev/pts dev proc )
- cauldron_verbose "closing chroot mounts: ${mounts[@]}"
+ # get a list of all mounted subdirs in the target in reverse order to
ensure
+ # that subdirs are unmounted before their parents
+ local mounts=( $(grep -o "$target[^[:space:]]*" "/proc/mounts" | sort
-r) )

# unmount the chroot mount points
for mnt in "${mounts[@]}"
do
- if grep -q "$mnt" "$target/proc/mounts"
+ if grep -q "$mnt" "/proc/mounts"
then
- "${CAULDRON_CMD_UNMOUNT[@]}" "$target/$mnt" ||
+ enchant_verbose "umounting in chroot: ${mnt#$target/}"
+ "${ENCHANT_CMD_UNMOUNT[@]}" "$mnt" ||
return $ERR_CHROOT_DONE
fi
done



  • [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (07047b4387c0d2fff909d6a816fdac0b1d24e8b0), Justin Boffemmyer, 02/20/2018

Archive powered by MHonArc 2.6.24.

Top of Page