v7fs rump support

This commit is contained in:
uch 2011-07-24 08:55:28 +00:00
parent e37f33931b
commit 7ce939b3e2
12 changed files with 246 additions and 13 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.944 2011/07/09 21:24:29 tron Exp $
# $NetBSD: mi,v 1.945 2011/07/24 08:55:28 uch Exp $
#
# Note: Don't delete entries from here - mark them as "obsolete" instead,
# unless otherwise stated below.
@ -1402,6 +1402,7 @@
./usr/sbin/rump_sysvbfs base-puffs-bin
./usr/sbin/rump_tmpfs base-puffs-bin
./usr/sbin/rump_udf base-puffs-bin
./usr/sbin/rump_v7fs base-puffs-bin
./usr/sbin/rwhod base-netutil-bin
./usr/sbin/sa base-sysutil-bin
./usr/sbin/screenblank base-sysutil-bin

View File

@ -1,4 +1,4 @@
# $NetBSD: shl.mi,v 1.592 2011/07/05 22:05:36 spz Exp $
# $NetBSD: shl.mi,v 1.593 2011/07/24 08:55:28 uch Exp $
#
# Note: Don't delete entries from here - mark them as "obsolete" instead,
# unless otherwise stated below.
@ -556,6 +556,9 @@
./usr/lib/librumpfs_union.so base-rump-shlib
./usr/lib/librumpfs_union.so.0 base-rump-shlib
./usr/lib/librumpfs_union.so.0.0 base-rump-shlib
./usr/lib/librumpfs_v7fs.so base-rump-shlib
./usr/lib/librumpfs_v7fs.so.0 base-rump-shlib
./usr/lib/librumpfs_v7fs.so.0.0 base-rump-shlib
./usr/lib/librumpfs_zfs.so base-rump-shlib zfs
./usr/lib/librumpfs_zfs.so.0 base-rump-shlib zfs
./usr/lib/librumpfs_zfs.so.0.0 base-rump-shlib zfs

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.1646 2011/07/21 03:13:31 mrg Exp $
# $NetBSD: mi,v 1.1647 2011/07/24 08:55:29 uch Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@ -3140,6 +3140,9 @@
./usr/lib/librumpfs_union.a comp-c-lib
./usr/lib/librumpfs_union_g.a -unknown- debuglib
./usr/lib/librumpfs_union_p.a comp-c-proflib profile
./usr/lib/librumpfs_v7fs.a comp-c-lib
./usr/lib/librumpfs_v7fs_g.a -unknown- debuglib
./usr/lib/librumpfs_v7fs_p.a comp-c-proflib profile
./usr/lib/librumpfs_zfs.a comp-c-lib zfs
./usr/lib/librumpfs_zfs_g.a -unknown- zfs,debuglib
./usr/lib/librumpfs_zfs_p.a comp-c-piclib zfs,profile
@ -4189,6 +4192,7 @@
./usr/libdata/debug/usr/sbin/rump_sysvbfs.debug comp-puffs-debug debug
./usr/libdata/debug/usr/sbin/rump_tmpfs.debug comp-puffs-debug debug
./usr/libdata/debug/usr/sbin/rump_udf.debug comp-puffs-debug debug
./usr/libdata/debug/usr/sbin/rump_v7fs.debug comp-puffs-debug debug
./usr/libdata/debug/usr/sbin/rwhod.debug comp-netutil-debug debug
./usr/libdata/debug/usr/sbin/sa.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/sbin/schedctl.debug comp-sysutil-debug debug

View File

