Module Name:    src
Committed By:   pooka
Date:           Mon Apr 26 23:47:25 UTC 2010

Modified Files:
        src/tests/fs/kernfs: Makefile t_basic.c

Log Message:
Undo infamous "mad \"scientist\"" experiment.  There is no need
for complicated application frobbing to get a kernel module loaded
into rump -- it will be loaded from the host automatically now.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/kernfs/Makefile \
    src/tests/fs/kernfs/t_basic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/kernfs/Makefile
diff -u src/tests/fs/kernfs/Makefile:1.1 src/tests/fs/kernfs/Makefile:1.2
--- src/tests/fs/kernfs/Makefile:1.1	Wed Mar 31 19:14:30 2010
+++ src/tests/fs/kernfs/Makefile	Mon Apr 26 23:47:25 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2010/03/31 19:14:30 pooka Exp $
+#	$NetBSD: Makefile,v 1.2 2010/04/26 23:47:25 pooka Exp $
 #
 
 TESTSDIR=	${TESTSBASE}/fs/kernfs
@@ -6,12 +6,9 @@
 
 TESTS_C=	t_basic
 
-# use kernel module binary on i386
-.if ${MACHINE} == "i386"
-OSRELEASE!=	${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh
-CPPFLAGS+=	-DMODDIR=\"/stand/${MACHINE}/${OSRELEASE}/modules/kernfs/\"
-CPPFLAGS+=	-DMODBASE=\"kernfs.kmod\"
-.else
+.include <bsd.own.mk>
+
+.ifndef RUMPKMOD
 LDADD+=	-lrumpfs_kernfs						# fs driver
 .endif
 LDADD+=	-lrumpvfs -lrump -lrumpuser -lpthread			# base
Index: src/tests/fs/kernfs/t_basic.c
diff -u src/tests/fs/kernfs/t_basic.c:1.1 src/tests/fs/kernfs/t_basic.c:1.2
--- src/tests/fs/kernfs/t_basic.c:1.1	Wed Mar 31 19:14:30 2010
+++ src/tests/fs/kernfs/t_basic.c	Mon Apr 26 23:47:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_basic.c,v 1.1 2010/03/31 19:14:30 pooka Exp $	*/
+/*	$NetBSD: t_basic.c,v 1.2 2010/04/26 23:47:25 pooka Exp $	*/
 
 #include <sys/types.h>
 #include <sys/mount.h>
@@ -34,66 +34,12 @@
 #define atf_tc_fail(...) errx(1, __VA_ARGS__)
 #endif
 
-#ifdef MODDIR
-/*
- * Try to load kernfs module (only on archs where ABIs match).
- * This is slightly ... inconvenient currently.  Let's try to improve
- * it in the future.
- *
- * steps:
- *   1) copy it into our working directory
- *   2) rename symbols
- *   3) lock & load
- */
-static int
-loadmodule(void)
-{
-	modctl_load_t ml;
-	int error;
-
-	if (system("cp " MODDIR MODBASE " .") == -1) {
-		warn("failed to copy %s into pwd", MODDIR MODBASE);
-		return errno;
-	}
-	if (chmod(MODBASE, 0666) == -1) {
-		warn("chmod %s", MODBASE);
-		return errno;
-	}
-	if (system("make -f /usr/src/sys/rump/Makefile.rump RUMP_SYMREN="
-	    MODBASE) == -1) {
-		warn("objcopy failed");
-		return errno;
-	}
-
-	if ((error = rump_pub_etfs_register(MODBASE, MODBASE, RUMP_ETFS_REG))) {
-		warn("rump etfs");
-		return error;
-	}
-
-	memset(&ml, 0, sizeof(ml));
-	ml.ml_filename = MODBASE;
-	if (rump_sys_modctl(MODCTL_LOAD, &ml) == -1) {
-		warn("module load");
-		return errno;
-	}
-
-	return 0;
-}
-#endif
-
 static void
 mountkernfs(void)
 {
 
 	rump_init();
 
-#ifdef MODDIR
-	if (loadmodule() != 0) {
-		/* failed?  fallback to dlopen() .... some day */
-		atf_tc_fail("could not load kernfs");
-	}
-#endif
-
 	if (rump_sys_mkdir("/kern", 0777) == -1)
 		atf_tc_fail_errno("mkdir /kern");
 	if (rump_sys_mount(MOUNT_KERNFS, "/kern", 0, NULL, 0) == -1)

Reply via email to