aboutsummaryrefslogtreecommitdiffstats
path: root/stubdom
diff options
context:
space:
mode:
Diffstat (limited to 'stubdom')
-rw-r--r--stubdom/Makefile10
-rw-r--r--stubdom/stubdom-dm31
2 files changed, 24 insertions, 17 deletions
diff --git a/stubdom/Makefile b/stubdom/Makefile
index cd7234980d..cdedf8f2ca 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -77,8 +77,12 @@ TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
TARGETS=ioemu c caml grub
+STUBDOMPATH="stubdompath.sh"
+genpath-target = $(call buildmakevars2file,$(STUBDOMPATH))
+$(eval $(genpath-target))
+
.PHONY: all
-all: build
+all: genpath build
ifeq ($(STUBDOM_SUPPORTED),1)
build: ioemu-stubdom c-stubdom pv-grub
else
@@ -270,8 +274,7 @@ libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a:: c
ioemu: cross-zlib cross-libpci libxc
[ -f ioemu/config-host.mak ] || \
( $(absolutify_xen_root); \
- PREFIX=$(PREFIX); \
- export PREFIX; \
+ $(buildmakevars2shellvars); \
cd ioemu ; \
LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) \
TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" \
@@ -374,6 +377,7 @@ clean:
$(MAKE) -C caml clean
$(MAKE) -C c clean
rm -fr grub-$(XEN_TARGET_ARCH)
+ rm -f $(STUBDOMPATH)
[ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) -C libxc-$(XEN_TARGET_ARCH) clean
-[ ! -d ioemu ] || $(MAKE) -C ioemu clean
diff --git a/stubdom/stubdom-dm b/stubdom/stubdom-dm
index 5161e1d0ee..76068a0bd0 100644
--- a/stubdom/stubdom-dm
+++ b/stubdom/stubdom-dm
@@ -5,6 +5,9 @@
# dm script around stubdomains.
#
+. ./stubdompath.sh
+stubdom_configdir="${XEN_CONFIG_DIR}/stubdoms"
+
# To fit xterms nicely
height=339
@@ -80,7 +83,7 @@ term() {
(
[ -n "$vncpid" ] && kill -9 $vncpid
xm destroy $domname-dm
- rm /etc/xen/stubdoms/$domname-dm
+ rm ${stubdom_configdir}/$domname-dm
) &
# We need to exit immediately so as to let xend do the commands above
exit 0
@@ -97,9 +100,9 @@ do
done
# Generate stubdom config file
-mkdir -p /etc/xen/stubdoms &>/dev/null
-echo "#This file is autogenerated, edit $domname instead!" > /etc/xen/stubdoms/$domname-dm
-echo "kernel = '/usr/lib/xen/boot/ioemu-stubdom.gz'" >> /etc/xen/stubdoms/$domname-dm
+mkdir -p ${stubdom_configdir} &>/dev/null
+echo "#This file is autogenerated, edit $domname instead!" > ${stubdom_configdir}/$domname-dm
+echo "kernel = '${XENFIRMWAREDIR}/ioemu-stubdom.gz'" >> ${stubdom_configdir}/$domname-dm
vfb="sdl=$sdl, opengl=$opengl"
test "$DISPLAY" && vfb="$vfb, display=$DISPLAY"
@@ -110,9 +113,9 @@ test "$vncpasswd" && vfb="$vfb, vncpasswd=$vncpasswd"
test "$keymap" && vfb="$vfb, keymap=$keymap"
test "$monitor" && vfb="$vfb, monitor=$monitor"
test "$serial" && vfb="$vfb, serial=$serial"
-echo "vfb = ['$vfb']" >> /etc/xen/stubdoms/$domname-dm
+echo "vfb = ['$vfb']" >> ${stubdom_configdir}/$domname-dm
-echo -n "disk = [ " >> /etc/xen/stubdoms/$domname-dm
+echo -n "disk = [ " >> ${stubdom_configdir}/$domname-dm
j=0
for i in `xenstore-ls /local/domain/$domid/device/vbd | grep 'backend =' | awk '{print $3}'`
do
@@ -126,13 +129,13 @@ do
vbd_devtype=`xenstore-read $vbd_front/device-type`
if [ $j -ne 0 ]
then
- echo -n "," >> /etc/xen/stubdoms/$domname-dm
+ echo -n "," >> ${stubdom_configdir}/$domname-dm
fi
- echo -n "'$vbd_type:$vbd_disk,$vbd_dev:$vbd_devtype,$vbd_mode'" >> /etc/xen/stubdoms/$domname-dm
+ echo -n "'$vbd_type:$vbd_disk,$vbd_dev:$vbd_devtype,$vbd_mode'" >> ${stubdom_configdir}/$domname-dm
j=$(( $j + 1 ))
done
-echo " ] " >> /etc/xen/stubdoms/$domname-dm
-echo -n "vif = [ " >> /etc/xen/stubdoms/$domname-dm
+echo " ] " >> ${stubdom_configdir}/$domname-dm
+echo -n "vif = [ " >> ${stubdom_configdir}/$domname-dm
j=0
for i in `xenstore-ls /local/domain/$domid/device/vif | grep 'backend =' | awk '{print $3}'`
do
@@ -141,13 +144,13 @@ do
vif_mac=`xenstore-read $i/mac`
if [ $j -ne 0 ]
then
- echo -n "," >> /etc/xen/stubdoms/$domname-dm
+ echo -n "," >> ${stubdom_configdir}/$domname-dm
fi
- echo -n "'mac=$vif_mac'" >> /etc/xen/stubdoms/$domname-dm
+ echo -n "'mac=$vif_mac'" >> ${stubdom_configdir}/$domname-dm
j=$(( $j + 1 ))
done
-echo " ] " >> /etc/xen/stubdoms/$domname-dm
-creation="xm create -c /etc/xen/stubdoms/$domname-dm target=$domid memory=32 extra=\"$extra\""
+echo " ] " >> ${stubdom_configdir}/$domname-dm
+creation="xm create -c ${stubdom_configdir}/$domname-dm target=$domid memory=32 extra=\"$extra\""
(while true ; do sleep 60 ; done) | /bin/sh -c "$creation" &
#xterm -geometry +0+0 -e /bin/sh -c "$creation ; echo ; echo press ENTER to shut down ; read" &