mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-01-13 01:58:27 +08:00
Mount.sh使用pardus-chroot挂载文件系统
This commit is contained in:
parent
e08b570db4
commit
e7b8127cd3
16
Mount.sh
16
Mount.sh
@ -7,6 +7,7 @@ if [ ! -d "$1" ]; then
|
|||||||
echo "路径不存在!"
|
echo "路径不存在!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
programPath=`dirname $0`
|
||||||
echo $0
|
echo $0
|
||||||
echo $1
|
echo $1
|
||||||
echo $2
|
echo $2
|
||||||
@ -16,13 +17,14 @@ cd "$1"
|
|||||||
# 拷贝 Qemu Static
|
# 拷贝 Qemu Static
|
||||||
cp -r /usr/bin/qemu-*-static ./usr/bin
|
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 --bind /dev/pts ./dev/pts
|
||||||
mount -t proc /proc ./proc
|
#mount -t proc /proc ./proc
|
||||||
mount --bind /etc/resolv.conf ./etc/resolv.conf
|
#mount --bind /etc/resolv.conf ./etc/resolv.conf
|
||||||
mount -t sysfs /sys ./sys
|
#mount -t sysfs /sys ./sys
|
||||||
#mount --bind /dev/shm ./dev/shm
|
#mount --bind /dev/shm ./dev/shm
|
||||||
chmod 777 -R root
|
chmod 777 -R root tmp
|
||||||
xhost +
|
xhost +
|
||||||
# 挂载 Wine 运行器目录
|
# 挂载 Wine 运行器目录
|
||||||
mount -o bind `dirname $0` ./opt/apps/deepin-wine-runner/
|
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
|
if [ ! -d "home/$2" ]; then
|
||||||
# 新建用户,且密码为 123456,以便读写
|
# 新建用户,且密码为 123456,以便读写
|
||||||
chroot . bash /opt/apps/deepin-wine-runner/ChangePassword.sh "$2"
|
"$programPath/pardus-chroot" . bash /opt/apps/deepin-wine-runner/ChangePassword.sh "$2"
|
||||||
fi
|
fi
|
||||||
# 挂载用户目录到 /root(默认 $HOME 路径)
|
# 挂载用户目录到 /root(默认 $HOME 路径)
|
||||||
if [[ $2 == "root" ]]; then
|
if [[ $2 == "root" ]]; then
|
||||||
@ -41,4 +43,4 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# 如果参数 3 存在
|
# 如果参数 3 存在
|
||||||
chroot "--userspec=$2:$2" . env "HOME=/home/$2" ${@:3}
|
"$programPath/pardus-chroot" "--userspec=$2:$2" . env "HOME=/home/$2" ${@:3}
|
||||||
|
@ -7,6 +7,7 @@ if [ ! -d "$1" ]; then
|
|||||||
echo "路径不存在!"
|
echo "路径不存在!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
programPath=`dirname $0`
|
||||||
echo $0
|
echo $0
|
||||||
echo $1
|
echo $1
|
||||||
echo $2
|
echo $2
|
||||||
@ -16,14 +17,15 @@ cd "$1"
|
|||||||
# 拷贝 Qemu Static
|
# 拷贝 Qemu Static
|
||||||
cp -r /usr/bin/qemu-*-static ./usr/bin
|
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 --bind /dev/pts ./dev/pts
|
||||||
mount -t proc /proc ./proc
|
#mount -t proc /proc ./proc
|
||||||
mount --bind /etc/resolv.conf ./etc/resolv.conf
|
#mount --bind /etc/resolv.conf ./etc/resolv.conf
|
||||||
mount -t sysfs /sys ./sys
|
#mount -t sysfs /sys ./sys
|
||||||
#mount --bind /dev/shm ./dev/shm
|
#mount --bind /dev/shm ./dev/shm
|
||||||
chmod 777 -R root
|
chmod 777 -R root tmp
|
||||||
xhost +
|
xhost +
|
||||||
|
|
||||||
# 如果参数 3 存在
|
# 如果参数 3 存在
|
||||||
chroot . ${@:3}
|
"$programPath/pardus-chroot" . ${@:3}
|
||||||
|
Loading…
Reference in New Issue
Block a user