From: Felix Abecassis Date: Tue, 21 Nov 2017 21:49:40 +0000 (-0800) Subject: lxc-oci: import common.conf and userns.conf X-Git-Tag: lxc-3.0.0.beta1~176^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7c685c6bee37da85069367db358c511276f6e5d;p=thirdparty%2Flxc.git lxc-oci: import common.conf and userns.conf Signed-off-by: Felix Abecassis --- diff --git a/templates/lxc-oci.in b/templates/lxc-oci.in index c06c62a67..1818567c4 100755 --- a/templates/lxc-oci.in +++ b/templates/lxc-oci.in @@ -34,6 +34,8 @@ for bin in skopeo umoci jq; do fi done +LXC_TEMPLATE_CONFIG="@LXCTEMPLATECONFIG@" + # Some useful functions cleanup() { if [ -d "$DOWNLOAD_TEMP" ]; then @@ -233,6 +235,14 @@ while read -r line; do echo "lxc.environment = ${line}" >> "${LXC_CONF_FILE}" done <<< "${environment}" +if [ -e "${LXC_TEMPLATE_CONFIG}/common.conf" ]; then + echo "lxc.include = ${LXC_TEMPLATE_CONFIG}/common.conf" >> "${LXC_CONF_FILE}" +fi + +if [ -n "$LXC_MAPPED_UID" ] && [ "$LXC_MAPPED_UID" != "-1" ] && [ -e "${LXC_TEMPLATE_CONFIG}/userns.conf" ]; then + echo "lxc.include = ${LXC_TEMPLATE_CONFIG}/userns.conf" >> "${LXC_CONF_FILE}" +fi + echo "lxc.uts.name = ${LXC_NAME}" >> "${LXC_CONF_FILE}" # set the hostname cat < ${LXC_ROOTFS}/etc/hostname