-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·31 lines (25 loc) · 973 Bytes
/
entrypoint.sh
File metadata and controls
executable file
·31 lines (25 loc) · 973 Bytes
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
#!/bin/bash
set -e
# 检查是否为只读,如果是,则重新挂载为读写
if [ -w "/sys/fs/cgroup" ]; then
echo "/sys/fs/cgroup is writable"
else
echo "Remounting /sys/fs/cgroup as RW..."
mount -o remount,rw /sys/fs/cgroup
fi
if [ ! -d "/opt/ovmlayer" ]; then
echo "[Init] /opt/ovmlayer directory not found, initializing with dev mode."
ovmlayer setup dev --base-rootfs=/root/rootfs.tar --layer-disk=/root/tmp_overlay_disk
elif [ -d "/opt/ovmlayer/layer_dir/base_rootfs/" ]; then
echo "[Init] Detected existing Layer data, skipping initialization."
else
echo "[Init] Initializing Layer with production configuration."
ovmlayer setup production --base-rootfs=/root/rootfs.tar
fi
if [ ! -d "/opt/ovmlayer/layer_dir/executor" ]; then
ovmlayer import --rename executor /tmp/executor-layer.tar
fi
# sync studio config
mkdir -p /root/.oomol-studio/oocana
echo '{"base_rootfs":["executor"]}' > /root/.oomol-studio/oocana/layer.json
exec "$@"