iopsys-feed/swmodd/files/etc/uci-defaults/01-fix-bundle-path
Vivek Kumar Dutta 90dfcd0ad3 swmodd: 2.5.11
Update default bundle root to '/container', swmodd only starts if
'/container' mounted and accessible.
Mounting of persistent storage to '/container' is out of scope of swmodd.
2024-06-17 18:27:55 +05:30

48 lines
1.1 KiB
Bash

#!/bin/sh
. /lib/functions.sh
configure_ee_path() {
local lxc_bundle oci_bundle name root
config_load swmodd
config_get lxc_bundle globals lxc_bundle_root ""
config_get oci_bundle globals oci_bundle_root ""
mkdir -p /etc/lxc
if [ -n "${lxc_bundle}" ]; then
# if lxc_bundle_root define in swmodd, then remove it
name=$(echo ${lxc_bundle##/*/})
root=$(echo ${lxc_bundle%/$name})
echo "lxc.lxcpath = ${lxc_bundle}" > /etc/lxc/lxc.conf
uci_set swmodd globals lxc_bundle_root ""
fi
if [ -n "${oci_bundle}" ]; then
# if oci_bundle_root define in swmodd, then remove it
name=$(echo ${oci_bundle##/*/})
root=$(echo ${oci_bundle%/$name})
echo "lxc.lxcpath = ${oci_bundle}" > /etc/lxc/lxc.conf
uci_set swmodd globals oci_bundle_root ""
fi
# configure root in globals section
if [ -n "${root}" ]; then
if ! uci_get swmodd globals root >/dev/null; then
uci_set swmodd globals root ${root}
fi
fi
if [ -z "${name}" ]; then
name="oci"
fi
# configure execenv in swmodd
if ! uci_get swmodd.@execenv[0].name >/dev/null; then
uci_add swmodd execenv execenv_1
uci_set swmodd execenv_1 name ${name}
fi
}
configure_ee_path