mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-27 08:31:04 +02:00
enter_chroot: use /proc/mounts rather than mount
Since /etc/mtab could be stale, use /proc/mounts instead. BUG=None TEST=`cros_sdk` in diff terminals still works Change-Id: I526e5173581820c6983fe3702493a0349c1232c3 Reviewed-on: https://gerrit.chromium.org/gerrit/22860 Reviewed-by: David James <davidjames@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
2fbd5af6a8
commit
9e5b0a43ba
@ -109,8 +109,8 @@ queue_mount() {
|
||||
|
||||
local mounted_path="${MOUNTED_PATH}$target"
|
||||
|
||||
case ${MOUNT_CACHE} in
|
||||
*" on ${mounted_path} "*)
|
||||
case " ${MOUNT_CACHE} " in
|
||||
*" ${mounted_path} "*)
|
||||
# Already mounted!
|
||||
;;
|
||||
*)
|
||||
@ -251,7 +251,7 @@ setup_env() {
|
||||
fi
|
||||
|
||||
debug "Mounting chroot environment."
|
||||
MOUNT_CACHE=$(mount)
|
||||
MOUNT_CACHE=$(echo $(awk '{print $2}' /proc/mounts))
|
||||
mount_queue_init
|
||||
queue_mount none "-t proc" /proc
|
||||
queue_mount none "-t sysfs" /sys
|
||||
|
Loading…
x
Reference in New Issue
Block a user