ia64/xen-unstable

changeset 13349:fb38d0794f50

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>
author Ewan Mellor <ewan@xensource.com>
date Tue Jan 09 17:23:22 2007 +0000 (2007-01-09)
parents 761f695043ff
children 56e2341f02c4
files tools/xm-test/ramdisk/Makefile.am tools/xm-test/ramdisk/skel/etc/init.d/rcS
line diff
     1.1 --- a/tools/xm-test/ramdisk/Makefile.am	Tue Jan 09 17:17:05 2007 +0000
     1.2 +++ b/tools/xm-test/ramdisk/Makefile.am	Tue Jan 09 17:23:22 2007 +0000
     1.3 @@ -36,7 +36,12 @@ XMTEST_MAJ_VER = $(shell echo @PACKAGE_V
     1.4  XMTEST_VER_IMG = initrd-$(XMTEST_MAJ_VER)-$(BR_ARCH).img
     1.5  XMTEST_DL_IMG = $(shell echo $(XMTEST_VER_IMG) | sed -e 's/x86_64/i386/g')
     1.6  
     1.7 -EXTRA_ROOT_DIRS = sys
     1.8 +EXTRA_ROOT_DIRS = sys modules
     1.9 +
    1.10 +BLKDRV = /lib/modules/$(shell uname -r)/kernel/drivers/xen/blkfront/xenblk.ko
    1.11 +NETDRV = /lib/modules/$(shell uname -r)/kernel/drivers/xen/netfront/xennet.ko
    1.12 +PKTDRV = /lib/modules/$(shell uname -r)/kernel/net/packet/af_packet.ko
    1.13 +
    1.14  
    1.15  if HVM
    1.16  all: initrd.img disk.img
    1.17 @@ -60,7 +65,11 @@ endif
    1.18  
    1.19  $(XMTEST_VER_IMG): $(BR_IMG)
    1.20  	chmod a+x skel/etc/init.d/rcS
    1.21 -	(cd skel; mkdir -p $(EXTRA_ROOT_DIRS); tar cf - .) \
    1.22 +	cd skel && mkdir -p $(EXTRA_ROOT_DIRS)
    1.23 +	-[ -e "$(BLKDRV)" ] && cp $(BLKDRV) skel/modules
    1.24 +	-[ -e "$(NETDRV)" ] && cp $(NETDRV) skel/modules
    1.25 +	-[ -e "$(PKTDRV)" ] && cp $(PKTDRV) skel/modules
    1.26 +	(cd skel; tar cf - .) \
    1.27  		| (cd $(BR_SRC)/$(BR_ROOT); tar xvf -)
    1.28  	cd $(BR_SRC) && make
    1.29  	cp $(BR_IMG) $(XMTEST_VER_IMG)
     2.1 --- a/tools/xm-test/ramdisk/skel/etc/init.d/rcS	Tue Jan 09 17:17:05 2007 +0000
     2.2 +++ b/tools/xm-test/ramdisk/skel/etc/init.d/rcS	Tue Jan 09 17:23:22 2007 +0000
     2.3 @@ -6,3 +6,14 @@ mount -a
     2.4  if uname -r | grep -q '^2.6'; then
     2.5  	mount -t sysfs none /sys
     2.6  fi
     2.7 +
     2.8 +# If the block, net, and packet drivers are modules, we need to load them
     2.9 +if test -e /modules/xenblk.ko; then
    2.10 +	insmod /modules/xenblk.ko > /dev/null 2>&1
    2.11 +fi
    2.12 +if test -e /modules/xennet.ko; then
    2.13 +	insmod /modules/xennet.ko > /dev/null 2>&1
    2.14 +fi
    2.15 +if test -e /modules/af_packet.ko; then
    2.16 +	insmod /modules/af_packet.ko > /dev/null 2>&1
    2.17 +fi