Set hostname in ramdisk image

This commit is contained in:
Dean Troyer 2011-10-13 15:50:44 -05:00
parent 7c076eeff5
commit 288f3bdc23

View file

@ -45,7 +45,7 @@ if [ ! -d $CHROOTCACHE/natty-dev ]; then
chroot $CHROOTCACHE/natty-dev groupadd libvirtd chroot $CHROOTCACHE/natty-dev groupadd libvirtd
chroot $CHROOTCACHE/natty-dev useradd stack -s /bin/bash -d $DEST -G libvirtd chroot $CHROOTCACHE/natty-dev useradd stack -s /bin/bash -d $DEST -G libvirtd
mkdir -p $CHROOTCACHE/natty-dev/$DEST mkdir -p $CHROOTCACHE/natty-dev/$DEST
chown stack $CHROOTCACHE/natty-dev/$DEST chroot $CHROOTCACHE/natty-dev chown stack $DEST
# a simple password - pass # a simple password - pass
echo stack:pass | chroot $CHROOTCACHE/natty-dev chpasswd echo stack:pass | chroot $CHROOTCACHE/natty-dev chpasswd
@ -115,6 +115,10 @@ auto eth0
iface eth0 inet dhcp iface eth0 inet dhcp
EOF EOF
# Set hostname
echo "ramstack" >$CHROOTCACHE/natty-stack/etc/hostname
echo "127.0.0.1 localhost ramstack" >$CHROOTCACHE/natty-stack/etc/hosts
# Configure the runner # Configure the runner
RUN_SH=$CHROOTCACHE/natty-stack/$DEST/run.sh RUN_SH=$CHROOTCACHE/natty-stack/$DEST/run.sh
cat > $RUN_SH <<EOF cat > $RUN_SH <<EOF