Manual Debian Live

Sobre aquest manual

1. Sobre aquest manual

1.1 Per als impacients
1.2 Termes
1.3 Autors
1.4 Contribuir en aquest document
1.4.1 Aplicar canvis
1.4.2 Traducció

2. Sobre el Projecte Debian Live

2.1 Motivació
2.1.1 Què passa amb els sistemes vius actuals
2.1.2 Per què crear el nostre pròpi sistema viu?
2.2 Filosofia
2.2.1 Només paquets Debian sense modificacions de la secció "main"
2.2.2 Paquets del sistema viu sense cap configuració
2.3 Contacte

Usuari

3. Instaŀlació

3.1 Requeriments
3.2 Instaŀlació de live-build
3.2.1 Des del repositori de Debian
3.2.2 À partir del codi font
3.2.3 A partir d'instantànies
3.3 Instal.lació de live-boot i live-config
3.3.1 Des del repositori de Debian
3.3.2 À partir del codi font
3.3.3 A partir d'instantànies

4. Conceptes bàsics

4.1 Què és un sistema viu?
4.2 Primers passos: construcció d'una imatge ISO híbrida
4.3 Usar una imatge ISO híbrida en viu
4.3.1 Gravar una imatge ISO en un medi físic
4.3.2 Còpiar una imatge ISO híbrida en un dispositiu USB
4.3.3 Arrencar els medis en viu
4.4 Utilitzar una màquina virtual per fer proves
4.4.1 Provar una imatge ISO amb QEMU
4.4.2 Provar una imatge ISO amb virtualbox-ose
4.5 Construir una imatge HDD
4.6 Utilitzar una imatge HDD
4.6.1 Provar una imatge HDD amb Qemu
4.6.2 Utilitzar l'espai lliure en una memòria USB
4.7 Construir una imatge netboot
4.7.1 Servidor DHCP
4.7.2 Servidor TFTP
4.7.3 Servidor NFS
4.7.4 Com provar l'arrencada en xarxa
4.7.5 Qemu
4.7.6 VMWare Player

5. Descripció general de les eines

5.1 El paquet live-build
5.1.1 L'ordre lb config
5.1.2 L'ordre lb build
5.1.3 L'ordre lb clean
5.2 El paquet live-boot
5.3 El paquet live-config

6. Gestió d'una configuració

6.1 Utilitzar auto per gestionar canvis de configuració
6.2 Scripts auto d'exemple

7. Personalització dels continguts

7.1 Configuració durant la construcció vs. durant l'arrencada
7.2 Etapes de la construcció
7.3 Suplementar lb config amb fitxers
7.4 Tasques de personalització

8. Personalització de la instaŀlació de paquets

8.1 Fonts dels paquets
8.1.1 Distribució, zones d'arxiu i mode
8.1.2 Miralls de distribució
8.1.3 Miralls de distribució utilitzats en temps de construcció
8.1.4 Miralls de distribució utilitzats en temps d'execució
8.1.5 Repositoris addicionals
8.2 Selecció dels paquets a instaŀlar
8.2.1 Llistes de paquets
8.2.2 Llistes predefinides de paquets
8.2.3 Llistes locals de paquets
8.2.4 Llistes locals de paquets per l'etapa binary
8.2.5 Ampliació d'una llista mitjançant includes
8.2.6 Ús de condicionals dins de les llistes de paquets
8.2.7 Tasques
8.2.8 Tasques d'escriptori i llenguatge
8.3 Instaŀlació de paquets modificats o de tercers
8.3.1 Fer servir packages.chroot per instaŀar paquets personalitzats
8.3.2 Fer servir un repositori APT per instaŀlar paquets personalitzats
8.3.3 Paquets personalitzats i APT
8.4 Configurar APT en temps de construcció
8.4.1 Seleccionar apt o aptitude
8.4.2 L'ús d'un proxy amb APT
8.4.3 Afinar APT per estalviar espai
8.4.4 Passar opcions per a apt o aptitude
8.4.5 APT pinning

9. Personalització dels continguts

9.1 Includes
9.1.1 Live/chroot local includes
9.1.2 Binary local includes
9.1.3 Binary includes
9.2 Scripts ganxo (Hooks)
9.2.1 Live/chroot local hooks
9.2.2 Scripts ganxo durant l'arrencada
9.2.3 Binary local hooks
9.3 Preconfiguració de les preguntes de Debconf

10. Customizing run time behaviours

10.1 Customizing the live user
10.2 Customizing locale and language
10.3 Persistence
10.3.1 The live-persistence.conf file
10.3.2 Using more than one persistence store

11. Customizing the binary image

11.1 Bootloader
11.2 ISO metadata

12. Customizing Debian Installer

12.1 Types of Debian Installer
12.2 Customizing Debian Installer by preseeding
12.3 Customizing Debian Installer content

