From 0c0fea7b4d98f74d89c3174d2e0a8f704983828e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 22 Mar 2013 00:59:58 -0400 Subject: [PATCH] enter_chroot: handle /var/lock->/run/lock symlinks Newer Gentoo builds have moved to /run which means /var/lock is a symlink to /run/lock. But since that is an absolute symlink, it points outside of the chroot which doesn't work for us. Use a stable path unrelated to the chroot instead, but only with newer chroots. We no longer have to worry about backwards compat because the code that used to rely on this lock file (running sync processes) was punted a long time ago. BUG=chromium:218085 TEST=`cbuildbot chromiumos-sdk` passes Change-Id: I38c6848dfb86386849050d7ccf3f90cbbe8e0e81 Reviewed-on: https://gerrit.chromium.org/gerrit/46231 Reviewed-by: David James Commit-Queue: Mike Frysinger Tested-by: Mike Frysinger --- sdk_lib/enter_chroot.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh index 4234181f1a..3aa25729f0 100755 --- a/sdk_lib/enter_chroot.sh +++ b/sdk_lib/enter_chroot.sh @@ -91,9 +91,9 @@ INNER_CHROME_ROOT=$FLAGS_chrome_root_mount # inside chroot CHROME_ROOT_CONFIG="/var/cache/chrome_root" # inside chroot FUSE_DEVICE="/dev/fuse" -chmod 0777 "$FLAGS_chroot/var/lock" - -LOCKFILE="$FLAGS_chroot/var/lock/enter_chroot" +# We can't use /var/lock because that might be a symlink to /run/lock outside +# of the chroot. Or /run on the host system might not exist. +LOCKFILE="${FLAGS_chroot}/.enter_chroot.lock" MOUNTED_PATH=$(readlink -f "$FLAGS_chroot") # Reset the depot tools/internal trunk pathways to what they'll