diff options
author | Ewan Mellor <ewan@xensource.com> | 2007-01-09 17:23:22 +0000 |
---|---|---|
committer | Ewan Mellor <ewan@xensource.com> | 2007-01-09 17:23:22 +0000 |
commit | e4658203b4ce1947e81e606d72ac9b1cfd2109fc (patch) | |
tree | 57de587b5de7e5fa1168415f7c89ee830f720e7c /tools/xm-test | |
parent | 319107a11b028d645c5b903e686fb3a64c6b5ea1 (diff) | |
download | xen-e4658203b4ce1947e81e606d72ac9b1cfd2109fc.tar.gz xen-e4658203b4ce1947e81e606d72ac9b1cfd2109fc.tar.bz2 xen-e4658203b4ce1947e81e606d72ac9b1cfd2109fc.zip |
Add needed modules to the ramdisk if the modules exist on the current system.
(i.e. the current system contains a modularized kernel)
Signed-off-by: Lynn Bendixsen <lbendixs@novell.com>
Diffstat (limited to 'tools/xm-test')
-rw-r--r-- | tools/xm-test/ramdisk/Makefile.am | 13 | ||||
-rw-r--r-- | tools/xm-test/ramdisk/skel/etc/init.d/rcS | 11 |
2 files changed, 22 insertions, 2 deletions
diff --git a/tools/xm-test/ramdisk/Makefile.am b/tools/xm-test/ramdisk/Makefile.am index b6c59d60e5..1de0d1423d 100644 --- a/tools/xm-test/ramdisk/Makefile.am +++ b/tools/xm-test/ramdisk/Makefile.am @@ -36,7 +36,12 @@ XMTEST_MAJ_VER = $(shell echo @PACKAGE_VERSION@ | perl -pe 's/(\d+)\.(\d+)\.\d+/ XMTEST_VER_IMG = initrd-$(XMTEST_MAJ_VER)-$(BR_ARCH).img XMTEST_DL_IMG = $(shell echo $(XMTEST_VER_IMG) | sed -e 's/x86_64/i386/g') -EXTRA_ROOT_DIRS = sys +EXTRA_ROOT_DIRS = sys modules + +BLKDRV = /lib/modules/$(shell uname -r)/kernel/drivers/xen/blkfront/xenblk.ko +NETDRV = /lib/modules/$(shell uname -r)/kernel/drivers/xen/netfront/xennet.ko +PKTDRV = /lib/modules/$(shell uname -r)/kernel/net/packet/af_packet.ko + if HVM all: initrd.img disk.img @@ -60,7 +65,11 @@ $(BR_IMG): $(BR_SRC) $(XMTEST_VER_IMG): $(BR_IMG) chmod a+x skel/etc/init.d/rcS - (cd skel; mkdir -p $(EXTRA_ROOT_DIRS); tar cf - .) \ + cd skel && mkdir -p $(EXTRA_ROOT_DIRS) + -[ -e "$(BLKDRV)" ] && cp $(BLKDRV) skel/modules + -[ -e "$(NETDRV)" ] && cp $(NETDRV) skel/modules + -[ -e "$(PKTDRV)" ] && cp $(PKTDRV) skel/modules + (cd skel; tar cf - .) \ | (cd $(BR_SRC)/$(BR_ROOT); tar xvf -) cd $(BR_SRC) && make cp $(BR_IMG) $(XMTEST_VER_IMG) diff --git a/tools/xm-test/ramdisk/skel/etc/init.d/rcS b/tools/xm-test/ramdisk/skel/etc/init.d/rcS index b3a92109e9..4c294f3dff 100644 --- a/tools/xm-test/ramdisk/skel/etc/init.d/rcS +++ b/tools/xm-test/ramdisk/skel/etc/init.d/rcS @@ -6,3 +6,14 @@ mount -a if uname -r | grep -q '^2.6'; then mount -t sysfs none /sys fi + +# If the block, net, and packet drivers are modules, we need to load them +if test -e /modules/xenblk.ko; then + insmod /modules/xenblk.ko > /dev/null 2>&1 +fi +if test -e /modules/xennet.ko; then + insmod /modules/xennet.ko > /dev/null 2>&1 +fi +if test -e /modules/af_packet.ko; then + insmod /modules/af_packet.ko > /dev/null 2>&1 +fi |