Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump. breakdown of commit: * install relevant headers into /usr/include/rump * build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern from src/lib and install as librumpuser and librump, respectively + this retains the ability to test a librump build with just the kernel sources at hand * move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib for general consumption, they are not kernel-space dwellers anyway * build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs * add chapter 3 manual pages for rump, rumpuser, ukfs and p2k * build and install userspace kernel file system daemons if MKPUFFS=yes is spexified * retire fsconsole for now, it will make a comeback with an actually implemented version shortly
This commit is contained in:
parent
4ca1cae072
commit
bdf6e0b034
6
Makefile
6
Makefile
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile,v 1.254 2008/07/29 04:49:43 mrg Exp $
|
||||
# $NetBSD: Makefile,v 1.255 2008/07/29 13:17:40 pooka Exp $
|
||||
|
||||
#
|
||||
# This is the top-level makefile for building NetBSD. For an outline of
|
||||
|
@ -88,6 +88,7 @@
|
|||
# do-lib: builds and installs prerequisites from lib.
|
||||
# do-gnu-lib: builds and installs prerequisites from gnu/lib.
|
||||
# do-external-lib: builds and installs prerequisites from external/lib.
|
||||
# do-sys-rump-fs-lib: builds and installs prerequisites from sys/rump/fs/lib
|
||||
# do-ld.so: builds and installs prerequisites from libexec/ld.*_so.
|
||||
# do-build: builds and installs the entire system.
|
||||
# do-x11: builds and installs X11R6 from src/x11 if ${MKX11} != "no"
|
||||
|
@ -207,6 +208,7 @@ BUILDTARGETS+= do-libgcc
|
|||
.endif
|
||||
BUILDTARGETS+= do-lib-libc
|
||||
BUILDTARGETS+= do-lib do-gnu-lib do-external-lib
|
||||
BUILDTARGETS+= do-sys-rump-fs-lib
|
||||
BUILDTARGETS+= do-ld.so
|
||||
BUILDTARGETS+= do-build
|
||||
.if ${MKX11} != "no"
|
||||
|
@ -356,7 +358,7 @@ do-${targ}: .PHONY ${targ}
|
|||
@true
|
||||
.endfor
|
||||
|
||||
.for dir in tools tools/compat lib/csu gnu/lib/crtstuff${LIBGCC_EXT} gnu/lib/libgcc${LIBGCC_EXT} lib/libc lib/libdes lib gnu/lib external/lib
|
||||
.for dir in tools tools/compat lib/csu gnu/lib/crtstuff${LIBGCC_EXT} gnu/lib/libgcc${LIBGCC_EXT} lib/libc lib/libdes lib gnu/lib external/lib sys/rump/fs/lib
|
||||
do-${dir:S/\//-/g}: .PHONY .MAKE
|
||||
.for targ in dependall install
|
||||
${MAKEDIRTARGET} ${dir} ${targ}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: mi,v 1.760 2008/07/28 20:17:46 pooka Exp $
|
||||
# $NetBSD: mi,v 1.761 2008/07/29 13:17:40 pooka Exp $
|
||||
#
|
||||
# Note: Don't delete entries from here - mark them as "obsolete" instead,
|
||||
# unless otherwise stated below.
|
||||
|
@ -894,6 +894,7 @@
|
|||
./usr/include/readline base-c-usr
|
||||
./usr/include/rpc base-c-usr
|
||||
./usr/include/rpcsvc base-c-usr
|
||||
./usr/include/rump base-c-usr
|
||||
./usr/include/security base-c-usr
|
||||
./usr/include/ss base-obsolete obsolete
|
||||
./usr/include/ssp base-c-usr
|
||||
|
@ -1305,6 +1306,17 @@
|
|||
./usr/sbin/rtadvd base-router-bin use_inet6
|
||||
./usr/sbin/rtquery base-netutil-bin
|
||||
./usr/sbin/rtsold base-netutil-bin inet6
|
||||
./usr/sbin/rump_cd9660 base-miscfs-bin puffs
|
||||
./usr/sbin/rump_efs base-miscfs-bin puffs
|
||||
./usr/sbin/rump_ext2fs base-miscfs-bin puffs
|
||||
./usr/sbin/rump_ffs base-miscfs-bin puffs
|
||||
./usr/sbin/rump_hfs base-miscfs-bin puffs
|
||||
./usr/sbin/rump_lfs base-miscfs-bin puffs
|
||||
./usr/sbin/rump_msdos base-miscfs-bin puffs
|
||||
./usr/sbin/rump_ntfs base-miscfs-bin puffs
|
||||
./usr/sbin/rump_syspuffs base-miscfs-bin puffs
|
||||
./usr/sbin/rump_tmpfs base-miscfs-bin puffs
|
||||
./usr/sbin/rump_udf base-miscfs-bin puffs
|
||||
./usr/sbin/rwhod base-netutil-bin
|
||||
./usr/sbin/sa base-sysutil-bin
|
||||
./usr/sbin/screenblank base-sysutil-bin
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: shl.elf,v 1.149 2008/06/22 15:44:45 christos Exp $
|
||||
# $NetBSD: shl.elf,v 1.150 2008/07/29 13:17:40 pooka Exp $
|
||||
#
|
||||
# Note: Do not mark "old" major and major.minor shared libraries as
|
||||
# "obsolete"; just remove the entry, as third-party applications
|
||||
|
@ -178,6 +178,8 @@
|
|||
./usr/lib/libobjc.so.2 base-sys-shlib gcc
|
||||
./usr/lib/libossaudio.so base-sys-shlib
|
||||
./usr/lib/libossaudio.so.0 base-sys-shlib
|
||||
./usr/lib/libp2k.so base-sys-shlib puffs
|
||||
./usr/lib/libp2k.so.0 base-sys-shlib puffs
|
||||
./usr/lib/libpam.so base-sys-shlib pam
|
||||
./usr/lib/libpam.so.1 base-sys-shlib pam
|
||||
./usr/lib/libpcap.so base-net-shlib
|
||||
|
@ -206,6 +208,34 @@
|
|||
./usr/lib/librpcsvc.so.0 base-net-shlib
|
||||
./usr/lib/librt.so base-sys-shlib
|
||||
./usr/lib/librt.so.0 base-sys-shlib
|
||||
./usr/lib/librump.so base-sys-shlib
|
||||
./usr/lib/librump.so.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_cd9660fs.so base-sys-shlib
|
||||
./usr/lib/librumpfs_cd9660fs.so.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_efs.so base-sys-shlib
|
||||
./usr/lib/librumpfs_efs.so.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_ext2fs.so base-sys-shlib
|
||||
./usr/lib/librumpfs_ext2fs.so.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_ffs.so base-sys-shlib
|
||||
./usr/lib/librumpfs_ffs.so.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_hfs.so base-sys-shlib
|
||||
./usr/lib/librumpfs_hfs.so.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_lfs.so base-sys-shlib
|
||||
./usr/lib/librumpfs_lfs.so.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_msdosfs.so base-sys-shlib
|
||||
./usr/lib/librumpfs_msdosfs.so.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_ntfs.so base-sys-shlib
|
||||
./usr/lib/librumpfs_ntfs.so.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_syspuffs.so base-sys-shlib
|
||||
./usr/lib/librumpfs_syspuffs.so.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_tmpfs.so base-sys-shlib
|
||||
./usr/lib/librumpfs_tmpfs.so.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_udf.so base-sys-shlib
|
||||
./usr/lib/librumpfs_udf.so.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_ufs.so base-sys-shlib
|
||||
./usr/lib/librumpfs_ufs.so.0 base-sys-shlib
|
||||
./usr/lib/librumpuser.so base-sys-shlib
|
||||
./usr/lib/librumpuser.so.0 base-sys-shlib
|
||||
./usr/lib/libsdp.so base-sys-shlib
|
||||
./usr/lib/libsdp.so.2 base-sys-shlib
|
||||
./usr/lib/libskey.so base-sys-shlib skey
|
||||
|
@ -225,6 +255,8 @@
|
|||
./usr/lib/libtermcap.so.0 base-sys-shlib
|
||||
./usr/lib/libtermlib.so base-sys-shlib
|
||||
./usr/lib/libtermlib.so.0 base-sys-shlib
|
||||
./usr/lib/libukfs.so base-sys-shlib
|
||||
./usr/lib/libukfs.so.0 base-sys-shlib
|
||||
./usr/lib/libusbhid.so base-sys-shlib
|
||||
./usr/lib/libusbhid.so.1 base-sys-shlib
|
||||
./usr/lib/libutil.so base-sys-shlib
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: shl.mi,v 1.440 2008/06/30 19:04:00 matt Exp $
|
||||
# $NetBSD: shl.mi,v 1.441 2008/07/29 13:17:40 pooka Exp $
|
||||
#
|
||||
# Note: Don't delete entries from here - mark them as "obsolete" instead,
|
||||
# unless otherwise stated below.
|
||||
|
@ -96,6 +96,7 @@
|
|||
./usr/lib/libobjc.so.2.0 base-sys-shlib gcc=3
|
||||
./usr/lib/libobjc.so.2.1 base-sys-shlib gcc=4
|
||||
./usr/lib/libossaudio.so.0.0 base-sys-shlib
|
||||
./usr/lib/libp2k.so.0.0 base-sys-shlib puffs
|
||||
./usr/lib/libpam.so.1.0 base-sys-shlib pam
|
||||
./usr/lib/libpcap.so.2.0 base-net-shlib
|
||||
./usr/lib/libpci.so.1.0 base-sys-shlib
|
||||
|
@ -110,6 +111,20 @@
|
|||
./usr/lib/libroken.so.13.0 base-krb5-shlib kerberos
|
||||
./usr/lib/librpcsvc.so.0.0 base-net-shlib
|
||||
./usr/lib/librt.so.0.0 base-sys-shlib
|
||||
./usr/lib/librump.so.0.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_cd9660fs.so.0.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_efs.so.0.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_ext2fs.so.0.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_ffs.so.0.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_hfs.so.0.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_lfs.so.0.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_msdosfs.so.0.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_ntfs.so.0.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_syspuffs.so.0.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_tmpfs.so.0.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_udf.so.0.0 base-sys-shlib
|
||||
./usr/lib/librumpfs_ufs.so.0.0 base-sys-shlib
|
||||
./usr/lib/librumpuser.so.0.0 base-sys-shlib
|
||||
./usr/lib/libsdp.so.2.0 base-sys-shlib
|
||||
./usr/lib/libskey.so.1.0 base-sys-shlib skey
|
||||
./usr/lib/libsl.so.3.0 base-krb5-shlib kerberos
|
||||
|
@ -120,6 +135,7 @@
|
|||
./usr/lib/libstdc++.so.6.0 base-sys-shlib gcc=4
|
||||
./usr/lib/libtermcap.so.0.6 base-sys-shlib
|
||||
./usr/lib/libtermlib.so.0.6 base-sys-shlib
|
||||
./usr/lib/libukfs.so.0.0 base-sys-shlib
|
||||
./usr/lib/libusbhid.so.1.0 base-sys-shlib
|
||||
./usr/lib/libutil.so.7.15 base-sys-shlib
|
||||
./usr/lib/libwrap.so.0.2 base-net-shlib
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: mi,v 1.1169 2008/07/28 12:42:12 pooka Exp $
|
||||
# $NetBSD: mi,v 1.1170 2008/07/29 13:17:40 pooka Exp $
|
||||
#
|
||||
# Note: don't delete entries from here - mark them as "obsolete" instead.
|
||||
#
|
||||
|
@ -1825,6 +1825,13 @@
|
|||
./usr/include/rpcsvc/ypclnt.h comp-c-include
|
||||
./usr/include/rpcsvc/yppasswd.h comp-c-include
|
||||
./usr/include/rpcsvc/yppasswd.x comp-c-include
|
||||
./usr/include/rump/p2k.h comp-c-include puffs
|
||||
./usr/include/rump/rump.h comp-c-include
|
||||
./usr/include/rump/rump_syscalls.h comp-c-include
|
||||
./usr/include/rump/rumpdefs.h comp-c-include
|
||||
./usr/include/rump/rumpuser.h comp-c-include
|
||||
./usr/include/rump/rumpvnode_if.h comp-c-include
|
||||
./usr/include/rump/ukfs.h comp-c-include
|
||||
./usr/include/sa.h comp-obsolete obsolete
|
||||
./usr/include/sched.h comp-c-include
|
||||
./usr/include/sdp.h comp-c-include
|
||||
|
@ -2313,6 +2320,8 @@
|
|||
./usr/lib/libobjc_p.a comp-objc-proflib profile
|
||||
./usr/lib/libossaudio.a comp-c-lib
|
||||
./usr/lib/libossaudio_p.a comp-c-proflib profile
|
||||
./usr/lib/libp2k.a comp-c-lib puffs
|
||||
./usr/lib/libp2k_p.a comp-c-proflib puffs,profile
|
||||
./usr/lib/libpam.a comp-c-lib pam
|
||||
./usr/lib/libpcap.a comp-c-lib
|
||||
./usr/lib/libpcap_p.a comp-c-proflib profile
|
||||
|
@ -2341,6 +2350,34 @@
|
|||
./usr/lib/librpcsvc_p.a comp-c-proflib profile
|
||||
./usr/lib/librt.a comp-c-lib
|
||||
./usr/lib/librt_p.a comp-c-proflib profile
|
||||
./usr/lib/librump.a comp-c-lib
|
||||
./usr/lib/librump_p.a comp-c-proflib profile
|
||||
./usr/lib/librumpfs_cd9660fs.a comp-c-lib
|
||||
./usr/lib/librumpfs_cd9660fs_p.a comp-c-proflib profile
|
||||
./usr/lib/librumpfs_efs.a comp-c-lib
|
||||
./usr/lib/librumpfs_efs_p.a comp-c-proflib profile
|
||||
./usr/lib/librumpfs_ext2fs.a comp-c-lib
|
||||
./usr/lib/librumpfs_ext2fs_p.a comp-c-proflib profile
|
||||
./usr/lib/librumpfs_ffs.a comp-c-lib
|
||||
./usr/lib/librumpfs_ffs_p.a comp-c-proflib profile
|
||||
./usr/lib/librumpfs_hfs.a comp-c-lib
|
||||
./usr/lib/librumpfs_hfs_p.a comp-c-proflib profile
|
||||
./usr/lib/librumpfs_lfs.a comp-c-lib
|
||||
./usr/lib/librumpfs_lfs_p.a comp-c-proflib profile
|
||||
./usr/lib/librumpfs_msdosfs.a comp-c-lib
|
||||
./usr/lib/librumpfs_msdosfs_p.a comp-c-proflib profile
|
||||
./usr/lib/librumpfs_ntfs.a comp-c-lib
|
||||
./usr/lib/librumpfs_ntfs_p.a comp-c-proflib profile
|
||||
./usr/lib/librumpfs_syspuffs.a comp-c-lib
|
||||
./usr/lib/librumpfs_syspuffs_p.a comp-c-proflib profile
|
||||
./usr/lib/librumpfs_tmpfs.a comp-c-lib
|
||||
./usr/lib/librumpfs_tmpfs_p.a comp-c-proflib profile
|
||||
./usr/lib/librumpfs_udf.a comp-c-lib
|
||||
./usr/lib/librumpfs_udf_p.a comp-c-proflib profile
|
||||
./usr/lib/librumpfs_ufs.a comp-c-lib
|
||||
./usr/lib/librumpfs_ufs_p.a comp-c-proflib profile
|
||||
./usr/lib/librumpuser.a comp-c-lib
|
||||
./usr/lib/librumpuser_p.a comp-c-proflib profile
|
||||
./usr/lib/libsdp.a comp-c-lib
|
||||
./usr/lib/libsdp_p.a comp-c-proflib profile
|
||||
./usr/lib/libskey.a comp-c-lib skey
|
||||
|
@ -2367,6 +2404,8 @@
|
|||
./usr/lib/libtermcap_p.a comp-c-proflib profile
|
||||
./usr/lib/libtermlib.a comp-c-lib
|
||||
./usr/lib/libtermlib_p.a comp-c-proflib profile
|
||||
./usr/lib/libukfs.a comp-c-lib
|
||||
./usr/lib/libukfs_p.a comp-c-proflib profile
|
||||
./usr/lib/libusb.a comp-obsolete obsolete
|
||||
./usr/lib/libusb_p.a comp-obsolete obsolete
|
||||
./usr/lib/libusb_pic.a comp-obsolete obsolete
|
||||
|
@ -3180,6 +3219,17 @@
|
|||
./usr/libdata/debug/usr/sbin/rpc.statd.debug comp-nfsserver-debug debug
|
||||
./usr/libdata/debug/usr/sbin/rpc.yppasswdd.debug comp-nis-debug yp,debug
|
||||
./usr/libdata/debug/usr/sbin/rpcbind.debug comp-rpcbind-debug debug
|
||||
./usr/libdata/debug/usr/sbin/rump_cd9660.debug comp-sysutil-debug debug,puffs
|
||||
./usr/libdata/debug/usr/sbin/rump_efs.debug comp-sysutil-debug debug,puffs
|
||||
./usr/libdata/debug/usr/sbin/rump_ext2fs.debug comp-sysutil-debug debug,puffs
|
||||
./usr/libdata/debug/usr/sbin/rump_ffs.debug comp-sysutil-debug debug,puffs
|
||||
./usr/libdata/debug/usr/sbin/rump_hfs.debug comp-sysutil-debug debug,puffs
|
||||
./usr/libdata/debug/usr/sbin/rump_lfs.debug comp-sysutil-debug debug,puffs
|
||||
./usr/libdata/debug/usr/sbin/rump_msdos.debug comp-sysutil-debug debug,puffs
|
||||
./usr/libdata/debug/usr/sbin/rump_ntfs.debug comp-sysutil-debug debug,puffs
|
||||
./usr/libdata/debug/usr/sbin/rump_syspuffs.debug comp-sysutil-debug debug,puffs
|
||||
./usr/libdata/debug/usr/sbin/rump_tmpfs.debug comp-sysutil-debug debug,puffs
|
||||
./usr/libdata/debug/usr/sbin/rump_udf.debug comp-sysutil-debug debug,puffs
|
||||
./usr/libdata/debug/usr/sbin/rtadvd.debug comp-router-debug use_inet6,debug
|
||||
./usr/libdata/debug/usr/sbin/rtquery.debug comp-netutil-debug debug
|
||||
./usr/libdata/debug/usr/sbin/rtsold.debug comp-netutil-debug inet6,debug
|
||||
|
@ -3278,6 +3328,7 @@
|
|||
./usr/libdata/lint/llib-lmilter.ln comp-obsolete obsolete
|
||||
./usr/libdata/lint/llib-lntp.ln comp-obsolete obsolete
|
||||
./usr/libdata/lint/llib-lossaudio.ln comp-c-lintlib lint
|
||||
./usr/libdata/lint/llib-lp2k.ln comp-c-lintlib lint,puffs
|
||||
./usr/libdata/lint/llib-lpam.ln comp-c-lintlib lint,pam
|
||||
./usr/libdata/lint/llib-lpcap.ln comp-c-lintlib lint
|
||||
./usr/libdata/lint/llib-lpci.ln comp-c-lintlib lint
|
||||
|
@ -3292,6 +3343,7 @@
|
|||
./usr/libdata/lint/llib-lrmt.ln comp-c-lintlib lint
|
||||
./usr/libdata/lint/llib-lrpcsvc.ln comp-c-lintlib lint
|
||||
./usr/libdata/lint/llib-lrt.ln comp-c-lintlib lint
|
||||
./usr/libdata/lint/llib-lrumpuser.ln comp-c-lintlib lint
|
||||
./usr/libdata/lint/llib-lsdp.ln comp-c-lintlib lint
|
||||
./usr/libdata/lint/llib-lskey.ln comp-c-lintlib lint,skey
|
||||
./usr/libdata/lint/llib-lsm.ln comp-obsolete obsolete
|
||||
|
@ -3301,6 +3353,7 @@
|
|||
./usr/libdata/lint/llib-lstdc.ln comp-c-lintlib lint
|
||||
./usr/libdata/lint/llib-ltelnet.ln comp-obsolete obsolete
|
||||
./usr/libdata/lint/llib-ltermcap.ln comp-c-lintlib lint
|
||||
./usr/libdata/lint/llib-lukfs.ln comp-c-lintlib lint
|
||||
./usr/libdata/lint/llib-lusb.ln comp-obsolete obsolete
|
||||
./usr/libdata/lint/llib-lusbhid.ln comp-c-lintlib lint
|
||||
./usr/libdata/lint/llib-lutil.ln comp-c-lintlib lint
|
||||
|
@ -6533,6 +6586,7 @@
|
|||
./usr/share/man/cat3/ossaudio.0 comp-c-catman .cat
|
||||
./usr/share/man/cat3/overlay.0 comp-c-catman .cat
|
||||
./usr/share/man/cat3/overwrite.0 comp-c-catman .cat
|
||||
./usr/share/man/cat3/p2k.0 comp-c-catman .cat,puffs
|
||||
./usr/share/man/cat3/pair_content.0 comp-c-catman .cat
|
||||
./usr/share/man/cat3/pam.0 comp-c-catman .cat,pam
|
||||
./usr/share/man/cat3/pam_acct_mgmt.0 comp-c-catman .cat,pam
|
||||
|
@ -6969,6 +7023,8 @@
|
|||
./usr/share/man/cat3/rresvport.0 comp-c-catman .cat
|
||||
./usr/share/man/cat3/rresvport_af.0 comp-c-catman .cat
|
||||
./usr/share/man/cat3/rsa.0 comp-obsolete obsolete
|
||||
./usr/share/man/cat3/rump.0 comp-c-catman .cat
|
||||
./usr/share/man/cat3/rumpuser.0 comp-c-catman .cat
|
||||
./usr/share/man/cat3/ruserok.0 comp-c-catman .cat
|
||||
./usr/share/man/cat3/savetty.0 comp-c-catman .cat
|
||||
./usr/share/man/cat3/scalb.0 comp-c-catman .cat
|
||||
|
@ -7376,6 +7432,7 @@
|
|||
./usr/share/man/cat3/tzsetwall.0 comp-c-catman .cat
|
||||
./usr/share/man/cat3/ualarm.0 comp-c-catman .cat
|
||||
./usr/share/man/cat3/uid_from_user.0 comp-c-catman .cat
|
||||
./usr/share/man/cat3/ukfs.0 comp-c-catman .cat
|
||||
./usr/share/man/cat3/ulimit.0 comp-c-catman .cat
|
||||
./usr/share/man/cat3/uname.0 comp-c-catman .cat
|
||||
./usr/share/man/cat3/unctrl.0 comp-c-catman .cat
|
||||
|
@ -11893,6 +11950,7 @@
|
|||
./usr/share/man/man3/ossaudio.3 comp-c-man .man
|
||||
./usr/share/man/man3/overlay.3 comp-c-man .man
|
||||
./usr/share/man/man3/overwrite.3 comp-c-man .man
|
||||
./usr/share/man/man3/p2k.3 comp-c-man .man,puffs
|
||||
./usr/share/man/man3/pair_content.3 comp-c-man .man
|
||||
./usr/share/man/man3/pam.3 comp-c-man .man,pam
|
||||
./usr/share/man/man3/pam_acct_mgmt.3 comp-c-man .man,pam
|
||||
|
@ -12329,6 +12387,8 @@
|
|||
./usr/share/man/man3/rresvport.3 comp-c-man .man
|
||||
./usr/share/man/man3/rresvport_af.3 comp-c-man .man
|
||||
./usr/share/man/man3/rsa.3 comp-obsolete obsolete
|
||||
./usr/share/man/man3/rump.3 comp-c-man .man
|
||||
./usr/share/man/man3/rumpuser.3 comp-c-man .man
|
||||
./usr/share/man/man3/ruserok.3 comp-c-man .man
|
||||
./usr/share/man/man3/savetty.3 comp-c-man .man
|
||||
./usr/share/man/man3/scalb.3 comp-c-man .man
|
||||
|
@ -12900,6 +12960,7 @@
|
|||
./usr/share/man/man3/wunderend.3 comp-c-man .man
|
||||
./usr/share/man/man3/wunderscore.3 comp-c-man .man
|
||||
./usr/share/man/man3/wvline.3 comp-c-man .man
|
||||
./usr/share/man/man3/ukfs.3 comp-c-man .man
|
||||
./usr/share/man/man3/xdr.3 comp-c-man .man
|
||||
./usr/share/man/man3/xdr_accepted_reply.3 comp-c-man .man
|
||||
./usr/share/man/man3/xdr_array.3 comp-c-man .man
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: shl.mi,v 1.64 2008/05/22 14:24:42 lukem Exp $
|
||||
# $NetBSD: shl.mi,v 1.65 2008/07/29 13:17:40 pooka Exp $
|
||||
#
|
||||
# Note: don't delete entries from here - mark them as "obsolete" instead.
|
||||
#
|
||||
|
@ -61,6 +61,7 @@
|
|||
./usr/lib/libopcodes.so.2 comp-c-shlib bfd
|
||||
./usr/lib/libopcodes.so.2.0 comp-c-shlib bfd
|
||||
./usr/lib/libossaudio_pic.a comp-c-piclib
|
||||
./usr/lib/libp2k_pic.a comp-c-piclib puffs
|
||||
./usr/lib/libpam_pic.a comp-c-piclib pam
|
||||
./usr/lib/libpcap_pic.a comp-c-piclib
|
||||
./usr/lib/libpci_pic.a comp-c-piclib
|
||||
|
@ -75,6 +76,20 @@
|
|||
./usr/lib/libroken_pic.a comp-c-piclib kerberos
|
||||
./usr/lib/librpcsvc_pic.a comp-c-piclib
|
||||
./usr/lib/librt_pic.a comp-c-piclib
|
||||
./usr/lib/librump_pic.a comp-c-piclib
|
||||
./usr/lib/librumpfs_cd9660fs_pic.a comp-c-piclib
|
||||
./usr/lib/librumpfs_efs_pic.a comp-c-piclib
|
||||
./usr/lib/librumpfs_ext2fs_pic.a comp-c-piclib
|
||||
./usr/lib/librumpfs_ffs_pic.a comp-c-piclib
|
||||
./usr/lib/librumpfs_hfs_pic.a comp-c-piclib
|
||||
./usr/lib/librumpfs_lfs_pic.a comp-c-piclib
|
||||
./usr/lib/librumpfs_msdosfs_pic.a comp-c-piclib
|
||||
./usr/lib/librumpfs_ntfs_pic.a comp-c-piclib
|
||||
./usr/lib/librumpfs_syspuffs_pic.a comp-c-piclib
|
||||
./usr/lib/librumpfs_tmpfs_pic.a comp-c-piclib
|
||||
./usr/lib/librumpfs_udf_pic.a comp-c-piclib
|
||||
./usr/lib/librumpfs_ufs_pic.a comp-c-piclib
|
||||
./usr/lib/librumpuser_pic.a comp-c-piclib
|
||||
./usr/lib/libsdp_pic.a comp-c-piclib
|
||||
./usr/lib/libskey_pic.a comp-c-piclib skey
|
||||
./usr/lib/libsl_pic.a comp-c-piclib kerberos
|
||||
|
@ -85,6 +100,7 @@
|
|||
./usr/lib/libstdc++_pic.a comp-cxx-piclib
|
||||
./usr/lib/libtermcap_pic.a comp-c-piclib
|
||||
./usr/lib/libtermlib_pic.a comp-c-piclib
|
||||
./usr/lib/libukfs_pic.a comp-c-piclib
|
||||
./usr/lib/libusbhid_pic.a comp-c-piclib
|
||||
./usr/lib/libutil_pic.a comp-c-piclib
|
||||
./usr/lib/libwrap_pic.a comp-c-piclib
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: NetBSD.dist,v 1.375 2008/07/29 04:50:52 mrg Exp $
|
||||
# $NetBSD: NetBSD.dist,v 1.376 2008/07/29 13:17:40 pooka Exp $
|
||||
# @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93
|
||||
|
||||
# Do not customize this file as it may be overwritten on upgrades.
|
||||
|
@ -315,6 +315,7 @@
|
|||
./usr/include/readline
|
||||
./usr/include/rpc
|
||||
./usr/include/rpcsvc
|
||||
./usr/include/rump
|
||||
./usr/include/security
|
||||
./usr/include/sys
|
||||
./usr/include/ssp
|
||||
|
|
13
lib/Makefile
13
lib/Makefile
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile,v 1.125 2008/07/12 12:20:08 gmcgarry Exp $
|
||||
# $NetBSD: Makefile,v 1.126 2008/07/29 13:17:40 pooka Exp $
|
||||
# from: @(#)Makefile 5.25.1.1 (Berkeley) 5/7/91
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
@ -90,6 +90,8 @@ SUBDIR+= libkrb5 # depends on libcrypto and more
|
|||
SUBDIR+= librefuse # depends on libpuffs
|
||||
.endif
|
||||
|
||||
SUBDIR+= librumpuser # depends on libpthread
|
||||
|
||||
# XXX These bind9/ISC libraries should depend on each other but the
|
||||
# XXX dependency ordering requires considerable investigation.
|
||||
# XXX Please preserve the order below so we know the order ISC links
|
||||
|
@ -111,6 +113,7 @@ SUBDIR+= .WAIT libkadm5srv libkadm5clnt libkafs libsl libss
|
|||
SUBDIR+= ../external/bsd/openldap/lib
|
||||
.endif
|
||||
|
||||
SUBDIR+= librump # depends on librumpuser
|
||||
|
||||
#==================== 3rd library dependency barrier ====================
|
||||
SUBDIR+= .WAIT
|
||||
|
@ -119,4 +122,12 @@ SUBDIR+= .WAIT
|
|||
SUBDIR+= libpam # depends on libkrb5, libkafs and more
|
||||
.endif
|
||||
|
||||
SUBDIR+= libukfs # depends on librump
|
||||
|
||||
#==================== 4th library dependency barrier ====================
|
||||
.if (${MKPUFFS} != "no")
|
||||
SUBDIR+= .WAIT
|
||||
SUBDIR+= libp2k # depends on libpuffs and libukfs
|
||||
.endif
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
# $NetBSD: Makefile,v 1.1 2008/07/29 13:17:40 pooka Exp $
|
||||
#
|
||||
|
||||
LIB= p2k
|
||||
LIBDPLIBS+= rump ${.CURDIR}/../librump \
|
||||
ukfs ${.CURDIR}/../libukfs
|
||||
|
||||
INCS= p2k.h
|
||||
INCSDIR= /usr/include/rump
|
||||
|
||||
SRCS= p2k.c
|
||||
MAN= p2k.3
|
||||
|
||||
.include <bsd.lib.mk>
|
|
@ -0,0 +1,75 @@
|
|||
.\" $NetBSD: p2k.3,v 1.1 2008/07/29 13:17:40 pooka Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2008 Antti Kantee. All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd July 28, 2008
|
||||
.Dt P2K 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm p2k
|
||||
.Nd puffs to kernel vfs translation library
|
||||
.Sh LIBRARY
|
||||
p2k Library (libp2k, \-lp2k)
|
||||
.Sh SYNOPSIS
|
||||
.In rump/p2k.h
|
||||
.Ft int
|
||||
.Fo p2k_run_fs
|
||||
.Fa "const char *vfsname" "const char *devpath" "const char *mountpath"
|
||||
.Fa "int mntflags" "void *arg" "size_t alen" "uint32_t puffs_flags"
|
||||
.Fc
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
library translates the puffs protocol to the kernel vfs protocol and
|
||||
back again.
|
||||
It can therefore be used to mount and run kernel file system code as
|
||||
a userspace daemon.
|
||||
.Pp
|
||||
Calling the library interface function mounts the file system and,
|
||||
if succesful, starts handling requests.
|
||||
The parameters are handled by
|
||||
.Fn ukfs_mount
|
||||
(see
|
||||
.Xr ukfs 3 ) ,
|
||||
with the exception that
|
||||
.Fa mountpath
|
||||
and
|
||||
.Fa puffs_flags
|
||||
are handled by
|
||||
.Xr puffs 3 .
|
||||
.Sh SEE ALSO
|
||||
.Xr puffs 3 ,
|
||||
.Xr rump 3 ,
|
||||
.Xr ukfs 3 ,
|
||||
.Xr rump_cd9660 8 ,
|
||||
.Xr rump_efs 8 ,
|
||||
.Xr rump_ext2fs 8 ,
|
||||
.Xr rump_ffs 8 ,
|
||||
.Xr rump_hfs 8 ,
|
||||
.Xr rump_lfs 8 ,
|
||||
.Xr rump_msdos 8 ,
|
||||
.Xr rump_ntfs 8 ,
|
||||
.Xr rump_syspuffs 8 ,
|
||||
.Xr rump_tmpfs 8 ,
|
||||
.Xr rump_udf 8
|
|
@ -0,0 +1,790 @@
|
|||
/* $NetBSD: p2k.c,v 1.1 2008/07/29 13:17:40 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
*
|
||||
* Development of this software was supported by Google Summer of Code.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* puffs 2k, i.e. puffs 2 kernel. Converts the puffs protocol to
|
||||
* the kernel vfs protocol and vice versa.
|
||||
*
|
||||
* A word about reference counting: puffs in the kernel is the king of
|
||||
* reference counting. We must maintain a vnode alive and kicking
|
||||
* until the kernel tells us to reclaim it. Therefore we make sure
|
||||
* we never accidentally lose a vnode. Before calling operations which
|
||||
* decrease the refcount we always bump the refcount up to compensate.
|
||||
* Come inactive, if the file system thinks that the vnode should be
|
||||
* put out of its misery, it will set the recycle flag. We use this
|
||||
* to tell the kernel to reclaim the vnode. Only in reclaim do we
|
||||
* really nuke the last reference.
|
||||
*/
|
||||
|
||||
#define __VFSOPS_EXPOSE
|
||||
struct fid;
|
||||
|
||||
#include <sys/mount.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/dirent.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <puffs.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <rump/rump.h>
|
||||
#include <rump/p2k.h>
|
||||
#include <rump/ukfs.h>
|
||||
|
||||
PUFFSOP_PROTOS(p2k)
|
||||
|
||||
static kauth_cred_t
|
||||
cred_create(const struct puffs_cred *pcr)
|
||||
{
|
||||
gid_t groups[NGROUPS];
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
short ngroups = 0;
|
||||
|
||||
if (puffs_cred_getuid(pcr, &uid) == -1)
|
||||
uid = 0;
|
||||
if (puffs_cred_getgid(pcr, &gid) == -1)
|
||||
gid = 0;
|
||||
puffs_cred_getgroups(pcr, groups, &ngroups);
|
||||
|
||||
/* LINTED: ngroups is ok */
|
||||
return rump_cred_create(uid, gid, ngroups, groups);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
cred_destroy(kauth_cred_t cred)
|
||||
{
|
||||
|
||||
rump_cred_destroy(cred);
|
||||
}
|
||||
|
||||
static struct componentname *
|
||||
makecn(const struct puffs_cn *pcn)
|
||||
{
|
||||
kauth_cred_t cred;
|
||||
|
||||
cred = cred_create(pcn->pcn_cred);
|
||||
/* LINTED: prehistoric types in first two args */
|
||||
return rump_makecn(pcn->pcn_nameiop, pcn->pcn_flags, pcn->pcn_name,
|
||||
pcn->pcn_namelen, cred, curlwp);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
freecn(struct componentname *cnp, int flags)
|
||||
{
|
||||
|
||||
rump_freecn(cnp, flags | RUMPCN_FREECRED);
|
||||
}
|
||||
|
||||
static void
|
||||
makelwp(struct puffs_usermount *pu)
|
||||
{
|
||||
pid_t pid;
|
||||
lwpid_t lid;
|
||||
|
||||
puffs_cc_getcaller(puffs_cc_getcc(pu), &pid, &lid);
|
||||
rump_setup_curlwp(pid, lid, 1);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
clearlwp(struct puffs_usermount *pu)
|
||||
{
|
||||
|
||||
rump_clear_curlwp();
|
||||
}
|
||||
|
||||
int
|
||||
p2k_run_fs(const char *vfsname, const char *devpath, const char *mountpath,
|
||||
int mntflags, void *arg, size_t alen, uint32_t puffs_flags)
|
||||
{
|
||||
char typebuf[PUFFS_TYPELEN];
|
||||
struct puffs_ops *pops;
|
||||
struct puffs_usermount *pu;
|
||||
struct puffs_node *pn_root;
|
||||
struct vnode *rvp;
|
||||
struct ukfs *ukfs;
|
||||
extern int puffs_fakecc;
|
||||
int rv, sverrno;
|
||||
|
||||
rv = -1;
|
||||
ukfs_init();
|
||||
ukfs = ukfs_mount(vfsname, devpath, mountpath, mntflags, arg, alen);
|
||||
if (ukfs == NULL)
|
||||
return -1;
|
||||
|
||||
PUFFSOP_INIT(pops);
|
||||
|
||||
PUFFSOP_SET(pops, p2k, fs, statvfs);
|
||||
PUFFSOP_SET(pops, p2k, fs, unmount);
|
||||
PUFFSOP_SET(pops, p2k, fs, sync);
|
||||
PUFFSOP_SET(pops, p2k, fs, fhtonode);
|
||||
PUFFSOP_SET(pops, p2k, fs, nodetofh);
|
||||
|
||||
PUFFSOP_SET(pops, p2k, node, lookup);
|
||||
PUFFSOP_SET(pops, p2k, node, create);
|
||||
PUFFSOP_SET(pops, p2k, node, mknod);
|
||||
PUFFSOP_SET(pops, p2k, node, open);
|
||||
PUFFSOP_SET(pops, p2k, node, close);
|
||||
PUFFSOP_SET(pops, p2k, node, access);
|
||||
PUFFSOP_SET(pops, p2k, node, getattr);
|
||||
PUFFSOP_SET(pops, p2k, node, setattr);
|
||||
#if 0
|
||||
PUFFSOP_SET(pops, p2k, node, poll);
|
||||
#endif
|
||||
PUFFSOP_SET(pops, p2k, node, mmap);
|
||||
PUFFSOP_SET(pops, p2k, node, fsync);
|
||||
PUFFSOP_SET(pops, p2k, node, seek);
|
||||
PUFFSOP_SET(pops, p2k, node, remove);
|
||||
PUFFSOP_SET(pops, p2k, node, link);
|
||||
PUFFSOP_SET(pops, p2k, node, rename);
|
||||
PUFFSOP_SET(pops, p2k, node, mkdir);
|
||||
PUFFSOP_SET(pops, p2k, node, rmdir);
|
||||
PUFFSOP_SET(pops, p2k, node, symlink);
|
||||
PUFFSOP_SET(pops, p2k, node, readdir);
|
||||
PUFFSOP_SET(pops, p2k, node, readlink);
|
||||
PUFFSOP_SET(pops, p2k, node, read);
|
||||
PUFFSOP_SET(pops, p2k, node, write);
|
||||
|
||||
PUFFSOP_SET(pops, p2k, node, inactive);
|
||||
PUFFSOP_SET(pops, p2k, node, reclaim);
|
||||
|
||||
strcpy(typebuf, "p2k|");
|
||||
if (strcmp(vfsname, "puffs") == 0) { /* XXX */
|
||||
struct puffs_kargs *args = arg;
|
||||
strlcat(typebuf, args->pa_typename, sizeof(typebuf));
|
||||
} else {
|
||||
strlcat(typebuf, vfsname, sizeof(typebuf));
|
||||
}
|
||||
|
||||
pu = puffs_init(pops, devpath, typebuf, ukfs_getmp(ukfs), puffs_flags);
|
||||
if (pu == NULL)
|
||||
goto out;
|
||||
|
||||
rvp = ukfs_getrvp(ukfs);
|
||||
pn_root = puffs_pn_new(pu, rvp);
|
||||
puffs_setroot(pu, pn_root);
|
||||
puffs_setfhsize(pu, 0, PUFFS_FHFLAG_PASSTHROUGH);
|
||||
puffs_setstacksize(pu, PUFFS_STACKSIZE_MIN);
|
||||
puffs_fakecc = 1;
|
||||
|
||||
puffs_set_prepost(pu, makelwp, clearlwp);
|
||||
|
||||
if ((rv = puffs_mount(pu, mountpath, mntflags, rvp))== -1)
|
||||
goto out;
|
||||
rv = puffs_mainloop(pu);
|
||||
|
||||
out:
|
||||
sverrno = errno;
|
||||
ukfs_release(ukfs, UKFS_RELFLAG_NOUNMOUNT);
|
||||
if (rv) {
|
||||
errno = sverrno;
|
||||
rv = -1;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* XXX: vn_lock() */
|
||||
#define VLE(a) RUMP_VOP_LOCK(a, LK_EXCLUSIVE)
|
||||
#define VLS(a) RUMP_VOP_LOCK(a, LK_SHARED)
|
||||
#define VUL(a) RUMP_VOP_UNLOCK(a, 0);
|
||||
#define AUL(a) assert(RUMP_VOP_ISLOCKED(a) == 0)
|
||||
|
||||
int
|
||||
p2k_fs_statvfs(struct puffs_usermount *pu, struct statvfs *sbp)
|
||||
{
|
||||
struct mount *mp = puffs_getspecific(pu);
|
||||
|
||||
return rump_vfs_statvfs(mp, sbp);
|
||||
}
|
||||
|
||||
int
|
||||
p2k_fs_unmount(struct puffs_usermount *pu, int flags)
|
||||
{
|
||||
struct mount *mp = puffs_getspecific(pu);
|
||||
struct puffs_node *pn_root = puffs_getroot(pu);
|
||||
struct vnode *rvp = pn_root->pn_data, *rvp2;
|
||||
int rv;
|
||||
|
||||
/*
|
||||
* We recycle the root node already here (god knows how
|
||||
* many references it has due to lookup). This is good
|
||||
* because VFS_UNMOUNT would do it anyway. But it is
|
||||
* very bad if VFS_UNMOUNT fails for a reason or another
|
||||
* (puffs guards against busy fs, but there might be other
|
||||
* reasons).
|
||||
*
|
||||
* Theoretically we're going south, sinking fast & dying
|
||||
* out here because the old vnode will be freed and we are
|
||||
* unlikely to get a vnode at the same address. But try
|
||||
* anyway.
|
||||
*
|
||||
* XXX: reallyfixmesomeday. either introduce VFS_ROOT to
|
||||
* puffs (blah) or check the cookie in every routine
|
||||
* against the root cookie, which might change (blah2).
|
||||
*/
|
||||
rump_vp_recycle_nokidding(rvp);
|
||||
rv = rump_vfs_unmount(mp, flags);
|
||||
if (rv) {
|
||||
int rv2;
|
||||
|
||||
rv2 = rump_vfs_root(mp, &rvp2, 0);
|
||||
assert(rv2 == 0 && rvp == rvp2);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
int
|
||||
p2k_fs_sync(struct puffs_usermount *pu, int waitfor,
|
||||
const struct puffs_cred *pcr)
|
||||
{
|
||||
struct mount *mp = puffs_getspecific(pu);
|
||||
kauth_cred_t cred;
|
||||
int rv;
|
||||
|
||||
cred = cred_create(pcr);
|
||||
rv = rump_vfs_sync(mp, waitfor, (kauth_cred_t)cred);
|
||||
cred_destroy(cred);
|
||||
|
||||
rump_bioops_sync();
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_fs_fhtonode(struct puffs_usermount *pu, void *fid, size_t fidsize,
|
||||
struct puffs_newinfo *pni)
|
||||
{
|
||||
struct mount *mp = puffs_getspecific(pu);
|
||||
struct vnode *vp;
|
||||
enum vtype vtype;
|
||||
voff_t vsize;
|
||||
dev_t rdev;
|
||||
int rv;
|
||||
|
||||
rv = rump_vfs_fhtovp(mp, fid, &vp);
|
||||
if (rv)
|
||||
return rv;
|
||||
|
||||
puffs_newinfo_setcookie(pni, vp);
|
||||
rump_getvninfo(vp, &vtype, &vsize, &rdev);
|
||||
puffs_newinfo_setvtype(pni, vtype);
|
||||
puffs_newinfo_setsize(pni, vsize);
|
||||
puffs_newinfo_setrdev(pni, rdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_fs_nodetofh(struct puffs_usermount *pu, void *cookie, void *fid,
|
||||
size_t *fidsize)
|
||||
{
|
||||
struct vnode *vp = cookie;
|
||||
|
||||
return rump_vfs_vptofh(vp, fid, fidsize);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_lookup(struct puffs_usermount *pu, void *opc,
|
||||
struct puffs_newinfo *pni, const struct puffs_cn *pcn)
|
||||
{
|
||||
struct componentname *cn;
|
||||
struct vnode *vp;
|
||||
enum vtype vtype;
|
||||
voff_t vsize;
|
||||
dev_t rdev;
|
||||
int rv;
|
||||
|
||||
cn = makecn(pcn);
|
||||
VLE(opc);
|
||||
rv = RUMP_VOP_LOOKUP(opc, &vp, cn);
|
||||
VUL(opc);
|
||||
freecn(cn, RUMPCN_ISLOOKUP);
|
||||
if (rv) {
|
||||
if (rv == EJUSTRETURN)
|
||||
rv = ENOENT;
|
||||
return rv;
|
||||
}
|
||||
VUL(vp);
|
||||
|
||||
puffs_newinfo_setcookie(pni, vp);
|
||||
rump_getvninfo(vp, &vtype, &vsize, &rdev);
|
||||
puffs_newinfo_setvtype(pni, vtype);
|
||||
puffs_newinfo_setsize(pni, vsize);
|
||||
puffs_newinfo_setrdev(pni, rdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_create(struct puffs_usermount *pu, void *opc,
|
||||
struct puffs_newinfo *pni, const struct puffs_cn *pcn,
|
||||
const struct vattr *vap)
|
||||
{
|
||||
struct componentname *cn;
|
||||
struct vnode *vp;
|
||||
int rv;
|
||||
|
||||
cn = makecn(pcn);
|
||||
VLE(opc);
|
||||
rump_vp_incref(opc);
|
||||
rv = RUMP_VOP_CREATE(opc, &vp, cn, __UNCONST(vap));
|
||||
AUL(opc);
|
||||
freecn(cn, 0);
|
||||
if (rv == 0) {
|
||||
VUL(vp);
|
||||
puffs_newinfo_setcookie(pni, vp);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_mknod(struct puffs_usermount *pu, void *opc, struct puffs_newinfo *pni,
|
||||
const struct puffs_cn *pcn, const struct vattr *vap)
|
||||
{
|
||||
struct componentname *cn;
|
||||
struct vnode *vp;
|
||||
int rv;
|
||||
|
||||
cn = makecn(pcn);
|
||||
VLE(opc);
|
||||
rump_vp_incref(opc);
|
||||
rv = RUMP_VOP_MKNOD(opc, &vp, cn, __UNCONST(vap));
|
||||
AUL(opc);
|
||||
freecn(cn, 0);
|
||||
if (rv == 0) {
|
||||
VUL(vp);
|
||||
puffs_newinfo_setcookie(pni, vp);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_open(struct puffs_usermount *pu, void *opc, int mode,
|
||||
const struct puffs_cred *pcr)
|
||||
{
|
||||
kauth_cred_t cred;
|
||||
int rv;
|
||||
|
||||
cred = cred_create(pcr);
|
||||
VLE(opc);
|
||||
rv = RUMP_VOP_OPEN(opc, mode, cred);
|
||||
VUL(opc);
|
||||
cred_destroy(cred);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_close(struct puffs_usermount *pu, void *opc, int flags,
|
||||
const struct puffs_cred *pcr)
|
||||
{
|
||||
kauth_cred_t cred;
|
||||
|
||||
cred = cred_create(pcr);
|
||||
VLE(opc);
|
||||
RUMP_VOP_CLOSE(opc, flags, cred);
|
||||
VUL(opc);
|
||||
cred_destroy(cred);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_access(struct puffs_usermount *pu, void *opc, int mode,
|
||||
const struct puffs_cred *pcr)
|
||||
{
|
||||
kauth_cred_t cred;
|
||||
int rv;
|
||||
|
||||
cred = cred_create(pcr);
|
||||
VLE(opc);
|
||||
rv = RUMP_VOP_ACCESS(opc, mode, cred);
|
||||
VUL(opc);
|
||||
cred_destroy(cred);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_getattr(struct puffs_usermount *pu, void *opc, struct vattr *vap,
|
||||
const struct puffs_cred *pcr)
|
||||
{
|
||||
kauth_cred_t cred;
|
||||
int rv;
|
||||
|
||||
cred = cred_create(pcr);
|
||||
VLE(opc);
|
||||
rv = RUMP_VOP_GETATTR(opc, vap, cred);
|
||||
VUL(opc);
|
||||
cred_destroy(cred);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_setattr(struct puffs_usermount *pu, void *opc, const struct vattr *vap,
|
||||
const struct puffs_cred *pcr)
|
||||
{
|
||||
kauth_cred_t cred;
|
||||
int rv;
|
||||
|
||||
cred = cred_create(pcr);
|
||||
VLE(opc);
|
||||
rv = RUMP_VOP_SETATTR(opc, __UNCONST(vap), cred);
|
||||
VUL(opc);
|
||||
cred_destroy(cred);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_fsync(struct puffs_usermount *pu, void *opc,
|
||||
const struct puffs_cred *pcr, int flags, off_t offlo, off_t offhi)
|
||||
{
|
||||
kauth_cred_t cred;
|
||||
int rv;
|
||||
|
||||
cred = cred_create(pcr);
|
||||
VLE(opc);
|
||||
rv = RUMP_VOP_FSYNC(opc, cred, flags, offlo, offhi);
|
||||
VUL(opc);
|
||||
cred_destroy(cred);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_mmap(struct puffs_usermount *pu, void *opc, vm_prot_t flags,
|
||||
const struct puffs_cred *pcr)
|
||||
{
|
||||
kauth_cred_t cred;
|
||||
int rv;
|
||||
|
||||
cred = cred_create(pcr);
|
||||
rv = RUMP_VOP_MMAP(opc, flags, cred);
|
||||
cred_destroy(cred);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_seek(struct puffs_usermount *pu, void *opc, off_t oldoff, off_t newoff,
|
||||
const struct puffs_cred *pcr)
|
||||
{
|
||||
kauth_cred_t cred;
|
||||
int rv;
|
||||
|
||||
cred = cred_create(pcr);
|
||||
VLE(opc);
|
||||
rv = RUMP_VOP_SEEK(opc, oldoff, newoff, cred);
|
||||
VUL(opc);
|
||||
cred_destroy(cred);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_remove(struct puffs_usermount *pu, void *opc, void *targ,
|
||||
const struct puffs_cn *pcn)
|
||||
{
|
||||
struct componentname *cn;
|
||||
int rv;
|
||||
|
||||
cn = makecn(pcn);
|
||||
VLE(opc);
|
||||
rump_vp_incref(opc);
|
||||
VLE(targ);
|
||||
rump_vp_incref(targ);
|
||||
rv = RUMP_VOP_REMOVE(opc, targ, cn);
|
||||
AUL(opc);
|
||||
AUL(targ);
|
||||
freecn(cn, 0);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_link(struct puffs_usermount *pu, void *opc, void *targ,
|
||||
const struct puffs_cn *pcn)
|
||||
{
|
||||
struct componentname *cn;
|
||||
int rv;
|
||||
|
||||
cn = makecn(pcn);
|
||||
VLE(opc);
|
||||
rump_vp_incref(opc);
|
||||
rv = RUMP_VOP_LINK(opc, targ, cn);
|
||||
freecn(cn, 0);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_rename(struct puffs_usermount *pu, void *src_dir, void *src,
|
||||
const struct puffs_cn *pcn_src, void *targ_dir, void *targ,
|
||||
const struct puffs_cn *pcn_targ)
|
||||
{
|
||||
struct componentname *cn_src, *cn_targ;
|
||||
int rv;
|
||||
|
||||
cn_src = makecn(pcn_src);
|
||||
cn_targ = makecn(pcn_targ);
|
||||
rump_vp_incref(src_dir);
|
||||
rump_vp_incref(src);
|
||||
VLE(targ_dir);
|
||||
rump_vp_incref(targ_dir);
|
||||
if (targ) {
|
||||
VLE(targ);
|
||||
rump_vp_incref(targ);
|
||||
}
|
||||
rv = RUMP_VOP_RENAME(src_dir, src, cn_src, targ_dir, targ, cn_targ);
|
||||
AUL(targ_dir);
|
||||
if (targ)
|
||||
AUL(targ);
|
||||
freecn(cn_src, 0);
|
||||
freecn(cn_targ, 0);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_mkdir(struct puffs_usermount *pu, void *opc, struct puffs_newinfo *pni,
|
||||
const struct puffs_cn *pcn, const struct vattr *vap)
|
||||
{
|
||||
struct componentname *cn;
|
||||
struct vnode *vp;
|
||||
int rv;
|
||||
|
||||
cn = makecn(pcn);
|
||||
VLE(opc);
|
||||
rump_vp_incref(opc);
|
||||
rv = RUMP_VOP_MKDIR(opc, &vp, cn, __UNCONST(vap));
|
||||
AUL(opc);
|
||||
freecn(cn, 0);
|
||||
if (rv == 0) {
|
||||
VUL(vp);
|
||||
puffs_newinfo_setcookie(pni, vp);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_rmdir(struct puffs_usermount *pu, void *opc, void *targ,
|
||||
const struct puffs_cn *pcn)
|
||||
{
|
||||
struct componentname *cn;
|
||||
int rv;
|
||||
|
||||
cn = makecn(pcn);
|
||||
VLE(opc);
|
||||
rump_vp_incref(opc);
|
||||
VLE(targ);
|
||||
rump_vp_incref(targ);
|
||||
rv = RUMP_VOP_RMDIR(opc, targ, cn);
|
||||
AUL(targ);
|
||||
AUL(opc);
|
||||
freecn(cn, 0);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_symlink(struct puffs_usermount *pu, void *opc,
|
||||
struct puffs_newinfo *pni, const struct puffs_cn *pcn_src,
|
||||
const struct vattr *vap, const char *link_target)
|
||||
{
|
||||
struct componentname *cn;
|
||||
struct vnode *vp;
|
||||
int rv;
|
||||
|
||||
cn = makecn(pcn_src);
|
||||
VLE(opc);
|
||||
rump_vp_incref(opc);
|
||||
rv = RUMP_VOP_SYMLINK(opc, &vp, cn,
|
||||
__UNCONST(vap), __UNCONST(link_target));
|
||||
AUL(opc);
|
||||
freecn(cn, 0);
|
||||
if (rv == 0) {
|
||||
VUL(vp);
|
||||
puffs_newinfo_setcookie(pni, vp);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_readdir(struct puffs_usermount *pu, void *opc, struct dirent *dent,
|
||||
off_t *readoff, size_t *reslen, const struct puffs_cred *pcr,
|
||||
int *eofflag, off_t *cookies, size_t *ncookies)
|
||||
{
|
||||
kauth_cred_t cred;
|
||||
struct uio *uio;
|
||||
off_t *vop_cookies;
|
||||
int vop_ncookies;
|
||||
int rv;
|
||||
|
||||
cred = cred_create(pcr);
|
||||
uio = rump_uio_setup(dent, *reslen, *readoff, RUMPUIO_READ);
|
||||
VLS(opc);
|
||||
if (cookies) {
|
||||
rv = RUMP_VOP_READDIR(opc, uio, cred, eofflag,
|
||||
&vop_cookies, &vop_ncookies);
|
||||
memcpy(cookies, vop_cookies, vop_ncookies * sizeof(*cookies));
|
||||
*ncookies = vop_ncookies;
|
||||
free(vop_cookies);
|
||||
} else {
|
||||
rv = RUMP_VOP_READDIR(opc, uio, cred, eofflag, NULL, NULL);
|
||||
}
|
||||
VUL(opc);
|
||||
if (rv == 0) {
|
||||
*reslen = rump_uio_getresid(uio);
|
||||
*readoff = rump_uio_getoff(uio);
|
||||
}
|
||||
rump_uio_free(uio);
|
||||
cred_destroy(cred);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_readlink(struct puffs_usermount *pu, void *opc,
|
||||
const struct puffs_cred *pcr, char *linkname, size_t *linklen)
|
||||
{
|
||||
kauth_cred_t cred;
|
||||
struct uio *uio;
|
||||
int rv;
|
||||
|
||||
cred = cred_create(pcr);
|
||||
uio = rump_uio_setup(linkname, *linklen, 0, RUMPUIO_READ);
|
||||
VLE(opc);
|
||||
rv = RUMP_VOP_READLINK(opc, uio, cred);
|
||||
VUL(opc);
|
||||
*linklen -= rump_uio_free(uio);
|
||||
cred_destroy(cred);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_read(struct puffs_usermount *pu, void *opc,
|
||||
uint8_t *buf, off_t offset, size_t *resid,
|
||||
const struct puffs_cred *pcr, int ioflag)
|
||||
{
|
||||
kauth_cred_t cred;
|
||||
struct uio *uio;
|
||||
int rv;
|
||||
|
||||
cred = cred_create(pcr);
|
||||
uio = rump_uio_setup(buf, *resid, offset, RUMPUIO_READ);
|
||||
VLS(opc);
|
||||
rv = RUMP_VOP_READ(opc, uio, ioflag, cred);
|
||||
VUL(opc);
|
||||
*resid = rump_uio_free(uio);
|
||||
cred_destroy(cred);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_write(struct puffs_usermount *pu, void *opc,
|
||||
uint8_t *buf, off_t offset, size_t *resid,
|
||||
const struct puffs_cred *pcr, int ioflag)
|
||||
{
|
||||
kauth_cred_t cred;
|
||||
struct uio *uio;
|
||||
int rv;
|
||||
|
||||
cred = cred_create(pcr);
|
||||
uio = rump_uio_setup(buf, *resid, offset, RUMPUIO_WRITE);
|
||||
VLE(opc);
|
||||
rv = RUMP_VOP_WRITE(opc, uio, ioflag, cred);
|
||||
VUL(opc);
|
||||
*resid = rump_uio_free(uio);
|
||||
cred_destroy(cred);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
int
|
||||
p2k_node_inactive(struct puffs_usermount *pu, void *opc)
|
||||
{
|
||||
struct vnode *vp = opc;
|
||||
bool recycle;
|
||||
int rv;
|
||||
|
||||
rump_vp_interlock(vp);
|
||||
(void) RUMP_VOP_PUTPAGES(vp, 0, 0, PGO_ALLPAGES);
|
||||
VLE(vp);
|
||||
rv = RUMP_VOP_INACTIVE(vp, &recycle);
|
||||
if (recycle)
|
||||
puffs_setback(puffs_cc_getcc(pu), PUFFS_SETBACK_NOREF_N1);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
p2k_node_reclaim(struct puffs_usermount *pu, void *opc)
|
||||
{
|
||||
|
||||
rump_vp_recycle_nokidding(opc);
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
/* $NetBSD: p2k.h,v 1.1 2008/07/29 13:17:40 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
*
|
||||
* Development of this software was supported by Google Summer of Code.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _RUMP_P2K_H_
|
||||
#define _RUMP_P2K_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
int p2k_run_fs(const char *, const char *, const char *, int,
|
||||
void *, size_t, uint32_t);
|
||||
|
||||
#endif /* _RUMP_P2K_H_ */
|
|
@ -0,0 +1,4 @@
|
|||
# $NetBSD: shlib_version,v 1.1 2008/07/29 13:17:40 pooka Exp $
|
||||
#
|
||||
major=0
|
||||
minor=0
|
|
@ -0,0 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.1 2008/07/29 13:17:41 pooka Exp $
|
||||
#
|
||||
|
||||
RUMPTOP= ${.CURDIR}/../../sys/rump
|
||||
|
||||
LIBDPLIBS+= rumpuser ${.CURDIR}/../librumpuser
|
||||
MAN= rump.3
|
||||
|
||||
.include "${RUMPTOP}/librump/rumpkern/Makefile.rumpkern"
|
|
@ -0,0 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.1 2008/07/29 13:17:41 pooka Exp $
|
||||
#
|
||||
|
||||
.PATH: ${.CURDIR}/../../sys/rump/librump/rumpuser
|
||||
|
||||
LIBDPLIBS+= pthread ${.CURDIR}/../libpthread
|
||||
MAN= rumpuser.3
|
||||
|
||||
.include "${.CURDIR}/../../sys/rump/librump/rumpuser/Makefile"
|
|
@ -0,0 +1,13 @@
|
|||
# $NetBSD: Makefile,v 1.1 2008/07/29 13:17:41 pooka Exp $
|
||||
#
|
||||
|
||||
LIB= ukfs
|
||||
LIBDPLIBS+= rump ${.CURDIR}/../librump
|
||||
|
||||
INCS= ukfs.h
|
||||
INCSDIR= /usr/include/rump
|
||||
|
||||
SRCS= ukfs.c
|
||||
MAN= ukfs.3
|
||||
|
||||
.include <bsd.lib.mk>
|
|
@ -0,0 +1,4 @@
|
|||
# $NetBSD: shlib_version,v 1.1 2008/07/29 13:17:41 pooka Exp $
|
||||
#
|
||||
major=0
|
||||
minor=0
|
|
@ -0,0 +1,291 @@
|
|||
.\" $NetBSD: ukfs.3,v 1.1 2008/07/29 13:17:41 pooka Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2008 Antti Kantee. All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd July 28, 2008
|
||||
.Dt UKFS 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm ukfs
|
||||
.Nd user kernel file system library interface
|
||||
.Sh LIBRARY
|
||||
ukfs Library (libukfs, \-lukfs)
|
||||
.Sh SYNOPSIS
|
||||
.In rump/ukfs.h
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
library provides direct access to file systems without having to
|
||||
specially mount a file system.
|
||||
Therefore, accessing a file system through
|
||||
.Nm
|
||||
requires no special kernel support apart from standard POSIX functionality.
|
||||
As
|
||||
.Nm
|
||||
is built upon
|
||||
.Xr rump 3 ,
|
||||
all kernel file systems which are supported by rump are available.
|
||||
It allows to write utilities for accessing file systems without having
|
||||
to duplicate file system internals knowledge already present in kernel
|
||||
file system drivers.
|
||||
.Pp
|
||||
.Nm
|
||||
provides a high-level pathname based interface for accessing file systems.
|
||||
If a lower level interface it desired,
|
||||
.Xr rump 3
|
||||
should be used directly.
|
||||
However, much like system calls, the interfaces of
|
||||
.Nm ,
|
||||
are self-contained and require no tracking and release of resources.
|
||||
The only exception is the file system handle
|
||||
.Ft struct ukfs .
|
||||
.Sh INITIALIZATION
|
||||
.Ft int
|
||||
.br
|
||||
.Fn ukfs_init
|
||||
.Pp
|
||||
.Ft struct ukfs *
|
||||
.br
|
||||
.Fo ukfs_mount
|
||||
.Fa "const char *vfsname" "const char *devpath" "const char *mounpath"
|
||||
.Fa "int mntflags" "void *arg" "size_t alen"
|
||||
.Fc
|
||||
.Pp
|
||||
.Ft void
|
||||
.br
|
||||
.Fn ukfs_release "struct ukfs *ukfs" "int flags"
|
||||
.Pp
|
||||
.Fn ukfs_init
|
||||
intializes the library and must be called once per process using
|
||||
.Nm .
|
||||
.Pp
|
||||
.Fn ukfs_mount
|
||||
intializes a file system image.
|
||||
The handle resulting from the operation is passed to all other routines
|
||||
and identifies the instance of the mount analoguous to what a pathname
|
||||
specifies in a normally mounted file system.
|
||||
The parameters are the following:
|
||||
.Bl -tag -width XXX -offset indent
|
||||
.It vfsname
|
||||
Name of the file system to be used, e.g.
|
||||
.Dv MOUNT_FFS .
|
||||
.It devpath
|
||||
Path of file system image.
|
||||
It can be either a regular file, device or, if the file system does
|
||||
not support the concept of a device, an abitrary string, e.g. network
|
||||
address.
|
||||
.It mountpath
|
||||
Path where the file system is mounted to.
|
||||
This parameter is used only by the file system being mounted.
|
||||
Most of the time
|
||||
.Dv UKFS_DEFAULTMP
|
||||
is the correct path.
|
||||
.It mntflags
|
||||
Flags as passed to the
|
||||
.Xr mount 2
|
||||
system call, for example
|
||||
.Dv MNT_RDONLY .
|
||||
In addition to generic parameters, file system specific parameters such as
|
||||
.Dv MNT_SOFTDEP
|
||||
(ffs) may be passed here.
|
||||
.It arg
|
||||
File system private argument structure.
|
||||
This is passed directly to the file system.
|
||||
It must match what
|
||||
.Fa vfsname
|
||||
expects.
|
||||
.It alen
|
||||
Size of said structure.
|
||||
.El
|
||||
.Pp
|
||||
.Fn ukfs_release
|
||||
releases the resources associated with
|
||||
.Fa ukfs .
|
||||
If
|
||||
.Fa flags
|
||||
is
|
||||
.Dv UKFS_RELFLAG_NOUNMOUNT ,
|
||||
the file system is not unmounted.
|
||||
This is required if the file system has already been unmounted due
|
||||
to prior activity, otherwise 0 should be passed.
|
||||
.Sh OPERATION
|
||||
.Ft int
|
||||
.br
|
||||
.Fn ukfs_chdir "struct ukfs *ukfs" "const char *path"
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fo ukfs_getdents
|
||||
.Fa "struct ukfs *ukfs" "const char *dirname" "off_t *off"
|
||||
.Fa "uint8_t *buf" "size_t bufsize"
|
||||
.Fc
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fo ukfs_read
|
||||
.Fa "struct ukfs *ukfs" "const char *filename" "off_t off"
|
||||
.Fa "uint8_t *buf" "size_t bufsize"
|
||||
.Fc
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fo ukfs_write
|
||||
.Fa "struct ukfs *ukfs" "const char *filename" "off_t off"
|
||||
.Fa "uint8_t *buf" "size_t bufsize"
|
||||
.Fc
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fn ukfs_create "struct ukfs *ukfs" "const char *filename" "mode_t mode"
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fn ukfs_mknod "struct ukfs *ukfs" "const char *path" "mode_t mode" "dev_t dev"
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fn ukfs_mkfifo "struct ukfs *ukfs" "const char *path" "mode_t mode"
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fn ukfs_mkdir "struct ukfs *ukfs" "const char *filename" "mode_t mode"
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fn ukfs_remove "struct ukfs *ukfs" "const char *filename"
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fn ukfs_rmdir "struct ukfs *ukfs" "const char *filename"
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fn ukfs_link "struct ukfs *ukfs" "const char *filename" "const char *f_create"
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fo ukfs_symlink
|
||||
.Fa "struct ukfs *ukfs" "const char *filename" "const char *linkname"
|
||||
.Fc
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fo ukfs_readlink
|
||||
.Fa "struct ukfs *ukfs" "const char *filename" "char *linkbuf" "size_t buflen"
|
||||
.Fc
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fn ukfs_rename "struct ukfs *ukfs" "const char *from" "const char *to"
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fo ukfs_stat
|
||||
.Fa "struct ukfs *ukfs" "const char *filename" "struct stat *file_stat"
|
||||
.Fc
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fo ukfs_lstat
|
||||
.Fa "struct ukfs *ukfs" "const char *filename" "struct stat *file_stat"
|
||||
.Fc
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fn ukfs_chmod "struct ukfs *ukfs" "const char *filename" "mode_t mode"
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fn ukfs_lchmod "struct ukfs *ukfs" "const char *filename" "mode_t mode"
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fo ukfs_chown
|
||||
.Fa "struct ukfs *ukfs" "const char *filename" "uid_t uid" "gid_t gid"
|
||||
.Fc
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fo ukfs_lchown
|
||||
.Fa "struct ukfs *ukfs" "const char *filename" "uid_t uid" "gid_t gid"
|
||||
.Fc
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fn ukfs_chflags "struct ukfs *ukfs" "const char *filename" "u_long flags"
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fn ukfs_lchflags "struct ukfs *ukfs" "const char *filename" "u_long flags"
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fo ukfs_utimes
|
||||
.Fa "struct ukfs *ukfs" "const char *filename" "const struct timeval *tptr"
|
||||
.Fc
|
||||
.Pp
|
||||
.Ft int
|
||||
.br
|
||||
.Fo ukfs_lutimes
|
||||
.Fa "struct ukfs *ukfs" "const char *filename" "const struct timeval *tptr"
|
||||
.Fc
|
||||
.Pp
|
||||
The above routines operate like their system call counterparts and the
|
||||
system call manual pages without the ukfs_ prefix should be referred to
|
||||
for further information on the parameters.
|
||||
.Pp
|
||||
The only call which modifies
|
||||
.Fa ukfs
|
||||
state is
|
||||
.Fn ukfs_chdir .
|
||||
It works like
|
||||
.Xr chdir 2
|
||||
in the sense that it affects the interpretation of relative paths.
|
||||
If succesful, all relative pathnames will be resolved starting from the
|
||||
current directory.
|
||||
Currently the call affects all accesses to that particular
|
||||
.Fa ,
|
||||
but it might be later changed to be thread private.
|
||||
.Sh UTILITIES
|
||||
.Ft int
|
||||
.br
|
||||
.Fn ukfs_util_builddirs "struct ukfs *ukfs" "const char *pathname" "mode_t mode"
|
||||
.Pp
|
||||
Builds a directory hierarchy.
|
||||
Unlike mkdir, the
|
||||
.Fa pathname
|
||||
argument may contain multiple levels of hierarchy.
|
||||
It is not considered an error if any of the directories specified exist
|
||||
already.
|
||||
.Sh SEE ALSO
|
||||
.Xr rump 3
|
||||
.Sh HISTORY
|
||||
.Nm
|
||||
first appeared in
|
||||
.Nx 5.0 .
|
||||
.Sh AUTHORS
|
||||
.An Antti Kantee Aq pooka@cs.hut.fi
|
||||
.Sh NOTES
|
||||
.Nm
|
||||
should be considered experimental technology and may change without warning.
|
|
@ -0,0 +1,536 @@
|
|||
/* $NetBSD: ukfs.c,v 1.1 2008/07/29 13:17:41 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
*
|
||||
* Development of this software was supported by the
|
||||
* Finnish Cultural Foundation.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This library enables access to files systems directly without
|
||||
* involving system calls.
|
||||
*/
|
||||
|
||||
#ifdef __linux__
|
||||
#define _XOPEN_SOURCE 500
|
||||
#define _BSD_SOURCE
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#endif
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <rump/ukfs.h>
|
||||
|
||||
#include <rump/rump.h>
|
||||
#include <rump/rump_syscalls.h>
|
||||
|
||||
#define UKFS_MODE_DEFAULT 0555
|
||||
|
||||
struct ukfs {
|
||||
struct mount *ukfs_mp;
|
||||
struct vnode *ukfs_rvp;
|
||||
|
||||
pthread_spinlock_t ukfs_spin;
|
||||
pid_t ukfs_nextpid;
|
||||
struct vnode *ukfs_cdir;
|
||||
};
|
||||
|
||||
struct mount *
|
||||
ukfs_getmp(struct ukfs *ukfs)
|
||||
{
|
||||
|
||||
return ukfs->ukfs_mp;
|
||||
}
|
||||
|
||||
struct vnode *
|
||||
ukfs_getrvp(struct ukfs *ukfs)
|
||||
{
|
||||
struct vnode *rvp;
|
||||
|
||||
rvp = ukfs->ukfs_rvp;
|
||||
rump_vp_incref(rvp);
|
||||
|
||||
return rvp;
|
||||
}
|
||||
|
||||
static pid_t
|
||||
nextpid(struct ukfs *ukfs)
|
||||
{
|
||||
pid_t npid;
|
||||
|
||||
pthread_spin_lock(&ukfs->ukfs_spin);
|
||||
npid = ukfs->ukfs_nextpid++;
|
||||
pthread_spin_unlock(&ukfs->ukfs_spin);
|
||||
|
||||
return npid;
|
||||
}
|
||||
|
||||
static void
|
||||
precall(struct ukfs *ukfs)
|
||||
{
|
||||
struct vnode *rvp, *cvp;
|
||||
|
||||
rump_setup_curlwp(nextpid(ukfs), 1, 1);
|
||||
rvp = ukfs_getrvp(ukfs);
|
||||
pthread_spin_lock(&ukfs->ukfs_spin);
|
||||
cvp = ukfs->ukfs_cdir;
|
||||
pthread_spin_unlock(&ukfs->ukfs_spin);
|
||||
rump_rcvp_set(rvp, cvp); /* takes refs */
|
||||
rump_vp_rele(rvp);
|
||||
}
|
||||
|
||||
static void
|
||||
postcall(struct ukfs *ukfs)
|
||||
{
|
||||
struct vnode *rvp;
|
||||
|
||||
rvp = ukfs_getrvp(ukfs);
|
||||
rump_rcvp_set(NULL, rvp);
|
||||
rump_vp_rele(rvp);
|
||||
rump_clear_curlwp();
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_init()
|
||||
{
|
||||
|
||||
rump_init();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct ukfs *
|
||||
ukfs_mount(const char *vfsname, const char *devpath, const char *mountpath,
|
||||
int mntflags, void *arg, size_t alen)
|
||||
{
|
||||
struct ukfs *fs = NULL;
|
||||
struct vfsops *vfsops;
|
||||
struct mount *mp;
|
||||
int rv = 0;
|
||||
|
||||
vfsops = rump_vfs_getopsbyname(vfsname);
|
||||
if (vfsops == NULL) {
|
||||
rv = ENOENT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
mp = rump_mnt_init(vfsops, mntflags);
|
||||
|
||||
fs = malloc(sizeof(struct ukfs));
|
||||
if (fs == NULL) {
|
||||
rv = ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
memset(fs, 0, sizeof(struct ukfs));
|
||||
pthread_spin_init(&fs->ukfs_spin, PTHREAD_PROCESS_SHARED);
|
||||
|
||||
rump_fakeblk_register(devpath);
|
||||
rv = rump_mnt_mount(mp, mountpath, arg, &alen);
|
||||
rump_fakeblk_deregister(devpath);
|
||||
if (rv) {
|
||||
warnx("VFS_MOUNT %d", rv);
|
||||
goto out;
|
||||
}
|
||||
fs->ukfs_mp = mp;
|
||||
|
||||
rv = rump_vfs_root(fs->ukfs_mp, &fs->ukfs_rvp, 0);
|
||||
fs->ukfs_cdir = ukfs_getrvp(fs);
|
||||
|
||||
out:
|
||||
if (rv) {
|
||||
if (fs && fs->ukfs_mp)
|
||||
rump_mnt_destroy(fs->ukfs_mp);
|
||||
if (fs)
|
||||
free(fs);
|
||||
errno = rv;
|
||||
fs = NULL;
|
||||
}
|
||||
|
||||
return fs;
|
||||
}
|
||||
|
||||
void
|
||||
ukfs_release(struct ukfs *fs, int flags)
|
||||
{
|
||||
int rv;
|
||||
|
||||
if ((flags & UKFS_RELFLAG_NOUNMOUNT) == 0) {
|
||||
rump_vp_rele(fs->ukfs_cdir);
|
||||
rv = rump_vfs_sync(fs->ukfs_mp, 1, NULL);
|
||||
rump_vp_recycle_nokidding(ukfs_getrvp(fs));
|
||||
rv |= rump_vfs_unmount(fs->ukfs_mp, 0);
|
||||
assert(rv == 0);
|
||||
}
|
||||
|
||||
rump_vfs_syncwait(fs->ukfs_mp);
|
||||
rump_mnt_destroy(fs->ukfs_mp);
|
||||
|
||||
pthread_spin_destroy(&fs->ukfs_spin);
|
||||
free(fs);
|
||||
}
|
||||
|
||||
/* don't need vn_lock(), since we don't have VXLOCK */
|
||||
#define VLE(a) rump_vp_lock_exclusive(a)
|
||||
#define VLS(a) rump_vp_lock_shared(a)
|
||||
#define VUL(a) rump_vp_unlock(a)
|
||||
#define AUL(a) assert(rump_vp_islocked(a) == 0)
|
||||
|
||||
#define STDCALL(ukfs, thecall) \
|
||||
int rv = 0; \
|
||||
\
|
||||
precall(ukfs); \
|
||||
thecall; \
|
||||
postcall(ukfs); \
|
||||
if (rv) { \
|
||||
errno = rv; \
|
||||
return -1; \
|
||||
} \
|
||||
return 0;
|
||||
|
||||
int
|
||||
ukfs_getdents(struct ukfs *ukfs, const char *dirname, off_t *off,
|
||||
uint8_t *buf, size_t bufsize)
|
||||
{
|
||||
struct uio *uio;
|
||||
struct vnode *vp;
|
||||
size_t resid;
|
||||
int rv, eofflag;
|
||||
|
||||
precall(ukfs);
|
||||
rv = rump_namei(RUMP_NAMEI_LOOKUP, RUMP_NAMEI_LOCKLEAF, dirname,
|
||||
NULL, &vp, NULL);
|
||||
postcall(ukfs);
|
||||
if (rv)
|
||||
goto out;
|
||||
|
||||
uio = rump_uio_setup(buf, bufsize, *off, RUMPUIO_READ);
|
||||
rv = RUMP_VOP_READDIR(vp, uio, NULL, &eofflag, NULL, NULL);
|
||||
VUL(vp);
|
||||
*off = rump_uio_getoff(uio);
|
||||
resid = rump_uio_free(uio);
|
||||
rump_vp_rele(vp);
|
||||
|
||||
out:
|
||||
if (rv) {
|
||||
errno = rv;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* LINTED: not totally correct return type, but follows syscall */
|
||||
return bufsize - resid;
|
||||
}
|
||||
|
||||
ssize_t
|
||||
ukfs_read(struct ukfs *ukfs, const char *filename, off_t off,
|
||||
uint8_t *buf, size_t bufsize)
|
||||
{
|
||||
int fd, rv = 0, dummy;
|
||||
ssize_t xfer = -1; /* XXXgcc */
|
||||
|
||||
precall(ukfs);
|
||||
fd = rump_sys_open(filename, RUMP_O_RDONLY, 0, &rv);
|
||||
if (rv)
|
||||
goto out;
|
||||
|
||||
xfer = rump_sys_pread(fd, buf, bufsize, 0, off, &rv);
|
||||
rump_sys_close(fd, &dummy);
|
||||
|
||||
out:
|
||||
postcall(ukfs);
|
||||
if (rv) {
|
||||
errno = rv;
|
||||
return -1;
|
||||
}
|
||||
return xfer;
|
||||
}
|
||||
|
||||
ssize_t
|
||||
ukfs_write(struct ukfs *ukfs, const char *filename, off_t off,
|
||||
uint8_t *buf, size_t bufsize)
|
||||
{
|
||||
int fd, rv = 0, dummy;
|
||||
ssize_t xfer = -1; /* XXXgcc */
|
||||
|
||||
precall(ukfs);
|
||||
fd = rump_sys_open(filename, RUMP_O_WRONLY, 0, &rv);
|
||||
if (rv)
|
||||
goto out;
|
||||
|
||||
/* write and commit */
|
||||
xfer = rump_sys_pwrite(fd, buf, bufsize, 0, off, &rv);
|
||||
if (rv == 0)
|
||||
rump_sys_fsync(fd, &dummy);
|
||||
|
||||
rump_sys_close(fd, &dummy);
|
||||
|
||||
out:
|
||||
postcall(ukfs);
|
||||
if (rv) {
|
||||
errno = rv;
|
||||
return -1;
|
||||
}
|
||||
return xfer;
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_create(struct ukfs *ukfs, const char *filename, mode_t mode)
|
||||
{
|
||||
int rv, fd, dummy;
|
||||
|
||||
precall(ukfs);
|
||||
fd = rump_sys_open(filename, RUMP_O_WRONLY | RUMP_O_CREAT, mode, &rv);
|
||||
rump_sys_close(fd, &dummy);
|
||||
|
||||
postcall(ukfs);
|
||||
if (rv) {
|
||||
errno = rv;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_mknod(struct ukfs *ukfs, const char *path, mode_t mode, dev_t dev)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys_mknod(path, mode, dev, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_mkfifo(struct ukfs *ukfs, const char *path, mode_t mode)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys_mkfifo(path, mode, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_mkdir(struct ukfs *ukfs, const char *filename, mode_t mode)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys_mkdir(filename, mode, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_remove(struct ukfs *ukfs, const char *filename)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys_unlink(filename, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_rmdir(struct ukfs *ukfs, const char *filename)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys_rmdir(filename, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_link(struct ukfs *ukfs, const char *filename, const char *f_create)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys_link(filename, f_create, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_symlink(struct ukfs *ukfs, const char *filename, const char *linkname)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys_symlink(filename, linkname, &rv));
|
||||
}
|
||||
|
||||
ssize_t
|
||||
ukfs_readlink(struct ukfs *ukfs, const char *filename,
|
||||
char *linkbuf, size_t buflen)
|
||||
{
|
||||
ssize_t rv;
|
||||
int myerr = 0;
|
||||
|
||||
precall(ukfs);
|
||||
rv = rump_sys_readlink(filename, linkbuf, buflen, &myerr);
|
||||
postcall(ukfs);
|
||||
if (myerr) {
|
||||
errno = rv;
|
||||
return -1;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_rename(struct ukfs *ukfs, const char *from, const char *to)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys_rename(from, to, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_chdir(struct ukfs *ukfs, const char *path)
|
||||
{
|
||||
struct vnode *newvp, *oldvp;
|
||||
int rv;
|
||||
|
||||
precall(ukfs);
|
||||
rump_sys_chdir(path, &rv);
|
||||
if (rv)
|
||||
goto out;
|
||||
|
||||
newvp = rump_cdir_get();
|
||||
pthread_spin_lock(&ukfs->ukfs_spin);
|
||||
oldvp = ukfs->ukfs_cdir;
|
||||
ukfs->ukfs_cdir = newvp;
|
||||
pthread_spin_unlock(&ukfs->ukfs_spin);
|
||||
if (oldvp)
|
||||
rump_vp_rele(oldvp);
|
||||
|
||||
out:
|
||||
postcall(ukfs);
|
||||
if (rv) {
|
||||
errno = rv;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_stat(struct ukfs *ukfs, const char *filename, struct stat *file_stat)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys___stat30(filename, file_stat, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_lstat(struct ukfs *ukfs, const char *filename, struct stat *file_stat)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys___lstat30(filename, file_stat, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_chmod(struct ukfs *ukfs, const char *filename, mode_t mode)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys_chmod(filename, mode, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_lchmod(struct ukfs *ukfs, const char *filename, mode_t mode)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys_lchmod(filename, mode, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_chown(struct ukfs *ukfs, const char *filename, uid_t uid, gid_t gid)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys_chown(filename, uid, gid, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_lchown(struct ukfs *ukfs, const char *filename, uid_t uid, gid_t gid)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys_lchown(filename, uid, gid, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_chflags(struct ukfs *ukfs, const char *filename, u_long flags)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys_chflags(filename, flags, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_lchflags(struct ukfs *ukfs, const char *filename, u_long flags)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys_lchflags(filename, flags, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_utimes(struct ukfs *ukfs, const char *filename, const struct timeval *tptr)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys_utimes(filename, tptr, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_lutimes(struct ukfs *ukfs, const char *filename,
|
||||
const struct timeval *tptr)
|
||||
{
|
||||
|
||||
STDCALL(ukfs, rump_sys_lutimes(filename, tptr, &rv));
|
||||
}
|
||||
|
||||
int
|
||||
ukfs_util_builddirs(struct ukfs *ukfs, const char *pathname, mode_t mode)
|
||||
{
|
||||
char *f1, *f2;
|
||||
int rv;
|
||||
mode_t mask;
|
||||
bool end;
|
||||
|
||||
/*ukfs_umask((mask = ukfs_umask(0)));*/
|
||||
umask((mask = umask(0)));
|
||||
|
||||
f1 = f2 = strdup(pathname);
|
||||
if (f1 == NULL) {
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
|
||||
end = false;
|
||||
for (;;) {
|
||||
/* find next component */
|
||||
f2 += strspn(f2, "/");
|
||||
f2 += strcspn(f2, "/");
|
||||
if (*f2 == '\0')
|
||||
end = true;
|
||||
else
|
||||
*f2 = '\0';
|
||||
|
||||
rv = ukfs_mkdir(ukfs, f1, mode & ~mask);
|
||||
if (errno == EEXIST)
|
||||
rv = 0;
|
||||
|
||||
if (rv == -1 || *f2 != '\0' || end)
|
||||
break;
|
||||
|
||||
*f2 = '/';
|
||||
}
|
||||
|
||||
free(f1);
|
||||
|
||||
return rv;
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
/* $NetBSD: ukfs.h,v 1.1 2008/07/29 13:17:41 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
*
|
||||
* Development of this software was supported by the
|
||||
* Finnish Cultural Foundation.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _RUMP_UKFS_H_
|
||||
#define _RUMP_UKFS_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* don't include <sys/header.h> for portability */
|
||||
struct vnode;
|
||||
struct componentname;
|
||||
struct stat;
|
||||
|
||||
struct ukfs;
|
||||
|
||||
#define UKFS_DEFAULTMP "/"
|
||||
|
||||
#define UKFS_RELFLAG_NOUNMOUNT 0x01
|
||||
|
||||
int ukfs_init(void);
|
||||
struct ukfs *ukfs_mount(const char *, const char *, const char *,
|
||||
int, void *, size_t);
|
||||
void ukfs_release(struct ukfs *, int);
|
||||
|
||||
int ukfs_getdents(struct ukfs *, const char *, off_t *,
|
||||
uint8_t *, size_t);
|
||||
ssize_t ukfs_read(struct ukfs *, const char *, off_t,
|
||||
uint8_t *, size_t);
|
||||
ssize_t ukfs_write(struct ukfs *, const char *, off_t,
|
||||
uint8_t *, size_t);
|
||||
ssize_t ukfs_readlink(struct ukfs *, const char *, char *, size_t);
|
||||
|
||||
int ukfs_create(struct ukfs *, const char *, mode_t);
|
||||
int ukfs_mkdir(struct ukfs *, const char *, mode_t);
|
||||
int ukfs_mknod(struct ukfs *, const char *, mode_t, dev_t);
|
||||
int ukfs_mkfifo(struct ukfs *, const char *, mode_t);
|
||||
int ukfs_symlink(struct ukfs *, const char *, const char *);
|
||||
|
||||
int ukfs_remove(struct ukfs *, const char *);
|
||||
int ukfs_rmdir(struct ukfs *, const char *);
|
||||
|
||||
int ukfs_link(struct ukfs *, const char *, const char *);
|
||||
int ukfs_rename(struct ukfs *, const char *, const char *);
|
||||
|
||||
int ukfs_chdir(struct ukfs *, const char *);
|
||||
|
||||
int ukfs_stat(struct ukfs *, const char *, struct stat *);
|
||||
int ukfs_lstat(struct ukfs *, const char *, struct stat *);
|
||||
|
||||
int ukfs_chmod(struct ukfs *, const char *, mode_t);
|
||||
int ukfs_lchmod(struct ukfs *, const char *, mode_t);
|
||||
int ukfs_chown(struct ukfs *, const char *, uid_t, gid_t);
|
||||
int ukfs_lchown(struct ukfs *, const char *, uid_t, gid_t);
|
||||
int ukfs_chflags(struct ukfs *, const char *, u_long);
|
||||
int ukfs_lchflags(struct ukfs *, const char *, u_long);
|
||||
|
||||
int ukfs_utimes(struct ukfs *, const char *,
|
||||
const struct timeval *);
|
||||
int ukfs_lutimes(struct ukfs *, const char *,
|
||||
const struct timeval *);
|
||||
|
||||
struct mount *ukfs_getmp(struct ukfs *);
|
||||
struct vnode *ukfs_getrvp(struct ukfs *);
|
||||
|
||||
/* Utilities */
|
||||
int ukfs_util_builddirs(struct ukfs *, const char *, mode_t);
|
||||
|
||||
#endif /* _RUMP_UKFS_H_ */
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: bsd.hostprog.mk,v 1.51 2008/04/26 20:03:44 christos Exp $
|
||||
# $NetBSD: bsd.hostprog.mk,v 1.52 2008/07/29 13:17:41 pooka Exp $
|
||||
# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
|
||||
|
||||
.include <bsd.init.mk>
|
||||
|
@ -33,6 +33,7 @@ LIBMENU?= /usr/lib/libmenu.a
|
|||
LIBMP?= /usr/lib/libmp.a
|
||||
LIBNTP?= /usr/lib/libntp.a
|
||||
LIBOBJC?= /usr/lib/libobjc.a
|
||||
LIBP2K?= /usr/lib/libp2k.a
|
||||
LIBPC?= /usr/lib/libpc.a
|
||||
LIBPCAP?= /usr/lib/libpcap.a
|
||||
LIBPCI?= /usr/lib/libpci.a
|
||||
|
@ -41,6 +42,8 @@ LIBPOSIX?= /usr/lib/libposix.a
|
|||
LIBPUFFS?= /usr/lib/libpuffs.a
|
||||
LIBRESOLV?= /usr/lib/libresolv.a
|
||||
LIBRPCSVC?= /usr/lib/librpcsvc.a
|
||||
LIBRUMP?= /usr/lib/librump.a
|
||||
LIBRUMPUSER?= /usr/lib/librumpuser.a
|
||||
LIBSDP?= /usr/lib/libsdp.a
|
||||
LIBSKEY?= /usr/lib/libskey.a
|
||||
LIBSSP?= /usr/lib/libssp.a
|
||||
|
@ -49,9 +52,24 @@ LIBSUPCXX?= /usr/lib/libsupc++.a
|
|||
LIBTERMCAP?= /usr/lib/libtermcap.a
|
||||
LIBUTIL?= /usr/lib/libutil.a
|
||||
LIBWRAP?= /usr/lib/libwrap.a
|
||||
LIBUKFS?= /usr/lib/libukfs.a
|
||||
LIBY?= /usr/lib/liby.a
|
||||
LIBZ?= /usr/lib/libz.a
|
||||
|
||||
##### rump file system modules
|
||||
LIBRUMPFS_CD9660FS?= /usr/lib/librumpfs_cd9660fs.a
|
||||
LIBRUMPFS_EFS?= /usr/lib/librumpfs_efs.a
|
||||
LIBRUMPFS_EXT2FS?= /usr/lib/librumpfs_ext2fs.a
|
||||
LIBRUMPFS_FFS?= /usr/lib/librumpfs_ffs.a
|
||||
LIBRUMPFS_HFS?= /usr/lib/librumpfs_hfs.a
|
||||
LIBRUMPFS_LFS?= /usr/lib/librumpfs_lfs.a
|
||||
LIBRUMPFS_MSDOSFS?= /usr/lib/librumpfs_msdosfs.a
|
||||
LIBRUMPFS_NTFS?= /usr/lib/librumpfs_ntfs.a
|
||||
LIBRUMPFS_SYSPUFFS?= /usr/lib/librumpfs_syspuffs.a
|
||||
LIBRUMPFS_TMPFS?= /usr/lib/librumpfs_tmpfs.a
|
||||
LIBRUMPFS_UDF?= /usr/lib/librumpfs_udf.a
|
||||
LIBRUMPFS_UFS?= /usr/lib/librumpfs_ufs.a
|
||||
|
||||
HOST_MKDEP?= CC=${HOST_CC:Q} mkdep
|
||||
MKDEP_SUFFIXES?= .lo .ln
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: bsd.prog.mk,v 1.229 2008/05/28 11:23:26 lukem Exp $
|
||||
# $NetBSD: bsd.prog.mk,v 1.230 2008/07/29 13:17:41 pooka Exp $
|
||||
# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
|
||||
|
||||
.ifndef HOSTPROG
|
||||
|
@ -94,8 +94,12 @@ LIBCRT0= ${DESTDIR}/usr/lib/crt0.o
|
|||
form fl g2c gcc gnumalloc gssapi hdb heimntlm hx509 intl ipsec \
|
||||
kadm5clnt kadm5srv kafs krb5 kvm l lber ldap ldap_r \
|
||||
m magic menu objc ossaudio pam pcap pci pmc posix pthread pthread_dbg \
|
||||
puffs radius resolv rmt roken rpcsvc rt sdp skey sl ss ssh ssl termcap \
|
||||
usbhid util wrap y z bind9 dns lwres isccfg isccc isc
|
||||
puffs radius resolv rmt roken rpcsvc rt rump rumpuser sdp skey sl ss \
|
||||
ssh ssl termcap usbhid util wrap y z bind9 dns lwres isccfg isccc isc \
|
||||
\
|
||||
rumpfs_cd9660fs rumpfs_efs rumpfs_ext2fs rumpfs_ffs rumpfs_hfs \
|
||||
rumpfs_lfs rumpfs_msdosfs rumpfs_nfs rumpfs_ntfs rumpfs_syspuffs \
|
||||
rumpfs_tmpfs rumpfs_udf rumpfs_ufs
|
||||
.ifndef LIB${_lib:tu}
|
||||
LIB${_lib:tu}= ${DESTDIR}/usr/lib/lib${_lib}.a
|
||||
.MADE: ${LIB${_lib:tu}} # Note: ${DESTDIR} will be expanded
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.69 2008/07/28 18:12:53 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.70 2008/07/29 13:17:40 pooka Exp $
|
||||
|
||||
SUBDIR= altq arch compat dev fs miscfs \
|
||||
net net80211 netatalk netbt netipsec netinet netinet6 \
|
||||
netisdn netiso netkey netnatm netsmb \
|
||||
nfs opencrypto rump sys ufs uvm
|
||||
nfs opencrypto sys ufs uvm
|
||||
|
||||
# interrupt implementation depends on the kernel within the port
|
||||
.if (${MACHINE} != "evbppc")
|
||||
|
|
|
@ -1,24 +1,16 @@
|
|||
# $NetBSD: Makefile.rump,v 1.9 2008/07/18 16:20:03 pooka Exp $
|
||||
# $NetBSD: Makefile.rump,v 1.10 2008/07/29 13:17:41 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
LIBISPRIVATE= yes
|
||||
NOMAN= wizd
|
||||
|
||||
WARNS?= 4
|
||||
DBG= -g -O0
|
||||
NOLINT= # kernel code
|
||||
|
||||
CPPFLAGS+= -I${.CURDIR} -I.
|
||||
|
||||
.if "${RUMPKERNEL}" != "no"
|
||||
CFLAGS+= -ffreestanding
|
||||
CPPFLAGS:= -I${NETBSDSRCDIR}/sys/rump/include ${CPPFLAGS}
|
||||
CPPFLAGS+= -D_KERNEL -I${NETBSDSRCDIR}/common/include
|
||||
CPPFLAGS+= -D_RUMPKERNEL -DDEBUG -DDIAGNOSTIC
|
||||
CPPFLAGS+= -nostdinc -I${NETBSDSRCDIR}/sys
|
||||
.endif
|
||||
CPPFLAGS+= -D_KERNEL -D_RUMPKERNEL -DDIAGNOSTIC
|
||||
CPPFLAGS:= -I${RUMPTOP}/include ${CPPFLAGS}
|
||||
CPPFLAGS+= -I${.CURDIR} -I.
|
||||
CPPFLAGS+= -I${RUMPTOP}/../../common/include
|
||||
CPPFLAGS+= -nostdinc -I${RUMPTOP}/..
|
||||
#CPPFLAGS+= -DDEBUG
|
||||
|
||||
LDFLAGS+= -Wl,--wrap=malloc
|
||||
|
||||
LIBRUMPDIR != cd ${NETBSDSRCDIR}/sys/rump/librump/rumpkern && ${PRINTOBJDIR}
|
||||
# If an options are changed, trigger a rebuild
|
||||
${SRCS:S/.c/.o/g}: ${RUMPTOP}/Makefile.rump
|
||||
|
|
|
@ -1,25 +1,29 @@
|
|||
$NetBSD: README.dirs,v 1.3 2007/08/16 19:56:22 pooka Exp $
|
||||
$NetBSD: README.dirs,v 1.4 2008/07/29 13:17:41 pooka Exp $
|
||||
|
||||
Runnable Userspace Meta Programs
|
||||
|
||||
Quick rundown of the current directory structure:
|
||||
|
||||
/librump - kernel runtime emulation
|
||||
sys/rump/librump - kernel runtime emulation
|
||||
/rumpkern - portion compiled with -D_KERNEL, uses kernel headers
|
||||
/rumpuser - userspace namespace support for previous, *NO* -D_KERNEL
|
||||
provides e.g. malloc() and some syscalls
|
||||
|
||||
/include
|
||||
sys/rump/include
|
||||
/machine - headers meant to be used for rump compilation when the MD
|
||||
ones cause too much trouble, e.g. curlwp which is different
|
||||
from arch to arch
|
||||
|
||||
/fs - file system rumps
|
||||
/lib - libraries used by fs rumps
|
||||
/lib$fs - kernel file system code compiled out of /sys with -D_KERNEL
|
||||
/libp2k - puffs-to-vfs adaption layer, userspace namespace
|
||||
/libukfs - user kernel file system, a library to access file system
|
||||
images (or devices) directly in userspace without going
|
||||
through a system call and puffs
|
||||
/bin - rumps themselves. fsconsole uses ukfs directly. the rest are
|
||||
file system specific rumps and use puffs
|
||||
sys/rump/fs - file system rumps
|
||||
/lib/lib_$fs - kernel file system code compiled out of /sys with -D_KERNEL
|
||||
|
||||
|
||||
Users:
|
||||
src/lib
|
||||
/libp2k - puffs-to-vfs adaption layer, userspace namespace
|
||||
/libukfs - user kernel file system, a library to access file system
|
||||
images (or devices) directly in userspace without going
|
||||
through a system call and puffs
|
||||
|
||||
src/usr.sbin/puffs
|
||||
rump_$fs - userspace file system daemons using the kernel fs code
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
$NetBSD: TODO,v 1.2 2008/07/16 15:54:24 pooka Exp $
|
||||
$NetBSD: TODO,v 1.3 2008/07/29 13:17:41 pooka Exp $
|
||||
|
||||
* fix the build structure to work better on non-NetBSD
|
||||
* figure out how to handle mount parameters in fs-independent
|
||||
fashion (requires kernel changes)
|
||||
* integrate build framework with config(1) to stop the need to
|
||||
maintain a separate build infrastructure
|
||||
* make libraries dynamic, dlopen them instead of linking if possible
|
||||
* dlopen libraries instead of linking where it makes sense
|
||||
+ makes a difference for e.g. "fsconsole"
|
||||
* support nfs (requires using the network stack in userspace)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# $NetBSD: Makefile,v 1.1 2007/08/05 22:28:01 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.2 2008/07/29 13:17:41 pooka Exp $
|
||||
#
|
||||
|
||||
SUBDIR= lib .WAIT bin
|
||||
SUBDIR= lib .WAIT rumptest
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
|
|
@ -1,30 +1,10 @@
|
|||
# $NetBSD: Makefile.rumpfs,v 1.8 2008/01/02 18:15:12 pooka Exp $
|
||||
# $NetBSD: Makefile.rumpfs,v 1.9 2008/07/29 13:17:41 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
RUMPFSLIST= cd9660fs efs ext2fs ffs hfs lfs msdosfs ntfs syspuffs tmpfs udf
|
||||
RUMPFSALL= ${RUMPFSLIST} p2k ukfs ufs
|
||||
|
||||
RUMPFSLIBDIR?= ${NETBSDSRCDIR}/sys/rump/fs/lib
|
||||
RUMPFSALL= ${RUMPFSLIST} ufs
|
||||
|
||||
.for var in ${RUMPFSALL}
|
||||
RUMPFSLIBS+=lib${var}
|
||||
.endfor
|
||||
|
||||
# this is a hack: PRINTOBJDIR is really expensive, so do it only when necessary
|
||||
.ifndef RUMPFS_NOFSLIB
|
||||
RUMPFS_WANT+=${PROG} p2k ukfs
|
||||
.endif
|
||||
|
||||
.for var in ${RUMPFS_WANT}
|
||||
.ifndef RUMPFSLIB${var:tu}OBJDIR
|
||||
RUMPFSLIB${var:tu}OBJDIR != cd ${RUMPFSLIBDIR}/lib${var} && ${PRINTOBJDIR}
|
||||
RUMPFSLD_${var:tu}:=-L${RUMPFSLIB${var:tu}OBJDIR} -Wl,--whole-archive \
|
||||
-l${var} -Wl,--no-whole-archive
|
||||
RUMPFSDP_${var:tu}:=${RUMPFSLIB${var:tu}OBJDIR}/lib${var}.a
|
||||
|
||||
RUMPFSLD_ALL+=${RUMPFSLD_${var:tu}}
|
||||
RUMPFSDP_ALL+=${RUMPFSDP_${var:tu}}
|
||||
.endif
|
||||
RUMPFSLDADD+=-lrumpfs_${var}
|
||||
.endfor
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.2 2007/08/16 19:48:31 pooka Exp $
|
||||
#
|
||||
|
||||
.include "${.CURDIR}/../Makefile.rumpfs"
|
||||
|
||||
SUBDIR= ${RUMPFSLIST} fsconsole
|
||||
|
||||
.include <bsd.subdir.mk>
|
|
@ -1,18 +0,0 @@
|
|||
# $NetBSD: Makefile.inc,v 1.4 2007/10/31 17:53:38 pooka Exp $
|
||||
#
|
||||
|
||||
NOMAN= 1
|
||||
WARNS?= 4
|
||||
|
||||
CPPFLAGS+= -I${NETBSDSRCDIR}/sys/rump/fs/lib/libp2k -I${NETBSDSRCDIR}/sys
|
||||
.ifndef RUMPFS_NOFSLIB
|
||||
LDADD+= ${RUMPFSLD_P2K} ${RUMPFSLD_UKFS} ${LIBUTIL} ${LIBPUFFS}
|
||||
.endif
|
||||
LDADD+= -L${LIBRUMPDIR} -Wl,--whole-archive -lrump \
|
||||
-Wl,--no-whole-archive -lpthread
|
||||
|
||||
RUMPKERNEL= no
|
||||
INSTALL_FILE= : not today
|
||||
|
||||
.include "${.CURDIR}/../../Makefile.rumpfs"
|
||||
.include "${NETBSDSRCDIR}/sys/rump/Makefile.rump"
|
|
@ -1,9 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.1 2007/08/05 22:28:01 pooka Exp $
|
||||
#
|
||||
|
||||
PROG= cd9660fs
|
||||
|
||||
LDADD+= ${RUMPFSLD_CD9660FS}
|
||||
DPADD+= ${RUMPFSDP_CD9660FS}
|
||||
|
||||
.include <bsd.prog.mk>
|
|
@ -1,9 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.1 2007/08/05 22:28:02 pooka Exp $
|
||||
#
|
||||
|
||||
PROG= efs
|
||||
|
||||
LDADD+= ${RUMPFSLD_EFS}
|
||||
DPADD+= ${RUMPFSDP_EFS}
|
||||
|
||||
.include <bsd.prog.mk>
|
|
@ -1,11 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.1 2007/08/07 21:26:36 pooka Exp $
|
||||
#
|
||||
|
||||
PROG= ext2fs
|
||||
|
||||
LDADD+= ${RUMPFSLD_EXT2FS} ${RUMPFSLD_UFS} ${RUMPFSLD_FFS}
|
||||
DPADD+= ${RUMPFSDP_EXT2FS} ${RUMPFSDP_UFS} ${RUMPFSDP_FFS}
|
||||
|
||||
RUMPFS_WANT+= ufs ffs
|
||||
|
||||
.include <bsd.prog.mk>
|
|
@ -1,11 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.1 2007/08/05 22:28:02 pooka Exp $
|
||||
#
|
||||
|
||||
PROG= ffs
|
||||
|
||||
LDADD+= ${RUMPFSLD_FFS} ${RUMPFSLD_UFS}
|
||||
DPADD+= ${RUMPFSDP_FFS} ${RUMPFSDP_UFS}
|
||||
|
||||
RUMPFS_WANT+= ufs
|
||||
|
||||
.include <bsd.prog.mk>
|
|
@ -1,15 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.3 2008/03/12 05:11:51 lukem Exp $
|
||||
#
|
||||
|
||||
PROG= fsconsole
|
||||
RUMPFS_NOFSLIB= # defined
|
||||
|
||||
LDADD+= ${RUMPFSLD_ALL}
|
||||
DPADD+= ${RUMPFSDP_ALL}
|
||||
CPPFLAGS+= -I${NETBSDSRCDIR}/sys/rump/librump/rumpkern \
|
||||
-I${LIBRUMPDIR} \
|
||||
-I${NETBSDSRCDIR}/sys/rump/fs/lib/libukfs
|
||||
|
||||
RUMPFS_WANT= ${RUMPFSLIST} ufs ukfs
|
||||
|
||||
.include <bsd.prog.mk>
|
|
@ -1,147 +0,0 @@
|
|||
/* $NetBSD: fsconsole.c,v 1.12 2008/07/15 16:21:19 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
*
|
||||
* Development of this software was supported by the
|
||||
* Finnish Cultural Foundation.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* If you can keep a secret: THIS IS NOT FINISHED AT ALL
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "ukfs.h"
|
||||
|
||||
struct fscons_args {
|
||||
char *fspec;
|
||||
};
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
uint8_t buf[8192];
|
||||
struct ukfs *fs;
|
||||
struct fscons_args args;
|
||||
off_t off;
|
||||
#ifdef __NetBSD__
|
||||
struct dirent *dent;
|
||||
#endif
|
||||
int rv;
|
||||
|
||||
ukfs_init();
|
||||
|
||||
if (argc != 3) {
|
||||
fprintf(stderr, "usage: fsconsole fstype fsdevice\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* XXXXXXXXXXX: this needs fs-specific handling */
|
||||
memset(&args, 0, sizeof(args));
|
||||
args.fspec = strdup(argv[2]);
|
||||
fs = ukfs_mount(argv[1], argv[2], "/", 0, &args, sizeof(args));
|
||||
|
||||
printf("got fs at %p\n", fs);
|
||||
|
||||
off = 0;
|
||||
rv = ukfs_getdents(fs, "/", &off, buf, sizeof(buf));
|
||||
printf("rv %d\n", rv);
|
||||
if (rv == -1)
|
||||
rv = 0;
|
||||
|
||||
#ifdef __NetBSD__
|
||||
dent = (void *)buf;
|
||||
while (rv) {
|
||||
printf("%s\n", dent->d_name);
|
||||
rv -= _DIRENT_SIZE(dent);
|
||||
dent = _DIRENT_NEXT(dent);
|
||||
}
|
||||
#endif
|
||||
|
||||
rv = ukfs_read(fs, "/etc/passwd", 0, buf, sizeof(buf));
|
||||
printf("rv %d\n%s\n", rv, buf);
|
||||
|
||||
rv = ukfs_remove(fs, "/lopinaa");
|
||||
if (rv == -1)
|
||||
warn("remove1 %d", rv);
|
||||
|
||||
rv = ukfs_mkdir(fs, "/jonkka", 0777);
|
||||
if (rv == -1)
|
||||
warn("mkdir %s", strerror(errno));
|
||||
rv = ukfs_chdir(fs, "/jonkka");
|
||||
if (rv == -1)
|
||||
warn("chdir %s", strerror(errno));
|
||||
|
||||
rv = ukfs_remove(fs, "/etc/LUSIKKAPUOLI");
|
||||
if (rv == -1)
|
||||
warn("remove2 %d", rv);
|
||||
|
||||
rv = ukfs_create(fs, "lopinaa", 0555 | S_IFREG);
|
||||
if (rv == -1)
|
||||
warn("create %d", rv);
|
||||
|
||||
rv = ukfs_link(fs, "/jonkka/lopinaa", "/LUSIKKAPUOLI");
|
||||
if (rv == -1)
|
||||
warn("link rv %d", rv);
|
||||
|
||||
rv = ukfs_symlink(fs, "/mihis_haluat_menna_tanaan", "/jonkka/muualle");
|
||||
if (rv == -1)
|
||||
warn("symlink %d", rv);
|
||||
|
||||
rv = ukfs_readlink(fs, "muualle",
|
||||
(char *)buf, sizeof(buf));
|
||||
if (rv > 0) {
|
||||
buf[rv] = '\0';
|
||||
printf("readlink rv %d result \"%s\"\n", rv, buf);
|
||||
} else {
|
||||
printf("readlink fail: %s\n", strerror(errno));
|
||||
}
|
||||
|
||||
off = 0;
|
||||
rv = ukfs_getdents(fs, "/etc", &off, buf, sizeof(buf));
|
||||
printf("rv %d\n", rv);
|
||||
if (rv == -1)
|
||||
rv = 0;
|
||||
|
||||
#ifdef __NetBSD__
|
||||
dent = (void *)buf;
|
||||
while (rv) {
|
||||
printf("%s\n", dent->d_name);
|
||||
rv -= _DIRENT_SIZE(dent);
|
||||
dent = _DIRENT_NEXT(dent);
|
||||
}
|
||||
#endif
|
||||
|
||||
ukfs_release(fs, 1);
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.1 2007/08/08 09:28:54 pooka Exp $
|
||||
#
|
||||
|
||||
PROG= hfs
|
||||
|
||||
LDADD+= ${RUMPFSLD_HFS}
|
||||
DPADD+= ${RUMPFSDP_HFS}
|
||||
|
||||
.include <bsd.prog.mk>
|
|
@ -1,11 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.2 2007/08/09 09:19:30 pooka Exp $
|
||||
#
|
||||
|
||||
PROG= lfs
|
||||
|
||||
LDADD+= ${RUMPFSLD_LFS} ${RUMPFSLD_UFS} ${RUMPFSLD_FFS}
|
||||
DPADD+= ${RUMPFSDP_LFS} ${RUMPFSDP_UFS} ${RUMPFSDP_FFS}
|
||||
|
||||
RUMPFS_WANT+= ufs ffs
|
||||
|
||||
.include <bsd.prog.mk>
|
|
@ -1,9 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.1 2007/08/08 07:53:55 pooka Exp $
|
||||
#
|
||||
|
||||
PROG= msdosfs
|
||||
|
||||
LDADD+= ${RUMPFSLD_MSDOSFS}
|
||||
DPADD+= ${RUMPFSDP_MSDOSFS}
|
||||
|
||||
.include <bsd.prog.mk>
|
|
@ -1,9 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.1 2007/08/05 22:28:03 pooka Exp $
|
||||
#
|
||||
|
||||
PROG= ntfs
|
||||
|
||||
LDADD+= ${RUMPFSLD_NTFS}
|
||||
DPADD+= ${RUMPFSDP_NTFS}
|
||||
|
||||
.include <bsd.prog.mk>
|
|
@ -1,11 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.1 2008/01/02 18:15:12 pooka Exp $
|
||||
#
|
||||
|
||||
PROG= syspuffs
|
||||
|
||||
LDADD+= ${RUMPFSLD_SYSPUFFS}
|
||||
DPADD+= ${RUMPFSDP_SYSPUFFS}
|
||||
|
||||
CPPFLAGS+= -I${RUMPFSLIBDIR}/libsyspuffs
|
||||
|
||||
.include <bsd.prog.mk>
|
|
@ -1,9 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.1 2007/08/05 22:28:03 pooka Exp $
|
||||
#
|
||||
|
||||
PROG= tmpfs
|
||||
|
||||
LDADD+= ${RUMPFSLD_TMPFS}
|
||||
DPADD+= ${RUMPFSDP_TMPFS}
|
||||
|
||||
.include <bsd.prog.mk>
|
|
@ -1,12 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.2 2008/05/14 20:13:05 reinoud Exp $
|
||||
#
|
||||
|
||||
PROG= udf
|
||||
|
||||
COPTS+= -DUDF_READWRITE -DDEBUG -DDIAGNOSTIC
|
||||
RUMPFSLD_UDF= -Wl,--whole-archive -lrump -Wl,--no-whole-archive
|
||||
|
||||
LDADD+= ${RUMPFSLD_UDF}
|
||||
DPADD+= ${RUMPFSDP_UDF}
|
||||
|
||||
.include <bsd.prog.mk>
|
|
@ -1,21 +1,7 @@
|
|||
# $NetBSD: Makefile.inc,v 1.8 2008/07/20 15:56:44 he Exp $
|
||||
# $NetBSD: Makefile.inc,v 1.9 2008/07/29 13:17:42 pooka Exp $
|
||||
#
|
||||
|
||||
LIBISPRIVATE= yes
|
||||
NOMAN= wizd
|
||||
RUMPTOP= ${.CURDIR}/../../..
|
||||
|
||||
WARNS?= 4
|
||||
DBG= -O0 -g
|
||||
|
||||
CPPFLAGS+= -I${.CURDIR} -I.
|
||||
.if "${RUMPKERNEL}" != "no"
|
||||
CFLAGS+= -ffreestanding
|
||||
CPPFLAGS:= -I${NETBSDSRCDIR}/sys/rump/include ${CPPFLAGS}
|
||||
CPPFLAGS+= -D_KERNEL -I${NETBSDSRCDIR}/common/include
|
||||
CPPFLAGS+= -D_RUMPKERNEL -DDEBUG -DDIAGNOSTIC
|
||||
CPPFLAGS+= -nostdinc -I${NETBSDSRCDIR}/sys
|
||||
|
||||
# If an options are changed, trigger a rebuild
|
||||
${SRCS:S/.c/.o/g}: ${.CURDIR}/../Makefile.inc
|
||||
|
||||
.endif
|
||||
.include "${RUMPTOP}/Makefile.rump"
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.2 2007/08/07 10:16:56 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.3 2008/07/29 13:17:42 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.PATH: ${.CURDIR}/../../../../fs/cd9660
|
||||
|
||||
LIB= cd9660fs
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/sys/fs/cd9660
|
||||
LIB= rumpfs_cd9660fs
|
||||
|
||||
SRCS= cd9660_bmap.c cd9660_node.c cd9660_util.c cd9660_vnops.c \
|
||||
cd9660_lookup.c cd9660_rrip.c cd9660_vfsops.c
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# $NetBSD: shlib_version,v 1.1 2008/07/29 13:17:42 pooka Exp $
|
||||
#
|
||||
major=0
|
||||
minor=0
|
|
@ -1,11 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.2 2007/08/07 10:16:57 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.3 2008/07/29 13:17:42 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.PATH: ${.CURDIR}/../../../../fs/efs
|
||||
|
||||
LIB= efs
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/sys/fs/efs
|
||||
LIB= rumpfs_efs
|
||||
|
||||
SRCS= efs_genfs.c efs_ihash.c efs_subr.c efs_vfsops.c efs_vnops.c
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# $NetBSD: shlib_version,v 1.1 2008/07/29 13:17:42 pooka Exp $
|
||||
#
|
||||
major=0
|
||||
minor=0
|
|
@ -1,11 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.1 2007/08/07 21:26:36 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.2 2008/07/29 13:17:42 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.PATH: ${.CURDIR}/../../../../ufs/ext2fs
|
||||
|
||||
LIB= ext2fs
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/sys/ufs/ext2fs
|
||||
LIB= rumpfs_ext2fs
|
||||
|
||||
SRCS= ext2fs_alloc.c ext2fs_balloc.c ext2fs_bmap.c ext2fs_bswap.c \
|
||||
ext2fs_inode.c ext2fs_lookup.c ext2fs_readwrite.c ext2fs_subr.c \
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# $NetBSD: shlib_version,v 1.1 2008/07/29 13:17:42 pooka Exp $
|
||||
#
|
||||
major=0
|
||||
minor=0
|
|
@ -1,11 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.3 2007/09/24 01:31:07 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.4 2008/07/29 13:17:42 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.PATH: ${.CURDIR}/../../../../ufs/ffs
|
||||
|
||||
LIB= ffs
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/sys/ufs/ffs
|
||||
LIB= rumpfs_ffs
|
||||
|
||||
SRCS= ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_inode.c \
|
||||
ffs_softdep.stub.c ffs_subr.c ffs_tables.c ffs_vfsops.c \
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# $NetBSD: shlib_version,v 1.1 2008/07/29 13:17:42 pooka Exp $
|
||||
#
|
||||
major=0
|
||||
minor=0
|
|
@ -1,11 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.1 2007/08/08 09:28:53 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.2 2008/07/29 13:17:42 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.PATH: ${.CURDIR}/../../../../fs/hfs
|
||||
|
||||
LIB= hfs
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/sys/fs/hfs
|
||||
LIB= rumpfs_hfs
|
||||
|
||||
SRCS= hfs_nhash.c hfs_subr.c hfs_vfsops.c hfs_vnops.c libhfs.c unicode.c
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# $NetBSD: shlib_version,v 1.1 2008/07/29 13:17:43 pooka Exp $
|
||||
#
|
||||
major=0
|
||||
minor=0
|
|
@ -1,11 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.4 2007/12/13 16:08:12 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.5 2008/07/29 13:17:43 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.PATH: ${.CURDIR}/../../../../ufs/lfs
|
||||
|
||||
LIB= lfs
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/sys/ufs/lfs
|
||||
LIB= rumpfs_lfs
|
||||
|
||||
SRCS= lfs_alloc.c lfs_balloc.c lfs_bio.c lfs_cksum.c lfs_debug.c \
|
||||
lfs_inode.c lfs_itimes.c lfs_rfw.c lfs_segment.c lfs_subr.c \
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# $NetBSD: shlib_version,v 1.1 2008/07/29 13:17:43 pooka Exp $
|
||||
#
|
||||
major=0
|
||||
minor=0
|
|
@ -1,11 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.1 2007/08/08 07:53:54 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.2 2008/07/29 13:17:43 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.PATH: ${.CURDIR}/../../../../fs/msdosfs
|
||||
|
||||
LIB= msdosfs
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/sys/fs/msdosfs
|
||||
LIB= rumpfs_msdosfs
|
||||
|
||||
SRCS= msdosfs_conv.c msdosfs_fat.c msdosfs_vfsops.c msdosfs_denode.c \
|
||||
msdosfs_lookup.c msdosfs_vnops.c
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# $NetBSD: shlib_version,v 1.1 2008/07/29 13:17:43 pooka Exp $
|
||||
#
|
||||
major=0
|
||||
minor=0
|
|
@ -1,11 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.2 2007/08/07 10:16:57 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.3 2008/07/29 13:17:43 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.PATH: ${.CURDIR}/../../../../nfs
|
||||
|
||||
LIB= nfs
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/sys/nfs
|
||||
LIB= rumpfs_nfs
|
||||
|
||||
SRCS= krpc_subr.c nfs_bio.c nfs_boot.c nfs_kq.c nfs_node.c \
|
||||
nfs_socket.c nfs_subs.c nfs_syscalls.c nfs_vfsops.c nfs_vnops.c
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# $NetBSD: shlib_version,v 1.1 2008/07/29 13:17:43 pooka Exp $
|
||||
#
|
||||
major=0
|
||||
minor=0
|
|
@ -1,11 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.3 2007/08/19 14:47:24 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.4 2008/07/29 13:17:43 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.PATH: ${.CURDIR}/../../../../fs/ntfs
|
||||
|
||||
LIB= ntfs
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/sys/fs/ntfs
|
||||
LIB= rumpfs_ntfs
|
||||
|
||||
SRCS= ntfs_compr.c ntfs_conv.c ntfs_ihash.c ntfs_subr.c \
|
||||
ntfs_vfsops.c ntfs_vnops.c
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# $NetBSD: shlib_version,v 1.1 2008/07/29 13:17:43 pooka Exp $
|
||||
#
|
||||
major=0
|
||||
minor=0
|
|
@ -1,22 +1,17 @@
|
|||
# $NetBSD: Makefile,v 1.2 2008/01/02 22:01:41 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.3 2008/07/29 13:17:43 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.PATH: ${.CURDIR}/../../../../fs/puffs
|
||||
.PATH: ${.CURDIR}/../../../../dev/putter
|
||||
|
||||
LIB= syspuffs
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/sys/fs/puffs
|
||||
.PATH: ${NETBSDSRCDIR}/sys/dev/putter
|
||||
LIB= rumpfs_syspuffs
|
||||
|
||||
SRCS= puffs_msgif.c puffs_node.c puffs_subr.c puffs_vfsops.c puffs_vnops.c
|
||||
SRCS+= putter.c
|
||||
|
||||
SRCS+= puffs_rumpglue.c
|
||||
|
||||
CPPFLAGS+= -I${NETBSDSRCDIR}/sys/rump/librump/rumpkern -I${LIBRUMPDIR}
|
||||
CPPFLAGS+= -I${NETBSDSRCDIR}/sys/rump/librump/rumpuser
|
||||
CPPFLAGS+= -DPUFFSDEBUG -DPUTTERDEBUG
|
||||
|
||||
.include "${NETBSDSRCDIR}/sys/rump/Makefile.rump"
|
||||
.include <bsd.lib.mk>
|
||||
.include <bsd.klinks.mk>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: puffs_rumpglue.c,v 1.3 2008/03/21 21:55:01 ad Exp $ */
|
||||
/* $NetBSD: puffs_rumpglue.c,v 1.4 2008/07/29 13:17:43 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008 Antti Kantee. All Rights Reserved.
|
||||
|
@ -29,7 +29,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: puffs_rumpglue.c,v 1.3 2008/03/21 21:55:01 ad Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: puffs_rumpglue.c,v 1.4 2008/07/29 13:17:43 pooka Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/conf.h>
|
||||
|
@ -40,8 +40,8 @@ __KERNEL_RCSID(0, "$NetBSD: puffs_rumpglue.c,v 1.3 2008/03/21 21:55:01 ad Exp $"
|
|||
|
||||
#include <dev/putter/putter_sys.h>
|
||||
|
||||
#include "rump.h"
|
||||
#include "rumpuser.h"
|
||||
#include <rump/rump.h>
|
||||
#include <rump/rumpuser.h>
|
||||
|
||||
#include "puffs_rumpglue.h"
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# $NetBSD: shlib_version,v 1.1 2008/07/29 13:17:43 pooka Exp $
|
||||
#
|
||||
major=0
|
||||
minor=0
|
|
@ -1,11 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.2 2007/08/07 10:16:58 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.3 2008/07/29 13:17:43 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.PATH: ${.CURDIR}/../../../../fs/tmpfs
|
||||
|
||||
LIB= tmpfs
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/sys/fs/tmpfs
|
||||
LIB= rumpfs_tmpfs
|
||||
|
||||
SRCS= tmpfs_fifoops.c tmpfs_specops.c tmpfs_vfsops.c tmpfs_pool.c \
|
||||
tmpfs_subr.c tmpfs_vnops.c
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# $NetBSD: shlib_version,v 1.1 2008/07/29 13:17:43 pooka Exp $
|
||||
#
|
||||
major=0
|
||||
minor=0
|
|
@ -1,11 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.2 2008/05/14 20:13:05 reinoud Exp $
|
||||
# $NetBSD: Makefile,v 1.3 2008/07/29 13:17:43 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.PATH: ${.CURDIR}/../../../../fs/udf
|
||||
|
||||
LIB= udf
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/sys/fs/udf
|
||||
LIB= rumpfs_udf
|
||||
|
||||
SRCS= udf_osta.c udf_vfsops.c udf_vnops.c udf_subr.c \
|
||||
udf_allocation.c udf_readwrite.c udf_strat_bootstrap.c \
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# $NetBSD: shlib_version,v 1.1 2008/07/29 13:17:43 pooka Exp $
|
||||
#
|
||||
major=0
|
||||
minor=0
|
|
@ -1,11 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.4 2007/09/24 01:31:07 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.5 2008/07/29 13:17:47 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.PATH: ${.CURDIR}/../../../../ufs/ufs
|
||||
|
||||
LIB= ufs
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/sys/ufs/ufs
|
||||
LIB= rumpfs_ufs
|
||||
|
||||
SRCS= ufs_bmap.c ufs_dirhash.c ufs_ihash.c ufs_inode.c ufs_lookup.c \
|
||||
ufs_vfsops.c ufs_vnops.c
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# $NetBSD: shlib_version,v 1.1 2008/07/29 13:17:47 pooka Exp $
|
||||
#
|
||||
major=0
|
||||
minor=0
|
|
@ -0,0 +1,10 @@
|
|||
# $NetBSD: Makefile,v 1.1 2008/07/29 13:17:47 pooka Exp $
|
||||
#
|
||||
|
||||
PROG= rumptest
|
||||
|
||||
LDADD= ${RUMPFSLDADD} -lrump -lrumpuser -lpthread
|
||||
LDFLAGS+=-Wl,--wrap=malloc
|
||||
|
||||
.include "${.CURDIR}/../Makefile.rumpfs"
|
||||
.include <bsd.prog.mk>
|
|
@ -0,0 +1,10 @@
|
|||
#include <sys/types.h>
|
||||
|
||||
#include <rump/rump.h>
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
||||
rump_init();
|
||||
}
|
|
@ -1,100 +1,5 @@
|
|||
# $NetBSD: Makefile,v 1.42 2008/07/28 13:56:59 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.43 2008/07/29 13:17:47 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.include "${NETBSDSRCDIR}/sys/rump/Makefile.rump"
|
||||
|
||||
LIB= rump
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/sys/kern ${NETBSDSRCDIR}/sys/lib/libkern \
|
||||
${NETBSDSRCDIR}/sys/conf ${NETBSDSRCDIR}/sys/dev \
|
||||
${NETBSDSRCDIR}/sys/miscfs/genfs \
|
||||
${NETBSDSRCDIR}/sys/miscfs/syncfs
|
||||
|
||||
# implement something
|
||||
SRCS= rump.c atomic.c auth.c emul.c intr.c genfs_io.c locks.c \
|
||||
ltsleep.c pool.c specfs.c vfs.c vm.c
|
||||
|
||||
# just stubs
|
||||
SRCS+= fstrans_stub.c misc_stub.c pmap_stub.c vfsops_stub.c
|
||||
|
||||
# sys/kern
|
||||
SRCS+= clock_subr.c kern_descrip.c kern_stub.c param.c \
|
||||
subr_bufq.c subr_hash.c subr_prf2.c subr_specificdata.c \
|
||||
subr_time.c subr_workqueue.c sys_descrip.c sys_generic.c vfs_bio.c \
|
||||
vfs_cache.c vfs_getcwd.c vfs_hooks.c vfs_init.c vfs_lookup.c \
|
||||
vfs_subr.c vfs_vnops.c vfs_syscalls.c vnode_if.c \
|
||||
subr_kobj.c kern_module.c
|
||||
|
||||
# sys/miscfs
|
||||
SRCS+= genfs_vfsops.c genfs_vnops.c sync_subr.c
|
||||
|
||||
# src/kern bufq
|
||||
SRCS+= subr_bufq.c bufq_disksort.c bufq_fcfs.c bufq_priocscan.c \
|
||||
bufq_readprio.c
|
||||
|
||||
# src/lib/libkern
|
||||
SRCS+= __assert.c scanc.c skpc.c
|
||||
|
||||
SRCS+= rumpvnode_if.c rump_syscalls.c
|
||||
|
||||
.if ${MACHINE_ARCH} == "vax"
|
||||
.PATH: ${NETBSDSRCDIR}/sys/lib/libkern/arch/vax
|
||||
SRCS+= blkset.S
|
||||
.endif
|
||||
|
||||
RUMPUSEROBJDIR != cd ${.CURDIR}/../rumpuser && ${PRINTOBJDIR}
|
||||
OBJS+= ${RUMPUSEROBJDIR}/rumpuser.o ${RUMPUSEROBJDIR}/rumpuser_pth.o
|
||||
|
||||
CPPFLAGS+= -I${NETBSDSRCDIR}/sys -I${NETBSDSRCDIR}/common/include \
|
||||
-I${NETBSDSRCDIR}/sys/rump/librump/rumpuser \
|
||||
-I${.CURDIR}/opt -DMAXUSERS=32
|
||||
|
||||
CFLAGS+= -Wno-pointer-sign
|
||||
|
||||
# Create a few files. We can't include them directly, because that
|
||||
# would create hideous namespace lossage. So just do some clever
|
||||
# (or less clever) renaming.
|
||||
#
|
||||
# Yes, this is borderline disgusting not to mention seriously
|
||||
# labile, but what are you gonna do for a quick hack?
|
||||
#
|
||||
VOPTORUMPVOP="-e s/vop/rump_vop/g;/VOPARG/!s/VOP/RUMP_VOP/g;/vfs_op_desc/,\$$d"
|
||||
VOPTORUMPVOP+="-e s/vm_prot_t/int/g"
|
||||
VOPTORUMPVOP+="-e s/voff_t/off_t/g;/sys\/buf\.h/s/.*/struct buf;/"
|
||||
RVNH=\#include \"rump.h\"
|
||||
rumpdefs.h rumpvnode_if.h rumpvnode_if.c: vnode_if.c \
|
||||
${NETBSDSRCDIR}/sys/sys/vnode_if.h \
|
||||
${NETBSDSRCDIR}/sys/kern/vnode_if.c \
|
||||
${NETBSDSRCDIR}/sys/sys/namei.h \
|
||||
${NETBSDSRCDIR}/sys/sys/fcntl.h \
|
||||
${NETBSDSRCDIR}/sys/sys/vnode.h \
|
||||
${NETBSDSRCDIR}/sys/sys/errno.h \
|
||||
${.CURDIR}/Makefile
|
||||
echo Regenerating rumpdefs.h rumpnode_if.h and rumpnode_if.c
|
||||
sed ${VOPTORUMPVOP}";s/SYS_VNODE_IF_H/SYS_RUMPVNODE_IF_H/g" \
|
||||
< ${NETBSDSRCDIR}/sys/sys/vnode_if.h > rumpvnode_if.h
|
||||
# XXX: some creative kludging to simulate 'a\' (I have no
|
||||
# clue how to make it work in a Makefile
|
||||
sed ${VOPTORUMPVOP}";/sys\/vnode.h/{x;s/.*/${RVNH}/;x;G;n;}" \
|
||||
< ${NETBSDSRCDIR}/sys/kern/vnode_if.c > rumpvnode_if.c
|
||||
sed -n '/#define NAMEI_/s/NAMEI_/RUMP_NAMEI_/gp' \
|
||||
< ${NETBSDSRCDIR}/sys/sys/namei.h > rumpdefs.h
|
||||
sed -n '/#define O_[A-Z]* *0x/s/O_/RUMP_O_/gp' \
|
||||
< ${NETBSDSRCDIR}/sys/sys/fcntl.h >> rumpdefs.h
|
||||
printf "#ifndef __VTYPE_DEFINED\n#define __VTYPE_DEFINED\n" \
|
||||
>> rumpdefs.h
|
||||
sed -n '/enum vtype.*{/p' \
|
||||
< ${NETBSDSRCDIR}/sys/sys/vnode.h >> rumpdefs.h
|
||||
printf "#endif /* __VTYPE_DEFINED */\n" >> rumpdefs.h
|
||||
printf "#ifndef EJUSTRETURN\n" >> rumpdefs.h
|
||||
sed -n '/EJUSTRETURN/p' \
|
||||
< ${NETBSDSRCDIR}/sys/sys/errno.h >> rumpdefs.h
|
||||
printf "#endif /* EJUSTRETURN */\n" >> rumpdefs.h
|
||||
|
||||
CLEANFILES+= rumpvnode_if.c rumpvnode_if.h rumpdefs.h
|
||||
|
||||
beforedepend: rumpvnode_if.c
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
.include <bsd.klinks.mk>
|
||||
RUMPTOP=${.CURDIR}/../..
|
||||
.include "${RUMPTOP}/librump/rumpkern/Makefile.rumpkern"
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
# $NetBSD: Makefile.rumpkern,v 1.1 2008/07/29 13:17:47 pooka Exp $
|
||||
#
|
||||
|
||||
.include "${RUMPTOP}/Makefile.rump"
|
||||
|
||||
LIB= rump
|
||||
LDFLAGS+= -Wl,--wrap=malloc
|
||||
|
||||
INCSDIR=/usr/include/rump
|
||||
INCS+= rump.h rumpdefs.h rump_syscalls.h rumpvnode_if.h
|
||||
|
||||
.PATH: ${RUMPTOP}/librump/rumpkern \
|
||||
${RUMPTOP}/../kern ${RUMPTOP}/../lib/libkern \
|
||||
${RUMPTOP}/../conf ${RUMPTOP}/../dev \
|
||||
${RUMPTOP}/../miscfs/genfs ${RUMPTOP}/../miscfs/syncfs
|
||||
|
||||
# implement something
|
||||
SRCS= rump.c atomic.c auth.c emul.c intr.c genfs_io.c locks.c \
|
||||
ltsleep.c pool.c specfs.c vfs.c vm.c
|
||||
|
||||
# just stubs
|
||||
SRCS+= fstrans_stub.c misc_stub.c pmap_stub.c vfsops_stub.c
|
||||
|
||||
# sys/kern
|
||||
SRCS+= clock_subr.c kern_descrip.c kern_stub.c param.c \
|
||||
subr_bufq.c subr_hash.c subr_prf2.c subr_specificdata.c \
|
||||
subr_time.c subr_workqueue.c sys_descrip.c sys_generic.c vfs_bio.c \
|
||||
vfs_cache.c vfs_getcwd.c vfs_hooks.c vfs_init.c vfs_lookup.c \
|
||||
vfs_subr.c vfs_vnops.c vfs_syscalls.c vnode_if.c \
|
||||
subr_kobj.c kern_module.c
|
||||
|
||||
# sys/miscfs
|
||||
SRCS+= genfs_vfsops.c genfs_vnops.c sync_subr.c
|
||||
|
||||
# src/kern bufq
|
||||
SRCS+= subr_bufq.c bufq_disksort.c bufq_fcfs.c bufq_priocscan.c \
|
||||
bufq_readprio.c
|
||||
|
||||
# src/lib/libkern
|
||||
SRCS+= __assert.c scanc.c skpc.c
|
||||
|
||||
SRCS+= rumpvnode_if.c rump_syscalls.c
|
||||
|
||||
.if ${MACHINE_ARCH} == "vax"
|
||||
.PATH: ${RUMPTOP}/../lib/libkern/arch/vax
|
||||
SRCS+= blkset.S
|
||||
.endif
|
||||
|
||||
# no shlib_version because this is automatically in sync with lib/librump
|
||||
SHLIB_MAJOR= 0
|
||||
SHLIB_MINOR= 0
|
||||
|
||||
CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern/opt -DMAXUSERS=32
|
||||
CFLAGS+= -Wno-pointer-sign
|
||||
|
||||
# Create a few files. We can't include them directly, because that
|
||||
# would create hideous namespace lossage. So just do some clever
|
||||
# (or less clever) renaming.
|
||||
#
|
||||
# Yes, this is borderline disgusting not to mention seriously
|
||||
# labile, but what are you gonna do for a quick hack?
|
||||
#
|
||||
VOPTORUMPVOP="-e s/vop/rump_vop/g;/VOPARG/!s/VOP/RUMP_VOP/g;/vfs_op_desc/,\$$d"
|
||||
VOPTORUMPVOP+="-e s/vm_prot_t/int/g"
|
||||
VOPTORUMPVOP+="-e s/voff_t/off_t/g;/sys\/buf\.h/s/.*/struct buf;/"
|
||||
RVNH=\#include \<rump\/rump.h\>
|
||||
rumpdefs.h rumpvnode_if.h rumpvnode_if.c: vnode_if.c \
|
||||
${RUMPTOP}/../sys/vnode_if.h \
|
||||
${RUMPTOP}/../kern/vnode_if.c \
|
||||
${RUMPTOP}/../sys/namei.h \
|
||||
${RUMPTOP}/../sys/fcntl.h \
|
||||
${RUMPTOP}/../sys/vnode.h \
|
||||
${RUMPTOP}/../sys/errno.h \
|
||||
${RUMPTOP}/librump/rumpkern/Makefile.rumpkern
|
||||
echo Regenerating rumpdefs.h, rumpvnode_if.h and rumpvnode_if.c
|
||||
sed ${VOPTORUMPVOP}";s/SYS_VNODE_IF_H/SYS_RUMPVNODE_IF_H/g" \
|
||||
< ${RUMPTOP}/../sys/vnode_if.h > rumpvnode_if.h
|
||||
# XXX: some creative kludging to simulate 'a\' (I have no
|
||||
# clue how to make it work in a Makefile
|
||||
sed ${VOPTORUMPVOP}";/sys\/vnode.h/{x;s/.*/${RVNH}/;x;G;n;}" \
|
||||
< ${RUMPTOP}/../kern/vnode_if.c > rumpvnode_if.c
|
||||
sed -n '/#define NAMEI_/s/NAMEI_/RUMP_NAMEI_/gp' \
|
||||
< ${RUMPTOP}/../sys/namei.h > rumpdefs.h
|
||||
sed -n '/#define O_[A-Z]* *0x/s/O_/RUMP_O_/gp' \
|
||||
< ${RUMPTOP}/../sys/fcntl.h >> rumpdefs.h
|
||||
printf "#ifndef __VTYPE_DEFINED\n#define __VTYPE_DEFINED\n" \
|
||||
>> rumpdefs.h
|
||||
sed -n '/enum vtype.*{/p' \
|
||||
< ${RUMPTOP}/../sys/vnode.h >> rumpdefs.h
|
||||
printf "#endif /* __VTYPE_DEFINED */\n" >> rumpdefs.h
|
||||
printf "#ifndef EJUSTRETURN\n" >> rumpdefs.h
|
||||
sed -n '/EJUSTRETURN/p' \
|
||||
< ${RUMPTOP}/../sys/errno.h >> rumpdefs.h
|
||||
printf "#endif /* EJUSTRETURN */\n" >> rumpdefs.h
|
||||
|
||||
CLEANFILES+= rumpvnode_if.c rumpvnode_if.h rumpdefs.h
|
||||
|
||||
beforedepend: rumpvnode_if.c
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
.include <bsd.klinks.mk>
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: atomic.c,v 1.4 2008/07/02 21:18:14 he Exp $ */
|
||||
/* $NetBSD: atomic.c,v 1.5 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
|
@ -33,8 +33,8 @@
|
|||
#include <sys/atomic.h>
|
||||
#include <sys/mutex.h>
|
||||
|
||||
#include "rump.h"
|
||||
#include "rumpuser.h"
|
||||
#include <rump/rump.h>
|
||||
#include <rump/rumpuser.h>
|
||||
|
||||
kmutex_t rump_atomic_lock;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: auth.c,v 1.9 2008/07/01 12:33:32 pooka Exp $ */
|
||||
/* $NetBSD: auth.c,v 1.10 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -34,8 +34,7 @@
|
|||
#include <sys/kmem.h>
|
||||
#include <sys/proc.h>
|
||||
|
||||
#include "rump.h"
|
||||
#include "rumpuser.h"
|
||||
#include <rump/rump.h>
|
||||
|
||||
struct kauth_cred {
|
||||
uid_t cr_uid;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: emul.c,v 1.43 2008/07/21 10:40:37 pooka Exp $ */
|
||||
/* $NetBSD: emul.c,v 1.44 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -50,10 +50,11 @@
|
|||
|
||||
#include <machine/stdarg.h>
|
||||
|
||||
#include <rump/rumpuser.h>
|
||||
|
||||
#include <uvm/uvm_map.h>
|
||||
|
||||
#include "rump_private.h"
|
||||
#include "rumpuser.h"
|
||||
|
||||
time_t time_second = 1;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: genfs_io.c,v 1.12 2008/07/20 16:18:13 pooka Exp $ */
|
||||
/* $NetBSD: genfs_io.c,v 1.13 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -37,7 +37,6 @@
|
|||
#include <miscfs/genfs/genfs.h>
|
||||
|
||||
#include "rump_private.h"
|
||||
#include "rumpuser.h"
|
||||
|
||||
void
|
||||
genfs_directio(struct vnode *vp, struct uio *uio, int ioflag)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: intr.c,v 1.3 2008/04/28 20:24:10 martin Exp $ */
|
||||
/* $NetBSD: intr.c,v 1.4 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
|
@ -35,9 +35,6 @@
|
|||
#include <sys/kmem.h>
|
||||
#include <sys/cpu.h>
|
||||
|
||||
#include "rump.h"
|
||||
#include "rumpuser.h"
|
||||
|
||||
struct v_dodgy {
|
||||
void (*func)(void *);
|
||||
void *arg;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: locks.c,v 1.17 2008/07/18 16:19:12 pooka Exp $ */
|
||||
/* $NetBSD: locks.c,v 1.18 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
|
@ -59,9 +59,9 @@
|
|||
#include <sys/rwlock.h>
|
||||
#include <sys/atomic.h>
|
||||
|
||||
#include "rump_private.h"
|
||||
#include <rump/rumpuser.h>
|
||||
|
||||
#include "rumpuser.h"
|
||||
#include "rump_private.h"
|
||||
|
||||
void
|
||||
mutex_init(kmutex_t *mtx, kmutex_type_t type, int ipl)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ltsleep.c,v 1.6 2008/01/27 19:07:21 pooka Exp $ */
|
||||
/* $NetBSD: ltsleep.c,v 1.7 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -33,8 +33,9 @@
|
|||
#include <sys/queue.h>
|
||||
#include <sys/simplelock.h>
|
||||
|
||||
#include <rump/rumpuser.h>
|
||||
|
||||
#include "rump_private.h"
|
||||
#include "rumpuser.h"
|
||||
|
||||
struct ltsleeper {
|
||||
wchan_t id;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pool.c,v 1.7 2008/03/23 14:39:17 rmind Exp $ */
|
||||
/* $NetBSD: pool.c,v 1.8 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -31,7 +31,7 @@
|
|||
#include <sys/mount.h>
|
||||
#include <sys/pool.h>
|
||||
|
||||
#include "rumpuser.h"
|
||||
#include <rump/rumpuser.h>
|
||||
|
||||
struct pool_cache pnbuf_cache;
|
||||
struct pool pnbuf_pool;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rump.c,v 1.47 2008/06/03 15:50:22 ad Exp $ */
|
||||
/* $NetBSD: rump.c,v 1.48 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -43,8 +43,9 @@
|
|||
|
||||
#include <miscfs/specfs/specdev.h>
|
||||
|
||||
#include <rump/rumpuser.h>
|
||||
|
||||
#include "rump_private.h"
|
||||
#include "rumpuser.h"
|
||||
|
||||
struct proc proc0;
|
||||
struct cwdinfo rump_cwdi;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rump.h,v 1.28 2008/07/01 12:33:32 pooka Exp $ */
|
||||
/* $NetBSD: rump.h,v 1.29 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -30,6 +30,11 @@
|
|||
#ifndef _SYS_RUMP_H_
|
||||
#define _SYS_RUMP_H_
|
||||
|
||||
/*
|
||||
* NOTE: do not #include anything from <sys> here. Otherwise this
|
||||
* has no chance of working on non-NetBSD platforms.
|
||||
*/
|
||||
|
||||
struct mount;
|
||||
struct vnode;
|
||||
struct vattr;
|
||||
|
@ -45,8 +50,8 @@ typedef struct kauth_cred *kauth_cred_t;
|
|||
|
||||
struct lwp;
|
||||
|
||||
#include "rumpvnode_if.h"
|
||||
#include "rumpdefs.h"
|
||||
#include <rump/rumpvnode_if.h>
|
||||
#include <rump/rumpdefs.h>
|
||||
|
||||
#ifndef curlwp
|
||||
#define curlwp rump_get_curlwp()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rump_private.h,v 1.8 2008/01/24 22:41:08 pooka Exp $ */
|
||||
/* $NetBSD: rump_private.h,v 1.9 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -41,7 +41,7 @@
|
|||
#include <uvm/uvm_object.h>
|
||||
#include <uvm/uvm_page.h>
|
||||
|
||||
#include "rump.h"
|
||||
#include <rump/rump.h>
|
||||
|
||||
#if 0
|
||||
#define DPRINTF(x) printf x
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: specfs.c,v 1.23 2008/07/21 00:08:30 pooka Exp $ */
|
||||
/* $NetBSD: specfs.c,v 1.24 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -40,8 +40,9 @@
|
|||
|
||||
#include <uvm/uvm_extern.h>
|
||||
|
||||
#include <rump/rumpuser.h>
|
||||
|
||||
#include "rump_private.h"
|
||||
#include "rumpuser.h"
|
||||
|
||||
/* We have special special ops */
|
||||
static int rump_specopen(void *);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: vfs.c,v 1.38 2008/03/12 14:49:19 pooka Exp $ */
|
||||
/* $NetBSD: vfs.c,v 1.39 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -45,8 +45,9 @@
|
|||
#include <miscfs/syncfs/syncfs.h>
|
||||
#include <miscfs/genfs/genfs.h>
|
||||
|
||||
#include <rump/rumpuser.h>
|
||||
|
||||
#include "rump_private.h"
|
||||
#include "rumpuser.h"
|
||||
|
||||
static int rump_vop_lookup(void *);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: vm.c,v 1.33 2008/07/20 16:18:13 pooka Exp $ */
|
||||
/* $NetBSD: vm.c,v 1.34 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -49,14 +49,15 @@
|
|||
#include <sys/buf.h>
|
||||
#include <sys/kmem.h>
|
||||
|
||||
#include <machine/pmap.h>
|
||||
|
||||
#include <rump/rumpuser.h>
|
||||
|
||||
#include <uvm/uvm.h>
|
||||
#include <uvm/uvm_prot.h>
|
||||
#include <uvm/uvm_readahead.h>
|
||||
|
||||
#include <machine/pmap.h>
|
||||
|
||||
#include "rump_private.h"
|
||||
#include "rumpuser.h"
|
||||
|
||||
/* dumdidumdum */
|
||||
#define len2npages(off, len) \
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
# $NetBSD: Makefile,v 1.7 2008/05/29 13:12:29 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.8 2008/07/29 13:17:47 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.PATH: ${NETBSDSRCDIR}/sys/rump/librump/librumpuser
|
||||
|
||||
LIB= rumpuser
|
||||
INCS= rumpuser.h
|
||||
INCSDIR= /usr/include/rump
|
||||
|
||||
SRCS= rumpuser.c rumpuser_pth.c
|
||||
|
||||
RUMPKERNEL= no
|
||||
# no shlib_version because this is automatically in sync with lib/librumpuser
|
||||
SHLIB_MAJOR= 0
|
||||
SHLIB_MINOR= 0
|
||||
|
||||
.include "${NETBSDSRCDIR}/sys/rump/Makefile.rump"
|
||||
.include <bsd.lib.mk>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rumpuser.c,v 1.17 2008/07/01 12:33:33 pooka Exp $ */
|
||||
/* $NetBSD: rumpuser.c,v 1.18 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -60,15 +60,13 @@
|
|||
#include "rumpuser.h"
|
||||
|
||||
#define DOCALL(rvtype, call) \
|
||||
do { \
|
||||
rvtype rv; \
|
||||
rv = call; \
|
||||
if (rv == -1) \
|
||||
*error = errno; \
|
||||
else \
|
||||
*error = 0; \
|
||||
return rv; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
return rv;
|
||||
|
||||
int
|
||||
rumpuser_stat(const char *path, struct stat *sb, int *error)
|
||||
|
@ -195,6 +193,7 @@ rumpuser_read_bio(int fd, void *data, size_t size, off_t offset,
|
|||
if (rv < 0)
|
||||
rv = 0;
|
||||
|
||||
/* LINTED: see above */
|
||||
rump_biodone(biodonecookie, rv, error);
|
||||
}
|
||||
|
||||
|
@ -234,6 +233,7 @@ rumpuser_write_bio(int fd, const void *data, size_t size, off_t offset,
|
|||
if (rv < 0)
|
||||
rv = 0;
|
||||
|
||||
/* LINTED: see above */
|
||||
rump_biodone(biodonecookie, rv, error);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# $NetBSD: Makefile,v 1.5 2007/08/09 22:03:01 pooka Exp $
|
||||
# $NetBSD: Makefile,v 1.6 2008/07/29 13:17:47 pooka Exp $
|
||||
|
||||
SUBDIR= mount_9p mount_portal mount_psshfs mount_sysctlfs
|
||||
|
||||
SUBDIR+=rump_cd9660 rump_efs rump_ext2fs rump_ffs rump_hfs rump_lfs
|
||||
SUBDIR+=rump_msdos rump_ntfs rump_syspuffs rump_tmpfs rump_udf
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
# $NetBSD: Makefile.inc,v 1.2 2007/05/28 12:06:39 tls Exp $
|
||||
# $NetBSD: Makefile.inc,v 1.3 2008/07/29 13:17:47 pooka Exp $
|
||||
|
||||
USE_FORT?= yes # network client
|
||||
|
||||
.if exists(${.CURDIR}/../../Makefile.inc)
|
||||
.include "${.CURDIR}/../../Makefile.inc"
|
||||
.endif
|
||||
|
||||
.ifdef(ISRUMP)
|
||||
LDADD+= -lp2k -lukfs -lrump -lrumpuser -lpuffs -lutil -lpthread
|
||||
DPADD+= ${LIBP2K} ${LIBUKFS} ${LIBRUMP} ${LIBRUMPUSER} ${LIBPUFFS}
|
||||
DPADD+= ${LIBUTIL} ${LIBPTHREAD}
|
||||
LDFLAGS+= -Wl,--wrap=malloc
|
||||
NOMAN= # temporary
|
||||
.endif
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
# $NetBSD: Makefile,v 1.1 2008/07/29 13:17:47 pooka Exp $
|
||||
#
|
||||
|
||||
PROG= rump_cd9660
|
||||
NOMAN= 1
|
||||
|
||||
LDADD+= -lrumpfs_cd9660fs
|
||||
DPADD+= ${LIBRUMPFS_CD9660FS}
|
||||
|
||||
ISRUMP= # yes
|
||||
|
||||
.include <bsd.prog.mk>
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cd9660fs.c,v 1.2 2007/08/14 15:56:15 pooka Exp $ */
|
||||
/* $NetBSD: rump_cd9660.c,v 1.1 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -31,14 +31,13 @@
|
|||
#include <sys/mount.h>
|
||||
|
||||
#include <isofs/cd9660/cd9660_mount.h>
|
||||
#include <puffs.h>
|
||||
|
||||
#include <rump/p2k.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "p2k.h"
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
|
@ -0,0 +1,11 @@
|
|||
# $NetBSD: Makefile,v 1.1 2008/07/29 13:17:47 pooka Exp $
|
||||
#
|
||||
|
||||
PROG= rump_efs
|
||||
|
||||
LDADD+= -lrumpfs_efs
|
||||
DPADD+= ${LIBRUMPFS_EFS}
|
||||
|
||||
ISRUMP= # gracie, padre
|
||||
|
||||
.include <bsd.prog.mk>
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: efs.c,v 1.4 2007/08/14 15:56:15 pooka Exp $ */
|
||||
/* $NetBSD: rump_efs.c,v 1.1 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -37,7 +37,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "p2k.h"
|
||||
#include <rump/p2k.h>
|
||||
|
||||
static void
|
||||
usage(void)
|
|
@ -0,0 +1,11 @@
|
|||
# $NetBSD: Makefile,v 1.1 2008/07/29 13:17:47 pooka Exp $
|
||||
#
|
||||
|
||||
PROG= rump_ext2fs
|
||||
|
||||
LDADD+= -lrumpfs_ext2fs -lrumpfs_ufs -lrumpfs_ffs
|
||||
DPADD+= ${LIBRUMPFS_EXT2FS} ${LIBRUMPFS_UFS} ${LIBRUMPFS_FFS}
|
||||
|
||||
ISRUMP= # yea baby
|
||||
|
||||
.include <bsd.prog.mk>
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ext2fs.c,v 1.3 2007/08/14 15:56:15 pooka Exp $ */
|
||||
/* $NetBSD: rump_ext2fs.c,v 1.1 2008/07/29 13:17:47 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -37,7 +37,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "p2k.h"
|
||||
#include <rump/p2k.h>
|
||||
|
||||
static void
|
||||
usage(void)
|
|
@ -0,0 +1,11 @@
|
|||
# $NetBSD: Makefile,v 1.1 2008/07/29 13:17:47 pooka Exp $
|
||||
#
|
||||
|
||||
PROG= rump_ffs
|
||||
|
||||
LDADD+= -lrumpfs_ffs -lrumpfs_ufs
|
||||
DPADD+= ${LIBRUMPFS_FFS} ${LIBRUMPFS_UFS}
|
||||
|
||||
ISRUMP= # affirmative
|
||||
|
||||
.include <bsd.prog.mk>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue