]> git.proxmox.com Git - mirror_lxc.git/blobdiff - templates/lxc-centos.in
Merge pull request #2055 from marcosps/cgfsng_debug
[mirror_lxc.git] / templates / lxc-centos.in
index 7dd14f9d2eaab1271e4a642248a478ddae313b55..4d2777bd6b045bf196eec9ee8b47ac3686a00576 100644 (file)
@@ -336,7 +336,7 @@ EOF
     # /dev/tty[1-4] will be symlinks to the ptys /dev/lxc/console and
     # /dev/lxc/tty[1-4] so that package updates can overwrite the symlinks.
     # lxc will maintain these links and bind mount ptys over /dev/lxc/*
-    # since lxc.devttydir is specified in the config.
+    # since lxc.tty.dir is specified in the config.
 
     # allow root login on console, tty[1-4], and pts/0 for libvirt
     echo "# LXC (Linux Containers)" >>${rootfs_path}/etc/securetty
@@ -533,7 +533,7 @@ copy_centos()
     #cp -a $cache/rootfs-$arch $rootfs_path || return 1
     # i prefer rsync (no reason really)
     mkdir -p $rootfs_path
-    rsync -a $cache/rootfs/ $rootfs_path/
+    rsync -SHaAX $cache/rootfs/ $rootfs_path/
     echo
     return 0
 }
@@ -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
@@ -618,13 +618,13 @@ lxc.rootfs = $rootfs_path
         # Seems that \s doesn't work in brackets.
         KEY=$(expr "${LINE}" : '\s*\([^         ]*\)\s*=')
 
-        if [[ "${KEY}" != "lxc.network.hwaddr" ]]
+        if [[ "${KEY}" != "lxc.net.0.hwaddr" ]]
         then
             echo ${LINE} >> $config_path/config
 
-            if [[ "${KEY}" == "lxc.network.link" ]]
+            if [[ "${KEY}" == "lxc.net.0.link" ]]
             then
-                echo "lxc.network.hwaddr = $(create_hwaddr)" >> $config_path/config
+                echo "lxc.net.0.hwaddr = $(create_hwaddr)" >> $config_path/config
             fi
         fi
     done < $config_path/config.def
@@ -641,22 +641,22 @@ lxc.include = @LXCTEMPLATECONFIG@/centos.common.conf
     # Append things which require expansion here...
     cat <<EOF >> $config_path/config
 lxc.arch = $arch
-lxc.utsname = $utsname
+lxc.uts.name = $utsname
 
 # When using LXC with apparmor, uncomment the next line to run unconfined:
-#lxc.aa_profile = unconfined
+#lxc.apparmor.profile = unconfined
 
 # example simple networking setup, uncomment to enable
-#lxc.network.type = $lxc_network_type
-#lxc.network.flags = up
-#lxc.network.link = $lxc_network_link
-#lxc.network.name = eth0
+#lxc.net.0.type = $lxc_network_type
+#lxc.net.0.flags = up
+#lxc.net.0.link = $lxc_network_link
+#lxc.net.0.name = eth0
 # Additional example for veth network type
 #    static MAC address,
-#lxc.network.hwaddr = 00:16:3e:77:52:20
+#lxc.net.0.hwaddr = 00:16:3e:77:52:20
 #    persistent veth device name on host side
 #        Note: This may potentially collide with other containers of same name!
-#lxc.network.veth.pair = v-$name-e0
+#lxc.net.0.veth.pair = v-$name-e0
 
 EOF
 
@@ -849,8 +849,8 @@ if [ -z "$release" ]; then
         # This is needed to clean out bullshit like 6workstation and 6server.
         release=$(expr $redhat_host_ver : '\([0-9.]*\)')
     else
-        echo "This is not a CentOS or Redhat host and release is missing, defaulting to 6 use -R|--release to specify release"
-        release=6
+        echo "This is not a CentOS or Red Hat host and release is missing, defaulting to 7, use -R|--release to specify release"
+        release=7
     fi
 fi
 
@@ -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