1
0
mirror of synced 2026-05-01 22:26:08 +00:00
Files
xen-tools.xen-tools/etc/hook.d/95-create-cfg
radu ed4a35c598 2006-05-18 08:39:32 by radu
Changed remaning ${use-ide} in 95-create-cfg to ${ide} (debian bug #366252)
2006-05-18 08:39:32 +00:00

50 lines
794 B
Bash
Executable File

#!/bin/sh
#
# This script is responsible for setting up the Xen Configuration file
#
# Steve
# --
# http://www.steve.org.uk/
prefix=$1
#
# Useful hook for testing.
#
output_dir=/etc/xen
if [ "${testing}" ]; then
if [ -d ${testing_dir} ]; then
output_dir=${testing_dir}
fi
fi
#
# Make sure we use ide style device names if required
#
device=sda
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 .. "
cat <<E_O_CFG > ${output_dir}/${hostname}.cfg
kernel = '${kernel}'
ramdisk = '${initrd}'
memory = ${memory}
name = '${hostname}'
root = '/dev/${device}1 ro'
disk = [ '${imagevbd},${device}1,w', '${swapvbd},${device}2,w' ]
${dyn}
E_O_CFG