From 187afc10d7f7668281a0b28141a6c7366c584a44 Mon Sep 17 00:00:00 2001 From: Nadav Ruskin Date: Wed, 23 May 2018 17:59:03 +0300 Subject: [PATCH 1/2] Started work on wsl support for every mount point --- imagefiles/dockcross | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/imagefiles/dockcross b/imagefiles/dockcross index 9661cfb..35030f2 100755 --- a/imagefiles/dockcross +++ b/imagefiles/dockcross @@ -183,8 +183,17 @@ fi # Change the PWD when working in Docker on Windows if [ -n "$UBUNTU_ON_WINDOWS" ]; then + WSL_ROOT = "/\/mnt\//" + + CFG_FILE=/etc/wsl.conf + CFG_CONTENT=$(cat $CFG_FILE | sed -r '/[^=]+=[^=]+/!d' | sed -r 's/\s+=\s/=/g') + eval "$CFG_CONTENT" + if [ -n "$root"] + WSL_ROOT=$root + HOST_PWD=`pwd -P` - HOST_PWD=${HOST_PWD/\/mnt\//} + + HOST_PWD=${HOST_PWD/$WSL_ROOT//} HOST_PWD=${HOST_PWD/\//:\/} elif [ -n "$MSYS" ]; then HOST_PWD=$PWD From 406a1b60f9a6b00e76bb7f693455b561f96c10b2 Mon Sep 17 00:00:00 2001 From: Nadav Ruskin Date: Sun, 27 May 2018 11:36:59 +0300 Subject: [PATCH 2/2] Helper script now works on wsl with modified roots --- imagefiles/dockcross | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/imagefiles/dockcross b/imagefiles/dockcross index 35030f2..9eb2890 100755 --- a/imagefiles/dockcross +++ b/imagefiles/dockcross @@ -183,18 +183,15 @@ fi # Change the PWD when working in Docker on Windows if [ -n "$UBUNTU_ON_WINDOWS" ]; then - WSL_ROOT = "/\/mnt\//" - + WSL_ROOT="/mnt/" CFG_FILE=/etc/wsl.conf CFG_CONTENT=$(cat $CFG_FILE | sed -r '/[^=]+=[^=]+/!d' | sed -r 's/\s+=\s/=/g') eval "$CFG_CONTENT" - if [ -n "$root"] + if [ -n "$root" ]; then WSL_ROOT=$root - + fi HOST_PWD=`pwd -P` - HOST_PWD=${HOST_PWD/$WSL_ROOT//} - HOST_PWD=${HOST_PWD/\//:\/} elif [ -n "$MSYS" ]; then HOST_PWD=$PWD HOST_PWD=${HOST_PWD/\//}