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