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.diff -r1.10 -r1.11 src/usr.sbin/puffs/Makefile.inc
(pooka)
--- 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 | |||
6 | USE_FORT?= yes # network client | 6 | USE_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 | |
14 | PROG= rump_${MOUNTNAME} | 14 | PROG= rump_${MOUNTNAME} | |
15 | MAN= rump_${MOUNTNAME}.8 | 15 | MAN= rump_${MOUNTNAME}.8 | |
16 | 16 | |||
17 | MOUNTDIR= ${.CURDIR}/../../../sbin | 17 | MOUNTDIR= ${.CURDIR}/../../../sbin | |
18 | MOUNT= ${MOUNTDIR}/mount | 18 | MOUNT= ${MOUNTDIR}/mount | |
19 | 19 | |||
20 | CPPFLAGS+= -I${MOUNTDIR}/mount_${MOUNTNAME} -I${MOUNT} -DMOUNT_NOMAIN | 20 | CPPFLAGS+= -I${MOUNTDIR}/mount_${MOUNTNAME} -I${MOUNT} -DMOUNT_NOMAIN | |
21 | SRCS+= mount_${MOUNTNAME}.c rump_${MOUNTNAME}.c pathadj.c fattr.c | 21 | SRCS+= 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 | |
27 | OSRELEASE!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh | 28 | OSRELEASE!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh | |
28 | KMODULEDIR= ${DESTDIR}/stand/${MACHINE}/${OSRELEASE}/modules/${MOUNTNAME} | 29 | KMODULEDIR= ${DESTDIR}/stand/${MACHINE}/${OSRELEASE}/modules/${MOUNTNAME} | |
29 | LDADD+= ${KMODULEDIR}/${MOUNTNAME}.kmod | 30 | LDADD+= ${KMODULEDIR}/${MOUNTNAME}.kmod | |
30 | .else | 31 | .else | |
31 | LDADD+= -lrumpfs_${MOUNTNAME} | 32 | LDADD+= -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 | |||
37 | LDADD+= -lp2k -lukfs -lrumpvfs -lrump -lrumpuser -lpuffs -lutil | 39 | LDADD+= -lp2k -lukfs -lrumpvfs -lrump -lrumpuser -lpuffs -lutil | |
38 | LDADD+= -lpthread | 40 | LDADD+= -lpthread | |
39 | 41 | |||
40 | DPADD+= ${LIBP2K} ${LIBUKFS} ${LIBRUMPVFS} ${LIBRUMP} ${LIBRUMPUSER} | 42 | DPADD+= ${LIBP2K} ${LIBUKFS} ${LIBRUMPVFS} ${LIBRUMP} ${LIBRUMPUSER} | |
41 | DPADD+= ${LIBPUFFS} ${LIBUTIL} ${LIBPTHREAD} | 43 | DPADD+= ${LIBPUFFS} ${LIBUTIL} ${LIBPTHREAD} | |
42 | .endif # ISRUMP | 44 | .endif # ISRUMP |
--- 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 | |||
6 | MOUNTNAME= lfs | 6 | MOUNTNAME= lfs | |
7 | 7 | DONOTLINKLIBS= # FFS and LFS loaded dynamically | ||
8 | LDADD+= -lrumpfs_ffs | |||
9 | DPADD+= ${LIBRUMPFS_FFS} | |||
10 | 8 | |||
11 | ISRUMP= # don't deny it | 9 | ISRUMP= # don't deny it | |
12 | 10 | |||
13 | .include <bsd.prog.mk> | 11 | .include <bsd.prog.mk> |
--- 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 | |||
42 | int | 43 | int | |
43 | main(int argc, char *argv[]) | 44 | main(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 | } |