little tweaks for using with production VMs
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 20 Mar 2014 11:24:10 +0000 (12:24 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 20 Mar 2014 11:24:10 +0000 (12:24 +0100)
lbuild-bridge.sh
lbuild-initvm.sh

index ecee98b..6bf317e 100755 (executable)
@@ -22,6 +22,7 @@ for line in file("/proc/net/dev"):
     if ifname.find("virbr")==0: continue
     if ifname.find("veth")==0: continue
     if ifname.find("tap")==0: continue
+    if ifname.find("vif")==0: continue
     print ifname
 EOF
 }
index 5f51503..1babde3 100755 (executable)
@@ -441,7 +441,7 @@ function setup_lxc() {
     esac
 
     # Enable cgroup -- xxx -- is this really useful ?
-    mkdir $lxc_root/cgroup
+    [ -d $lxc_root/cgroup ] || mkdir $lxc_root/cgroup
     
     # set up resolv.conf
     cp /etc/resolv.conf $lxc_root/etc/resolv.conf
@@ -860,7 +860,7 @@ function main () {
        masklen=$(ip addr show $PUBLIC_BRIDGE | grep -v inet6 | grep inet | awk '{print $2;}' | cut -d/ -f2)
         NETMASK=$(masklen_to_netmask $masklen)
         GATEWAY=$(ip route show | grep default | awk '{print $3}' | head -1)
-        VIF_HOST="i$(echo $GUEST_HOSTNAME | cut -d. -f1)"
+        VIF_HOST="vif_$(echo $GUEST_HOSTNAME | cut -d. -f1)"
     fi
 
     setup_lxc $lxc $fcdistro $pldistro $personality