diff --git a/Mount.sh b/Mount.sh index cc6b4eb..45c0d7a 100644 --- a/Mount.sh +++ b/Mount.sh @@ -14,11 +14,11 @@ echo $3 # 挂载必备目录 cd "$1" mount --bind /dev ./dev -mount --bind /dev/pts ./dev/pts +#mount --bind /dev/pts ./dev/pts mount -t proc /proc ./proc mount --bind /etc/resolv.conf ./etc/resolv.conf mount -t sysfs /sys ./sys -mount --bind /dev/shm ./dev/shm +#mount --bind /dev/shm ./dev/shm chmod 777 -R root xhost + # 挂载 Wine 运行器目录 @@ -34,8 +34,8 @@ fi if [[ $2 == "root" ]]; then mount --bind root "$1/root/" else - mount --bind "/home/$2" "$1/root/" + mount --bind "/home/$2" "$1/home/$2" fi # 如果参数 3 存在 -chroot "--userspec=$2:$2" . "${@:3}" \ No newline at end of file +chroot "--userspec=$2:$2" . env "HOME=/home/$2" "${@:3}" diff --git a/QemuDownload.py b/QemuDownload.py index 312a9bb..7dede56 100644 --- a/QemuDownload.py +++ b/QemuDownload.py @@ -350,6 +350,8 @@ def on_delButton_clicked(): if not changed: name = f"{path}/i386/{localJsonList[ui.localWineList.currentIndex().row()]}".replace(".tar.gz", "") print(name) + # 必须取消挂载目录才行 + os.system(f"bash '{programPath}/UnMount.sh' '{name}'") #name = f"{homePath}/.deepin-wine-runner-ubuntu-images/{localJsonList[ui.localWineList.currentIndex().row()]}" dir = QtCore.QDir(name) dir.removeRecursively() diff --git a/QemuRun.py b/QemuRun.py index 8e8b669..eda1857 100644 --- a/QemuRun.py +++ b/QemuRun.py @@ -23,4 +23,4 @@ if __name__ == "__main__": if not os.path.ismount(f"{homePath}/.deepin-wine-runner-ubuntu-images/{sys.argv[1]}/proc"): print("文件暂未挂载,开始挂载") sys.exit(os.system(f"pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY bash '{programPath}/Mount.sh' '{homePath}/.deepin-wine-runner-ubuntu-images/{sys.argv[1]}' '{userName}' {commandList}")) - sys.exit(os.system(f"pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY chroot '--userspec={userName}:{userName}' '{homePath}/.deepin-wine-runner-ubuntu-images/{sys.argv[1]}/' env DISPLAY=:0.0 {commandList}")) \ No newline at end of file + sys.exit(os.system(f"pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY chroot '--userspec={userName}:{userName}' '{homePath}/.deepin-wine-runner-ubuntu-images/{sys.argv[1]}/' env 'HOME=/home/{userName}' {commandList}"))