Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 53 lines (47 sloc) 1.18 KB
#!/bin/sh
#
# /etc/init.d/init.d-sdkinit
# Creates some fake information for the SDK fake xapi
#
# chkconfig: 345 21 00
# description: Populate xensource-inventory
. /etc/init.d/functions
case "$1" in
start)
# This is a run-once script!
if [ -e @INVENTORY@ ]; then
exit 0
fi
echo -n "Starting sdkinit: "
cat /proc/cpuinfo > @ETCDIR@/boot_time_cpu
touch @ETCDIR@/boot_time_info_updated
if [ -d /proc/xen ]; then
# Set the domain0 uuid to the real uuid of this SDK VM
DOMID=`/usr/bin/xenstore-read domid`
VMUUID=`/usr/bin/xenstore-read /local/domain/$DOMID/vm | cut -c5-`
DOM0UUID=$VMUUID
else
# If booting HVM we have no uuid knowledge
DOM0UUID=`uuidgen`
fi
HOSTUUID=`uuidgen`
INSTALLDATE=`date "+%Y-%m-%d %H:%M:%S.000000"`
(cat @INVENTORY@.skel; cat << EOF) > @INVENTORY@
KERNEL_VERSION='2.6.18-92.1.6.el5.xs4.1.920.367.638xen'
XEN_VERSION='3.2.1'
INSTALLATION_DATE='${INSTALLDATE}'
PRIMARY_DISK='/dev/sda'
BACKUP_PARTITION='/dev/sda2'
INSTALLATION_UUID='${HOSTUUID}'
CONTROL_DOMAIN_UUID='${DOM0UUID}'
DEFAULT_SR_PHYSDEVS='/dev/sda3'
DOM0_MEM='752'
EOF
echo "[ OK ]"
;;
stop)
;;
*)
echo "Usage: $0 [start|stop]"
;;
esac
Jump to Line
Something went wrong with that request. Please try again.