From fb0e87f81c61fe8d41301e79eb0a634c1b80b24f Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Sun, 22 Jan 2023 09:48:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=A8=E8=B7=A8=E6=9E=B6?= =?UTF-8?q?=E6=9E=84chroot=E4=B8=8B=E5=87=BA=E7=8E=B0=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Mount.sh | 3 ++- MountWithoutHome.sh | 3 ++- mainwindow.py | 4 ++-- pardus-chroot | 5 +++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Mount.sh b/Mount.sh index 4ef5f0e..a50e06a 100755 --- a/Mount.sh +++ b/Mount.sh @@ -41,6 +41,7 @@ if [[ $2 == "root" ]]; then else mount --bind "/home/$2" "$1/home/$2" fi - +# 挂载此内容以可以跨架构运行程序 +mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc # 如果参数 3 存在 "$programPath/pardus-chroot" "--userspec=$2:$2" . env "HOME=/home/$2" ${@:3} diff --git a/MountWithoutHome.sh b/MountWithoutHome.sh index af91d24..9cff35f 100755 --- a/MountWithoutHome.sh +++ b/MountWithoutHome.sh @@ -26,6 +26,7 @@ cp -r /usr/bin/qemu-*-static ./usr/bin #mount --bind /dev/shm ./dev/shm chmod 777 -R root tmp xhost + - +# 挂载此内容以可以跨架构运行程序 +mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc # 如果参数 3 存在 "$programPath/pardus-chroot" . ${@:3} diff --git a/mainwindow.py b/mainwindow.py index 8428b86..655345f 100755 --- a/mainwindow.py +++ b/mainwindow.py @@ -2622,12 +2622,12 @@ installWineOnDeepin23Alpha = QtWidgets.QAction(QtGui.QIcon(f"{programPath}/Icon/ installWineHQ = QtWidgets.QAction(QtGui.QIcon(f"{programPath}/Icon/Function/wine.png"), transla.transe("U", "安装 WineHQ")) installMoreWine = QtWidgets.QAction(QtGui.QIcon(f"{programPath}/Icon/Function/more-wine.png"), transla.transe("U", "安装更多 Wine")) downloadChrootBottle = QtWidgets.QAction(QtGui.QIcon(f"{programPath}/Icon/Function/CHROOT.png"), transla.transe("U", "下载 Chroot 容器")) -p2 = QtWidgets.QAction(transla.transe("U", "设置程序(&S)")) +p2 = QtWidgets.QAction(QtGui.QIcon.fromTheme("settings"), transla.transe("U", "设置程序(&S)")) enabledAll = QtWidgets.QAction(transla.transe("U", "强制启用所有被禁用的组件(不推荐)")) p3 = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(47), transla.transe("U", "清空软件历史记录(&C)")) cleanCache = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(47), transla.transe("U", "清空软件缓存")) cleanProgramUnuse = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(47), transla.transe("U", "删除程序组件")) -p4 = QtWidgets.QAction(transla.transe("U", "退出程序(&E)")) +p4 = QtWidgets.QAction(QtGui.QIcon.fromTheme("exit"), transla.transe("U", "退出程序(&E)")) programmenu.addAction(p1) programmenu.addAction(installWineOnDeepin23) programmenu.addAction(installWineOnDeepin23Alpha) diff --git a/pardus-chroot b/pardus-chroot index 2e96b59..c04d4e5 100755 --- a/pardus-chroot +++ b/pardus-chroot @@ -24,12 +24,13 @@ mount -t tmpfs tmpfs "$DESTDIR/dev/shm" if [[ -d /sys/firmware/efi/ ]] ; then mount -t efivarfs efivarfs "$DESTDIR/sys/firmware/efi/efivars" fi -cat /etc/resolv.conf > $DESTDIR/etc/resolv.conf +#cat /etc/resolv.conf > $DESTDIR/etc/resolv.conf SHELL=/bin/bash unshare --fork --pid chroot "$DESTDIR" "$@" +exit if [[ -d /sys/firmware/efi/ ]] ; then while umount "$DESTDIR/sys/firmware/efi/efivars" 2>/dev/null ; do : ;done fi for dir in dev/pts dev/shm dev sys proc run media ; do while umount "$DESTDIR/$dir" 2>/dev/null; do : ;done done -umount -lf "$DESTDIR" 2>/dev/null +#umount -lf "$DESTDIR" 2>/dev/null