Fix 'too many levels of symbolic links' error.

In an Ubuntu Precise chroot on the Chromebook Pixel, /run/shm is a
symbolic link to /dev/shm, so bind-mounting /run/shm to /dev/shm
is really bind-mounting /dev/shm to itself, which causes a 'too many
levels of symbolic links' error. To fix this, we check for a symbolic
link prior to running this command.

BUG=none
TEST=cros_sdk no longer prints errors on Chromebook Pixel
Change-Id: Ib46cde2b4a0e00b69bd187488967e445b228ae80
Reviewed-on: https://gerrit.chromium.org/gerrit/45048
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh
index 20127ad..f957c39 100755
--- a/sdk_lib/enter_chroot.sh
+++ b/sdk_lib/enter_chroot.sh
@@ -212,9 +212,9 @@
     setup_mount none "-t sysfs" /sys
     setup_mount /dev "--bind" /dev
     setup_mount none "-t devpts" /dev/pts
-    if [ -d /run ]; then
+    if [[ -d /run ]]; then
       setup_mount /run "--bind" /run
-      if [ -d /run/shm ]; then
+      if [[ -d /run/shm && ! -L /run/shm ]]; then
         setup_mount /run/shm "--bind" /run/shm
       fi
     fi