Projecte

13. Reporting bugs

13.1 Known issues
13.2 Rebuild from scratch
13.3 Use up-to-date packages
13.4 Collect information
13.5 Isolate the failing case if possible
13.6 Use the correct package to report the bug against
13.6.1 At build time whilst bootstrapping
13.6.2 At build time whilst installing packages
13.6.3 At boot time
13.6.4 At run time
13.7 Do the research
13.8 Where to report bugs

14. Coding Style

14.1 Compatibility
14.2 Indenting
14.3 Wrapping
14.4 Variables
14.5 Miscellaneous

15. Procedures

15.1 Udeb Uploads
15.2 Major Releases
15.3 Point Releases
15.3.1 Last Point Release of a Debian Release
15.3.2 Point release announcement template

Exemples

16. Examples

16.1 Using the examples
16.2 Tutorial 1: A standard image
16.3 Tutorial 2: A web browser utility
16.4 Tutorial 3: A personalized image
16.4.1 First revision
16.4.2 Second revision
16.5 A VNC Kiosk Client
16.6 A base image for a 128M USB key
16.7 A localized KDE desktop and installer

Apèndix

17. Style guide

17.1 Guidelines for authors
17.1.1 Linguistic features
17.1.2 Procedures
17.2 Guidelines for translators
17.2.1 Translation hints

Manual Debian Live

Usuari

10. Customizing run time behaviours

All configuration that is done during run time is done by live-config. Here are some of the most common options of live-config that users are interested in. A full list of all possibilities can be found in the manpage of live-config.

10.1 Customizing the live user

One important consideration is that the live user is created by live-boot at boot time, not by live-build at build time. This not only influences where materials relating to the live user are introduced in your build, as discussed in Live/chroot local includes, but also any groups and permissions associated with the live user.

You can specify additional groups that the live user will belong to by preseeding the passwd/user-default-groups debconf value. For example, to add the live user to the fuse group, add the following preseed under config/preseed/ for the chroot stage:

$ lb config
$ echo user-setup passwd/user-default-groups string audio cdrom \
   dip floppy video plugdev netdev powerdev scanner bluetooth fuse \
   >> config/preseed/my.preseed.chroot

It is also possible to change the default username "user" and the default password "live". If you want to do that for any reason, you can easily achieve it as follows:

To change the default username you can simply specify it in your config:

$ lb config --bootappend-live "username=live-user"

One possible way of changing the default password is by means of a hook as described in Boot-time hooks. In order to do that you can use the "passwd" hook from /usr/share/doc/live-config/examples/hooks, prefix it accordingly (e.g. 2000-passwd) and add it to config/includes.chroot/lib/live/config/

10.2 Customizing locale and language

