makerumpmanpages.sh revision 1.11
11.1Spooka#!/bin/sh 21.1Spooka# 31.11Spooka# $NetBSD: makerumpmanpages.sh,v 1.11 2010/11/22 01:07:51 pooka Exp $ 41.1Spooka# 51.1Spooka 61.1SpookaIFS=' ' 71.11SpookaMANTMPL1=".\\\" \$NetBSD\$"' 81.1Spooka.\" 91.2Spooka.\" WARNING: GENERATED FILE, DO NOT EDIT 101.2Spooka.\" INSTEAD, EDIT makerumpmanpages.sh AND REGEN 111.2Spooka.\" 121.10Spooka.\" Copyright (c) 2008-2010 Antti Kantee. All rights reserved. 131.1Spooka.\" 141.1Spooka.\" Redistribution and use in source and binary forms, with or without 151.1Spooka.\" modification, are permitted provided that the following conditions 161.1Spooka.\" are met: 171.1Spooka.\" 1. Redistributions of source code must retain the above copyright 181.1Spooka.\" notice, this list of conditions and the following disclaimer. 191.1Spooka.\" 2. Redistributions in binary form must reproduce the above copyright 201.1Spooka.\" notice, this list of conditions and the following disclaimer in the 211.1Spooka.\" documentation and/or other materials provided with the distribution. 221.1Spooka.\" 231.1Spooka.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND 241.1Spooka.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 251.1Spooka.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 261.1Spooka.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 271.1Spooka.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 281.1Spooka.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 291.1Spooka.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 301.1Spooka.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 311.1Spooka.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 321.1Spooka.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 331.1Spooka.\" SUCH DAMAGE. 341.1Spooka.\" 351.10Spooka.Dd November 21, 2010 361.1Spooka.Dt RUMP_XXXFSXXX 8 371.1Spooka.Os 381.1Spooka.Sh NAME 391.1Spooka.Nm rump_xxxfsxxx 401.11Spooka.Nd mount a xxxfsxxx xxxfssrcxxx with a userspace server 411.1Spooka.Sh SYNOPSIS 421.1Spooka.Cd "file-system PUFFS" 431.8Spooka.Cd "pseudo-device putter" 441.1Spooka.Pp 451.1Spooka.Nm 461.1Spooka.Op options 471.11Spooka.Ar xxximagexxx 481.10Spooka.Ar mountpoint 491.1Spooka.Sh DESCRIPTION 501.9Spooka.Em NOTE! 511.11SpookaThis manual page describes features specific to the 521.9Spooka.Xr rump 3 531.11Spookafile server. 541.11SpookaPlease see 551.11Spooka.Xr mount_xxxfsxxx 8 561.11Spookafor a full description of the available command line options. 571.9Spooka.Pp 581.1SpookaThe 591.1Spooka.Nm 601.1Spookautility can be used to mount xxxfsxxx file systems. 611.1SpookaIt uses 621.1Spooka.Xr rump 3 631.1Spookaand 641.1Spooka.Xr p2k 3 651.1Spookato facilitate running the file system as a server in userspace. 661.1SpookaAs opposed to 671.1Spooka.Xr mount_xxxfsxxx 8 , 681.1Spooka.Nm 691.1Spookadoes not use file system code within the kernel and therefore does 701.1Spookanot require kernel support except 711.1Spooka.Xr puffs 4 . 721.10SpookaApart from a minor speed penalty there is no downside with respect to 731.11Spookain-kernel code.' 741.11Spooka 751.11SpookaMANTMPL_BLK='.Pp 761.7Spooka.Nm 771.10Spookadoes not require using 781.7Spooka.Xr vnconfig 8 791.10Spookafor mounts from regular files and the file path can be passed 801.10Spookadirectly as the 811.11Spooka.Ar xxximagexxx 821.10Spookaparameter. 831.10SpookaIn fact, the use of 841.10Spooka.Xr vnconfig 8 851.10Spookais discouraged, since it is unable to properly deal with images on 861.10Spookasparse files. 871.10Spooka.Pp 881.10SpookaIn case the image contains multiple partitions, the desired partition 891.10Spookamust be indicated by appending the token 901.10Spooka.Dq %DISKLABEL:p% 911.10Spookato the 921.11Spooka.Ar xxximagexxx 931.10Spookapath. 941.10SpookaThe letter 951.10Spooka.Dq p 961.10Spookaspecifies the partition as obtained via 971.10Spooka.Xr disklabel 8 . 981.10SpookaFor example, to mount partition 991.10Spooka.Dq e 1001.10Spookafrom image 1011.10Spooka.Pa /tmp/wd0.img , 1021.10Spookause 1031.10Spooka.Dq /tmp/wd0.img%DISKLABEL:e% . 1041.7Spooka.Pp 1051.1SpookaIt is recommended that untrusted file system images be mounted with 1061.1Spooka.Nm 1071.1Spookainstead of 1081.1Spooka.Xr mount_xxxfsxxx 8 . 1091.1SpookaCorrupt file system images commonly cause the file system 1101.1Spookato crash the entire kernel, but with 1111.1Spooka.Nm 1121.11Spookaonly the userspace server process will dump core.' 1131.11Spooka 1141.11SpookaMANTMPL_NET='.Pp 1151.11SpookaEven though the 1161.11Spooka.Nm 1171.11Spookafile system client runs within a virtual rump kernel in userspace, 1181.11Spookait uses host network services 1191.11Spooka.Pq by means of Dq rump sockin . 1201.11SpookaThis means that regardless of whether using 1211.11Spooka.Nm 1221.11Spookaor 1231.11Spooka.Xr mount_xxxfsxxx 8 , 1241.11Spookathe same network configurations will be used. 1251.11SpookaCurrently, 1261.11Spooka.Dq sockin 1271.11Spookasupports IPv4.' 1281.11Spooka 1291.11SpookaMANTMPL2='.Pp 1301.5SpookaTo use 1311.5Spooka.Nm 1321.5Spookavia 1331.5Spooka.Xr mount 8 , 1341.5Spookathe flags 1351.6Swiz.Fl o Ar rump 1361.5Spookaand 1371.6Swiz.Fl t Ar xxxfsxxx 1381.5Spookashould be given. 1391.5SpookaSimilarly, 1401.5Spooka.Nm 1411.11Spookais used instead of 1421.5Spooka.Xr mount_xxxfsxxx 8 1431.6Swizif 1441.5Spooka.Dq rump 1451.5Spookais added to the options field of 1461.5Spooka.Xr fstab 5 . 1471.1Spooka.Sh SEE ALSO 1481.1Spooka.Xr p2k 3 , 1491.1Spooka.Xr puffs 3 , 1501.1Spooka.Xr rump 3 , 1511.1Spooka.Xr mount_xxxfsxxx 8 1521.1Spooka.Sh HISTORY 1531.1SpookaThe 1541.1Spooka.Nm 1551.1Spookautility first appeared in 1561.11Spooka.Nx xxxfirstxxx .' 1571.1Spooka 1581.11Spooka# vary manpages slightly based on the type of server in question 1591.11Spookadisk="cd9660 efs ext2fs ffs hfs lfs msdos ntfs sysvbfs udf" 1601.11Spookanet="nfs smbfs" 1611.11Spookafictional="fdesc kernfs tmpfs" 1621.11Spookaspecial="au-naturel nqmfs syspuffs" 1631.11Spooka 1641.11Spookafirst5="cd9660 efs ext2fs ffs hfs lfs msdos nfs ntfs syspuffs sysvbfs tmpfs udf" 1651.11Spooka 1661.11Spookamember () 1671.11Spooka{ 1681.11Spooka 1691.11Spooka what=$1 1701.11Spooka shift 1711.11Spooka 1721.11Spooka while [ $# -gt 0 ] ; do 1731.11Spooka [ "$1" = "${what}" ] && return 0 1741.11Spooka shift 1751.11Spooka done 1761.11Spooka return 1 1771.11Spooka} 1781.11Spooka 1791.11Spookasedsub='s/xxxfsxxx/$fs/g\;s/XXXFSXXX/$fsc/g\;s/xxximagexxx/$image/g\;'\ 1801.11Spooka's/xxxfirstxxx/$first/g\;s/xxxfssrcxxx/$fssrc/g\;' 1811.11Spooka 1821.11Spooka# auto manual pages 1831.1Spookafor x in rump_* 1841.1Spookado 1851.1Spooka fs=${x#rump_} 1861.1Spooka 1871.11Spooka # see if we are dealing with a new server 1881.11Spooka if ! member $fs $disk $net $fictional $special ; then 1891.11Spooka echo ERROR: $fs not found in any class! 1901.11Spooka exit 1 1911.11Spooka fi 1921.11Spooka 1931.11Spooka # special file systems have special manpages 1941.11Spooka member $fs $special && continue 1951.11Spooka 1961.11Spooka # figure out our type 1971.11Spooka if member $fs $disk ; then 1981.11Spooka mytype=disk 1991.11Spooka image=image 2001.11Spooka fssrc=image 2011.11Spooka fi 2021.11Spooka if member $fs $net ; then 2031.11Spooka mytype=net 2041.11Spooka image=share 2051.11Spooka fssrc=share 2061.11Spooka fi 2071.11Spooka if member $fs $fictional ; then 2081.11Spooka mytype=special 2091.11Spooka image=$fs 2101.11Spooka fssrc='fictional fs' 2111.11Spooka fi 2121.11Spooka 2131.11Spooka # which version did server first appear? 2141.11Spooka if member $fs $first5 ; then 2151.11Spooka first=5.0 2161.11Spooka else 2171.11Spooka first=6.0 2181.1Spooka fi 2191.1Spooka 2201.1Spooka fsc=`echo $fs | tr '[:lower:]' '[:upper:]'` 2211.11Spooka eval sedstr="${sedsub}" 2221.11Spooka 2231.11Spooka echo ${MANTMPL1} | sed -e "$sedstr" > rump_${fs}/rump_${fs}.8 2241.11Spooka [ ${mytype} = disk ] && \ 2251.11Spooka echo ${MANTMPL_BLK} | sed -e "$sedstr" >> rump_${fs}/rump_${fs}.8 2261.11Spooka [ ${mytype} = net ] && \ 2271.11Spooka echo ${MANTMPL_NET} | sed -e "$sedstr" >> rump_${fs}/rump_${fs}.8 2281.11Spooka echo ${MANTMPL2} | sed -e "$sedstr" >> rump_${fs}/rump_${fs}.8 2291.1Spookadone 230