Browse code

Set hostname in ramdisk image

Dean Troyer authored on 2011/10/14 05:50:44
Showing 1 changed files
... ...
@@ -45,7 +45,7 @@ if [ ! -d $CHROOTCACHE/natty-dev ]; then
45 45
     chroot $CHROOTCACHE/natty-dev groupadd libvirtd
46 46
     chroot $CHROOTCACHE/natty-dev useradd stack -s /bin/bash -d $DEST -G libvirtd
47 47
     mkdir -p $CHROOTCACHE/natty-dev/$DEST
48
-    chown stack $CHROOTCACHE/natty-dev/$DEST
48
+    chroot $CHROOTCACHE/natty-dev chown stack $DEST
49 49
 
50 50
     # a simple password - pass
51 51
     echo stack:pass | chroot $CHROOTCACHE/natty-dev chpasswd
... ...
@@ -115,6 +115,10 @@ auto eth0
115 115
 iface eth0 inet dhcp
116 116
 EOF
117 117
 
118
+# Set hostname
119
+echo "ramstack" >$CHROOTCACHE/natty-stack/etc/hostname
120
+echo "127.0.0.1		localhost	ramstack" >$CHROOTCACHE/natty-stack/etc/hosts
121
+
118 122
 # Configure the runner
119 123
 RUN_SH=$CHROOTCACHE/natty-stack/$DEST/run.sh
120 124
 cat > $RUN_SH <<EOF