-
Notifications
You must be signed in to change notification settings - Fork 0
/
mcl
72 lines (72 loc) · 2.5 KB
/
mcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/zsh
LOAD=$(dirname $(readlink -f $0))
setopt no_nomatch
HOME=/var/mcl
for sdir in data
do
if [[ -d "${LOAD}/${sdir}" ]] {
{ Config="${Config} --dev-bind $LOAD/${sdir}/ $HOME/${sdir}/" }
pushd $LOAD/${sdir}/
for dir in ./*
do
for file in ./$dir/*
do
Config="${Config} --tmpfs $HOME/${sdir}/$dir"
if [[ -f "$file" ]] {
Config="${Config} --dev-bind $LOAD/${sdir}/$file $HOME/${sdir}/$file"
} else
{
if [[ -d "$file" ]] {
Config="${Config} --dev-bind $LOAD/${sdir}/$file $HOME/${sdir}/$file"
}
}
done
done
popd
}
done
Part="--dev /dev --proc /proc \
--new-session --clearenv --unshare-all --share-net --die-with-parent \
--symlink usr/lib /lib \
--symlink usr/lib64 /lib64 \
--ro-bind /usr/lib /usr/lib \
--ro-bind /usr/lib64 /usr/lib64 \
--ro-bind /usr/bin/ffprobe /bin/ffprobe \
--ro-bind /usr/bin/ffmpeg /bin/ffmpeg \
--ro-bind /usr/bin/bash /bin/zsh \
--ro-bind /usr/share/ /usr/share/ \
--ro-bind-try /var/lib/ca-certificates /var/lib/ca-certificates \
--ro-bind /etc/machine-id /etc/machine-id \
--ro-bind /etc/nsswitch.conf /etc/nsswitch.conf \
--ro-bind /etc/resolv.conf /etc/resolv.conf \
--ro-bind /etc/vulkan /etc/vulkan \
--ro-bind-try /etc/fonts /etc/fonts \
--ro-bind-try /var/cache/fontconfig/ /var/cache/fontconfig/ \
--ro-bind-try /etc/ld.so.cache /etc/ld.so.cache \
--ro-bind /etc/ld.so.conf /etc/ld.so.conf \
--ro-bind /etc/ca-certificates /etc/ca-certificates \
--ro-bind /etc/localtime /etc/localtime \
--ro-bind /etc/pki /etc/pki \
--ro-bind-try /etc/fonts /etc/fonts \
--dev-bind /tmp /tmp \
--dev-bind /tmp $HOME/temp \
--tmpfs /dev/shm \
--setenv HOME $HOME \
--setenv PWD $HOME \
--setenv LANG zh_CN.UTF-8 \
--setenv PATH /usr/local/bin:/usr/bin:/bin \
--setenv USER mcl \
--dev-bind-try $LOAD/config/ $HOME/config/ \
--dev-bind-try $LOAD/libs/ $HOME/libs/ \
--dev-bind-try $LOAD/modules/ $HOME/modules/ \
--dev-bind-try $LOAD/plugin-libraries/ $HOME/plugin-libraries/ \
--dev-bind-try $LOAD/plugin-shared-libraries/ $HOME/plugin-shared-libraries/ \
--dev-bind-try $LOAD/plugins/ $HOME/plugins/ \
--dev-bind-try $LOAD/mcl.jar $HOME/mcl.jar \
--dev-bind-try $LOAD/config.json $HOME/config.json \
--dev-bind-try $LOAD/overflow.json $HOME/overflow.json\
${Config} \
-- zsh -c \"cd $HOME && $JRE_HOME/bin/java -Dmirai.console.skip-end-user-readme -D=mirai.no-desktop -Dmcl.disable-ansi=true -jar mcl.jar -u $* \"
"
echo $Part|xargs bwrap
# $JRE_HOME/bin/java -D=mirai.no-desktop -Dmcl.disable-ansi=true -jar mcl.jar -u $*