[Fusionforge-commits] r12525 - trunk/tests/lxc

Christian Bayle cbayle at fusionforge.org
Wed Mar 2 12:07:18 CET 2011


Author: cbayle
Date: 2011-03-02 12:07:17 +0100 (Wed, 02 Mar 2011)
New Revision: 12525

Modified:
   trunk/tests/lxc/lxc-debian6.postinst
Log:
Set hostname for hostname -f to work


Modified: trunk/tests/lxc/lxc-debian6.postinst
===================================================================
--- trunk/tests/lxc/lxc-debian6.postinst	2011-03-02 10:51:14 UTC (rev 12524)
+++ trunk/tests/lxc/lxc-debian6.postinst	2011-03-02 11:07:17 UTC (rev 12525)
@@ -2,7 +2,7 @@
 
 configure_network()
 {
-if [ $# -ne 4 ]
+if [ $# -ne 5 ]
 then
 	exit 1
 else
@@ -10,6 +10,7 @@
 	address=$2
 	netmask=$3
 	gateway=$4
+	hostname=$5
 	if [ -e $rootfs/etc/network/interfaces ]
 	then
 		cat <<EOF > $rootfs/etc/network/interfaces
@@ -23,6 +24,9 @@
 	gateway $gateway
 
 EOF
+		cat <<EOF >> $rootfs/etc/hosts
+$address	$hostname.local $hostname
+EOF
 	else
 		exit 2
 	fi
@@ -96,7 +100,7 @@
 
 rootfs=$path/rootfs
 
-configure_network $rootfs $address $netmask $gateway
+configure_network $rootfs $address $netmask $gateway $name
 if [ $? -ne 0 ]; then
     echo "failed to configure network"
     exit 1




More information about the Fusionforge-commits mailing list