Fix src dir copying

This commit is contained in:
2024-04-24 15:14:35 +02:00
parent f4a3c18146
commit 1f97dc31a6
2 changed files with 8 additions and 2 deletions

View File

@@ -39,6 +39,7 @@ echo mkdir /Users/mac/drone|ssh 127.0.0.1 bash
echo -e "drone\tUsers/mac/drone" | ssh 127.0.0.1 'sudo tee "/etc/synthetic.conf"'
# Fix problems with encoding (https://stackoverflow.com/questions/68809929/unicode-normalization-not-appropriate-for-ascii-8bit)
echo export LC_ALL=en_US.UTF-8 | ssh 127.0.0.1 'tee ~/.zshrc'
echo export LC_ALL=en_US.UTF-8 | ssh 127.0.0.1 'tee ~/.bashrc'
# Redirect all commands to VM
echo Redirecting executables
sed -i -r 's:^\#\!/bin/bash$:\#\!/usr.orig/bin/bash:' /home/arch/OSX-KVM/Launch-nopicker.sh

9
run.sh
View File

@@ -17,8 +17,13 @@ if ! ps -aux|grep -q [^\[]qemu[-]system; then
fi
if [ -d "/drone/src" ]; then
ssh 127.0.0.1 'sudo mount_9p src'
ssh 127.0.0.1 'sudo ln -s /Volumes/src /drone/src'
#ssh 127.0.0.1 'sudo ln -s /Volumes/src /drone/src'
# Compilation on 9p filesystem is too slow so make a local copy
ssh 127.0.0.1 'sudo mkdir /Users/mac/drone/src'
ssh 127.0.0.1 'sudo rsync -a /Volumes/src/ /Users/mac/drone/src/'
ssh 127.0.0.1 'sudo umount /Volumes/src'
fi
fi
cat /proc/self/environ|ssh 127.0.0.1 'vars=(); while read -rd '"''"' keyVal; do; key=${keyVal%=*}; val=${keyVal#*=}; if [[ "$keyVal" == "GITHUB_WORKSPACE=/drone/src" ]]; then keyVal="GITHUB_WORKSPACE=/Volumes/src"; fi; if (( ! ${(P)+key} )); then vars+=("$keyVal"); elif [[ "$key" == "PATH" ]]; then vars+=("PATH=$val:$PATH"); fi; done; pwd="'"$PWD"'"; if [ -d "$pwd" ] ; then cd "$pwd"; fi; sudo -E env -i "${vars[@]}" '"$0"' '"$@"
cat /proc/self/environ|ssh 127.0.0.1 'vars=(); while read -rd '"''"' keyVal; do; key=${keyVal%=*}; val=${keyVal#*=}; if [[ "$keyVal" == "GITHUB_WORKSPACE=/drone/src" ]]; then keyVal="GITHUB_WORKSPACE=/Users/mac/drone/src"; fi; if (( ! ${(P)+key} )); then vars+=("$keyVal"); elif [[ "$key" == "PATH" ]]; then vars+=("PATH=$val:$PATH"); fi; done; pwd="'"$PWD"'"; if [ -d "$pwd" ] ; then cd "$pwd"; fi; sudo -E env -i "${vars[@]}" '"$0"' '"$@"