From 7f30c14bdcf570d6b68405e4cdca88448a11c24e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 12 Apr 2013 13:47:01 -0400 Subject: [PATCH] enter_chroot: bind mount /dev/pts All devpts mounts are actually shared, even if you do: mount -t devpts none /dev/pts mount -t devpts none /mnt/foo mount -t devpts none /mnt/asdfasdf These all provide the same data. This is problematic because most distros mount their host devpts like so: mount -t devpts devpts /dev/pts -o mode=620,gid=5 But when cros_sdk runs, it uses: mount -t devpts none /dev/pts We aren't specifying a mode/gid, so it ends up using the defaults, and this resets the host devpts mount as well. Since we've already assumed that the system has devpts available, it's fine to also assume that the system has it mounted at /dev/pts and we can simply bind mount it. BUG=None TEST=`cros_sdk` no longer messes up host perms on /dev/pts Change-Id: Ib594fc5e47707f296d97ac1edce32659ed2b2273 Reviewed-on: https://gerrit.chromium.org/gerrit/48018 Reviewed-by: Steev Klimaszewski Reviewed-by: David James Commit-Queue: Mike Frysinger Tested-by: Mike Frysinger --- sdk_lib/enter_chroot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh index 51a15f1b06..30d80523e8 100755 --- a/sdk_lib/enter_chroot.sh +++ b/sdk_lib/enter_chroot.sh @@ -213,7 +213,7 @@ setup_env() { setup_mount none "-t proc" /proc setup_mount none "-t sysfs" /sys setup_mount /dev "--bind" /dev - setup_mount none "-t devpts" /dev/pts + setup_mount /dev/pts "--bind" /dev/pts if [[ -d /run ]]; then setup_mount /run "--bind" /run if [[ -d /run/shm && ! -L /run/shm ]]; then