endif
-include hookslib.mak
+-include hookstarget.mak
libqemu.a: $(LIBOBJS)
rm -f $@
rm -f *.o *.a *~ $(PROGS) gen-op.h dyngen-opc.h op.h nwfpe/*.o fpu/*.o
rm -f *.d */*.d tcg/*.o
-install: all
+install: all install-hook
ifneq ($(PROGS),)
$(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
endif
--- /dev/null
+
+install-hook:
+ $(INSTALL_DIR) "$(DESTDIR)/$(bindir)"
+ $(INSTALL_DIR) "$(DESTDIR)/$(configdir)"
+ $(INSTALL_PROG) qemu-ifup "$(DESTDIR)/$(configdir)/"
--- /dev/null
+#!/bin/sh
+
+#. /etc/rc.d/init.d/functions
+#ulimit -c unlimited
+
+echo 'config qemu network with xen bridge for ' $*
+
+bridge=$2
+
+#
+# Old style bridge setup with netloop, used to have a bridge name
+# of xenbrX, enslaving pethX and vif0.X, and then configuring
+# eth0.
+#
+# New style bridge setup does not use netloop, so the bridge name
+# is ethX and the physical device is enslaved pethX
+#
+# So if...
+#
+# - User asks for xenbrX
+# - AND xenbrX doesn't exist
+# - AND there is a ethX device which is a bridge
+#
+# ..then we translate xenbrX to ethX
+#
+# This lets old config files work without modification
+#
+if [ ! -e "/sys/class/net/$bridge" ] && [ -z "${bridge##xenbr*}" ]
+then
+ if [ -e "/sys/class/net/eth${bridge#xenbr}/bridge" ]
+ then
+ bridge="eth${bridge#xenbr}"
+ fi
+fi
+
+ifconfig $1 0.0.0.0 up
+brctl addif $bridge $1 || true
datadir := $(subst qemu,xen/qemu,$(datadir))
docdir := $(subst qemu,xen/qemu,$(docdir))
mandir := $(subst share/man,share/xen/man,$(mandir))
+
+configdir := /etc/xen