WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] [XM-TEST] Add modules for modularized kernels

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] [XM-TEST] Add modules for modularized kernels
From: "Lynn Bendixsen" <lbendixs@xxxxxxxxxx>
Date: Fri, 08 Dec 2006 14:53:45 -0700
Delivery-date: Fri, 08 Dec 2006 13:53:54 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Greetings,

The ramdisk built by xm-test does not work on modularized kernels (e.g. SUSE 
kernels).  
The attached patch remedies that by adding the required modules to the ramdisk. 
 For this patch to work it must be built on a machine booted to the same kernel 
as the target machine.


Signed- off- by: Lynn Bendixsen <lbendixs@xxxxxxxxxx>
---
Add needed modules to the ramdisk if the modules exist on the current system. 
(i.e. the current system contains a modularized kernel)

diff -ruN xm-test.3_0_4.untarred/ramdisk/Makefile.am xm-test/ramdisk/Makefile.am
--- xm-test.3_0_4.untarred/ramdisk/Makefile.am  2006-12-07 08:25:41.000000000 
-0700
+++ xm-test/ramdisk/Makefile.am 2006-12-07 08:40:38.000000000 -0700
@@ -35,7 +35,12 @@
 XMTEST_MAJ_VER = $(shell echo @PACKAGE_VERSION@ | perl -pe 
's/(\d+)\.(\d+)\.\d+/\1.\2/')
 XMTEST_VER_IMG = initrd-$(XMTEST_MAJ_VER)-$(BR_ARCH).img

-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
@@ -59,7 +64,11 @@

 $(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 -ruN xm-test.3_0_4.untarred/ramdisk/skel/etc/init.d/rcS 
xm-test/ramdisk/skel/etc/init.d/rcS
--- xm-test.3_0_4.untarred/ramdisk/skel/etc/init.d/rcS  2006-12-07 
08:25:41.000000000 -0700
+++ xm-test/ramdisk/skel/etc/init.d/rcS 2006-12-07 08:43:16.000000000 -0700
@@ -6,3 +6,14 @@
 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

---


Lynn Bendixsen
Software Engineer
lbendixs@xxxxxxxxxx
801-861-2887

Novell, Inc. 
SUSE* Linux Enterprise 10
Your Linux is ready 
http://www.novell.com/linux

Attachment: add-kernel-mods-to-ramdisk.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] [XM-TEST] Add modules for modularized kernels, Lynn Bendixsen <=