Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/fs/kernfs Undo infamous "mad \"scientist\"" experiment...



details:   https://anonhg.NetBSD.org/src/rev/4861a4a8ed52
branches:  trunk
changeset: 754301:4861a4a8ed52
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Apr 26 23:47:25 2010 +0000

description:
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.

diffstat:

 tests/fs/kernfs/Makefile  |  11 +++-----
 tests/fs/kernfs/t_basic.c |  56 +----------------------------------------------
 2 files changed, 5 insertions(+), 62 deletions(-)

diffs (101 lines):

diff -r 500851da06d8 -r 4861a4a8ed52 tests/fs/kernfs/Makefile
--- a/tests/fs/kernfs/Makefile  Mon Apr 26 23:43:36 2010 +0000
+++ b/tests/fs/kernfs/Makefile  Mon Apr 26 23:47:25 2010 +0000
@@ -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
diff -r 500851da06d8 -r 4861a4a8ed52 tests/fs/kernfs/t_basic.c
--- a/tests/fs/kernfs/t_basic.c Mon Apr 26 23:43:36 2010 +0000
+++ b/tests/fs/kernfs/t_basic.c Mon Apr 26 23:47:25 2010 +0000
@@ -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)



Home | Main Index | Thread Index | Old Index