Prepare for 2.5.
[febootstrap.git] / febootstrap.pod
1 =head1 NAME
2
3 febootstrap - Bootstrap a basic Fedora system (like Debian debootstrap)
4
5 =head1 SYNOPSIS
6
7  febootstrap [--options] REPO TARGET [MIRROR]
8
9 =head1 EXAMPLES
10
11  febootstrap fedora-10 /tmp/f10
12  febootstrap rawhide /tmp/rawhide
13  febootstrap rawhide /tmp/rawhide http://mymirror/rawhide/x86_64/os
14  febootstrap --groupinstall="Mail Server" fedora-10 /tmp/mailserver
15
16 =head1 DESCRIPTION
17
18 febootstrap creates a Fedora root filesystem, based on the Fedora
19 version specified by I<REPO> under the directory specified by
20 I<TARGET>.  Optionally I<MIRROR> can point to a local mirror
21 (otherwise the public Fedora mirrors are used).  I<REPO> names are
22 C<fedora-I<VERSION>> (eg. C<fedora-10>) or C<rawhide>.
23
24 febootstrap does I<not> need to be run as root.  If for some reason
25 you do run it as root, then it works slightly differently and may have
26 side effects such as stopping or starting system daemons.
27
28 For more advanced needs, take a look at L<mock(1)>, C<livecd-creator>
29 and I<thincrust.net>'s C<appliance-creator>.
30
31 The normal output is a root directory located at I<TARGET> and
32 a fakeroot logfile at C<I<TARGET>/fakeroot.log>.
33
34 =head1 OPTIONS
35
36 =over 4
37
38 =item B<-i package>
39
40 =item B<--install=package>
41
42 =item B<-g "group">
43
44 =item B<--groupinstall="group">
45
46 Specify the package or group to install.  To list multiple packages or
47 groups, you must give multiple C<-i> or C<-g> options.  Group names
48 can contain spaces, so use quotes where necessary.
49
50 These are passed directly to C<yum install> or C<yum groupinstall>
51 commands, and thus any dependencies are also resolved by yum.  You can
52 also use shell globs and filenames here, as with ordinary yum.
53
54 If no packages or groups are given, then we install the C<Core> group
55 which is a small working Fedora installation (but by no means
56 minimal).  Use C<yum groupinfo Core> to list the packages currently in
57 the C<Core> group.
58
59 =item B<--no-clean>
60
61 Normally febootstrap will clean up the yum repository
62 (C</var/cache/yum> inside the image).  This contains the downloaded
63 RPMs and metadata.  However if you give the C<--no-clean> option, then
64 the yum repository is left.  This is useful if you want to run further
65 yum commands inside the filesystem by hand.
66
67 =item B<-p "proxyurl">
68
69 =item B<--proxy="proxyurl">
70
71 URL to the proxy server that yum should use.
72
73 =item B<-u source>
74
75 =item B<--updates=source>
76
77 Pull in updates from an additional updates repository.  The possible
78 sources are:
79
80 =over 4
81
82 =item -u C<http://...> (a URL)
83
84 Get updates from the specific URL.
85
86 =item -u C<updates-released-fN> (an updates repository name)
87
88 Get updates from the public mirrors of the named repository
89 (eg. C<updates-released-f10>).  See REPOSITORIES below.
90
91 =item -u C<none> (default)
92
93 Don't add an updates repository.  This is the default.
94
95 =back
96
97 =back
98
99 =head1 REPOSITORIES
100
101 You can list available repositories by visiting this URL:
102
103 L<http://mirrors.fedoraproject.org/mirrorlist?repo=help&arch=i386>
104
105 (If necessary replace C<i386> with your architecture, but it seems
106 unlikely that this list will change based on architecture).
107
108 =head1 RUNNING EXTRA COMMANDS IN THE ROOT FILESYSTEM
109
110 If you want to run further commands inside the root filesystem, for
111 example additional C<yum> installs, then use C<febootstrap-run>.  See
112 the L<febootstrap-run(8)> manual page for more details.
113
114 You have to be careful about modifying files in the root filesystem
115 directly (without using C<febootstrap-run>).  It's easy to confuse
116 fakeroot and end up with the wrong permissions on files (see FAKEROOT
117 LOGFILE below).
118
119 C<febootstrap-run> runs the command inside the root filesystem, which
120 means it won't normally have access to files outside the root.  You
121 can use C<FAKECHROOT_EXCLUDE_PATH> environment variable (see
122 L<fakechroot(1)>) or copy files into the root first.
123
124 =head2 FAKEROOT LOGFILE
125
126 When febootstrap is run as non-root (the normal case) we use fakeroot
127 so that yum thinks it is running as root.  Fakeroot keeps track of
128 "real" file permissions in a log file which is saved into the target
129 directory as C<I<TARGET>/fakeroot.log>.
130
131 This logfile is indexed by inode number, which makes certain
132 operations safe and other operations unsafe.
133 Files should be replaced only by doing:
134
135  echo updated-content > old-file
136
137 (since that preserves the original inode).
138
139 Deleting files and then creating new ones (even with a different name)
140 is usually unsafe, because the new files might reuse inodes claimed by
141 the old files, and so appear with peculiar permissions
142 (eg. unreadable, or as a symbolic link).
143
144 Deleting files is also usually unsafe, although the reasons are more
145 subtle.  If you just use C<rm> then the inode number is not deleted
146 from C<fakeroot.log> which means it can be reused by another file
147 later on.
148
149 In most cases it's usually safest to use C<febootstrap-run>.
150
151 You can use the fakeroot logfile in a number of ways:
152
153 =over 4
154
155 =item *
156
157 Use L<febootstrap-run(8)> to run a command with the faked file
158 permissions.
159
160 =item *
161
162 Use L<febootstrap-install(8)> to install a file with permissions
163 in the root filesystem.
164
165 =item *
166
167 Generate an initramfs (compressed cpio) file containing the correct
168 permissions using the tool C<febootstrap-to-initramfs>.
169
170 =item *
171
172 Generate a supermin appliance using the tool
173 C<febootstrap-to-supermin>.
174
175 =item *
176
177 Apply the permissions to the target directory using the forthcoming
178 tool C<febootstrap-fix-root> (requires root).
179
180 =back
181
182 =head1 RUNNING FEBOOTSTRAP AS ROOT
183
184 There is some rudimentary support for running C<febootstrap> as root.
185 However it is not well-tested and generally not recommended.
186
187 =head1 COMPARISON TO DEBOOTSTRAP
188
189 febootstrap cannot do cross-architecture installs (C<debootstrap
190 --foreign>).  The reason is that C<%pre> and C<%post> scripts cannot
191 run.  It may be possible to defer running of scriptlets (which is
192 basically how debootstrap works), and patches to do this are welcomed.
193
194 febootstrap cannot do 32-on-64 bit installs.  The reason is that
195 fakeroot and fakechroot do not load the correct preload library.  This
196 is really a bug in fakeroot/fakechroot, which we think would be easy
197 to fix.  (debootstrap deals with this case the same as for
198 C<--foreign> installs - see previous point).
199
200 =head1 OTHER RESTRICTIONS AND BUGS
201
202 The following programs are not run during C<%post> scriptlets (because
203 they are all statically linked, and fakechroot cannot run statically
204 linked programs).
205
206 =over 4
207
208 =item C</sbin/ldconfig> (from many packages)
209
210 =item C</usr/sbin/glibc_post_upgrade> (from C<glibc>)
211
212 =item C</usr/sbin/build-locale-archive> (from C<glibc-common>)
213
214 =item C</usr/sbin/libgcc_post_upgrade> (from C<libgcc>)
215
216 =back
217
218 If you wish, you can run them the first time you boot into the new
219 machine.
220
221 febootstrap recreates the repository anew each time, and this causes
222 yum to download all the RPMs every time.  This is very wasteful, and
223 we should provide a way to cache the repository.
224
225 =head1 HOME PAGE
226
227 L<http://et.redhat.com/~rjones/febootstrap>
228
229 =head1 SEE ALSO
230
231 L<febootstrap-to-initramfs(8)>,
232 L<febootstrap-minimize(8)>,
233 L<febootstrap-run(8)>,
234 L<febootstrap-install(8)>,
235 L<febootstrap-to-supermin(8)>,
236 L<fakeroot(1)>,
237 L<fakechroot(1)>,
238 L<yum(8)>,
239 L<rpm(8)>.
240
241 =head1 ALTERNATIVES
242
243 L<mock(1)>,
244 L<http://fedoraproject.org/wiki/FedoraLiveCD/LiveCDHowTo>,
245 L<http://thincrust.net/>,
246 L<debootstrap(8)>,
247 C<ubuntu-vm-builder>.
248
249 =head1 AUTHORS
250
251 Richard W.M. Jones <rjones @ redhat . com>
252
253 =head1 COPYRIGHT
254
255 (C) Copyright 2009 Red Hat Inc.,
256 L<http://et.redhat.com/~rjones/febootstrap>.
257
258 This program is free software; you can redistribute it and/or modify
259 it under the terms of the GNU General Public License as published by
260 the Free Software Foundation; either version 2 of the License, or
261 (at your option) any later version.
262
263 This program is distributed in the hope that it will be useful,
264 but WITHOUT ANY WARRANTY; without even the implied warranty of
265 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
266 GNU General Public License for more details.
267
268 You should have received a copy of the GNU General Public License
269 along with this program; if not, write to the Free Software
270 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.