From e7b8127cd3e50e0c823854eb54783324c9791731 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Sun, 25 Dec 2022 22:28:46 +0800 Subject: [PATCH] =?UTF-8?q?Mount.sh=E4=BD=BF=E7=94=A8pardus-chroot?= =?UTF-8?q?=E6=8C=82=E8=BD=BD=E6=96=87=E4=BB=B6=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Mount.sh | 16 +++++++++------- MountWithoutHome.sh | 14 ++++++++------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Mount.sh b/Mount.sh index 6fd5b6f..4ef5f0e 100755 --- a/Mount.sh +++ b/Mount.sh @@ -7,6 +7,7 @@ if [ ! -d "$1" ]; then echo "路径不存在!" exit 1 fi +programPath=`dirname $0` echo $0 echo $1 echo $2 @@ -16,13 +17,14 @@ cd "$1" # 拷贝 Qemu Static cp -r /usr/bin/qemu-*-static ./usr/bin # 挂载目录 -mount --bind /dev ./dev +# 此部分将会由 pardus-chroot 来处理 +#mount --bind /dev ./dev #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 -t proc /proc ./proc +#mount --bind /etc/resolv.conf ./etc/resolv.conf +#mount -t sysfs /sys ./sys #mount --bind /dev/shm ./dev/shm -chmod 777 -R root +chmod 777 -R root tmp xhost + # 挂载 Wine 运行器目录 mount -o bind `dirname $0` ./opt/apps/deepin-wine-runner/ @@ -31,7 +33,7 @@ mount -o bind /usr/share/fonts ./usr/share/fonts # 配置用户 if [ ! -d "home/$2" ]; then # 新建用户,且密码为 123456,以便读写 - chroot . bash /opt/apps/deepin-wine-runner/ChangePassword.sh "$2" + "$programPath/pardus-chroot" . bash /opt/apps/deepin-wine-runner/ChangePassword.sh "$2" fi # 挂载用户目录到 /root(默认 $HOME 路径) if [[ $2 == "root" ]]; then @@ -41,4 +43,4 @@ else fi # 如果参数 3 存在 -chroot "--userspec=$2:$2" . env "HOME=/home/$2" ${@:3} +"$programPath/pardus-chroot" "--userspec=$2:$2" . env "HOME=/home/$2" ${@:3} diff --git a/MountWithoutHome.sh b/MountWithoutHome.sh index 724f16e..af91d24 100755 --- a/MountWithoutHome.sh +++ b/MountWithoutHome.sh @@ -7,6 +7,7 @@ if [ ! -d "$1" ]; then echo "路径不存在!" exit 1 fi +programPath=`dirname $0` echo $0 echo $1 echo $2 @@ -16,14 +17,15 @@ cd "$1" # 拷贝 Qemu Static cp -r /usr/bin/qemu-*-static ./usr/bin # 挂载目录 -mount --bind /dev ./dev +# 这里将由 pardus-chroot 处理 +#mount --bind /dev ./dev #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 -t proc /proc ./proc +#mount --bind /etc/resolv.conf ./etc/resolv.conf +#mount -t sysfs /sys ./sys #mount --bind /dev/shm ./dev/shm -chmod 777 -R root +chmod 777 -R root tmp xhost + # 如果参数 3 存在 -chroot . ${@:3} +"$programPath/pardus-chroot" . ${@:3}