common.sh: move nfs checks to single user
This is only used by make_chroot.sh code, so move it there. The
common.sh script is loaded by a lot of tools in different repos,
so lets strip it down to untangle it.
BUG=None
TEST=CQ passes
Change-Id: I594f9e5acb0e267b454a0a42160cd74597395228
Reviewed-on: https://chromium-review.googlesource.com/1724904
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Michael Mortensen <mmortensen@google.com>
diff --git a/common.sh b/common.sh
index 828054a..df4b83e 100644
--- a/common.sh
+++ b/common.sh
@@ -511,16 +511,6 @@
echo
}
-is_nfs() {
- [[ $(stat -f -L -c %T "$1") == "nfs" ]]
-}
-
-warn_if_nfs() {
- if is_nfs "$1"; then
- warn "$1 is on NFS. This is untested. You can send patches if it's broken."
- fi
-}
-
# Enter a chroot and restart the current script if needed
restart_in_chroot_if_needed() {
# NB: Pass in ARGV: restart_in_chroot_if_needed "$@"
diff --git a/sdk_lib/make_chroot.sh b/sdk_lib/make_chroot.sh
index 48e85ec..c9b1a86 100755
--- a/sdk_lib/make_chroot.sh
+++ b/sdk_lib/make_chroot.sh
@@ -703,4 +703,10 @@
EOF
-warn_if_nfs "${SUDO_HOME}"
+is_nfs() {
+ [[ $(stat -f -L -c %T "$1") == "nfs" ]]
+}
+
+if is_nfs "$1"; then
+ warn "$1 is on NFS. This is untested. You can send patches if it's broken."
+fi