@ -1,4 +1,4 @@
# $NetBSD: shl.mi,v 1.181 2011/07/21 03:13:32 mrg Exp $
# $NetBSD: shl.mi,v 1.182 2011/07/24 08:55:30 uch Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@ -167,6 +167,7 @@
./usr/lib/librumpfs_umap_pic.a comp-c-piclib
./usr/lib/librumpfs_umapfs_pic.a comp-obsolete obsolete
./usr/lib/librumpfs_union_pic.a comp-c-piclib
./usr/lib/librumpfs_v7fs_pic.a comp-c-piclib
./usr/lib/librumpfs_zfs_pic.a comp-c-piclib zfs
./usr/lib/librumphijack_pic.a comp-c-piclib
./usr/lib/librumpkern_crypto_pic.a comp-c-piclib
@ -370,6 +371,7 @@
./usr/libdata/debug/usr/lib/librumpfs_udf.so.0.0.debug comp-rump-debug debug
./usr/libdata/debug/usr/lib/librumpfs_umap.so.0.0.debug comp-rump-debug debug
./usr/libdata/debug/usr/lib/librumpfs_union.so.0.0.debug comp-rump-debug debug
./usr/libdata/debug/usr/lib/librumpfs_v7fs.so.0.0.debug comp-rump-debug debug
./usr/libdata/debug/usr/lib/librumpfs_zfs.so.0.0.debug comp-rump-debug debug,zfs
./usr/libdata/debug/usr/lib/librumphijack.so.0.0.debug comp-rump-debug debug
./usr/libdata/debug/usr/lib/librumpkern_crypto.so.0.0.debug comp-rump-debug debug

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.1325 2011/07/20 20:51:11 jakllsch Exp $
# $NetBSD: mi,v 1.1326 2011/07/24 08:55:30 uch Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@ -2708,6 +2708,7 @@
./usr/share/man/cat8/rump_sysvbfs.0 man-puffs-catman .cat
./usr/share/man/cat8/rump_tmpfs.0 man-puffs-catman .cat
./usr/share/man/cat8/rump_udf.0 man-puffs-catman .cat
./usr/share/man/cat8/rump_v7fs.0 man-puffs-catman .cat
./usr/share/man/cat8/rusersd.0 man-netutil-catman .cat
./usr/share/man/cat8/rwalld.0 man-netutil-catman .cat
./usr/share/man/cat8/rwhod.0 man-netutil-catman .cat
@ -5252,6 +5253,7 @@
./usr/share/man/html8/rump_sysvbfs.html man-puffs-htmlman html
./usr/share/man/html8/rump_tmpfs.html man-puffs-htmlman html
./usr/share/man/html8/rump_udf.html man-puffs-htmlman html
./usr/share/man/html8/rump_v7fs.html man-puffs-htmlman html
./usr/share/man/html8/rusersd.html man-netutil-htmlman html
./usr/share/man/html8/rwalld.html man-netutil-htmlman html
./usr/share/man/html8/rwhod.html man-netutil-htmlman html
@ -8077,6 +8079,7 @@
./usr/share/man/man8/rump_sysvbfs.8 man-puffs-man .man
./usr/share/man/man8/rump_tmpfs.8 man-puffs-man .man
./usr/share/man/man8/rump_udf.8 man-puffs-man .man
./usr/share/man/man8/rump_v7fs.8 man-puffs-man .man
./usr/share/man/man8/rusersd.8 man-netutil-man .man
./usr/share/man/man8/rwalld.8 man-netutil-man .man
./usr/share/man/man8/rwhod.8 man-netutil-man .man

View File

@ -1,11 +1,11 @@
# $NetBSD: Makefile.rumpfscomp,v 1.3 2011/03/05 03:15:25 joerg Exp $
# $NetBSD: Makefile.rumpfscomp,v 1.4 2011/07/24 08:55:30 uch Exp $
#
.include <bsd.own.mk>
RUMPFSCOMP= cd9660 efs ext2fs fdesc ffs hfs kernfs lfs mfs msdos \
nfs nilfs ntfs null ptyfs smbfs syspuffs sysvbfs \
tmpfs udf umap union
tmpfs udf umap union v7fs
.if ${MKZFS} != "no"
RUMPFSCOMP+= zfs

View File

