Tue Jul 21 00:37:25 2009 UTC ()
Make rump_lfs work again: load fs components dynamically instead
of trying to link them in on the command line and get pounded by
link set failage.


(pooka)
diff -r1.10 -r1.11 src/usr.sbin/puffs/Makefile.inc
diff -r1.4 -r1.5 src/usr.sbin/puffs/rump_lfs/Makefile
diff -r1.3 -r1.4 src/usr.sbin/puffs/rump_lfs/rump_lfs.c

cvs diff -r1.10 -r1.11 src/usr.sbin/puffs/Makefile.inc (expand / switch to unified diff)

--- src/usr.sbin/puffs/Makefile.inc 2009/01/18 20:42:11 1.10
+++ src/usr.sbin/puffs/Makefile.inc 2009/07/21 00:37:25 1.11
@@ -1,42 +1,44 @@ @@ -1,42 +1,44 @@
1# $NetBSD: Makefile.inc,v 1.10 2009/01/18 20:42:11 he Exp $ 1# $NetBSD: Makefile.inc,v 1.11 2009/07/21 00:37:25 pooka Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4.include <bsd.sys.mk> 4.include <bsd.sys.mk>
5 5
6USE_FORT?= yes # network client 6USE_FORT?= yes # network client
7 7
8.if exists(${.CURDIR}/../../Makefile.inc) 8.if exists(${.CURDIR}/../../Makefile.inc)
9.include "${.CURDIR}/../../Makefile.inc" 9.include "${.CURDIR}/../../Makefile.inc"
10.endif 10.endif
11 11
12.ifdef ISRUMP 12.ifdef ISRUMP
13.ifdef MOUNTNAME 13.ifdef MOUNTNAME
14PROG= rump_${MOUNTNAME} 14PROG= rump_${MOUNTNAME}
15MAN= rump_${MOUNTNAME}.8 15MAN= rump_${MOUNTNAME}.8
16 16
17MOUNTDIR= ${.CURDIR}/../../../sbin 17MOUNTDIR= ${.CURDIR}/../../../sbin
18MOUNT= ${MOUNTDIR}/mount 18MOUNT= ${MOUNTDIR}/mount
19 19
20CPPFLAGS+= -I${MOUNTDIR}/mount_${MOUNTNAME} -I${MOUNT} -DMOUNT_NOMAIN 20CPPFLAGS+= -I${MOUNTDIR}/mount_${MOUNTNAME} -I${MOUNT} -DMOUNT_NOMAIN
21SRCS+= mount_${MOUNTNAME}.c rump_${MOUNTNAME}.c pathadj.c fattr.c 21SRCS+= mount_${MOUNTNAME}.c rump_${MOUNTNAME}.c pathadj.c fattr.c
22 22
23# on select archs use the kernel module directly, otherwise fallback 23# on select archs use the kernel module directly, otherwise fallback
24# to the rump library 24# to the rump library
 25.ifndef DONOTLINKLIBS
25.undef RUMPKMOD 26.undef RUMPKMOD
26.ifdef RUMPKMOD 27.ifdef RUMPKMOD
27OSRELEASE!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh 28OSRELEASE!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh
28KMODULEDIR= ${DESTDIR}/stand/${MACHINE}/${OSRELEASE}/modules/${MOUNTNAME} 29KMODULEDIR= ${DESTDIR}/stand/${MACHINE}/${OSRELEASE}/modules/${MOUNTNAME}
29LDADD+= ${KMODULEDIR}/${MOUNTNAME}.kmod 30LDADD+= ${KMODULEDIR}/${MOUNTNAME}.kmod
30.else 31.else
31LDADD+= -lrumpfs_${MOUNTNAME} 32LDADD+= -lrumpfs_${MOUNTNAME}
32.endif 33.endif
 34.endif
33 35
34.PATH: ${MOUNT} ${MOUNTDIR}/mount_${MOUNTNAME} 36.PATH: ${MOUNT} ${MOUNTDIR}/mount_${MOUNTNAME}
35.endif # MOUNTNAME 37.endif # MOUNTNAME
36 38
37LDADD+= -lp2k -lukfs -lrumpvfs -lrump -lrumpuser -lpuffs -lutil 39LDADD+= -lp2k -lukfs -lrumpvfs -lrump -lrumpuser -lpuffs -lutil
38LDADD+= -lpthread 40LDADD+= -lpthread
39 41
40DPADD+= ${LIBP2K} ${LIBUKFS} ${LIBRUMPVFS} ${LIBRUMP} ${LIBRUMPUSER} 42DPADD+= ${LIBP2K} ${LIBUKFS} ${LIBRUMPVFS} ${LIBRUMP} ${LIBRUMPUSER}
41DPADD+= ${LIBPUFFS} ${LIBUTIL} ${LIBPTHREAD} 43DPADD+= ${LIBPUFFS} ${LIBUTIL} ${LIBPTHREAD}
42.endif # ISRUMP 44.endif # ISRUMP

