Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: enter_chroot.sh

Issue 2714010: enter_chroot: when preparing chroot, mount devpts filesystem as well (Closed) Base URL: ssh://gitrw.chromium.org/crosutils
Patch Set: one more space indent Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: enter_chroot.sh
diff --git a/enter_chroot.sh b/enter_chroot.sh
index f5dc11d6b872920b771e895ee9fd4bb22e6a15c8..9d2117cd6b5eb151b2b6c73ff2d43e180a543767 100755
--- a/enter_chroot.sh
+++ b/enter_chroot.sh
@@ -104,6 +104,13 @@ function setup_env {
die "Could not mount $MOUNTED_PATH"
fi
+ MOUNTED_PATH="$(readlink -f "${FLAGS_chroot}/dev/pts")"
+ if [ -z "$(mount | grep -F "on $MOUNTED_PATH ")" ]
+ then
+ sudo mount none -t devpts "$MOUNTED_PATH" || \
+ die "Could not mount $MOUNTED_PATH"
+ fi
+
MOUNTED_PATH="$(readlink -f "${FLAGS_chroot}$CHROOT_TRUNK_DIR")"
if [ -z "$(mount | grep -F "on $MOUNTED_PATH ")" ]
then
@@ -206,7 +213,10 @@ function teardown_env {
else
MOUNTED_PATH=$(readlink -f "$FLAGS_chroot")
echo "Unmounting chroot environment."
- for i in $(mount | grep -F "on $MOUNTED_PATH/" | awk '{print $3}'); do
+ # sort the list of mounts in reverse order, to ensure umount of
+ # cascading mounts in proper order
+ for i in \
+ $(mount | grep -F "on $MOUNTED_PATH/" | sort -r | awk '{print $3}'); do
safe_umount "$i"
done
fi
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698