Skip to content

Commit 28db026

Browse files
committed
refact: lxc compatibility
1 parent 0dd8239 commit 28db026

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎system/cuos/init.sh‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ ensure_docker_config_json() {
2222
fi
2323
}
2424

25+
wait_for_lxc_system_init() {
26+
while [[ ! -f "/system_init.json" ]]; do
27+
echo "waiting for /system_init.json"
28+
sleep 1
29+
done
30+
}
31+
2532
ensure_system_config() {
2633
# Exec first-run if not yet started. E.g. for testing in docker containers.
2734
if [[ ! -f "/etc/active_slot" ]]; then
@@ -32,6 +39,7 @@ ensure_system_config() {
3239
return
3340
fi
3441
if [[ "${VIRT_TYPE}" == "lxc" || "${VIRT_TYPE}" == "docker" ]]; then
42+
wait_for_lxc_system_init
3543
cat "/system_init.json" >"${CONFIG_PATH}"
3644
else
3745
mkdir -p "/mnt/boot"

0 commit comments

Comments
 (0)