]> git.proxmox.com Git - mirror_lxc.git/commitdiff
confile: lxc.rootfs --> lxc.rootfs.path
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 2 Jul 2017 00:21:08 +0000 (02:21 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 2 Jul 2017 12:40:06 +0000 (14:40 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
29 files changed:
README.md
doc/lxc.container.conf.sgml.in
src/lxc/confile.c
src/lxc/lxccontainer.c
src/lxc/tools/lxc_ls.c
src/tests/lxc-test-autostart
src/tests/lxc-test-cloneconfig
src/tests/parse_config_file.c
templates/lxc-alpine.in
templates/lxc-altlinux.in
templates/lxc-archlinux.in
templates/lxc-busybox.in
templates/lxc-centos.in
templates/lxc-cirros.in
templates/lxc-debian.in
templates/lxc-fedora-legacy.in
templates/lxc-fedora.in
templates/lxc-gentoo.in
templates/lxc-openmandriva.in
templates/lxc-opensuse.in
templates/lxc-oracle.in
templates/lxc-plamo.in
templates/lxc-pld.in
templates/lxc-slackware.in
templates/lxc-sparclinux.in
templates/lxc-sshd.in
templates/lxc-ubuntu-cloud.in
templates/lxc-ubuntu.in
templates/lxc-voidlinux.in

index 52c1ba45689175d2206b87a1ab4dcb427d4cf979..dd03a298b9ae0a6033561a5b4b994db205c66a42 100644 (file)
--- a/README.md
+++ b/README.md
@@ -79,7 +79,7 @@ quite restricted. Just to highlight the two most common problems:
 
 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
index 4a8e0b9e6f2368ed1a7a2aeb52008a2f220fc1c8..9b9b210d4bbc4c0da0780ac0fc7ad0112ea76dc6 100644 (file)
@@ -1042,7 +1042,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
       <variablelist>
         <varlistentry>
           <term>
-            <option>lxc.rootfs</option>
+            <option>lxc.rootfs.path</option>
           </term>
           <listitem>
             <para>
@@ -1076,7 +1076,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
           </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>
@@ -1426,7 +1426,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
           <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>
@@ -1662,7 +1662,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
             <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>
@@ -1989,7 +1989,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
         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>
index 7fc97f386912808cf818ec555f5aa094e98229c2..d79c03793eb3252e7a0b8078e23a71f5c5b34709 100644 (file)
@@ -91,7 +91,7 @@ lxc_config_define(fstab);
 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);
@@ -162,13 +162,17 @@ static struct lxc_config_t config[] = {
        { "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
@@ -2035,8 +2039,8 @@ static int set_config_includefiles(const char *key, const char *value,
        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);
 }
@@ -3026,8 +3030,8 @@ static int get_config_mount(const char *key, char *retv, int inlen,
        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);
 }
@@ -3440,8 +3444,8 @@ static inline int clr_config_fstab(const char *key, struct lxc_conf *c,
        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;
index 56a34941dde59d23e5b2ffd4280cc2b631d6c4e5..b0d890e8348896de16f1ffdf677b17d345a3380c 100644 (file)
@@ -1071,8 +1071,8 @@ static struct bdev *do_bdev_create(struct lxc_container *c, const char *type,
                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;
        }
@@ -2936,15 +2936,22 @@ static int copy_storage(struct lxc_container *c0, struct lxc_container *c,
                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)
@@ -3165,7 +3172,13 @@ static struct lxc_container *do_lxcapi_clone(struct lxc_container *c, const char
                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;
index c8176571ee11357f47f01370e5889bd32f43d6cf..ad102886b6ad85317af49264c255f20b6fb4e626 100644 (file)
@@ -546,7 +546,12 @@ static int ls_get(struct ls **m, size_t *size, const struct lxc_arguments *args,
                         * 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;
 
index 0d45bc70e9bab18dd99060b2f96b39886d37ac79..e5b651b3dbb39b06bf5a239355723116fb7e6d16 100755 (executable)
@@ -56,7 +56,7 @@ if [ -f /etc/lsb-release ]; then
 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
index 5692c170b0a70d4748f81e00c327f7d9ecf44f2d..84e2fee97d9f997f9fb1654b3019b35ea99e62eb 100755 (executable)
@@ -109,7 +109,7 @@ EOF
 # 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
index 9239b42fa5355e11c928d8667c37f3a559077241..bc69b3a16def87852aaa40f43b60d579e96840ed 100644 (file)
@@ -503,13 +503,22 @@ int main(int argc, char *argv[])
                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) {
index 2d6a1b9ff3bfe77315af9fdc753f6f62019dc273..359f02875bbb029c37398aa638f242826bef7b2d 100644 (file)
@@ -483,7 +483,7 @@ readonly MIRROR_URL="${mirror_url:-$DEFAULT_MIRROR_URL}"
 [ -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"
index ffc59373dc80fe8e3d2babd4256e897038fa89df..fe57f326202c14f1ad486188391b446f8133877d 100644 (file)
@@ -274,7 +274,7 @@ copy_configuration()
 {
 
     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
@@ -460,10 +460,10 @@ if [ "$(id -u)" != "0" ]; then
     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
index 46c422083e92fb8ac7d034255c69f6c85933bc8a..defea748a977cf01e9d3ce268ee4a83b84f59d01 100644 (file)
@@ -151,8 +151,8 @@ copy_configuration() {
     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
index ac0fcd43d28fe21923fba4d1fac22cd438298074..e93c9e59d56236e1a0d1886a0d21bb07aabad74e 100644 (file)
@@ -339,7 +339,7 @@ copy_configuration()
     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
@@ -427,8 +427,8 @@ fi
 # 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
index 23bc739fba3e7338e968f3a16c55b9cd9445dff3..f816517ee6d8269e3fb339e4b461714a26945e07 100644 (file)
@@ -598,8 +598,8 @@ copy_configuration()
 {
     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
@@ -861,10 +861,10 @@ fi
 
 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
index b9c94d91d8496778f052e60b4d8a39862d8df784..c5e864c24c45e53b70ae2c7f4dbfdb40f734d7d7 100644 (file)
@@ -118,7 +118,7 @@ copy_configuration()
 cat >> "$path/config" <<EOF
 # Template used to create this container: cirros
 
-lxc.rootfs = $rootfs
+lxc.rootfs.path = $rootfs
 
 lxc.tty = 4
 lxc.pts = 1024
index bd9f9f9d67d094d3312e55877c10b9bf1dba0016..b82faa3b8c66caf66e9609467d304b5d93eaacea 100644 (file)
@@ -511,7 +511,7 @@ copy_configuration()
     ## 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
@@ -787,8 +787,8 @@ fi
 # 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
index 815f74c5313b7f268937698ede4300525131a9cf..60d83afc6ba7211f10463c7a9744c8554aea2e94 100644 (file)
@@ -1082,8 +1082,8 @@ copy_configuration()
 {
     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
@@ -1367,10 +1367,10 @@ fi
 
 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
index 46a9b918c99498b5df7367b84defcc45a1f730fc..3191757ecb7f1123d3c08576bd00959c7aa64b52 100644 (file)
@@ -439,8 +439,8 @@ copy_configuration()
     # 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
@@ -1185,10 +1185,10 @@ fi
 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
index 8f68f1757576d4573bc7b2d927b259b2b0840429..e16366603cf22a8fd1c16781fb38ba36f67513e3 100644 (file)
@@ -282,9 +282,9 @@ container_setup() {
     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"
@@ -686,11 +686,11 @@ container_conf()
         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}"
index fbc7c786659fe93195803b289081fcb696fa2564..8845e617e47685a57d95140e923290d0c412003e 100644 (file)
@@ -226,7 +226,7 @@ copy_configuration()
 {
 
     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
@@ -424,10 +424,10 @@ if [ "$(id -u)" != "0" ]; then
     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
index 380b3c0282a0cf1e32898ae2649988a7eb059059..25b59edad30fd999027c430af08152b675a5f348 100644 (file)
@@ -303,8 +303,8 @@ copy_configuration()
     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
@@ -504,8 +504,8 @@ fi
 # 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
index eeb7e74489a1a3a94380b84d3376e3f87b5da39b..afb690210903537651eb5da2769fb25ecc0ce207 100644 (file)
@@ -484,7 +484,7 @@ container_config_create()
 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
index 9c17f77be8320b633bea755a56f362045dc9e7af..d59c49bfc22d7ae1a1f66efa9cb82c4166716ffa 100644 (file)
@@ -346,8 +346,8 @@ ptcache=$cache/partial-${prog##*-}-$release-$arch
 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
index 60c75ca0069a4a7b8e95be2343fa0a53689a54a1..f50f3fb83da292d0f9755be724ad28cb56616310 100644 (file)
@@ -234,7 +234,7 @@ copy_configuration()
 {
 
        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
@@ -423,10 +423,10 @@ fi
 
 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
index f36e150a7a777dc3fa521f5eef473ae88182764a..2c80351e5b8c1fff78b980ff947ae6547411d981 100644 (file)
@@ -743,8 +743,8 @@ fi
 # 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
index 087c545529d72c7acb662e3267636f89d5441763..e5e686f8eb14962c00a1d433d4e2545396594310 100644 (file)
@@ -318,7 +318,7 @@ container_config_create()
 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
 
index 08b303de9b74ee09d02522b3281c0cffdf6997a9..8cf4d6ae7471a2f24c9b99e4707ea4fc1312917e 100644 (file)
@@ -127,7 +127,7 @@ copy_configuration()
 
     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
@@ -250,8 +250,8 @@ fi
 # 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
index 9717fa874567cbe87b16afd18e4555b550b54a71..2bf534ab8f59570476528050e8da1f741ba42f89 100644 (file)
@@ -89,7 +89,7 @@ copy_configuration()
     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
@@ -263,8 +263,8 @@ fi
 # 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
index 81d6b6ca2fce971af9f270f2f1899c0e27cdea0e..8077b319cdcdaa72811e666b5c4f23d0227c9896 100644 (file)
@@ -529,7 +529,7 @@ copy_configuration()
     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
@@ -809,8 +809,8 @@ fi
 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
index 6a4e919231a01d29225217b0f2bd3f9d14bccf7e..d74da385a6c25de90e66bba9a1a25b33f162d094 100644 (file)
@@ -69,8 +69,8 @@ copy_configuration() {
     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