Big update of documentation; use sed -i instead of sed -ie in script
[grml-live.git] / docs / grml-live.txt
1 grml-live(8)
2 ============
3
4 Name
5 ----
6
7 grml-live - build framework based on FAI for generating a grml and Debian based
8 Linux Live system (CD/ISO)
9
10 Synopsis
11 --------
12
13 grml-live [-c <classe[s]>] [-t <target_directory>] [-s <suite>] [-Fvh]
14
15 *******************************************************************************
16 Important! This document is growing as requested. If you have questions which
17 aren't answered by this document yet please let me know: <mika@grml.org>!
18 *******************************************************************************
19
20 Description
21 -----------
22
23 grml-live provides the build system for creating a grml and Debian based Linux
24 Live-CD. The build system is based on
25 link:http://www.informatik.uni-koeln.de/fai/[FAI] (Fully Automatic
26 Installation). grml-live uses the "fai dirinstall" feature to generate a chroot
27 system based on the class concept of FAI (see later sections for further
28 details) and provides the framework to be able to generate a full-featured ISO.
29 It does not use all the FAI features by default though and you don't have to
30 know FAI to be able to use it.
31
32 The use of FAI gives you the flexibility to choose the packages you would like
33 to include on your very own Linux Live-CD without having to deal with all the
34 details of a build process.
35
36 CAUTION: grml-live does **not** use /etc/fai for configuration but instead
37 provides and uses /etc/grml/fai. This ensures that it does not clash with
38 default FAI configuration and packages, so you can use grml-live and FAI
39 completely independent at the same time!
40
41 [NOTE]
42
43 Please notice that you should have a fast network connection as all the Debian
44 packages will be downloaded and installed via network. If you want to use a
45 local mirror (strongly recommended if you plan to use grml-live more than once)
46 checkout mkdebmirror (see /usr/share/doc/grml-live/examples/mkdebmirror),
47 debmirror(1), reprepro(1) (see /usr/share/doc/grml-live/examples/reprepro/ for a
48 sample configuration) and approx(8). To avoid downloading the base system again
49 and again check out FAI's NFSROOT (see FAQ of this document for details).
50
51 Options
52 -------
53
54   -c **CLASSES**::
55
56 Specify the CLASSES to be used for building the ISO via FAI.  By default only
57 the classes GRMLBASE and I386 are assumed, resulting in a small base system
58 (being about ~150MB total ISO size) for x86 (32bit).
59
60   -s **SUITE**::
61
62 Specify the Debian suite you want to use for your live-system.  Defaults to
63 "etch" (being current Debian/stable). Supported values are: etch, lenny, sid,
64 stable, testing, unstable.
65
66   -t **TARGET_DIRECTORY**::
67
68 Main output directory of the build process of FAI.  Some directories are created
69 inside this target directory, being: grml_cd (where the files for creating the
70 ISO are located, including the compressed squashfs file), grml_chroot (the
71 chroot system) and grml_isos (where the resulting ISO is stored).
72
73   -F::
74
75 Force execution and do not prompt for acknowledgment of configuration.
76
77   -h::
78
79 Display short usage information and exit.
80
81   -v::
82
83 Increase verbosity in the build process.
84
85 How to get your own Live-CD - the easy, fast and simple way
86 -----------------------------------------------------------
87
88 To get a small, Debian-stable and grml-based Live-CD using /grml/grml-live
89 as build and output directory just run:
90
91   # grml-live
92
93 To get a small Debian-unstable and grml-small based Live-CD using
94 /home/mika/grml-live as build and output directory just use:
95
96   # grml-live -c GRMLBASE,GRML_SMALL,I386 -t /home/mika/grml-live
97
98 [NOTE]
99
100 If you have about 700MB of free space inside /dev/shm (being a tmpfs, usually
101 you should have >=1GB of RAM) just run "mount -o remount,suid,dev,rw /dev/shm"
102 and use /dev/shm as build and output directory - resulting in very fast build
103 process.  But please be aware of the fact that rebooting your system will result
104 in an empty /dev/shm, so please another directory for $CHROOT_TARGET,
105 $BUILD_TARGET and $ISO_TARGET if you plan to create more persistent output. :)
106
107 Main features of grml-live
108 --------------------------
109
110 * create a grml-/Debian-based Linux Live-CD with one single command
111
112 * class based concept, providing a maximum of flexibility
113
114 * supports integration of own hooks, scripts and configuration
115
116 * supports use and integration of own Software and/or Kernels via simple use of
117 Debian repositories
118
119 * native support of FAI features
120
121 * multi-arch support (work in progress)
122
123 The class concept
124 -----------------
125
126 grml-live uses FAI and its class based concept for adjusting configuration and
127 setup according to your needs. This gives you flexibility and strength without
128 losing the simplicity in the build process.
129
130 The main and base class provided by grml-live is named GRMLBASE. It's strongly
131 recommended to **always** use the class GRMLBASE when building an ISO using
132 grml-live, as well as the architecture dependend class which provides the kernel
133 (being 'I386' for x86_32 currently only). The following files and directories
134 are relevant for class GRMLBASE by default:
135
136   /etc/grml/fai/config/scripts/GRMLBASE/
137   /etc/grml/fai/config/debconf/GRMLBASE
138   /etc/grml/fai/config/class/GRMLBASE.var
139   /etc/grml/fai/config/hooks/instsoft.GRMLBASE
140   /etc/grml/fai/config/package_config/GRMLBASE
141
142 Take a look at the next section for information about the concept of those
143 files/directories.
144
145 If you want to use your own configuration, extend an existing configuration
146 and/or add additional packages to your ISO just invent a new class (or extend an
147 existing one). For example if you want to use your own class named "FOOBAR" just
148 extend CLASSES="GRMLBASE,I386" inside /etc/grml/grml-live.conf to
149 CLASSES="GRMLBASE,I386,FOOBAR" or invoke grml-live using the classes option:
150 "grml-live -c GRMLBASE,I386,FOOBAR ...".
151
152 More details regarding the class concept can be found in the documentation of
153 FAI itself (being available at /usr/share/doc/fai-doc/).
154
155 Files
156 -----
157
158 Notice that grml-live ships FAI configuration files that do not use the same
159 namespace as the FAI packages itself. This ensures that grml-live does not clash
160 with your usual FAI configuration, so instead of /etc/fai/fai.conf (package
161 fai-client) grml uses /etc/grml/fai/fai.conf instead. For more details see
162 below. To get an idea how another configuration or example files could look like
163 check out /usr/share/doc/fai-doc/examples/simple/ (provided by Debian package
164 fai-doc). Furthermore /usr/share/doc/fai-doc/fai-guide.html/ch-config.html
165 provides documentation regarding configuration possibilities.
166
167   /usr/sbin/grml-live
168
169 Script for the main build process. Requires root permissions for execution.
170
171   /etc/grml/grml-live.conf
172
173 Main configuration file for grml-live. All the important steps can be configured
174 at this stage.
175
176   /etc/grml/fai/fai.conf
177
178 Main configuration file for FAI which specifies where all the configuration
179 files and scripts for FAI/grml-live can be found. By default it is set to
180 FAI_CONFIGDIR=/etc/grml/fai/config, a directory shipped by grml-live
181 out-of-the-box so you shouldn't have to configure anything in this file.
182
183   /etc/grml/fai/make-fai-nfsroot.conf
184
185 This file is used by make-fai-nfsroot(8) only. Usually you don't have to change
186 anything inside this file. If you want to modify NFSROOT though you can adjust
187 it there.
188
189   /etc/grml/fai/NFSROOT
190
191 This file specifies the package list for creating the NFSROOT.
192
193   /etc/grml/fai/apt/sources.list
194
195 This file specifies which mirrors should be used for retreiving the Debian
196 packages used for creating the main chroot (including all the software you would
197 like to see included). If you want to use a local mirror you either have to
198 adjust this file or use the GRML_LIVE_SOURCES variable inside
199 /etc/grml/grml-live.conf which modifies /etc/grml/fai/apt/sources.list
200 on-the-fly then.
201
202   /etc/grml/fai/config/
203
204 The main directory for configuration of FAI/grml-live. More details below.
205
206   /etc/grml/fai/config/class/
207
208 This directory contains files which specify main configuration variables for the
209 FAI classes.
210
211   /etc/grml/fai/config/debconf/
212
213 This directory provides the files for preseeding/configuration of debconf
214 through files.
215
216   /etc/grml/fai/config/hooks/
217
218 This directory provides files for customising the build process through hooks.
219 Hooks are user defined programs or scripts, which are called during the
220 installation process.
221
222   /etc/grml/fai/config/package_config/
223
224 Directory with lists of software packages to be installed or removed.  The
225 different classes describe what should find its way to your ISO.  When running
226 "grml-live -c GRMLBASE,I386 ..." only the files from the directories GRMLBASE
227 and I386 will be taken, if you use 'grml-live -c GRMLBASE,I386,FOOBAR ...' then
228 the files of GRMLBASE, I386 **plus** the files from FOOBAR will be taken. So
229 just create a new class to adjust the package selection according to your needs.
230 Please notice that the directory GRMLBASE contains a package list defining a
231 minimum but still reasonable package configuration.
232
233   /etc/grml/fai/config/scripts/
234
235 Scripts for customising the ISO within the build process.
236
237   /etc/grml/fai/files/
238
239 This directory provides files used inside the scripts of
240 /etc/grml/fai/config/scripts/*. For a full documentation what happens with the
241 files please refer to the source of the scripts.
242
243   /etc/grml/fai/live-initramfs/
244
245 This directory provides the files used for building the initramfs/initrd via
246 live-initramfs(8).
247
248 Requirements for the build system
249 ---------------------------------
250
251 * any Debian based system should be sufficient (if not it's a bug, so please
252 send us a bug report then) [a usual link:http://grml.org/grml2hd/[grml2hd]
253 harddisk installation ships all you need]
254
255 * enough free disk space; at least 800MB are required for a minimal grml-live
256 run (\~400MB for the chroot [$CHROOT_TARGET], \~150MB for the build target
257 [$BUILD_TARGET] and \~150MB for the resulting ISO [$ISO_TARGET] plus some
258 temporary files)
259
260 * fast network access for retreiving the Debian packages used for creating the
261 chroot (check out "local mirror" and "NFSROOT" to workaround this problem as far
262 as possiblbe)
263
264 FAQ
265 ---
266
267 Help, I'm using Debian etch and I don't have FAI version >3.2
268 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
269
270   wget http://www.informatik.uni-koeln.de/fai/download/etch/fai-client_3.2.1_all.deb \
271        http://www.informatik.uni-koeln.de/fai/download/etch/fai-server_3.2.1_all.deb
272   dpkg -i fai-client_3.2.1_all.deb fai-server_3.2.1_all.deb
273
274 or check out the link:http://www.informatik.uni-koeln.de/fai/[FAI-homepage] for
275 further details.
276
277 I've problems with the build process. How to start debugging?
278 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
279
280 Check out the logs inside /var/log/fai/dirinstall/... If you don't have the time
281 to debug the problem in further detail or don't know how to proceed just send a
282 copy of your config, logs and the commandline with a short problem description
283 to <mika@grml.org>:
284
285   # history | grep grml-live > /etc/grml/grml_live.cmdline
286   # tar zcf grml_live_problem.tar.gz /etc/grml/grml-live.conf \
287             /var/log/fai/dirinstall /etc/grml/fai
288
289 Can I use my own (local) Debian mirror?
290 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
291
292 Sure. Just adjust the variables GRML_LIVE_SOURCES and FAI_DEBOOTSTRAP (if not
293 already using NFSROOT's base.tgz) inside /etc/grml/grml-live.conf according to
294 your needs. Please don't forget that you should use the grml servers as well
295 (see default configuration) so all the grml packages can be downloaded as well.
296
297 If you want to use a local (for example NFS mount) mirror additionally, just
298 adjust MIRROR_DIRECTORY and MIRROR_SOURCES insede /etc/grml/grml-live.conf as
299 well.
300
301 Unless you specify GRML_LIVE_SOURCES and/or FAI_DEBOOTSTRAP the default from
302 /etc/grml/fai/apt/sources.list and /etc/grml/fai/make-fai-nfsroot.conf will be
303 taken. If you customise the variables in /etc/grml/grml-live.conf then the two
304 files will be adjusted during runtime automatically.
305
306 If MIRROR_DIRECTORY and MIRROR_SOURCES are specified the local mirror will be
307 taken as first entry in the generated sources.list so it's prefered over
308 non-local mirrors. Using a fallback mirror (via providing several mirrors in
309 GRML_LIVE_SOURCES as used by default) is a recommended setting.
310
311 How do I add additional Debian package(s) to my CD/ISO?
312 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
313
314 Just create a new class (using the package_config directory):
315
316   # cat > /etc/grml/fai/config/package_config/MIKA << EOF
317   PACKAGES aptitude
318
319   vim
320   another_name_of_a_debian_package
321   and_another_one
322   EOF
323
324 and specify it when invoking grml-live then:
325
326   # grml-live -c GRMLBASE,I386,MIKA
327
328 I fscked up my grml-live configuration. How do I reset it to the defaults?
329 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
330
331 Notice: this deletes all your grml-live configuration files. If that's really
332 what you are searching for just run:
333
334   rm -rf /etc/grml/fai /etc/grml/grml-live.conf
335   dpkg -i --force-confnew --force-confmiss /path/to/grml-live_..._all.deb
336
337 [NOTE]
338
339 If you don't control your /etc using a version control system (VCS) yet it's a
340 good chance to start using it now. Check out
341 link:http://michael-prokop.at/blog/2007/03/14/maintain-etc-with-mercurial-on-debian/[http://michael-prokop.at/blog/2007/03/14/maintain-etc-with-mercurial-on-debian/]
342 for more details how to maintain /etc using the mercurial VCS.
343
344 How do I create a base.tgz for use as NFSROOT?
345 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
346
347 First of all build the chroot system:
348
349   mkdir /tmp/nfsroot && cd /tmp/nfsroot
350   debootstrap etch /tmp/nfsroot/ http://ftp.de.debian.org/debian
351   tar zcf base.tgz ./
352
353 Then check out where your NFSROOT is located:
354
355   # grep '^NFSROOT' /etc/grml/fai/make-fai-nfsroot.conf
356   NFSROOT=/grml/fai/nfsroot
357
358 So as /grml/fai/nfsroot is your NFSROOT place the file under
359 /grml/fai/nfsroot/live/filesystem.dir/var/tmp/:
360
361   mv base.tgz /grml/fai/nfsroot/live/filesystem.dir/var/tmp/base.tgz
362
363 Now running "grml-live ..." will use this file as main system instead of
364 executing debootstrap. Check out the output for the following lines:
365
366   [...]
367   Calling task_extrbase
368   Unpacking Debian base archive
369   Extracting /grml/fai/nfsroot/live/filesystem.dir/var/tmp/base.tgz
370   Calling task_mirror
371   [...]
372
373 I've a question which isn't answered by this document
374 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
375
376 Don't hesitate to ask on IRC (channel #grml on irc.freenode.org) or just drop me
377 a mail: <mika@grml.org>
378
379 Known TODOs
380 -----------
381
382 * "fai dirinstall" does not seem to always exit according to what happend during
383 the build; make sure to exit on any error
384
385 * document the available classes in more detail
386
387 * add a check to make sure $TARGET is mounted rw,suid,dev?
388
389 * add support for amd64 [gebi?] + ppc [formorer?] (and identify all packages
390 that are arch specific so we have a clean package list in all classes)
391
392 * support different grml-flavours through classes right out-of-the-box (being:
393 grml and  grml-small (done), each for x86, amd64 and ppc)
394
395 * support signed apt repositories (currently it's deactivated via FAI's
396 FAI_ALLOW_UNSIGNED=1 for some packages in the toolchain)
397
398 * support setting stuff like ISO name, version,... on-the-fly (especially for
399 stuff inside boot/isolinux/*)
400
401 * support "final builds" (including stuff like generating md5sums, gpg,... -
402 create a grml_release-directory including all the details about the build
403 process like dpkg selection, logs,...)
404
405 * the grml-live class(es) should send output to stdout and stderr as used inside
406 FAI as well (so it's not as verbose unless you specify it, make it configurable
407 though); check for errors inside the logs then as well
408
409 * provide possibility for cleanup of all created build directories and
410 a smart summary of the buildprocess (including "took ... minutes/seconds to
411 build...")
412
413 * check out how FAI_DEBMIRROR of /etc/grml/fai/fai.conf could be merged with our
414 MIRROR_DIRECTORY and MIRROR_SOURCES feature of /etc/grml/grml-live.conf
415
416 * support hooks to allow further customisation of the build process
417
418 Long term goals
419 ---------------
420
421 * Provide all upcoming grml releases based on grml-live.
422
423 * Provide a console interface (using dialog) for easy and common use of
424 grml-live.
425
426 * Provide a graphical interface (for example using pygtk) for easy and common
427 use of grml-live.
428
429 Download / install grml-live as a Debian package
430 ------------------------------------------------
431
432 Debian packages will be available through the grml-repository at
433 link:http://deb.grml.org/[http://deb.grml.org/] as soon as the grml-team
434 considers grml-live as stable enough. In the meantime just build the package on
435 your own:
436
437   hg clone http://hg.grml.org/grml-live
438   cd grml-live
439   debuild -us -uc
440
441 Source
442 ------
443
444 The source of grml-live is available at
445 link:http://hg.grml.org/grml-live/[http://hg.grml.org/grml-live/]
446
447 Bugs
448 ----
449
450 Please report feedback, link:http://grml.org/bugs/[bugreports] and wishes
451 link:http://grml.org/contact/[to the grml-team]!
452
453 Authors
454 -------
455 Michael Prokop <mika@grml.org>.
456
457 /////////////////////////////////////
458 // vim:ai tw=80 ft=asciidoc expandtab
459 /////////////////////////////////////