cvs diff -r1.4 -r1.5 src/usr.sbin/puffs/rump_lfs/Makefile (expand / switch to unified diff)

--- src/usr.sbin/puffs/rump_lfs/Makefile 2009/05/02 01:15:53 1.4
+++ src/usr.sbin/puffs/rump_lfs/Makefile 2009/07/21 00:37:25 1.5
@@ -1,13 +1,11 @@ @@ -1,13 +1,11 @@
1# $NetBSD: Makefile,v 1.4 2009/05/02 01:15:53 pooka Exp $ 1# $NetBSD: Makefile,v 1.5 2009/07/21 00:37:25 pooka Exp $
2# 2#
3 3
4.include <bsd.own.mk> 4.include <bsd.own.mk>
5 5
6MOUNTNAME= lfs 6MOUNTNAME= lfs
7 7DONOTLINKLIBS= # FFS and LFS loaded dynamically
8LDADD+= -lrumpfs_ffs 
9DPADD+= ${LIBRUMPFS_FFS} 
10 8
11ISRUMP= # don't deny it 9ISRUMP= # don't deny it
12 10
13.include <bsd.prog.mk> 11.include <bsd.prog.mk>

cvs diff -r1.3 -r1.4 src/usr.sbin/puffs/rump_lfs/rump_lfs.c (expand / switch to unified diff)

--- src/usr.sbin/puffs/rump_lfs/rump_lfs.c 2008/09/04 15:34:55 1.3
+++ src/usr.sbin/puffs/rump_lfs/rump_lfs.c 2009/07/21 00:37:25 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rump_lfs.c,v 1.3 2008/09/04 15:34:55 pooka Exp $ */ 1/* $NetBSD: rump_lfs.c,v 1.4 2009/07/21 00:37:25 pooka Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2008 Antti Kantee. All Rights Reserved. 4 * Copyright (c) 2008 Antti Kantee. All Rights Reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -26,34 +26,45 @@ @@ -26,34 +26,45 @@
26 */ 26 */
27 27
28#include <sys/types.h> 28#include <sys/types.h>
29#include <sys/mount.h> 29#include <sys/mount.h>
30 30
31#include <ufs/ufs/ufsmount.h> 31#include <ufs/ufs/ufsmount.h>
32 32
33#include <err.h> 33#include <err.h>
34#include <puffs.h> 34#include <puffs.h>
35#include <stdlib.h> 35#include <stdlib.h>
36#include <unistd.h> 36#include <unistd.h>
37 37
38#include <rump/p2k.h> 38#include <rump/p2k.h>
 39#include <rump/ukfs.h>
39 40
40#include "mount_lfs.h" 41#include "mount_lfs.h"
41 42
42int 43int
43main(int argc, char *argv[]) 44main(int argc, char *argv[])
44{ 45{
45 struct ufs_args args; 46 struct ufs_args args;
46 char canon_dev[MAXPATHLEN], canon_dir[MAXPATHLEN]; 47 char canon_dev[MAXPATHLEN], canon_dir[MAXPATHLEN];
47 int mntflags; 48 int mntflags;
48 int rv; 49 int rv;
49 50
50 setprogname(argv[0]); 51 setprogname(argv[0]);
51 52
 53 /*
 54 * Load FFS and LFS already here. we need both and link set
 55 * lossage does not allow them to be linked on the command line.
 56 */
 57 ukfs_init();
 58 if (ukfs_modload("/usr/lib/librumpfs_ffs.so") != 1)
 59 err(1, "modload ffs");
 60 if (ukfs_modload("/usr/lib/librumpfs_lfs.so") != 1)
 61 err(1, "modload lfs");
 62
52 mount_lfs_parseargs(argc, argv, &args, &mntflags, canon_dev, canon_dir); 63 mount_lfs_parseargs(argc, argv, &args, &mntflags, canon_dev, canon_dir);
53 rv = p2k_run_fs(MOUNT_LFS, canon_dev, canon_dir, mntflags, 64 rv = p2k_run_fs(MOUNT_LFS, canon_dev, canon_dir, mntflags,
54 &args, sizeof(args), 0); 65 &args, sizeof(args), 0);
55 if (rv) 66 if (rv)
56 err(1, "mount"); 67 err(1, "mount");
57 68
58 return 0; 69 return 0;
59} 70}