/usr/sbin/dtc_change_bsd_kernel is in dtc-xen 0.5.17-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | #!/bin/sh
USAGE="Usage: $0 <xen id> <ram size> [normal|install]"
if [ $# -lt 3 ]; then
echo $USAGE
fi
# Things that often change
# Source the configuration in the config file!
if [ -f /etc/dtc-xen/dtc-xen.conf ] ; then
. /etc/dtc-xen/dtc-xen.conf
fi
# Figure out the LVM name from dtc-xen.conf
LVMNAME=`dtc-xen-volgroup`
[ -z "$LVMNAME" ] && {
echo "Could not determine volume group from which to provision the volume" 1>&2
echo "You might want to set provisioning_volgroup in dtc-xen.conf" 1>&2
exit 78
}
FSTAB_LVMNAME=`echo ${LVMNAME} | sed -e 's/-/--/g'`
#NODE_NUM=6501
#DEBIAN_REPOS="http://65.apt-proxy.gplhost.com:9999/debian"
#NETMASK=255.255.255.0
#NETWORK=202.124.18.0
#BROADCAST=202.124.18.255
#GATEWAY=202.124.18.1
# Figure out the VPS mount point
if [ -n "$provisioning_mount_point" ]
then
VPSGLOBPATH="$provisioning_mount_point"
else
VPSGLOBPATH="$VPS_MOUNTPOINT"
fi
INSTALL_KERNELPATH="${bsd_install_kernel_path}"
NORMAL_KERNELPATH="${bsd_kernel_path}"
# Things that most of then time don't change
VPSNUM=$1
VPSNAME=xen${VPSNUM}
VPSHOSTNAME=xen${NODE_NUM}${VPSNUM}
RAMSIZE=$2
KERNEL_TYPE=$3
ALL_IPADDRS=$4
MAC_ADDR=${vps_mac_prefix}:${VPSNUM}
case "$KERNEL_TYPE" in
"install")
KERNELPATH=$INSTALL_KERNELPATH
;;
"normal")
KERNELPATH=$NORMAL_KERNELPATH
;;
*)
echo $USAGE;
exit 1
;;
esac
if [ ! -z "${MAC_ADDR}" ] ; then
XEN_WRITE_MAC="mac=${MAC_ADDR}, "
else
XEN_WRITE_MAC=""
fi
echo "kernel = \"${KERNELPATH}\"
memory = ${RAMSIZE}
name = \"${VPSNAME}\"
vif = [ '${XEN_WRITE_MAC}ip=${ALL_IPADDRS}' ]
disk = [ 'phy:/dev/mapper/${FSTAB_LVMNAME}-${VPSNAME},0x3,w' ]
" >/etc/xen/${VPSNAME}
if [ ! -e /etc/xen/auto/${VPSNAME} ] ; then
ln -s ../${VPSNAME} /etc/xen/auto/${VPSNAME}
fi
|