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

Unified Diff: enter_chroot.sh

Issue 6519022: Make mount points before attempting to mount on them (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Typo fix Created 9 years, 10 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 ac34ad961f583ffa9807c7462c421af638f0dfe5..ac54459e2cc0a6681359298427c09910acc14210 100755
--- a/enter_chroot.sh
+++ b/enter_chroot.sh
@@ -143,6 +143,11 @@ function ensure_mounted {
local mounted_path="$(readlink -f "${FLAGS_chroot}/$target")"
if [ -z "$(mount | grep -F "on ${mounted_path} ")" ]; then
+ # Attempt to make the mountpoint as the user. This depends on the
+ # fact that all mountpoints that should be owned by root are
+ # already present.
+ mkdir -p "${mounted_path}"
+
# NB: mount_args deliberately left unquoted
debug mount ${mount_args} "${source}" "${mounted_path}"
sudo -- mount ${mount_args} "${source}" "${mounted_path}" || \
« 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