@ -0,0 +1,18 @@
# $NetBSD: Makefile,v 1.1 2011/07/24 08:55:31 uch Exp $
#
.PATH: ${.CURDIR}/../../../../fs/v7fs
LIB= rumpfs_v7fs
SRCS= v7fs_endian.c v7fs_superblock.c v7fs_inode.c v7fs_dirent.c \
v7fs_datablock.c v7fs_file.c v7fs_io.c
SRCS+= v7fs_file_util.c v7fs_inode_util.c v7fs_superblock_util.c
SRCS+= v7fs_io_kern.c v7fs_extern.c v7fs_vnops.c v7fs_vfsops.c
CPPFLAGS+= -DV7FS_EI
.include <bsd.lib.mk>
.include <bsd.klinks.mk>

View File

@ -0,0 +1,4 @@
# $NetBSD: shlib_version,v 1.1 2011/07/24 08:55:31 uch Exp $
#
major=0
minor=0

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.15 2010/07/11 06:16:54 mrg Exp $
# $NetBSD: Makefile,v 1.16 2011/07/24 08:55:30 uch Exp $
.include <bsd.own.mk>
@ -6,7 +6,7 @@ SUBDIR= mount_9p mount_psshfs mount_sysctlfs
SUBDIR+=rump_cd9660 rump_efs rump_ext2fs rump_ffs rump_hfs rump_lfs
SUBDIR+=rump_msdos rump_nfs rump_ntfs rump_syspuffs rump_sysvbfs
SUBDIR+=rump_tmpfs rump_udf
SUBDIR+=rump_tmpfs rump_udf rump_v7fs
.if ${MKCRYPTO} != "no"
SUBDIR+=rump_smbfs

View File

@ -1,12 +1,12 @@
#!/bin/sh
#
# $NetBSD: makerumpmanpages.sh,v 1.12 2010/11/22 07:56:31 pooka Exp $
# $NetBSD: makerumpmanpages.sh,v 1.13 2011/07/24 08:55:30 uch Exp $
#
IFS=' '
COPYRIGHT='.\" WARNING: GENERATED FILE, DO NOT EDIT
.\" INSTEAD, EDIT makerumpmanpages.sh AND REGEN
.\" from: $NetBSD: makerumpmanpages.sh,v 1.12 2010/11/22 07:56:31 pooka Exp $
.\" from: $NetBSD: makerumpmanpages.sh,v 1.13 2011/07/24 08:55:30 uch Exp $
.\"
.\" Copyright (c) 2008-2010 Antti Kantee. All rights reserved.
.\"
@ -156,7 +156,7 @@ utility first appeared in
.Nx xxxfirstxxx .'
# vary manpages slightly based on the type of server in question
disk="cd9660 efs ext2fs ffs hfs lfs msdos ntfs sysvbfs udf"
disk="cd9660 efs ext2fs ffs hfs lfs msdos ntfs sysvbfs udf v7fs"
net="nfs smbfs"
fictional="fdesc kernfs tmpfs"
special="au-naturel nqmfs syspuffs"
@ -220,7 +220,7 @@ do
fsc=`echo $fs | tr '[:lower:]' '[:upper:]'`
eval sedstr="${sedsub}"
printf '.\\" $NetBSD: makerumpmanpages.sh,v 1.12 2010/11/22 07:56:31 pooka Exp $\n.\\"\n' > rump_${fs}/rump_${fs}.8
printf '.\\" $NetBSD: makerumpmanpages.sh,v 1.13 2011/07/24 08:55:30 uch Exp $\n.\\"\n' > rump_${fs}/rump_${fs}.8
echo ${COPYRIGHT} | sed -e 's/\$//g' >> rump_${fs}/rump_${fs}.8
echo ${MANTMPL1} | sed -e "$sedstr" >> rump_${fs}/rump_${fs}.8

View File

