Merge branch 'master' of ssh://git.grml.org/grml-live
[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 [-a <architecture>] [-c <classe[s]>] [-C <configfile>] [-g
14 <grml_name>] [-i <iso_name> ] [-o <output_directory>] [-r <release_name>] [-s
15 <suite>] [-t <template_directory>] [-v <version_number>] [-bBFhquVz]
16
17 CAUTION: Please check out <<current_state,the 'Current state of grml-live with
18 squashfs-tools and kernel' section>> for details about current state of involved
19 tools before starting with grml-live or if you encounter any problems.
20
21 Description
22 -----------
23
24 grml-live provides the build system for creating a grml and Debian based Linux
25 Live-CD. The build system is based on
26 link:http://fai-project.org/[FAI] (Fully Automatic
27 Installation). grml-live uses the "fai dirinstall" feature to generate a chroot
28 system based on the class concept of FAI (see later sections for further
29 details) and provides the framework to be able to generate a full-featured ISO.
30 It does not use all the FAI features by default though and you don't have to
31 know FAI to be able to use it.
32
33 The use of FAI gives you the flexibility to choose the packages you would like
34 to include on your very own Linux Live-CD without having to deal with all the
35 details of a build process.
36
37 CAUTION: grml-live does **not** use /etc/fai for configuration but instead
38 provides and uses /etc/grml/fai. This ensures that it does not clash with
39 default FAI configuration and packages, so you can use grml-live and FAI
40 completely independent at the same time!
41
42 [NOTE]
43
44 Please notice that you should have a fast network connection as all the Debian
45 packages will be downloaded and installed via network. If you want to use a
46 local mirror (strongly recommended if you plan to use grml-live more than once)
47 checkout mkdebmirror (see /usr/share/doc/grml-live/examples/mkdebmirror),
48 debmirror(1), reprepro(1) (see /usr/share/doc/grml-live/examples/reprepro/ for a
49 sample configuration), apt-cacher(1) and approx(8). To avoid downloading the
50 base system again and again check out FAI's NFSROOT (see FAQ of this document
51 for details).
52
53 Options
54 -------
55
56   -a **ARCHITECTURE**::
57
58 Use the specified architecture instead of the currently running one.  This
59 allows building a 32bit system on a 64bit host (though you can't build a 64bit
60 system on a 32bit system/kernel of course). Please notice that real
61 crosscompiling (like building a ppc system on x86) isn't possible due to the
62 nature and the need of working in a chroot. Currently supported values: i386
63 and amd64.
64
65   -b::
66
67 Build the ISO without updating the chroot via FAI. This option is useful for
68 example when working on stable releases: if you have a working base
69 system/chroot and do not want to execute any further updates (via "-u" option)
70 but intend to only build the ISO.
71
72   -B::
73
74 Build the ISO without touching the chroot at all. This option is useful if
75 you modified anything that FAI or grml-live might adjust via grml's FAI
76 scripts.  It's like the '-b' option but even more advanced. Use only if you
77 really know that you do not want to update the chroot.
78
79   -c **CLASSES**::
80
81 Specify the CLASSES to be used for building the ISO via FAI.  By default only
82 the classes GRMLBASE, GRML_MEDIUM and I386 are assumed, resulting in a small base
83 system (being about ~180MB total ISO size). If using a non-I386 system (like
84 AMD64) you should specify the appropriate architecture as well. Additionally you
85 can specify a class providing a grml-kernel (see
86 <<classes,the 'CLASSES' section in this document>> for details about available classes).
87 So instead of GRML_MEDIUM you can also use GRML_SMALL and GRML_FULL.
88
89 [IMPORTANT]
90 All class names should be written in uppercase letters. Do not use a dash, use
91 an underscore. So do not use "amd64" but "AMD64", do not use "FOO BAR" but
92 "FOO_BAR".
93
94
95   -C **CONFIGURATION_FILE**::
96
97 The specified file is used as configuration file for grml-live. By default
98 /etc/grml/grml-live.conf is used as default configuration. If a file named
99 /etc/grml/grml-live.local exists it is used as well (sourced after reading
100 /etc/grml/grml-live.conf meant as main file for local configuration). As a last
101 option the specified configuration file is sourced so it is possible to override
102 settings of /etc/grml/grml-live.conf as well as of /etc/grml/grml-live.local.
103 Please notice that all configuration files have to be adjusted during execution
104 of grml-live, so please make sure you use /etc/grml/grml-live.conf as a base for
105 your own configuration file (usually /etc/grml/grml-live.local). Please also
106 notice that the configuration file specified via this option is **not** (yet)
107 supported inside the scripts/hooks/classes at /etc/grml/fai/config. Instead use
108 /etc/grml/grml-live.local for configuration stuff used inside
109 /etc/grml/fai/config.
110
111   -d **DATE**::
112
113 Use specified date as build date information on the ISO instead of the default.
114 The default is the date when grml-live is being executed (retrieved via
115 executing 'date +%Y-%m-%d'). The information is stored inside the file
116 /GRML/grml-version on the ISO, /etc/grml_version in the squashfs file and in all
117 the bootsplash related files. This option is useful if you want to provide an
118 ISO with release information for a specific date but have to build it in
119 advance. Usage example: '-d 2009-10-30'
120
121   -F::
122
123 Force execution and do not prompt for acknowledgment of configuration.
124
125   -g **GRML_NAME**::
126
127 Set the grml flavour name. Common usage examples: grml, grml-small, grml64.
128 Please do NOT use blanks and any special characters like '/', ';' inside
129 GRML_NAME, otherwise you might notice problems while booting.
130
131   -h::
132
133 Display short usage information and exit.
134
135   -i **ISO_NAME**::
136
137 Specify name of ISO which will be available inside $OUTPUT_DIRECTORY/grml_isos
138 by default.
139
140   -I **CHROOT_INSTALL**::
141
142 Specify name of source directory which provides files that should become part of
143 the chroot/ISO. Not enabled by default. Note: the files are installed under '/'
144 in the chroot so you have to create the rootfs structure on your own.
145
146   -n::
147
148 Skip creation of the ISO file. This option is useful if you want to build/update
149 the chroot and/or recreate the squashfs file without building an ISO file.
150
151   -o **OUTPUT_DIRECTORY**::
152
153 Main output directory of the build process of FAI.  Some directories are created
154 inside this target directory, being: grml_cd (where the files for creating the
155 ISO are located, including the compressed squashfs file), grml_chroot (the
156 chroot system) and grml_isos (where the resulting ISO is stored).
157
158   -q::
159
160 Build the ISO without (re-)creating the squashfs compressed file using mksquashfs.
161 This option is useful if you just want to update parts outside the chroot in the ISO.
162 Consider combining this option with the build-only option '-b'.
163
164   -r **RELEASENAME**::
165
166 Specify name of the release.
167
168   -s **SUITE**::
169
170 Specify the Debian suite you want to use for your live-system.  Defaults to
171 "lenny" (being current Debian/stable). Supported values are: etch, lenny, sid.
172 Debian "squeeze" (current Debian/testing) requires base.tgz
173 (/etc/grml/fai/config/basefiles/$CLASSNAME.tar.gz) or a recent version of
174 debootstrap.
175
176   -t **TEMPLATE_DIRECTORY**::
177
178 Specify place of the templates used for building the ISO. By default
179 (and if not manually specified) this is /usr/share/grml-live/templates/.
180
181   -u::
182
183 Update existing chroot instead of rebuilding it from scratch. This option is
184 based on the softupdate feature of FAI.
185
186   -v **VERSION_NUMBER**::
187
188 Specify version number of the release.
189
190   -V::
191
192 Increase verbosity in the build process.
193
194   -z::
195
196 Use ZLIB instead of LZMA compression in mksquashfs part of the build process.
197
198 [[usage-examples]]
199 Usage examples
200 --------------
201
202 To get a small, Debian-stable and grml-based Live-CD using /grml/grml-live
203 as build and output directory just run:
204
205   # grml-live
206
207 To get a small Debian-unstable and grml-small based Live-CD using
208 /home/mika/grml-live as build and output directory just use:
209
210   # grml-live -s sid -c GRMLBASE,GRML_SMALL,I386 -o /home/mika/grml-live
211
212 To get a medium sized, Debian-unstable and grml-based Live-CD for i386
213 architecture using /grml/grml-live as build and output directory just run:
214
215   # grml-live -s sid -a i386 -c GRMLBASE,GRML_MEDIUM,I386
216
217 To get a small, Debian-unstable and grml-based Live-CD using /tmp as build and
218 output directory and use grml_0.0-3.iso as ISO name (placed inside
219 /tmp/grml_isos) just invoke:
220
221   # grml-live -o /tmp -c GRMLBASE,GRML_SMALL,I386 -s sid -i grml_0.0-3.iso
222
223 [NOTE]
224
225 If you have about 700MB of free space inside /dev/shm (being a tmpfs, usually
226 you should have >=1GB of RAM) just run "mount -o remount,suid,dev,rw /dev/shm"
227 and use /dev/shm as build and output directory - resulting in very fast build
228 process.  But please be aware of the fact that rebooting your system will result
229 in an empty /dev/shm, so please use another directory for $CHROOT_OUTPUT,
230 $BUILD_OUTPUT and $ISO_OUTPUT if you plan to create more persistent output. :)
231
232 [[main-features]]
233 Main features of grml-live
234 --------------------------
235
236 * create a grml-/Debian-based Linux Live-CD with one single command
237
238 * class based concept, providing a maximum of flexibility
239
240 * supports integration of own hooks, scripts and configuration
241
242 * supports use and integration of own Software and/or Kernels via simple use of
243 Debian repositories
244
245 * native support of FAI features
246
247 * multi-arch support (work in progress)
248
249 [[class-concept]]
250 The class concept
251 -----------------
252
253 grml-live uses FAI and its class based concept for adjusting configuration and
254 setup according to your needs. This gives you flexibility and strength without
255 losing the simplicity in the build process.
256
257 The main and base class provided by grml-live is named GRMLBASE. It's strongly
258 recommended to **always** use the class GRMLBASE when building an ISO using
259 grml-live, as well as the architecture dependent class which provides the kernel
260 (being 'I386' for x86_32 and 'AMD64' for x86_64) and a GRML_* class (like
261 GRML_SMALL, GRML_MEDIUM or GRML_FULL). The following files and directories are
262 relevant for class GRMLBASE by default:
263
264   /etc/grml/fai/config/scripts/GRMLBASE/
265   /etc/grml/fai/config/debconf/GRMLBASE
266   /etc/grml/fai/config/class/GRMLBASE.var
267   /etc/grml/fai/config/hooks/instsoft.GRMLBASE
268   /etc/grml/fai/config/package_config/GRMLBASE
269
270 Take a look at the next section for information about the concept of those
271 files/directories.
272
273 If you want to use your own configuration, extend an existing configuration
274 and/or add additional packages to your ISO just invent a new class (or extend an
275 existing one). For example if you want to use your own class named "FOOBAR" just
276 set CLASSES="GRMLBASE,GRML_SMALL,I386,FOOBAR" inside /etc/grml/grml-live.local
277 or invoke grml-live using the classes option: "grml-live -c
278 GRMLBASE,GRML_SMALL,I386,FOOBAR ...".
279
280 More details regarding the class concept can be found in the documentation of
281 FAI itself (being available at /usr/share/doc/fai-doc/).
282
283 [[X7]]
284 [[classes]]
285 Available classes
286 -----------------
287
288 The package selection part of the classes can be found in
289 /etc/grml/fai/config/package_config whereas some further classes are defined for
290 example in /etc/grml/fai/config/scripts/ so specific feature sets can be
291 selected. The following classes are predefined:
292
293 * DEBORPHAN: get rid of all packages listed in output of Deborphan
294
295 * GRMLBASE: the main class responsible for getting a minimal subset of what's
296 defining a grml system. Important parts of the buildprocess are specified in
297 this class as well, so unless you have a really good reason you should always
298 use this class.
299
300 * GRML_FULL: full featured grml, also known as the "normal", full grml.
301
302 * GRML_MEDIUM: medium sized grml version, known as grml-medium
303
304 * GRML_POWERPC: grml for PowerPC architecture, not supported yet (still work in
305 progress)
306
307 * GRML_SMALL: minimum sized grml version, known as grml-small
308
309 * LATEX: LaTeX(-related) packages like auctex, texlive,...
310 (which used to be shipped by grml before the LaTeX removal)
311
312 * LATEX_CLEANUP: get rid of several very large LaTeX directories
313 (like some /usr/share/doc/texlive-*, /usr/share/doc/texmf,...)
314
315 * LOCALES: use full featured locales setup (see /etc/locale.gen.grml). This
316 avoids to get rid of /usr/share/locale - which happens by default otherwise - as
317 well.
318
319 * NO_ONLINE: do not run scripts during the chroot build process which require a
320 network connection
321
322 * RELEASE: run some specific scripts and commands to provide the workflow for an
323 official grml release
324
325 * REMOVE_DOCS: get rid of documentation directories (like /usr/share/doc,
326 /usr/share/man/, /usr/share/info,...)
327
328 * XORG: providing important packages for use with a base grml-featured X.org
329 setup
330
331 [[files]]
332 Files
333 -----
334
335 Notice that grml-live ships FAI configuration files that do not use the same
336 namespace as the FAI packages itself. This ensures that grml-live does not clash
337 with your usual FAI configuration, so instead of /etc/fai/fai.conf (package
338 fai-client) grml uses /etc/grml/fai/fai.conf instead. For more details see
339 below. To get an idea how another configuration or example files could look like
340 check out /usr/share/doc/fai-doc/examples/simple/ (provided by Debian package
341 fai-doc). Furthermore /usr/share/doc/fai-doc/fai-guide.html/ch-config.html
342 provides documentation regarding configuration possibilities.
343
344   /usr/sbin/grml-live
345
346 Script for the main build process. Requires root permissions for execution.
347
348   /etc/grml/grml-live.conf
349
350 Main configuration file for grml-live which should be considered as a reference
351 configuration file only. Please use /etc/grml/grml-live.local for local
352 configuration instead.
353
354   /etc/grml/grml-live.local
355
356 All the local configuration should go to this file. This file overrides any
357 defaults of grml-live. Configurations via /etc/grml/grml-live.local are preferred
358 over the ones from /etc/grml/grml-live.conf. If you want to override settings
359 from /etc/grml/grml-live.local as well you have to specify them on the grml-live
360 commandline.
361
362   /etc/grml/fai/fai.conf
363
364 Main configuration file for FAI which specifies where all the configuration
365 files and scripts for FAI/grml-live can be found. By default the configuration
366 variables are FAI_CONFIG_SRC=file:///etc/grml/fai/config and
367 FAI_CONFIGDIR=/etc/grml/fai/config - both pointing to a directory shipped by
368 grml-live out-of-the-box so you shouldn't have to configure anything in this
369 file.
370
371   /etc/grml/fai/make-fai-nfsroot.conf
372
373 This file is used by make-fai-nfsroot(8) only. Usually you don't have to change
374 anything inside this file. If you want to modify NFSROOT though you can adjust
375 it there.
376
377   /etc/grml/fai/NFSROOT
378
379 This file specifies the package list for creating the NFSROOT.
380
381   /etc/grml/fai/apt/sources.list
382
383 This file specifies which mirrors should be considered for retrieving the Debian
384 packages when creating the main chroot (including all the software you would
385 like to see included). Important: this file should *not* be adjusted manually!
386 Instead use the GRML_LIVE_SOURCES variable inside /etc/grml/grml-live.conf or
387 /etc/grml/grml-live.local which modifies /etc/grml/fai/apt/sources.list
388 on-the-fly via grml-live then. If you want to generally adjust apt configuration
389 use FAI's fcopy command with /etc/grml/fai/config/files instead.
390
391   /etc/grml/fai/config/
392
393 The main directory for configuration of FAI/grml-live. More details below.
394
395   /etc/grml/fai/config/class/
396
397 This directory contains files which specify main configuration variables for the
398 FAI classes.
399
400   /etc/grml/fai/config/debconf/
401
402 This directory provides the files for preseeding/configuration of debconf
403 through files.
404
405   /etc/grml/fai/config/hooks/
406
407 This directory provides files for customising the build process through hooks.
408 Hooks are user defined programs or scripts, which are called during the
409 installation process.
410
411   /etc/grml/fai/config/package_config/
412
413 Directory with lists of software packages to be installed or removed.  The
414 different classes describe what should find its way to your ISO.  When running
415 "grml-live -c GRMLBASE,GRML_SMALL,I386 ..." only the configuration of GRMLBASE,
416 GRML_SMALL and and I386 will be taken. If you use 'grml-live -c
417 GRMLBASE,GRML_SMALL,I386,FOOBAR ...' then the files of GRMLBASE, GRML_SMALL,
418 I386 **plus** the files from FOOBAR will be taken. So just create a new class to
419 adjust the package selection according to your needs.  Please notice that the
420 directory GRMLBASE contains a package list defining a minimum but still
421 reasonable package configuration.
422
423   /etc/grml/fai/config/scripts/
424
425 Scripts for customising the ISO within the build process.
426
427   /etc/grml/fai/live-initramfs/
428
429 This directory provides the files used for building the initramfs/initrd via
430 live-initramfs(8).
431
432 [[log-files]]
433 Available log files
434 -------------------
435
436 grml-live itself logs to /var/log/grml-live.log. Unless you set PRESERVE_LOGFILE
437 in your grml-live configuration the file is cleared on each new invocation of
438 grml-live.
439
440 The FAI part of grml-live logs to /var/log/fai/$HOSTNAME/ - so the
441 default being /var/log/fai/grml/.
442
443 If you are using the grml-live buildd you will find the logs of the grml-live
444 run at /var/log/grml-buildd.stdout and /var/log/grml-buildd.stderr.
445
446 If you want to store build information in a database just install the
447 grml-live-db Debian package. Further details available in the grml-live-db
448 manpage.
449
450 [[requirements]]
451 Requirements for the build system
452 ---------------------------------
453
454 * any Debian based system should be sufficient (if it doesn't work it's a bug,
455 please send us a bug report then) [a usual
456 link:http://grml.org/grml2hd/[grml2hd] harddisk installation (using grml or
457 grml-medium) ships all you need]. Check out <<deploy-on-debian,How do I deploy
458 grml-live on a plain Debian installation>> for details how to set up grml-live
459 on a plain, original Debian system.
460
461 * enough free disk space; at least 800MB are required for a minimal grml-live
462 run (\~400MB for the chroot [$CHROOT_OUTPUT], \~150MB for the build target
463 [$BUILD_OUTPUT] and \~150MB for the resulting ISO [$ISO_OUTPUT] plus some
464 temporary files), if you plan to use GRML_FULL you should have at least 4GB of
465 total free disk space
466
467 * fast network access for retrieving the Debian packages used for creating the
468 chroot (check out "local mirror" and "NFSROOT" to workaround this problem as far
469 as possible)
470
471 For further information see next section.
472
473 [[X8]]
474 [[current_state]]
475 Current state of grml-live with squashfs-tools and kernel
476 ---------------------------------------------------------
477
478 To make it easier to track problems this section documents current state of
479 grml-live playing together with squashfs-tools / squashfs-lzma-tools /
480 squashfs-lzma-tools4 (for building the compressed file) and the kernel version.
481 Documentation of this section is up2date by 1st of september 2010, please report
482 any bugs you encounter.
483
484 Difference between squashfs-lzma-tools, squashfs-lzma-tools4 and squashfs-tools
485 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
486
487 Whereas the ZLIB compression is much faster in the build process, the LZMA
488 compression provides a smaller resulting ISO. If you're wondering: the official
489 Grml builds use the LZMA compression.
490
491 Squashfs-tools was introduced in Debian and once provided support for LZMA
492 compression. Sadly LZMA compression within squashfs-tools became unsupported and
493 therefore squashfs-lzma-tools[4] had to be introduced and maintained by the Grml
494 team. Different kernel versions provide different squashfs file formats. Kernel
495 versions until 2.6.28-grml[64] used the 3.x file format but those outdated
496 kernels aren't supported by grml-live automatically anymore nowdays (manual
497 handling through SQUASHFS_BINARY possible though). Kernel versions
498 2.6.31-grml[64] and 2.6.33-grml[64] use openwrt's squashfs lzma file format
499 version 4. Kernel versions starting with 2.6.35-grml[64] use the mainline ondisk
500 file format version 4.
501
502 If you're wondering which package supports what, here's a short overview:
503
504 * squashfs-lzma-tools4 4.0-x: ZLIB as default, LZMA support via '-comp lzma'
505 option (enabled by grml-live by default), file format version 4 (mainline
506 version), package maintained and available from Grml, recommended for current
507 grml-live builds featuring kernels >=2.6.35-grml[64]
508
509 * squashfs-lzma-tools 4.0-2: ZLIB as default, LZMA support via '-lzma' option
510 (enabled by grml-live by default), file format version 4 (openwrt style),
511 package maintained and available from Grml, recommended for any grml-live builds
512 with kernel versions 2.6.31-grml[64] and 2.6.33-grml[64]
513
514 * squashfs-tools 1:4.0-x: ZLIB as default, no LZMA support/options, file format
515 version 4, package maintained and available from Debian, recommended only for
516 ZLIB-only builds of any grml-live builds with kernel versions >=2.6.31-grml[64]
517
518 ////////////////////////////////////////////////////////////////////////////////
519 Outdated, JFTR:
520
521 * squashfs-tools 1:3.3-7: ZLIB as default, no LZMA support/options, file format
522 version 3
523
524 * squashfs-tools 1:3.2r2-9exp1: LZMA as default, ZLIB support via '-nolzma'
525 option, file format version 3
526
527 * squashfs-lzma-tools 3.3-1: LZMA as default, ZLIB support via '-nolzma' option,
528 file format version 3
529 ////////////////////////////////////////////////////////////////////////////////
530
531 Now, depending on the kernel version you want to use you need different versions
532 of squashfs-tools/squashfs-lzma-tools[4]. Yes, that's a mess (don't ask how much
533 this sucks for us developers) - though we're putting lots of effort into our
534 toolchain to automatically handle this for you through the grml-live build
535 system and provide proper documentation. The situation is supposed to calm down
536 with the recent integration of the squashfs file format 4 in the mainline
537 kernel. Support for LZMA is pending and as soon as it's available mainline this
538 should dramatically simplify the situation for developers as well as users.
539
540 [TIP]
541 If you want to force usage of a specific mksquashfs binary just set the
542 SQUASHFS_BINARY configuration/environment variable. Set SQUASHFS_OPTIONS for
543 customizing the options that should be used by the mksquashfs binary during
544 build process.
545
546 Using squashfs-lzma-tools4 4.0-1 on the build system
547 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
548
549 squashfs-lzma-tools4 4.0-1 is available via the Grml repositories. It provides
550 the mksquashfs-lzma4 and unsquashfs-lzma4 binaries. The package does NOT
551 conflict with neither Debian's squashfs-tools package nor Grml's
552 squashfs-lzma-tools package, so you can install all of them at the same time and
553 the build system will try to figure out the best matching binary automatically
554 for you.
555
556 The packages can be downloaded from
557 link:http://deb.grml.org/pool/main/s/squashfs-lzma-tools4/[http://deb.grml.org/pool/main/s/squashfs-lzma-tools4/]
558
559 It provides support for the new squashfs file format version 4 (as available in
560 mainline, so *not* the one being used by squashfs-lzma-tools and kernel
561 2.6.33-grml) and therefore requires kernel versions starting with
562 2.6.35-grml[64]. It supports LZMA as well as ZLIB compression. Just use the
563 defaults for enabling LZMA or use grml-live's '-z' option if you want to use
564 ZLIB compression instead.
565
566 * Kernel 2.6.31-grml[64]: works with ZLIB compression, fails with LZMA
567 * Kernel 2.6.33-grml[64]: works with ZLIB compression, fails with LZMA
568 * Kernel 2.6.35-grml[64]: works with ZLIB *and* LZMA compression
569
570 [NOTE]
571 squashfs-lzma-tools4 is the recommended package for building up2date ISOs with
572 grml-live! Please use other squashfs-* packages only if you want to build live
573 systems providing kernel versions older than 2.6.35-grml*. Use
574 squashfs-lzma-tools4 from Grml if you want to remaster any Grml releases MORE
575 RECENT than 2010.04.
576
577 Using squashfs-lzma-tools 4.0-2 on the build system
578 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
579
580 squashfs-lzma-tools 4.0-2 is available via the Grml repositories. It provides
581 the mksquashfs-lzma and unsquashfs-lzma binaries. The package does NOT conflict
582 with Debian's squashfs-tools package (you can install both of them at the same
583 time).
584
585 The packages can be downloaded from
586 link:http://deb.grml.org/pool/main/s/squashfs-lzma-tools/[http://deb.grml.org/pool/main/s/squashfs-lzma-tools/]
587
588 It provides support for the new squashfs file format version 4 (based on openwrt
589 patches, this is *not* the mainline file format that's being used by kernel
590 2.6.35-grml and squashfs-lzma-tools4!) and therefore requires kernel versions
591 newer than 2.6.28-grml[64]. It supports LZMA as well as ZLIB compression. Just
592 use the defaults for enabling LZMA or use grml-live's '-z' option if you want to
593 use ZLIB instead.
594
595 * Kernel \<=2.6.28-grml[64]: does not work
596 * Kernel 2.6.31-grml[64]: works
597 * Kernel 2.6.33-grml[64]: works
598 * Kernel 2.6.35-grml[64]: works for ZLIB compression, fails for LZMA
599
600 [NOTE]
601 Please use squashfs-lzma-tools >=4.0-2 from Grml only if you want to remaster
602 Grml releases 2009.10 and 2010.04 or live systems with their according kernel
603 versions.
604
605 Using squashfs-tools 1:4.0-X on the build system
606 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
607
608 squashfs-tools >=1:4.0-1 is available in Debian/unstable and Debian/testing. It
609 provides the mksquashfs and unsquashfs binaries. The package does NOT conflict
610 neither with the squashfs-lzma-tools 4.0-2 package nor with the
611 squashfs-lzma-tools4 package (so you can install all of them at the same time).
612
613 The packages can be downloaded from
614 link:ftp://ftp.de.debian.org/debian/pool/main/s/squashfs-tools/[ftp://ftp.de.debian.org/debian/pool/main/s/squashfs-tools/]
615
616 It provides support for the new squashfs file format version 4 and therefore
617 requires kernel versions newer than 2.6.28-grml[64].
618
619 It does NOT support LZMA compression (dropped with
620 link:http://packages.debian.org/changelogs/pool/main/s/squashfs-tools/current/changelog[version
621 1:3.3-4] and not yet re-integrated yet, see
622 link:http://bugs.debian.org/594595[#594595]). If you need LZMA support please
623 use Grml's squashfs-lzma-tools[4] (see sections above) instead.
624
625 * Kernels \<=2.6.28-grml[64]: does not work
626 * Kernel 2.6.31-grml[64]: works (ZLIB only)
627 * Kernel 2.6.33-grml[64]: works (ZLIB only)
628 * Kernel 2.6.35-grml[64]: works (ZLIB only)
629
630 [NOTE]
631 Please use squashfs-tools >=1:4.0-1 only if you want to remaster Grml releases
632 starting with 2009.10 using the ZLIB compression, please use squashfs-lzma-tools
633 / squashfs-lzma-tools4 otherwise instead.
634
635 //////////////////////////////////////////////////////////////////////////////////
636 Outdated, JFTR:
637
638 Using squashfs-lzma-tools 3.3-1 on the build system
639 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
640
641 squashfs-lzma-tools 3.3-1 from the Grml repository supports kernel
642 2.6.26-grml[64] and 2.6.28-grml[64] using both LZMA and ZLIB (-nolzma)
643 compression.
644
645 The packages can be downloaded from
646 link:http://deb.grml.org/pool/main/s/squashfs-lzma/[http://deb.grml.org/pool/main/s/squashfs-lzma/].
647
648 [NOTE]
649 Please use squashfs-lzma-tools 3.3-1 only if you want to remaster Grml releases
650 2008.11 or 2009.05.
651
652 Using squashfs-tools 1:3.3-7 on the build system
653 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
654
655 squashfs-tools 1:3.3-7 is available through
656 http://grml.org/squashfs/squashfs-tools_3.3-7_i386.deb (for x86) or
657 http://grml.org/squashfs/squashfs-tools_3.3-7_amd64.deb (for amd64) [both build
658 on and for Debian/etch but working with testing and unstable as well].
659
660 Please notice that squashfs-tools 1:3.3-7 does NOT support LZMA compression at
661 all (so you won't be able to remaster release 2008.11 and 2009.05 using LZMA for
662 example). The -nolzma option of mksquashfs is not available therefore (even
663 though grml-live will deactivate it for you automatically anyway). Please use
664 squashfs-lzma-tools instead.
665
666 * Kernel 2.6.23-grml: does NOT work, please use squashfs-tools 1:3.2r2-9exp1
667                       instead if you still want to use kernel 2.6.23 (not
668                       recommended)
669 * Kernel 2.6.26-grml: works (without LZMA compression only of course!)
670 * Kernel 2.6.28-grml: works (without LZMA compression only of course!)
671
672 Using squashfs-tools 1:3.2r2-9exp1 on the build system
673 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
674
675 squashfs-tools 1:3.2r2-9exp1 is available via the grml-testing repository,
676 running:
677
678   # aptitude install squashfs-tools=1:3.2r2-9exp1
679
680 or directly via downloading the files
681 http://grml.org/squashfs/squashfs-tools_3.2r2-9exp1_i386.deb (for x86) or
682 http://grml.org/squashfs/squashfs-tools_3.2r2-9exp1_amd64.deb (for amd64).
683
684 Using with ZLIB compression (SQUASHFS_OPTIONS='-nolzma' or -z
685 option in grml-live cmdline):
686
687 * Kernel 2.6.23-grml: works
688 * Kernel 2.6.26-grml: works
689 * Kernel 2.6.28-grml: supposed to work (not verified though)
690
691 Using with LZMA compression:
692
693 * Kernel 2.6.23-grml: works
694 * Kernel 2.6.26-grml: does NOT work, please use ZLIB mode instead or switch
695   to Debian package squashfs-lzma-tools 3.3-1 (see section above).
696 * Kernel 2.6.28-grml: does NOT work, please use ZLIB mode instead or switch
697   to Debian package squashfs-lzma-tools 3.3-1 (see section above).
698 //////////////////////////////////////////////////////////////////////////////////
699
700 [[faq]]
701 FAQ
702 ---
703
704 [[deploy-on-debian]]
705 How do I deploy grml-live on a plain Debian installation?
706 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
707
708 The easiest way to get a running grml-live setup is to install Grml or
709 grml-medium using grml2hd (for example inside KVM, Virtualbox, VMware,... if you
710 don't want to run it on a physical system). Of course using grml-live on a
711 plain, original Debian installation is supported as well. So there we go.
712
713 What we have: plain, original Debian Lenny (5.0).
714
715 What we want: build a grml-medium ISO based on Debian/squeeze for the i386
716 architecture using grml-live.
717
718 [IMPORTANT]
719
720 If you encounter any problems while booting the resulting ISO please be aware of
721 <<current_state,the 'current state of grml-live with squashfs-tools and kernel'
722 section>>.
723
724 Instructions
725 ^^^^^^^^^^^^
726
727   # adjust sources.list:
728   cat >> /etc/apt/sources.list << EOF
729
730   # grml stable repository:
731     deb     http://deb.grml.org/ grml-stable  main
732   # deb-src http://deb.grml.org/ grml-stable  main
733
734   # grml testing/development repository:
735     deb     http://deb.grml.org/ grml-testing main
736   # deb-src http://deb.grml.org/ grml-testing main
737   EOF
738
739   # adjust apt-pinning (only prefer squashfs stuff from grml):
740   cat >> /etc/apt/preferences << EOF
741   Package: *
742   Pin: origin deb.grml.org
743   Pin-Priority: 1
744
745   Package: squashfs-lzma-tools
746   Pin: origin deb.grml.org
747   Pin-Priority: 996
748
749   Package: squashfs-lzma-tools4
750   Pin: origin deb.grml.org
751   Pin-Priority: 996
752   EOF
753
754   # get keyring for apt:
755   apt-get update
756   apt-get --allow-unauthenticated install grml-debian-keyring
757
758   # optionally(!) install basefile so we don't have to build basic
759   # chroot from scratch, grab from http://daily.grml.org/
760   # mkdir -p /etc/grml/fai/config/basefiles/
761   # mv base.tgz /etc/grml/fai/config/basefiles/I386.tar.gz
762   # mv base64.tgz /etc/grml/fai/config/basefiles/AMD64.tar.gz
763
764   # install relevant tools
765   # please check out http://grml.org/grml-live/#current_state when encountering problems!
766   apt-get -o APT::Install-Recommends=false install grml-live squashfs-lzma-tools squashfs-lzma-tools4
767
768   # adjust grml-live configuration for our needs:
769   cat > /etc/grml/grml-live.local << EOF
770   ## want a faster build process and don't need smaller ISOs?
771   ## if so use zlib compression, for kernels >=2.6.35-grml* and squashfs-lzma-tools4:
772   # SQUASHFS_OPTIONS="-comp gzip -b 256k"
773   ## ... or for kernels <=2.6.33-grml* and squashfs-lzma-tools:
774   # SQUASHFS_OPTIONS="-nolzma -b 256k"
775   ## want to use a specific squashfs binary?
776   # SQUASHFS_BINARY='/usr/bin/mksquashfs'
777   # install local files into the chroot
778   CHROOT_INSTALL="/etc/grml/fai/chroot_install"
779   ## adjust if necessary (defaults to /grml/grml-live):
780   ## OUTPUT="/srv/grml-live"
781   FAI_DEBOOTSTRAP="squeeze http://cdn.debian.net/debian/"
782   ARCH="i386"
783   CLASSES="GRMLBASE,GRML_MEDIUM,I386"
784   # PRESERVE_LOGFILE='1'
785   # ZERO_FAI_LOGFILE='1'
786   GRML_LIVE_SOURCES="
787   deb http://deb.grml.org/            grml-stable  main
788   deb http://deb.grml.org/            grml-testing main
789   deb http://cdn.debian.net/debian squeeze main contrib non-free
790   "
791   EOF
792
793   # just optional(!) - upgrade FAI to latest available version:
794   cat >> /etc/apt/sources.list << EOF
795   # fai:
796     deb http://fai-project.org/download lenny koeln
797   EOF
798
799   # get gpg key of FAI repos and install current FAI version:
800   gpg -a --recv-keys AB9B66FD; gpg -a --export AB9B66FD | apt-key add -
801   apt-get update
802   apt-get install fai-client fai-server fai-doc
803
804 That's it. Now invoking 'grml-live -V' should build the ISO.  If everything
805 worked as expected the last line of the shell output should look like:
806
807   [*] Successfully finished execution of grml-live [running 687 seconds]
808
809 and the ISO can be found inside /grml-live/grml-live/grml_isos/ then.
810
811 [[fai-on-etch]]
812 Help, I'm using Debian etch and I don't have FAI version >3.2
813 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
814
815   wget http://fai-project.org/download/etch/fai-client_3.2.8_all.deb \
816        http://fai-project.org/download/etch/fai-server_3.2.8_all.deb \
817        http://fai-project.org/download/etch/fai-doc_3.2.8_all.deb
818   dpkg -i fai-client_3.2.8_all.deb fai-server_3.2.8_all.deb fai-doc_3.2.8_all.deb
819
820 or check out the link:http://fai-project.org/[FAI-homepage] for
821 further details.
822
823 [[how-to-debug]]
824 I've problems with the build process. How to start debugging?
825 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
826
827 Check out the logs inside /var/log/fai/... If you think it's a bug in grml-live
828 send a copy of your config, logs and the commandline with a short problem
829 description to <mika@grml.org>:
830
831   # history | grep grml-live > /etc/grml/grml_live.cmdline
832   # tar zcf grml_live_problem.tar.gz /etc/grml/grml-live.conf \
833             /etc/grml/grml_live.cmdline /etc/grml/grml-buildd.conf \
834             /var/log/fai /etc/grml/fai
835   -> finally mail grml_live_problem.tar.gz to <mika@grml.org>
836
837 If you need help with grml-live or would like to see new features as part of
838 grml-live you can get commercial support via
839 link:http://grml-solutions.com/[Grml Solutions].
840
841 [[lzma-vs-zlib]]
842 How much is the difference between LZMA and ZLIB compression?
843 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
844
845 ISO size (bs = blocksize):
846
847 [width="45%",cols="3,^2,^2"]
848 |============================================================
849 |ISO                   |LZMA (256kB bs) |ZLIB
850 |grml_sid              |666M | 771M
851 |grml_squeeze          |659M | 761M
852 |grml_lenny            |624M | 723M
853 |grml64_sid            |677M | 791M
854 |grml64_squeeze        |671M | 785M
855 |grml64_lenny          |639M | 745M
856 |grml-medium_sid       |208M | 236M
857 |grml-medium_squeeze   |206M | 234M
858 |grml-medium_lenny     |193M | 220M
859 |grml64-medium_sid     |213M | 245M
860 |grml64-medium_squeeze |213M | 244M
861 |grml64-medium_lenny   |201M | 231M
862 |grml-small_sid        |102M | 118M
863 |grml-small_squeeze    |101M | 117M
864 |grml-small_lenny      |97M  | 112M
865 |grml64-small_sid      |103M | 120M
866 |grml64-small_squeeze  |103M | 120M
867 |grml64-small_lenny    |99M  | 116M
868 |============================================================
869
870 Build time of grml-medium's squashfs file (depends on your system, though just
871 to get the ratio between the different options):
872
873 * 10 minutes and 4 seconds with LZMA default blocksize (128k)
874 * 7 minutes 27 seconds with LZMA and blocksize 256k
875 * 6 minutes and 8 seconds with LZMA blocksize 512k
876 * 1 minute and 40 seconds with ZLIB
877
878 [[install-local-files]]
879 How to I install further files into the chroot/ISO?
880 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
881
882 Just point the configuration variable CHROOT_INSTALL to the directory which
883 provides the files you would like to install. Note that the files are installed
884 under '/' in the chroot - so you have to create the rootfs structure on your
885 own. Usage example:
886
887   echo "CHROOT_INSTALL=\$GRML_FAI_CONFIG/chroot_install" >> /etc/grml/grml-live.local
888   mkdir -p /etc/grml/fai/chroot_install/usr/src/
889   wget example.org/foo.tar.gz
890   mv foo.tar.gz /etc/grml/fai/chroot_install/usr/src/
891   grml-live ...
892
893 [[local-debian-mirror]]
894 Can I use my own (local) Debian mirror?
895 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
896
897 Sure. Just adjust the variables GRML_LIVE_SOURCES and FAI_DEBOOTSTRAP (if not
898 already using NFSROOT's base.tgz) inside /etc/grml/grml-live.conf according to
899 your needs. Please don't forget that you should use the grml servers as well
900 (see default configuration) so all the grml packages can be downloaded as well.
901
902 If you want to use a local (for example NFS mount) mirror additionally, just
903 adjust MIRROR_DIRECTORY and MIRROR_SOURCES inside /etc/grml/grml-live.conf as
904 well.
905
906 Unless you specify GRML_LIVE_SOURCES and/or FAI_DEBOOTSTRAP the default from
907 /etc/grml/fai/apt/sources.list and /etc/grml/fai/make-fai-nfsroot.conf will be
908 taken. If you customise the variables in /etc/grml/grml-live.conf then the two
909 files will be adjusted during runtime automatically.
910
911 If MIRROR_DIRECTORY and MIRROR_SOURCES are specified the local mirror will be
912 taken as first entry in the generated sources.list so it's preferred over
913 non-local mirrors. Using a fallback mirror (via providing several mirrors in
914 GRML_LIVE_SOURCES as used by default) is a recommended setting.
915
916 [[add-additional-debian-packages]]
917 How do I add additional Debian package(s) to my CD/ISO?
918 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
919
920 Just create a new class (using the package_config directory):
921
922   # cat > /etc/grml/fai/config/package_config/MIKA << EOF
923   PACKAGES aptitude
924
925   vim
926   another_name_of_a_debian_package
927   and_another_one
928   EOF
929
930 and specify it when invoking grml-live then:
931
932   # grml-live -c GRMLBASE,GRML_SMALL,I386,MIKA
933
934 [[reset-grml-live-configuration]]
935 I fscked up my grml-live configuration. How do I reset it to the defaults?
936 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
937
938 Notice: this deletes all your grml-live configuration files. If that's really
939 what you are searching for just run:
940
941   rm -rf /etc/grml/fai /etc/grml/grml-live.conf
942   dpkg -i --force-confnew --force-confmiss /path/to/grml-live_..._all.deb
943
944 [NOTE]
945
946 If you don't control your /etc using a version control system (VCS) yet it's a
947 good chance to start using it now. Check out
948 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/]
949 for more details how to maintain /etc using the mercurial VCS.
950
951 [[create-a-base-tgz]]
952 How do I create a base.tgz for use as NFSROOT?
953 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
954
955 First of all build the chroot system:
956
957   mkdir /tmp/nfsroot && cd /tmp/nfsroot
958   debootstrap lenny /tmp/nfsroot/ http://cdn.debian.net/debian
959   tar zcf base.tgz ./
960
961 Then check out where your NFSROOT is located:
962
963   # grep '^NFSROOT' /etc/grml/fai/make-fai-nfsroot.conf
964   NFSROOT=/grml/fai/nfsroot
965
966 So as /grml/fai/nfsroot is your NFSROOT place the file under
967 /grml/fai/nfsroot/live/filesystem.dir/var/tmp/:
968
969   mv base.tgz /grml/fai/nfsroot/live/filesystem.dir/var/tmp/base.tgz
970
971 or even better use /etc/grml/fai/config/basefiles/$CLASSNAME.tar.gz instead.
972 Use I386 as $CLASSNAME for i386 builds and AMD64 for amd64 builds.
973
974 Now running "grml-live ..." will use this file as main system instead of
975 executing debootstrap. Check out the output for the following lines if using
976 NFSROOT:
977
978   [...]
979   Calling task_extrbase
980   Unpacking Debian base archive
981   Extracting /grml/fai/nfsroot/live/filesystem.dir/var/tmp/base.tgz
982   Calling task_mirror
983   [...]
984
985 or if using /etc/grml/fai/config/basefiles/$CLASSNAME.tar.gz for:
986
987   [...]
988   ftar: extracting /etc/grml/fai/config/basefiles///AMD64.tar.gz to
989   /grml-live/grml-live_20071029.22138/grml_chroot//
990   [...]
991
992 [TIP]
993 Existing base.tgz can be found at http://daily.grml.org/
994
995 [[apt-cacher]]
996 Set up apt-cacher / apt-cacher-ng for use with grml-live
997 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
998
999 Make sure /etc/grml/grml-live.conf provides according GRML_LIVE_SOURCES and
1000 FAI_DEBOOTSTRAP:
1001
1002   # cat /etc/grml/grml-live.conf
1003   [...]
1004   GRML_LIVE_SOURCES="
1005   deb http://localhost:3142/deb.grml.org grml-stable  main
1006   deb http://localhost:3142/deb.grml.org grml-testing main
1007   deb http://localhost:3142/cdn.debian.net/debian lenny main contrib non-free
1008   "
1009   [...]
1010   FAI_DEBOOTSTRAP="lenny http://localhost:3142/cdn.debian.net/debian lenny main contrib non-free"
1011
1012 Make sure apt-cacher / apt-cacher-ng is running ('/etc/init.d/apt-cacher
1013 restart' or '/etc/init.d/apt-cacher-ng restart'). That's it.  All downloaded
1014 files will be cached in /var/cache/apt-cacher/ or /var/cache/apt-cacher-ng then.
1015
1016 [[approx]]
1017 Set up approx for use with grml-live
1018 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1019
1020 Make sure /etc/grml/grml-live.conf provides according GRML_LIVE_SOURCES and
1021 FAI_DEBOOTSTRAP:
1022
1023   # cat /etc/grml/grml-live.conf
1024   [...]
1025   GRML_LIVE_SOURCES="
1026   deb http://localhost:9999/grml            grml-stable  main
1027   deb http://localhost:9999/grml            grml-testing main
1028   deb http://localhost:9999/debian lenny    main contrib non-free
1029   "
1030   FAI_DEBOOTSTRAP="lenny http://localhost:9999/debian"
1031
1032 Configure approx:
1033
1034   # cat /etc/approx/approx.conf
1035   [...]
1036   debian http://ftp.at.debian.org/debian
1037   grml   http://deb.grml.org/
1038
1039 Don't forget to restart approx (/etc/init.d/approx restart). That's it.
1040 All downloaded files will be cached in /var/cache/approx now.
1041
1042 [[question]]
1043 I've a question which isn't answered by this document
1044 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1045
1046 Don't hesitate to contact the author: <mika@grml.org>
1047
1048 [[download]]
1049 Download / install grml-live as a Debian package
1050 ------------------------------------------------
1051
1052 Debian packages are available through the grml-repository at
1053 link:http://deb.grml.org/pool/main/g/grml-live/[deb.grml.org].  If you want to
1054 build a Debian package on your own (using for example a specific version or the
1055 current development tree), just execute:
1056
1057   git clone git://git.grml.org/grml-live
1058   cd grml-live
1059   debuild -us -uc
1060
1061 [[source]]
1062 Source
1063 ------
1064
1065 The source of grml-live is available at
1066 link:http://git.grml.org/?p=grml-live.git[http://git.grml.org/?p=grml-live.git]
1067
1068 [[todo-list]]
1069 TODO list
1070 ---------
1071
1072 Check out the link:http://git.grml.org/?p=grml-live.git;a=blob;f=TODO;hb=HEAD[TODO file].
1073
1074 [[bugs]]
1075 Bugs
1076 ----
1077
1078 Please report feedback, link:http://grml.org/bugs/[bugreports] and wishes
1079 link:http://grml.org/contact/[to the grml-team]!
1080
1081 [[documentation]]
1082 Documentation
1083 -------------
1084
1085 The most recent grml-live documentation is available online at
1086 http://grml.org/grml-live/ and for offline reading also available
1087 in different formats:
1088
1089 * http://grml.org/grml-live/grml-live.epub
1090 * http://grml.org/grml-live/grml-live.pdf
1091
1092 [[authors]]
1093 Authors
1094 -------
1095 Michael Prokop <mika@grml.org>
1096
1097 /////////////////////////////////////
1098 // vim:ai tw=80 ft=asciidoc expandtab
1099 /////////////////////////////////////