Version 2.8.
[febootstrap.git] / febootstrap-run.pod
1 =head1 NAME
2
3 febootstrap-run - Run extra commands in febootstrap root filesystem
4
5 =head1 SYNOPSIS
6
7  febootstrap-run [--options] DIR [--] [CMD ...]
8
9 =head1 DESCRIPTION
10
11 This can be used to run extra commands in the febootstrap root
12 filesystem.  It is just a simple wrapper around the standard
13 C<fakeroot> and C<fakechroot> commands.
14
15 If given, the C<CMD ...> is run inside the root filesystem.  The
16 command acts as if it was run as root and chrooted into the root
17 filesystem.
18
19 If the command is omitted, then we start a shell.
20
21 If C<CMD ...> could contain anything starting with a C<-> character
22 then use C<--> to separate C<febootstrap-run> parameters from the
23 command:
24
25  febootstrap-run ./f10 -- ls -l
26
27 =head1 OPTIONS
28
29 =over 4
30
31 =item B<--ro>
32
33 Usually any changes to permissions made by the command are recorded in
34 the C<fakeroot.log> file.  However if C<--ro> flag is given, then
35 changes to permissions are not recorded.  (Note: changes to file
36 contents still happen).
37
38 =back
39
40 =head1 EXAMPLES
41
42 Remove a directory subtree safely:
43
44  febootstrap-run initramfs -- rm -r /etc
45
46 (This requires that you have a compatible 'rm' command in the root).
47
48 Another way to do complex operations from a script is to export a
49 function:
50
51  #!/bin/bash
52
53  do_stuff ()
54  {
55      # complex operations inside the root
56  }
57  export -f do_stuff
58  febootstrap-run root -- bash -c do_stuff
59
60 =head1 ENVIRONMENT VARIABLES
61
62 Some L<fakechroot(1)> environment variables are applicable.  In
63 particular you may want to set:
64
65  export FAKECHROOT_EXCLUDE_PATH=/proc
66
67 =head1 SEE ALSO
68
69 L<febootstrap(8)>,
70 L<febootstrap-install(8)>,
71 L<fakeroot(1)>,
72 L<fakechroot(1)>.
73
74 =head1 AUTHORS
75
76 Richard W.M. Jones <rjones @ redhat . com>
77
78 =head1 COPYRIGHT
79
80 (C) Copyright 2009 Red Hat Inc.,
81 L<http://people.redhat.com/~rjones/febootstrap>.
82
83 This program is free software; you can redistribute it and/or modify
84 it under the terms of the GNU General Public License as published by
85 the Free Software Foundation; either version 2 of the License, or
86 (at your option) any later version.
87
88 This program is distributed in the hope that it will be useful,
89 but WITHOUT ANY WARRANTY; without even the implied warranty of
90 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
91 GNU General Public License for more details.
92
93 You should have received a copy of the GNU General Public License
94 along with this program; if not, write to the Free Software
95 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.