@ -0,0 +1,134 @@
.\" $NetBSD: rump_v7fs.8,v 1.1 2011/07/24 08:55:31 uch Exp $
.\"
.\" WARNING: GENERATED FILE, DO NOT EDIT
.\" INSTEAD, EDIT makerumpmanpages.sh AND REGEN
.\" from: NetBSD: makerumpmanpages.sh,v 1.12 2010/11/22 07:56:31 pooka Exp
.\"
.\" Copyright (c) 2008-2010 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 November 21, 2010
.Dt RUMP_V7FS 8
.Os
.Sh NAME
.Nm rump_v7fs
.Nd mount a v7fs image with a userspace server
.Sh SYNOPSIS
.Cd "file-system PUFFS"
.Cd "pseudo-device putter"
.Pp
.Nm
.Op options
.Ar image
.Ar mountpoint
.Sh DESCRIPTION
.Em NOTE!
This manual page describes features specific to the
.Xr rump 3
file server.
Please see
.Xr mount_v7fs 8
for a full description of the available command line options.
.Pp
The
.Nm
utility can be used to mount v7fs file systems.
It uses
.Xr rump 3
and
.Xr p2k 3
to facilitate running the file system as a server in userspace.
As opposed to
.Xr mount_v7fs 8 ,
.Nm
does not use file system code within the kernel and therefore does
not require kernel support except
.Xr puffs 4 .
Apart from a minor speed penalty there is no downside with respect to
in-kernel code.
.Pp
.Nm
does not require using
.Xr vnconfig 8
for mounts from regular files and the file path can be passed
directly as the
.Ar image
parameter.
In fact, the use of
.Xr vnconfig 8
is discouraged, since it is unable to properly deal with images on
sparse files.
.Pp
In case the image contains multiple partitions, the desired partition
must be indicated by appending the token
.Dq %DISKLABEL:p%
to the
.Ar image
path.
The letter
.Dq p
specifies the partition as obtained via
.Xr disklabel 8 .
For example, to mount partition
.Dq e
from image
.Pa /tmp/wd0.img ,
use
.Dq /tmp/wd0.img%DISKLABEL:e% .
.Pp
It is recommended that untrusted file system images be mounted with
.Nm
instead of
.Xr mount_v7fs 8 .
Corrupt file system images commonly cause the file system
to crash the entire kernel, but with
.Nm
only the userspace server process will dump core.
.Pp
To use
.Nm
via
.Xr mount 8 ,
the flags
.Fl o Ar rump
and
.Fl t Ar v7fs
should be given.
Similarly,
.Nm
is used instead of
.Xr mount_v7fs 8
if
.Dq rump
is added to the options field of
.Xr fstab 5 .
.Sh SEE ALSO
.Xr p2k 3 ,
.Xr puffs 3 ,
.Xr rump 3 ,
.Xr mount_v7fs 8
.Sh HISTORY
The
.Nm
utility first appeared in
.Nx 6.0 .

View File

@ -0,0 +1,64 @@
/* $NetBSD: rump_v7fs.c,v 1.1 2011/07/24 08:55:31 uch 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 ``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.
*/
#include <sys/types.h>
#include <sys/mount.h>
#include <rump/p2k.h>
#include <rump/ukfs.h>
#include <err.h>
#include <puffs.h>
#include <stdlib.h>
#include <string.h>
#include "mount_v7fs.h"
int
main(int argc, char *argv[])
{
struct v7fs_args args;
char canon_dev[UKFS_DEVICE_MAXPATHLEN], canon_dir[MAXPATHLEN];
struct ukfs_part *part;
int mntflags;
int rv;
setprogname(argv[0]);
puffs_unmountonsignal(SIGINT, true);
puffs_unmountonsignal(SIGTERM, true);
UKFS_DEVICE_ARGVPROBE(&part);
mount_v7fs_parseargs(argc, argv, &args, &mntflags,
canon_dev, canon_dir);
rv = p2k_run_diskfs(MOUNT_V7FS, canon_dev, part, canon_dir, mntflags,
&args, sizeof(args), 0);
ukfs_part_release(part);
if (rv)
err(1, "mount");
return 0;
}