]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
ubuntu template: handle /etc/resolv.conf being a symlink
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 31 Jul 2012 14:01:28 +0000 (16:01 +0200)
committerDaniel Lezcano <daniel.lezcano@free.fr>
Tue, 31 Jul 2012 14:01:28 +0000 (16:01 +0200)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
templates/lxc-ubuntu.in

index 0061798cdcfa5b1386947f223043e3b7af1b1220..f3fb8dcc4de8f184769f1a9f9619fac0deb1c3de 100644 (file)
@@ -468,9 +468,13 @@ post_process()
             chroot $rootfs apt-get install --force-yes -y python-software-properties
             chroot $rootfs add-apt-repository ppa:ubuntu-virt/ppa
         fi
-        cp /etc/resolv.conf "${rootfs}/etc"
+       cresolvonf="${rootfs}/etc/resolv.conf"
+       mv $cresolvonf ${cresolvonf}.lxcbak
+        cat /etc/resolv.conf > ${cresolvonf}
         chroot $rootfs apt-get update
         chroot $rootfs apt-get install --force-yes -y lxcguest
+       rm -f ${cresolvonf}
+       mv ${cresolvonf}.lxcbak ${cresolvonf}
     fi
 
     # If the container isn't running a native architecture, setup multiarch