When the live system boots, language is involved in two steps:

  • the locale generation
  • setting the keyboard configuration
  • The default locale when building a Live system is locales=en_US.UTF-8. To define the locale that should be generated, use the locales parameter in the --bootappend-live option of lb config, e.g.

    $ lb config --bootappend-live "locales=de_CH.UTF-8"

    Multiple locales may be specified as a comma-delimited list.

    This parameter, as well as the keyboard configuration parameters indicated below, can also be used at the kernel command line. You can specify a locale by language_country (in which case the default encoding is used) or the full language_country.encoding word. A list of supported locales and the encoding for each can be found in /usr/share/i18n/SUPPORTED.

    Both the console and X keyboard configuration are performed by live-config using the console-setup package. To configure them, use the keyboard-layouts, keyboard-variant, keyboard-options and keyboard-model boot parameters via the --bootappend-live option. Valid options for these can be found in /usr/share/X11/xkb/rules/base.lst. To find layouts and variants for a given language, try searching for the English name of the language and/or the country where the language is spoken, e.g:

    $ egrep -i '(^!|german.*switzerland)' /usr/share/X11/xkb/rules/base.lst
    ! model
    ! layout
       ch              German (Switzerland)
    ! variant
       legacy          ch: German (Switzerland, legacy)
       de_nodeadkeys   ch: German (Switzerland, eliminate dead keys)
       de_sundeadkeys  ch: German (Switzerland, Sun dead keys)
       de_mac          ch: German (Switzerland, Macintosh)
    ! option

    Note that each variant lists the layout to which it applies in the description.

    Often, only the layout needs to be configured. For example, to get the locale files for German and Swiss German keyboard layout in X use:

    $ lb config --bootappend-live "locales=de_CH.UTF-8 keyboard-layouts=ch"

    However, for very specific use cases, you may wish to include other parameters. For example, to set up a French system with a French-Dvorak layout (called Bepo) on a TypeMatrix EZ-Reach 2030 USB keyboard, use:

    $ lb config --bootappend-live \
         "locales=fr_FR.UTF-8 keyboard-layouts=fr keyboard-variant=bepo keyboard-model=tm2030usb"

    Multiple values may be specified as comma-delimited lists for each of the keyboard-* options, with the exception of keyboard-model, which accepts only one value. Please see the keyboard(5) man page for details and examples of XKBMODEL, XKBLAYOUT, XKBVARIANT and XKBOPTIONS variables. If multiple keyboard-variant values are given, they will be matched one-to-one with keyboard-layouts values (see setxkbmap(1) -variant option). Empty values are allowed; e.g. to define two layouts, the default being US QWERTY and the other being US Dvorak, use:

    $ lb config --bootappend-live \
         "keyboard-layouts=us,us keyboard-variant=,dvorak"

    10.3 Persistence

    A live cd paradigm is a pre-installed system which runs from read-only media, like a cdrom, where writes and modifications do not survive reboots of the host hardware which runs it.

    A Debian Live system is a generalization of this paradigm and thus supports other media in addition to CDs; but still, in its default behaviour, it should be considered read-only and all the run-time evolutions of the system are lost at shutdown.

    'Persistence' is a common name for different kinds of solutions for saving across reboots some, or all, of this run-time evolution of the system. To understand how it works it would be handy to know that even if the system is booted and run from read-only media, modifications to the files and directories are written on writable media, typically a ram disk (tmpfs) and ram disks' data do not survive reboots.

    The data stored on this ramdisk should be saved on a writable persistent medium like local storage media, a network share or even a session of a multisession (re)writable CD/DVD. All these media are supported in Debian Live in different ways, and all but the last one require a special boot parameter to be specified at boot time: persistence.

    If the boot parameter persistence is set (and nopersistence is not set), local storage media (e.g. hard disks, USB drives) will be probed for persistence volumes during boot. It is possible to restrict which types of persistence volumes to use by specifying certain boot parameters described in the live-boot(7) man page. A persistence volume is any of the following:

  • a partition, identified by its GPT name.
  • a filesystem, identified by its filesystem label.
  • an image file located on the root of any readable filesystem (even an NTFS partition of a foreign OS), identified by its file name. In this case the file name must also use the containing filesystem as the file extension, e.g. "persistence.ext4".
  • The volume label for overlays must be persistence. And in order to fully customize the volume's persistence there must be a file named live-persistence.conf. See The live-persistence.conf file

    Here are some examples of how to prepare a volume to be used for persistence. It can be, for instance, an ext4 partition on a hard disk or on a usb key created with, e.g.:

    # mkfs.ext4 -L persistence /dev/sdb1

    See also Using the space left on a USB stick.

    If you already have a partition on your device, you could just change the label with one of the following:

    # tune2fs -L persistence /dev/sdb1 # for ext2,3,4 filesystems

    Here's an example of how to create an ext4-based image file used for persistence:

    $ dd if=/dev/null of=persistence bs=1G seek=1 # for a 1GB sized image file
    $ /sbin/mkfs.ext4 -F persistence

    Then copy the persistence file to the root of a writable partition.

    10.3.1 The live-persistence.conf file

    A volume with the label persistence can be configured to make arbitrary directories persistent. The file live-persistence.conf, located on the volume's filesystem root, controls which directories it makes persistent, and in which way.

    How custom overlay mounts are configured is described in full detail in the live-persistence.conf(5) man page, but a simple example should be sufficient for most uses. Let's say we want to make our home directory and APT cache persistent in an ext4 filesystem on the /dev/sdb1 partition:

    # mkfs.ext4 -L persistence /dev/sdb1
    # mount -t ext4 /dev/sdb1 /mnt
    # echo "/home" >> /mnt/live-persistence.conf
    # echo "/var/cache/apt" >> /mnt/live-persistence.conf

    Then we reboot. During the first boot the contents of /home and /var/cache/apt will be copied into the persistence volume, and from then on all changes to these directories will live in the persistence volume. Please note that any paths listed in the live-persistence.conf file cannot contain white spaces or the special . and .. path components. Also, neither /live (or any of its sub-directories) nor / can be made persistent using custom mounts.

    Several different custom overlay volumes (with their own live-persistence.conf files) can be used at the same time, but if several volumes make the same directory persistent, only one of them will be used. If any two mounts are "nested" (i.e. one is a sub-directory of the other) the parent will be mounted before the child so no mount will be hidden by the other. Nested custom mounts are problematic if they are listed in the same live-persistence.conf file. See the live-persistence.conf(5) man page for how to handle that case if you really need it (hint: you usually don't).

    10.3.2 Using more than one persistence store

    If a user would need multiple persistence store of the same type for different locations or testing, such as persistence-nonwork and persistence-work, the boot parameter persistence-label used in conjunction with the boot parameter persistence will allow for multiple but unique persistence media. An example would be if a user wanted to use a persistence partition labeled persistence-subText they would use the boot parameters of: persistence persistence-label=subText.