From a734dfaadb4db20a7b979e335734eaef92494c47 Mon Sep 17 00:00:00 2001 From: steve Date: Thu, 25 May 2006 23:33:04 +0000 Subject: [PATCH] 2006-05-25 23:33:04 by steve Updated so that DHCP also sets : vif = [ '' ] This is mandatory for DHCP instances nowadays .. I think. --- etc/hook.d/95-create-cfg | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/etc/hook.d/95-create-cfg b/etc/hook.d/95-create-cfg index 125196d..e9ae405 100755 --- a/etc/hook.d/95-create-cfg +++ b/etc/hook.d/95-create-cfg @@ -36,14 +36,12 @@ if [ "${ide}" ]; then device=hda fi -if [ "${dhcp}" ]; then - dyn='dhcp = "dhcp"' -else - dyn="vif = ['ip=${ip}']" -fi echo "Creating Xen configuration file in /etc/xen .. " +# +# Default stuff +# cat < ${output_dir}/${hostname}.cfg kernel = '${kernel}' ramdisk = '${initrd}' @@ -51,6 +49,18 @@ memory = ${memory} name = '${hostname}' root = '/dev/${device}1 ro' disk = [ '${imagevbd},${device}1,w', '${swapvbd},${device}2,w' ] -${dyn} - E_O_CFG + + +# +# DHCP vs. Static +# +if [ "${dhcp}" ]; then + cat <> ${output_dir}/${hostname}.cfg +dhcp = "dhcp" +vif = [ '' ] +E_O_CFG +else + echo "vif = ['ip=${ip}']" >> ${output_dir}/${hostname}.cfg +fi +