summaryrefslogtreecommitdiffstats
path: root/recipes-extended/xen/files/xenminiinit.sh
blob: 22d5008f5245063da9365a12a5f0312fed04463b (plain)
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
#!/bin/sh

# This is currently a very raw init script for xen-minimal
# Feel free to expand and make more useful

STARTDOMAINS="rtos freedos"

# Shutdown Xen domains
for foo in $STARTDOMAINS ; do
	xl destroy $foo
done

# Stop and Startup Xen common
if test -f /etc/init.d/xencommons ; then
	echo Using Xen standard init scripts
#	/etc/init.d/libvirtd stop
#	/etc/init.d/xendomains stop
#	/etc/init.d/xencommons stop
#
#	/etc/init.d/xencommons start
#	/etc/init.d/libvirtd start
#	/etc/init.d/xendomains start
else
	echo Skipping Xen standard init scripts

	killall xenstored
	killall xenconsoled
	umount /proc/xen

	# Fix up device nodes
	if pidof udevd ; then 
		echo Udev running.  Skipping mdev fixups
	else
		rm -rf /dev/xen
		mkdir /dev/xen
		for foo in /dev/xen!* ; do ln -s $foo /dev/xen/`echo $foo | cut -f 2 -d '!'` ; done
	fi

	mount -t xenfs xenfs /proc/xen
	xenstored --pid-file=/var/run/xenstored.pid
	xenstore-write "/local/domain/0/name" "Domain-0"
	xenconsoled --pid-file=/var/run/xenconsoled.pid
fi

# Remove the images we have
cd /tmp
rm -rf xen

# Grab and start the VM images
mkdir xen
cd xen
for foo in $STARTDOMAINS ; do
	wget http://candidates/xen/images/$foo.zip
	unzip $foo.zip
	xl create $foo.cfg
done

# Fix up the Webmin server with a new admin password
test -f /usr/libexec/webmin/changepass.pl && /usr/libexec/webmin/changepass.pl /etc/webmin admin password