修复MountWithouHome.sh的问题

This commit is contained in:
gfdgd xi 2022-12-09 22:45:51 +08:00
parent 12d8fb69e8
commit 9fb280271b
4 changed files with 35 additions and 6 deletions

@ -26,4 +26,4 @@ chmod 777 -R root
xhost + xhost +
# 如果参数 3 存在 # 如果参数 3 存在
chroot ${@:3} chroot . ${@:3}

@ -20,7 +20,8 @@ umount ./etc/resolv.conf
umount ./sys umount ./sys
umount ./dev/shm umount ./dev/shm
# 挂载 Wine 运行器目录 # 挂载 Wine 运行器目录
umount ./opt/apps/deepin-wine-runner/ umount ./opt
umount ./opt/apps/deepin-wine-runner
# 挂载字体 # 挂载字体
umount ./usr/share/fonts umount ./usr/share/fonts
# 挂载用户目录到 /root默认 $HOME 路径) # 挂载用户目录到 /root默认 $HOME 路径)

@ -471,7 +471,7 @@ def ConfigQemu():
choose = QtWidgets.QInputDialog.getItem(window, "提示", "选择需要 Chroot 到里面的容器", lists, 0, False) choose = QtWidgets.QInputDialog.getItem(window, "提示", "选择需要 Chroot 到里面的容器", lists, 0, False)
if not choose[1]: if not choose[1]:
return return
threading.Thread(target=OpenTerminal, args=[f"python3 '{programPath}/QemuRun.py' '{int(setting['QemuUnMountHome'])}' '{choose[0]}' "]).start() threading.Thread(target=OpenTerminal, args=[f"python3 '{programPath}/QemuRun.py' '{choose[0]}' '{int(setting['QemuUnMountHome'])}' "]).start()
print(choose) print(choose)
# 生成 desktop 文件在桌面 # 生成 desktop 文件在桌面
@ -2257,7 +2257,7 @@ try:
for g in qemuBottleList: for g in qemuBottleList:
nameValue.append([ nameValue.append([
f"使用qemu-{g[0]}-static 调用容器{g[1]}运行 ", f"使用qemu-{g[0]}-static 调用容器{g[1]}运行 ",
f"python3 '{programPath}/QemuRun.py' {int(setting['QemuUnMountHome'])} '{g[0]}/{g[1]}' " f"python3 '{programPath}/QemuRun.py' '{g[0]}/{g[1]}' {int(setting['QemuUnMountHome'])} "
]) ])
except: except:
traceback.print_exc() traceback.print_exc()
@ -2406,6 +2406,20 @@ for i in iconListUnBuild:
iconList.append(i) iconList.append(i)
print(iconList) print(iconList)
# Qemu Lock
try:
if os.path.exists("/tmp/deepin-wine-runner-lock.txt"):
print("lock")
with open(f"/tmp/deepin-wine-runner-lock.txt", "r") as file:
setting["QemuUnMountHome"] = bool(int(file.read()))
else:
print("unlock")
with open(f"/tmp/deepin-wine-runner-lock.txt", "w") as file:
# = bool(int(file.read()))
file.write(str(int(setting["QemuUnMountHome"])))
except:
traceback.print_exc()
########################### ###########################
# 窗口创建 # 窗口创建
########################### ###########################

@ -471,7 +471,7 @@ def ConfigQemu():
choose = QtWidgets.QInputDialog.getItem(window, "提示", "选择需要 Chroot 到里面的容器", lists, 0, False) choose = QtWidgets.QInputDialog.getItem(window, "提示", "选择需要 Chroot 到里面的容器", lists, 0, False)
if not choose[1]: if not choose[1]:
return return
threading.Thread(target=OpenTerminal, args=[f"python3 '{programPath}/QemuRun.py' '{int(setting['QemuUnMountHome'])}' '{choose[0]}' "]).start() threading.Thread(target=OpenTerminal, args=[f"python3 '{programPath}/QemuRun.py' '{choose[0]}' '{int(setting['QemuUnMountHome'])}' "]).start()
print(choose) print(choose)
# 生成 desktop 文件在桌面 # 生成 desktop 文件在桌面
@ -2257,7 +2257,7 @@ try:
for g in qemuBottleList: for g in qemuBottleList:
nameValue.append([ nameValue.append([
f"使用qemu-{g[0]}-static 调用容器{g[1]}运行 ", f"使用qemu-{g[0]}-static 调用容器{g[1]}运行 ",
f"python3 '{programPath}/QemuRun.py' {int(setting['QemuUnMountHome'])} '{g[0]}/{g[1]}' " f"python3 '{programPath}/QemuRun.py' '{g[0]}/{g[1]}' {int(setting['QemuUnMountHome'])} "
]) ])
except: except:
traceback.print_exc() traceback.print_exc()
@ -2406,6 +2406,20 @@ for i in iconListUnBuild:
iconList.append(i) iconList.append(i)
print(iconList) print(iconList)
# Qemu Lock
try:
if os.path.exists("/tmp/deepin-wine-runner-lock.txt"):
print("lock")
with open(f"/tmp/deepin-wine-runner-lock.txt", "r") as file:
setting["QemuUnMountHome"] = bool(int(file.read()))
else:
print("unlock")
with open(f"/tmp/deepin-wine-runner-lock.txt", "w") as file:
# = bool(int(file.read()))
file.write(str(int(setting["QemuUnMountHome"])))
except:
traceback.print_exc()
########################### ###########################
# 窗口创建 # 窗口创建
########################### ###########################