deep-wine-runner/deb/opt/apps/deepin-wine-runner/MountWithoutHome.sh

33 lines
754 B
Bash
Raw Normal View History

2022-12-09 10:37:50 +08:00
#!/bin/bash
if [ ` whoami ` != "root" ]; then
echo "Only root can run me"
exit 1
fi
if [ ! -d "$1" ]; then
echo "路径不存在!"
exit 1
fi
2023-01-03 19:21:32 +08:00
programPath=`dirname $0`
2022-12-09 10:37:50 +08:00
echo $0
echo $1
echo $2
echo $3
# 挂载必备目录
cd "$1"
# 拷贝 Qemu Static
cp -r /usr/bin/qemu-*-static ./usr/bin
# 挂载目录
2023-01-03 19:21:32 +08:00
# 这里将由 pardus-chroot 处理
#mount --bind /dev ./dev
2022-12-09 10:37:50 +08:00
#mount --bind /dev/pts ./dev/pts
2023-01-03 19:21:32 +08:00
#mount -t proc /proc ./proc
#mount --bind /etc/resolv.conf ./etc/resolv.conf
#mount -t sysfs /sys ./sys
2022-12-09 10:37:50 +08:00
#mount --bind /dev/shm ./dev/shm
2023-01-03 19:21:32 +08:00
chmod 777 -R root tmp
2022-12-09 10:37:50 +08:00
xhost +
# 挂载此内容以可以跨架构运行程序
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
2022-12-09 10:37:50 +08:00
# 如果参数 3 存在
2023-01-03 19:21:32 +08:00
"$programPath/pardus-chroot" . ${@:3}