LXC is configured via a simple set of keys. For example,
-- `lxc.rootfs`
+- `lxc.rootfs.path`
- `lxc.mount.entry`
LXC namespaces configuration keys by using single dots. This means complex
<variablelist>
<varlistentry>
<term>
- <option>lxc.rootfs</option>
+ <option>lxc.rootfs.path</option>
</term>
<listitem>
<para>
</term>
<listitem>
<para>
- where to recursively bind <option>lxc.rootfs</option>
+ where to recursively bind <option>lxc.rootfs.path</option>
before pivoting. This is to ensure success of the
<citerefentry>
<refentrytitle><command>pivot_root</command></refentrytitle>
<listitem><para> LXC_ROOTFS_MOUNT: the path to the mounted root filesystem. </para></listitem>
<listitem><para> LXC_CONFIG_FILE: the path to the container configuration file. </para></listitem>
<listitem><para> LXC_SRC_NAME: in the case of the clone hook, this is the original container's name. </para></listitem>
- <listitem><para> LXC_ROOTFS_PATH: this is the lxc.rootfs entry for the container. Note this is likely not where the mounted rootfs is to be found, use LXC_ROOTFS_MOUNT for that. </para></listitem>
+ <listitem><para> LXC_ROOTFS_PATH: this is the lxc.rootfs.path entry for the container. Note this is likely not where the mounted rootfs is to be found, use LXC_ROOTFS_MOUNT for that. </para></listitem>
</itemizedlist>
</para>
<para>
<para>
The host relative path to the container root which has been
mounted to the rootfs.mount location.
- [<option>lxc.rootfs</option>]
+ [<option>lxc.rootfs.path</option>]
</para>
</listitem>
</varlistentry>
lxc.cgroup.devices.allow = b 8:0 rw
lxc.mount = /etc/fstab.complex
lxc.mount.entry = /lib /root/myrootfs/lib none ro,bind 0 0
- lxc.rootfs = /mnt/rootfs.complex
+ lxc.rootfs.path = dir:/mnt/rootfs.complex
lxc.cap.drop = sys_module mknod setuid net_raw
lxc.cap.drop = mac_override
</programlisting>
lxc_config_define(rootfs_mount);
lxc_config_define(rootfs_options);
lxc_config_define(rootfs_backend);
-lxc_config_define(rootfs);
+lxc_config_define(rootfs_path);
lxc_config_define(uts_name);
lxc_config_define(hooks);
lxc_config_define(net_type);
{ "lxc.mount", set_config_fstab, get_config_fstab, clr_config_fstab, },
{ "lxc.rootfs.mount", set_config_rootfs_mount, get_config_rootfs_mount, clr_config_rootfs_mount, },
{ "lxc.rootfs.options", set_config_rootfs_options, get_config_rootfs_options, clr_config_rootfs_options, },
+ { "lxc.rootfs.path", set_config_rootfs_path, get_config_rootfs_path, clr_config_rootfs_path, },
/* REMOVE IN LXC 3.0
legacy rootfs.backend key
*/
{ "lxc.rootfs.backend", set_config_rootfs_backend, get_config_rootfs_backend, clr_config_rootfs_backend, },
- { "lxc.rootfs", set_config_rootfs, get_config_rootfs, clr_config_rootfs, },
+ /* REMOVE IN LXC 3.0
+ legacy rootfs key
+ */
+ { "lxc.rootfs", set_config_rootfs_path, get_config_rootfs_path, clr_config_rootfs_path, },
/* REMOVE IN LXC 3.0
legacy utsname key
return lxc_config_read(value, lxc_conf, true);
}
-static int set_config_rootfs(const char *key, const char *value,
- struct lxc_conf *lxc_conf, void *data)
+static int set_config_rootfs_path(const char *key, const char *value,
+ struct lxc_conf *lxc_conf, void *data)
{
return set_config_path_item(&lxc_conf->rootfs.path, value);
}
return fulllen;
}
-static int get_config_rootfs(const char *key, char *retv, int inlen,
- struct lxc_conf *c, void *data)
+static int get_config_rootfs_path(const char *key, char *retv, int inlen,
+ struct lxc_conf *c, void *data)
{
return lxc_get_conf_str(retv, inlen, c->rootfs.path);
}
return 0;
}
-static inline int clr_config_rootfs(const char *key, struct lxc_conf *c,
- void *data)
+static inline int clr_config_rootfs_path(const char *key, struct lxc_conf *c,
+ void *data)
{
free(c->rootfs.path);
c->rootfs.path = NULL;
return NULL;
}
- if (!c->set_config_item(c, "lxc.rootfs", bdev->src)) {
- ERROR("Failed to set config item \"lxc.rootfs\" to \"%s\"",
+ if (!c->set_config_item(c, "lxc.rootfs.path", bdev->src)) {
+ ERROR("Failed to set config item \"lxc.rootfs.path\" to \"%s\"",
bdev->src);
return NULL;
}
return -1;
}
- /* Append a new lxc.rootfs entry to the unexpanded config. */
+ /* REMOVE IN LXC 3.0
+ * legacy rootfs key
+ */
clear_unexp_config_line(c->lxc_conf, "lxc.rootfs", false);
- if (!do_append_unexp_config_line(c->lxc_conf, "lxc.rootfs",
+
+ /* Append a new lxc.rootfs.path entry to the unexpanded config. */
+ clear_unexp_config_line(c->lxc_conf, "lxc.rootfs.path", false);
+ if (!do_append_unexp_config_line(c->lxc_conf, "lxc.rootfs.path",
c->lxc_conf->rootfs.path)) {
ERROR("Error saving new rootfs to cloned config.");
return -1;
}
- /* Append a new lxc.rootfs.backend entry to the unexpanded config. */
+ /* REMOVE IN LXC 3.0
+ * legacy rootfs.backend key
+ */
clear_unexp_config_line(c->lxc_conf, "lxc.rootfs.backend", false);
if (flags & LXC_CLONE_SNAPSHOT)
fclose(fout);
goto out;
}
+
+ /* REMOVE IN LXC 3.0
+ * legacy rootfs key
+ */
clear_unexp_config_line(c->lxc_conf, "lxc.rootfs", false);
+
+ clear_unexp_config_line(c->lxc_conf, "lxc.rootfs.path", false);
write_config(fout, c->lxc_conf);
fclose(fout);
c->lxc_conf->rootfs.path = origroot;
* need a path-extractor function. We face the same
* problem with the ovl_mkdir() function in
* lxcoverlay.{c,h}. */
- char *curr_path = ls_get_config_item(c, "lxc.rootfs", running);
+ char *curr_path = ls_get_config_item(c, "lxc.rootfs.path", running);
+ /* REMOVE IN LXC 3.0
+ legacy rootfs key
+ */
+ if (!curr_path)
+ curr_path = ls_get_config_item(c, "lxc.rootfs", running);
if (!curr_path)
goto put_and_next;
fi
lxc-create -t download -n $CONTAINER_NAME -B dir -- -d ubuntu -r $release -a $ARCH
-CONTAINER_PATH=$(dirname $(lxc-info -n $CONTAINER_NAME -c lxc.rootfs -H) | sed -e 's/dir://')
+CONTAINER_PATH=$(dirname $(lxc-info -n $CONTAINER_NAME -c lxc.rootfs.path -H) | sed -e 's/dir://')
cp $CONTAINER_PATH/config $CONTAINER_PATH/config.bak
# Ensure it's not in lxc-autostart
# We need this in 5.conf
lxc-destroy -n lxctestb || true
lxc-create -t busybox -n lxctestb -B dir
-CONTAINER_PATH=$(dirname $(lxc-info -n lxctestb -c lxc.rootfs -H) | sed 's/dir://')
+CONTAINER_PATH=$(dirname $(lxc-info -n lxctestb -c lxc.rootfs.path -H) | sed 's/dir://')
lxc-destroy -n lxctestb
# No nics, one clone hook in $container
goto non_test_error;
}
- /* lxc.rootfs */
+ /* REMOVE IN LXC 3.0
+ legacy lxc.rootfs key
+ */
if (set_get_compare_clear_save_load(c, "lxc.rootfs", "/some/path", tmpf,
true) < 0) {
lxc_error("%s\n", "lxc.rootfs");
goto non_test_error;
}
+ /* lxc.rootfs.path */
+ if (set_get_compare_clear_save_load(c, "lxc.rootfs.path", "/some/path", tmpf,
+ true) < 0) {
+ lxc_error("%s\n", "lxc.rootfs.path");
+ goto non_test_error;
+ }
+
/* lxc.rootfs.mount */
if (set_get_compare_clear_save_load(c, "lxc.rootfs.mount", "/some/path",
tmpf, true) < 0) {
[ -n "$path" ] || die 1 'Missing required option --path'
if [ -z "$rootfs" ] && [ -f "$path/config" ]; then
- rootfs="$(sed -nE 's/^lxc.rootfs\s*=\s*(.*)$/\1/p' "$path/config")"
+ rootfs="$(sed -nE 's/^lxc.rootfs.path\s*=\s*(.*)$/\1/p' "$path/config")"
fi
if [ -z "$rootfs" ]; then
rootfs="$path/rootfs"
{
mkdir -p $config_path
- grep -q "^lxc.rootfs" $config_path/config 2>/dev/null || echo "lxc.rootfs = $rootfs_path" >> $config_path/config
+ grep -q "^lxc.rootfs.path" $config_path/config 2>/dev/null || echo "lxc.rootfs.path = $rootfs_path" >> $config_path/config
cat <<EOF >> $config_path/config
lxc.uts.name = $name
lxc.tty = 4
exit 1
fi
-# check for 'lxc.rootfs' passed in through default config by lxc-create
+# check for 'lxc.rootfs.path' passed in through default config by lxc-create
if [ -z "$rootfs_path" ]; then
- if grep -q '^lxc.rootfs' $path/config 2>/dev/null ; then
- rootfs_path=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $path/config)
+ if grep -q '^lxc.rootfs.path' $path/config 2>/dev/null ; then
+ rootfs_path=$(awk -F= '/^lxc.rootfs.path =/{ print $2 }' $path/config)
else
rootfs_path=$path/rootfs
fi
echo "lxc.uts.name = ${name}" >> "${config}"
grep -q "^lxc.arch" "${config}" 2>/dev/null \
|| echo "lxc.arch = ${arch}" >> "${config}"
- grep -q "^lxc.rootfs" "${config}" 2>/dev/null \
- || echo "lxc.rootfs = ${rootfs_path}" >> "${config}"
+ grep -q "^lxc.rootfs.path" "${config}" 2>/dev/null \
+ || echo "lxc.rootfs.path = ${rootfs_path}" >> "${config}"
[ -e "${shared_config}" ] \
&& echo "lxc.include = ${shared_config}" >> "${config}"
if [ $? -ne 0 ]; then
rootfs=$2
name=$3
-grep -q "^lxc.rootfs" $path/config 2>/dev/null || echo "lxc.rootfs = $rootfs" >> $path/config
+grep -q "^lxc.rootfs.path" $path/config 2>/dev/null || echo "lxc.rootfs.path = $rootfs" >> $path/config
cat <<EOF >> $path/config
lxc.signal.halt = SIGUSR1
lxc.rebootsignal = SIGTERM
# detect rootfs
config="$path/config"
if [ -z "$rootfs" ]; then
- if grep -q '^lxc.rootfs' $config 2>/dev/null ; then
- rootfs=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $config)
+ if grep -q '^lxc.rootfs.path' $config 2>/dev/null ; then
+ rootfs=$(awk -F= '/^lxc.rootfs.path =/{ print $2 }' $config)
else
rootfs=$path/rootfs
fi
{
mkdir -p $config_path
- grep -q "^lxc.rootfs" $config_path/config 2>/dev/null || echo "
-lxc.rootfs = $rootfs_path
+ grep -q "^lxc.rootfs.path" $config_path/config 2>/dev/null || echo "
+lxc.rootfs.path = $rootfs_path
" >> $config_path/config
# The following code is to create static MAC addresses for each
if [ -z "$rootfs_path" ]; then
rootfs_path=$path/rootfs
- # check for 'lxc.rootfs' passed in through default config by lxc-create
- if grep -q '^lxc.rootfs' $path/config 2>/dev/null ; then
- rootfs_path=$(sed -e '/^lxc.rootfs\s*=/!d' -e 's/\s*#.*//' \
- -e 's/^lxc.rootfs\s*=\s*//' -e q $path/config)
+ # check for 'lxc.rootfs.path' passed in through default config by lxc-create
+ if grep -q '^lxc.rootfs.path' $path/config 2>/dev/null ; then
+ rootfs_path=$(sed -e '/^lxc.rootfs.path\s*=/!d' -e 's/\s*#.*//' \
+ -e 's/^lxc.rootfs.path\s*=\s*//' -e q $path/config)
fi
fi
config_path=$path
cat >> "$path/config" <<EOF
# Template used to create this container: cirros
-lxc.rootfs = $rootfs
+lxc.rootfs.path = $rootfs
lxc.tty = 4
lxc.pts = 1024
## Add the container-specific config
echo "" >> "$path/config"
echo "# Container specific configuration" >> "$path/config"
- grep -q "^lxc.rootfs" "$path/config" 2> /dev/null || echo "lxc.rootfs = $rootfs" >> "$path/config"
+ grep -q "^lxc.rootfs.path" "$path/config" 2> /dev/null || echo "lxc.rootfs.path = $rootfs" >> "$path/config"
cat <<EOF >> $path/config
lxc.tty = $num_tty
# detect rootfs
config="$path/config"
if [ -z "$rootfs" ]; then
- if grep -q '^lxc.rootfs' "$config" 2> /dev/null ; then
- rootfs=$(awk -F= '/^lxc.rootfs[ \t]+=/{ print $2 }' "$config")
+ if grep -q '^lxc.rootfs.path' "$config" 2> /dev/null ; then
+ rootfs=$(awk -F= '/^lxc.rootfs.path[ \t]+=/{ print $2 }' "$config")
else
rootfs=$path/rootfs
fi
{
mkdir -p $config_path
- grep -q "^lxc.rootfs" $config_path/config 2>/dev/null || echo "
-lxc.rootfs = $rootfs_path
+ grep -q "^lxc.rootfs.path" $config_path/config 2>/dev/null || echo "
+lxc.rootfs.path = $rootfs_path
" >> $config_path/config
# The following code is to create static MAC addresses for each
if [ -z "$rootfs_path" ]; then
rootfs_path=$path/rootfs
- # check for 'lxc.rootfs' passed in through default config by lxc-create
- if grep -q '^lxc.rootfs' $path/config 2>/dev/null ; then
- rootfs_path=$(sed -e '/^lxc.rootfs\s*=/!d' -e 's/\s*#.*//' \
- -e 's/^lxc.rootfs\s*=\s*//' -e q $path/config)
+ # check for 'lxc.rootfs.path' passed in through default config by lxc-create
+ if grep -q '^lxc.rootfs.path' $path/config 2>/dev/null ; then
+ rootfs_path=$(sed -e '/^lxc.rootfs.path\s*=/!d' -e 's/\s*#.*//' \
+ -e 's/^lxc.rootfs.path\s*=\s*//' -e q $path/config)
fi
fi
config_path=$path
# include configuration from default.conf if available
grep -q "^lxc." "${lxc_default_conf}" > "${config}" 2>/dev/null
- grep -q "^lxc.rootfs" "${config}" 2>/dev/null || echo "
-lxc.rootfs = ${rootfs}
+ grep -q "^lxc.rootfs.path" "${config}" 2>/dev/null || echo "
+lxc.rootfs.path = ${rootfs}
" >> "${config}"
# The following code is to create static MAC addresses for each
config="${path}/config"
if [ -z "${rootfs}" ]
then
- # check for 'lxc.rootfs' passed in through default config by lxc-create
- if grep -q '^lxc.rootfs' "${config}" 2>/dev/null
+ # check for 'lxc.rootfs.path' passed in through default config by lxc-create
+ if grep -q '^lxc.rootfs.path' "${config}" 2>/dev/null
then
- rootfs=$(awk -F= '/^lxc.rootfs =/{ print $2 }' "${config}")
+ rootfs=$(awk -F= '/^lxc.rootfs.path =/{ print $2 }' "${config}")
else
rootfs="${path}/rootfs"
fi
echo '### lxc-gentoo template stuff starts here' >> "$path/config"
#Determine rootfs
- #If backingstore was specified, lxc.rootfs should be present or --rootfs did the rootfs var creation
+ #If backingstore was specified, lxc.rootfs.path should be present or --rootfs did the rootfs var creation
if [ -z "${rootfs}" ]; then
- rootfs=`awk -F= '$1 ~ /^lxc.rootfs/ { print $2 }' "$path/config" 2>/dev/null`
+ rootfs=`awk -F= '$1 ~ /^lxc.rootfs.path/ { print $2 }' "$path/config" 2>/dev/null`
if [ -z "${rootfs}" ]; then
#OK it's default
rootfs="${path}/rootfs"
grep -q "^lxc.net.0.hwaddr" ${conf_file} || sed -i -e "/^lxc\.net\.0\.type[ \t]*=[ \t]*veth/a lxc.net.0.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//')" ${conf_file}
fi
- if grep -q "^lxc.rootfs" "${conf_file}" ; then
+ if grep -q "^lxc.rootfs.path" "${conf_file}" ; then
#lxc-create already provided one
conf_rootfs_line=""
else
- conf_rootfs_line="lxc.rootfs = $(readlink -f "${rootfs}")"
+ conf_rootfs_line="lxc.rootfs.path = $(readlink -f "${rootfs}")"
fi
if [[ "${arch}" == "x86" || "${arch}" == "amd64" ]]; then
local conf_arch_line="lxc.arch = ${arch}"
{
mkdir -p $config_path
- grep -q "^lxc.rootfs" $config_path/config 2>/dev/null || echo "lxc.rootfs = $rootfs_path" >> $config_path/config
+ grep -q "^lxc.rootfs.path" $config_path/config 2>/dev/null || echo "lxc.rootfs.path = $rootfs_path" >> $config_path/config
cat <<EOF >> $config_path/config
lxc.uts.name = $name
lxc.tty = 4
exit 1
fi
-# check for 'lxc.rootfs' passed in through default config by lxc-create
+# check for 'lxc.rootfs.path' passed in through default config by lxc-create
if [ -z "$rootfs_path" ]; then
- if grep -q '^lxc.rootfs' $path/config 2>/dev/null ; then
- rootfs_path=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $path/config)
+ if grep -q '^lxc.rootfs.path' $path/config 2>/dev/null ; then
+ rootfs_path=$(awk -F= '/^lxc.rootfs.path =/{ print $2 }' $path/config)
else
rootfs_path=$path/$name/rootfs
fi
rootfs=$2
name=$3
- grep -q "^lxc.rootfs" $path/config 2>/dev/null || echo "
-lxc.rootfs = $rootfs_path
+ grep -q "^lxc.rootfs.path" $path/config 2>/dev/null || echo "
+lxc.rootfs.path = $rootfs_path
" >> $path/config
# The following code is to create static MAC addresses for each
# detect rootfs
config="$path/config"
if [ -z "$rootfs" ]; then
- if grep -q '^lxc.rootfs' $config 2>/dev/null ; then
- rootfs=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $config)
+ if grep -q '^lxc.rootfs.path' $config 2>/dev/null ; then
+ rootfs=$(awk -F= '/^lxc.rootfs.path =/{ print $2 }' $config)
else
rootfs=$path/rootfs
fi
lxc.arch = $arch
lxc.uts.name = $name
EOF
- grep -q "^lxc.rootfs" $cfg_dir/config 2>/dev/null || echo "lxc.rootfs = $container_rootfs" >> $cfg_dir/config
+ grep -q "^lxc.rootfs.path" $cfg_dir/config 2>/dev/null || echo "lxc.rootfs.path = $container_rootfs" >> $cfg_dir/config
if [ $container_release_major != "4" ]; then
echo "lxc.cap.drop = sys_resource" >>$cfg_dir/config
dlcache=$cache/cache-${prog##*-}-$release-$arch
rtcache=$cache/rootfs-${prog##*-}-$release-$arch
if [ -z "$rootfs" ] ; then
- if grep -q "^lxc.rootfs" $path/config ; then
- rootfs=`awk -F= '/^lxc.rootfs =/{ print $2 }' $path/config`
+ if grep -q "^lxc.rootfs.path" $path/config ; then
+ rootfs=`awk -F= '/^lxc.rootfs.path =/{ print $2 }' $path/config`
else
rootfs=$path/rootfs
fi
{
mkdir -p $config_path
- grep -q "^lxc.rootfs" $config_path/config 2>/dev/null || echo "lxc.rootfs = $rootfs_path" >> $config_path/config
+ grep -q "^lxc.rootfs.path" $config_path/config 2>/dev/null || echo "lxc.rootfs.path = $rootfs_path" >> $config_path/config
cat <<EOF >> $config_path/config
# Most of below settings should be taken as defaults from
# lxc.include = /usr/share/lxc/config/common.conf
if [ -z "$rootfs" ]; then
rootfs_path=$path/rootfs
- # check for 'lxc.rootfs' passed in through default config by lxc-create
+ # check for 'lxc.rootfs.path' passed in through default config by lxc-create
# TODO: should be lxc.rootfs.mount used instead?
- if grep -q '^lxc.rootfs' $path/config 2>/dev/null ; then
- rootfs_path=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $path/config)
+ if grep -q '^lxc.rootfs.path' $path/config 2>/dev/null ; then
+ rootfs_path=$(awk -F= '/^lxc.rootfs.path =/{ print $2 }' $path/config)
fi
else
rootfs_path=$rootfs
# detect rootfs
config="$path/config"
if [ -z "$rootfs" ]; then
- if grep -q '^lxc.rootfs' $config 2>/dev/null ; then
- rootfs=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $config)
+ if grep -q '^lxc.rootfs.path' $config 2>/dev/null ; then
+ rootfs=$(awk -F= '/^lxc.rootfs.path =/{ print $2 }' $config)
else
rootfs=$path/rootfs
fi
lxc.arch = $arch
lxc.uts.name = $name
EOF
- grep -q "^lxc.rootfs" $cfg_dir/config 2>/dev/null || echo "lxc.rootfs = $container_rootfs" >> $cfg_dir/config
+ grep -q "^lxc.rootfs.path" $cfg_dir/config 2>/dev/null || echo "lxc.rootfs.path = $container_rootfs" >> $cfg_dir/config
echo "lxc.cap.drop = sys_resource" >>$cfg_dir/config
init_path=$(realpath --relative-to=/ $(readlink -f /sbin/init))
- grep -q "^lxc.rootfs" $path/config 2>/dev/null || echo "lxc.rootfs = $rootfs" >> $path/config
+ grep -q "^lxc.rootfs.path" $path/config 2>/dev/null || echo "lxc.rootfs.path = $rootfs" >> $path/config
cat <<EOF >> $path/config
lxc.uts.name = $name
lxc.pts = 1024
# detect rootfs
config="$path/config"
if [ -z "$rootfs" ]; then
- if grep -q '^lxc.rootfs' $config 2>/dev/null ; then
- rootfs=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $config)
+ if grep -q '^lxc.rootfs.path' $config 2>/dev/null ; then
+ rootfs=$(awk -F= '/^lxc.rootfs.path =/{ print $2 }' $config)
else
rootfs=$path/rootfs
fi
echo "" >> $path/config
echo "# Container specific configuration" >> $path/config
[ -e "$path/config-auto" ] && cat $path/config-auto >> $path/config && rm $path/config-auto
- grep -q "^lxc.rootfs" $path/config 2>/dev/null || echo "lxc.rootfs = $rootfs" >> $path/config
+ grep -q "^lxc.rootfs.path" $path/config 2>/dev/null || echo "lxc.rootfs.path = $rootfs" >> $path/config
cat <<EOF >> $path/config
lxc.uts.name = $name
lxc.arch = $arch
# detect rootfs
config="$path/config"
if [ -z "$rootfs" ]; then
- if grep -q '^lxc.rootfs' $config 2>/dev/null ; then
- rootfs=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $config)
+ if grep -q '^lxc.rootfs.path' $config 2>/dev/null ; then
+ rootfs=$(awk -F= '/^lxc.rootfs.path =/{ print $2 }' $config)
else
rootfs=$path/rootfs
fi
echo "" >> $path/config
echo "# Container specific configuration" >> $path/config
[ -e "$path/config-auto" ] && cat $path/config-auto >> $path/config && rm $path/config-auto
- grep -q "^lxc.rootfs" $path/config 2>/dev/null || echo "lxc.rootfs = $rootfs" >> $path/config
+ grep -q "^lxc.rootfs.path" $path/config 2>/dev/null || echo "lxc.rootfs.path = $rootfs" >> $path/config
cat <<EOF >> $path/config
lxc.uts.name = $name
lxc.arch = $arch
config="$path/config"
# if $rootfs exists here, it was passed in with --rootfs
if [ -z "$rootfs" ]; then
- if grep -q '^lxc.rootfs' $config 2>/dev/null ; then
- rootfs=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $config)
+ if grep -q '^lxc.rootfs.path' $config 2>/dev/null ; then
+ rootfs=$(awk -F= '/^lxc.rootfs.path =/{ print $2 }' $config)
else
rootfs=$path/rootfs
fi
mkdir -p "${config_path}"
local config="${config_path}/config"
echo "lxc.uts.name = ${name}" >> "${config}"
- grep -q "^lxc.rootfs" "${config}" 2>/dev/null \
- || echo "lxc.rootfs = ${rootfs_path}" >> "${config}"
+ grep -q "^lxc.rootfs.path" "${config}" 2>/dev/null \
+ || echo "lxc.rootfs.path = ${rootfs_path}" >> "${config}"
# Detect if were in a UserNS and include the right config
if [ -z "${LXC_MAPPED_GID+x}" ] || [ -z "${LXC_MAPPED_UID+x}" ]; then