use our own libvirt (1.0.4) for f18 and f20
[build.git] / lbuild-initvm.sh
index 199cacf..34c9115 100755 (executable)
@@ -499,6 +499,11 @@ function debian_install () {
     #virsh -c lxc:/// lxc-enter-namespace $lxc /bin/bash -c "apt-get -y install $DEBIAN_PREINSTALLED"
     chroot $lxc_root apt-get update
     chroot $lxc_root apt-get -y install $DEBIAN_PREINSTALLED
+    # configure hostname
+    cat <<EOF > ${lxc_root}/etc/hostname
+$GUEST_HOSTNAME
+EOF
+    
 }
 
 function debian_configure () {
@@ -916,7 +921,7 @@ function main () {
 
     if [ -n "$BUILD_MODE" ] ; then
        # we can now set GUEST_HOSTNAME safely
-        [ -z "$GUEST_HOSTNAME" ] && GUEST_HOSTNAME=$lxc
+        [ -z "$GUEST_HOSTNAME" ] && GUEST_HOSTNAME=$(echo $lxc | sed -e 's,\.,-,g')
     else
        # as this command can be used in other contexts, not specifying
        # a repo is considered a warning