| @@ -1,120 +1,125 @@ | | | @@ -1,120 +1,125 @@ |
1 | .\" $NetBSD: mksandbox.8,v 1.3 2012/08/26 22:13:18 wiz Exp $ | | 1 | .\" $NetBSD: mksandbox.8,v 1.4 2013/05/29 15:14:49 wiz Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 2012 Thomas Klausner <wiz@NetBSD.org> | | 3 | .\" Copyright (c) 2012 Thomas Klausner <wiz@NetBSD.org> |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" Redistribution and use in source and binary forms, with or without | | 6 | .\" Redistribution and use in source and binary forms, with or without |
7 | .\" modification, are permitted provided that the following conditions | | 7 | .\" modification, are permitted provided that the following conditions |
8 | .\" are met: | | 8 | .\" are met: |
9 | .\" 1. Redistributions of source code must retain the above copyright | | 9 | .\" 1. Redistributions of source code must retain the above copyright |
10 | .\" notice, this list of conditions and the following disclaimer. | | 10 | .\" notice, this list of conditions and the following disclaimer. |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright |
12 | .\" notice, this list of conditions and the following disclaimer in the | | 12 | .\" notice, this list of conditions and the following disclaimer in the |
13 | .\" documentation and/or other materials provided with the distribution. | | 13 | .\" documentation and/or other materials provided with the distribution. |
14 | .\" | | 14 | .\" |
15 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | | 15 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
16 | .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | | 16 | .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
17 | .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 17 | .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
18 | .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 18 | .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
19 | .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 19 | .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
20 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 20 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
21 | .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 21 | .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
22 | .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 22 | .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
23 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 23 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
24 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 24 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 | .\" | | 25 | .\" |
26 | .Dd August 26, 2012 | | 26 | .Dd May 29, 2013 |
27 | .Dt MKSANDBOX 8 | | 27 | .Dt MKSANDBOX 8 |
28 | .Os | | 28 | .Os |
29 | .Sh NAME | | 29 | .Sh NAME |
30 | .Nm mksandbox | | 30 | .Nm mksandbox |
31 | .Nd set up a sandbox | | 31 | .Nd set up a sandbox |
32 | .Sh SYNOPSIS | | 32 | .Sh SYNOPSIS |
33 | .Nm | | 33 | .Nm |
| | | 34 | .Op Fl Fl mounthost Ns = Ns Ar host |
34 | .Op Fl Fl pkgsrc Ns = Ns Ar dir | | 35 | .Op Fl Fl pkgsrc Ns = Ns Ar dir |
35 | .Op Fl Fl src Ns = Ns Ar srcdir | | 36 | .Op Fl Fl src Ns = Ns Ar srcdir |
36 | .Op Fl Fl verbose | | 37 | .Op Fl Fl verbose |
37 | .Op Fl Fl without-x | | 38 | .Op Fl Fl without-x |
38 | .Op Fl Fl xsrc Ns = Ns Ar xsrcdir | | 39 | .Op Fl Fl xsrc Ns = Ns Ar xsrcdir |
39 | .Ar sandbox-dir | | 40 | .Ar sandbox-dir |
40 | .Sh DESCRIPTION | | 41 | .Sh DESCRIPTION |
41 | .Nm | | 42 | .Nm |
42 | is a small shell script to set up a sandbox (usually for a pkgsrc bulk | | 43 | is a small shell script to set up a sandbox (usually for a pkgsrc bulk |
43 | build), using null mounts. | | 44 | build), using null mounts. |
44 | The sandbox is set up for the target directory | | 45 | The sandbox is set up for the target directory |
45 | .Ar sandbox-dir . | | 46 | .Ar sandbox-dir . |
46 | .Pp | | 47 | .Pp |
47 | The supported options are: | | 48 | The following options are available: |
48 | .Bl -tag -width "Xpkgsrc=dirXXX" | | 49 | .Bl -tag -width "Xmounthost=hostXXX" |
| | | 50 | .It Fl Fl mounthost Ns = Ns Ar host |
| | | 51 | Use |
| | | 52 | .Ar host |
| | | 53 | as the mount host. |
49 | .It Fl Fl pkgsrc Ns = Ns Ar dir | | 54 | .It Fl Fl pkgsrc Ns = Ns Ar dir |
50 | Look for the pkgsrc files in | | 55 | Look for the pkgsrc files in |
51 | .Ar dir | | 56 | .Ar dir |
52 | instead of the default | | 57 | instead of the default |
53 | .Pa /usr/pkgsrc . | | 58 | .Pa /usr/pkgsrc . |
54 | .It Fl Fl src Ns = Ns Ar srcdir | | 59 | .It Fl Fl src Ns = Ns Ar srcdir |
55 | Look for the | | 60 | Look for the |
56 | .Nx | | 61 | .Nx |
57 | src files in | | 62 | src files in |
58 | .Ar dir | | 63 | .Ar srcdir |
59 | instead of the default | | 64 | instead of the default |
60 | .Pa /usr/src | | 65 | .Pa /usr/src |
61 | (only needed for some packages that compile kernel modules). | | 66 | (only needed for some packages that compile kernel modules). |
62 | .It Fl Fl verbose | | 67 | .It Fl Fl verbose |
63 | More verbose output. | | 68 | More verbose output. |
64 | .It Fl Fl without-x | | 69 | .It Fl Fl without-x |
65 | Do not include X files in the sandbox. | | 70 | Do not include X files in the sandbox. |
66 | .It Fl Fl xsrc Ns = Ns Ar xsrcdir | | 71 | .It Fl Fl xsrc Ns = Ns Ar xsrcdir |
67 | Look for the | | 72 | Look for the |
68 | .Nx | | 73 | .Nx |
69 | xsrc files in | | 74 | xsrc files in |
70 | .Ar dir | | 75 | .Ar xsrcdir |
71 | instead of the default | | 76 | instead of the default |
72 | .Pa /usr/src | | 77 | .Pa /usr/xsrc |
73 | (only needed for some packages). | | 78 | (only needed for some packages). |
74 | .El | | 79 | .El |
75 | .Sh USAGE | | 80 | .Sh USAGE |
76 | After | | 81 | After |
77 | .Nm | | 82 | .Nm |
78 | has finished successfully, | | 83 | has finished successfully, |
79 | .Ar sandbox-dir | | 84 | .Ar sandbox-dir |
80 | will contain a file | | 85 | will contain a file |
81 | .Pa sandbox | | 86 | .Pa sandbox |
82 | which can be used to set up and tear down the sandbox, as well as | | 87 | which can be used to set up and tear down the sandbox, as well as |
83 | execute commands inside. | | 88 | execute commands inside. |
84 | The | | 89 | The |
85 | .Pa sandbox | | 90 | .Pa sandbox |
86 | script supports the following commands: | | 91 | script supports the following commands: |
87 | .Bl -tag -width XanythingXelseXXX | | 92 | .Bl -tag -width XXnoXargumentXXXX |
88 | .It Ic mount | | 93 | .It Ic mount |
89 | Set up the sandbox. | | 94 | Set up the sandbox. |
90 | .It Ic umount | | 95 | .It Ic umount |
91 | Tear down the sandbox. | | 96 | Tear down the sandbox. |
92 | .It (no argument) | | 97 | .It (no argument) |
93 | Start | | 98 | Start |
94 | .Xr ksh 1 | | 99 | .Xr ksh 1 |
95 | inside the sandbox. | | 100 | inside the sandbox. |
96 | Can only be called after | | 101 | Can only be called after |
97 | .Ic mount . | | 102 | .Ic mount . |
98 | .It anything-else | | 103 | .It Ic command |
99 | Try running | | 104 | Try running |
100 | .Pa anything-else | | 105 | .Pa command |
101 | inside the sandbox. | | 106 | inside the sandbox. |
102 | Fails if the argument is not an executable. | | 107 | Fails if the argument is not an executable. |
103 | Can only be called after | | 108 | Can only be called after |
104 | .Ic mount . | | 109 | .Ic mount . |
105 | .El | | 110 | .El |
106 | .Sh EXAMPLES | | 111 | .Sh EXAMPLES |
107 | The most common usage is running mksandbox once, e.g. | | 112 | The most common usage is running mksandbox once, e.g., |
108 | .Dl mksandbox /home/user/sandboxdir | | 113 | .Dl mksandbox /home/user/sandboxdir |
109 | and then reusing this sandbox. | | 114 | and then reusing this sandbox. |
110 | Once the sandbox exists, the most common usage is: | | 115 | Once the sandbox exists, the most common usage is: |
111 | .Bd -literal -offset indent | | 116 | .Bd -literal -offset indent |
112 | cd /home/user/sandboxdir | | 117 | cd /home/user/sandboxdir |
113 | \&./sandbox mount | | 118 | \&./sandbox mount |
114 | \&./sandbox | | 119 | \&./sandbox |
115 | (do something inside, like a bulk build or building one package by hand) | | 120 | (do something inside, like a bulk build or building one package by hand) |
116 | (CTRL-D or logout, to leave the shell inside the sandbox) | | 121 | (CTRL-D or logout, to leave the shell inside the sandbox) |
117 | \&./sandbox umount | | 122 | \&./sandbox umount |
118 | .Ed | | 123 | .Ed |
119 | .Sh AUTHORS | | 124 | .Sh AUTHORS |
120 | .An Alistair G. Crooks | | 125 | .An Alistair G. Crooks |