Rights: Copyright © 2006-2012 Debian Live Project;
License: Aquest programa és un programari lliure: es pot redistribuir i/o modificar sota els termes de la Llicència Pública General de la GNU com és publicada per la Free Software Foundation, ja sigui la versió 3 de la Llicència, o (si ho preferiu) qualsevol versió posterior.
Aquest programa es distribueix amb l'esperança que sigui útil, però sense cap garantia, fins i tot sense la garantia implícita de COMERCIALITZACIÓ o ADEQUACIÓ PER A PROPÒSITS DETERMINATS. Vegeu la Llicència General Pública de la GNU per a més detalls.
Haurieu de rebre una còpia de la Llicència Pública General de la GNU amb aquest programa. Si no és així, consulteu http://www.gnu.org/licenses/.
El text complet de la Llicència Pública General de la GNU es pot trobar a /usr/share/common-licenses/GPL-3.
Aquest manual serveix com a punt d'accés únic a tota la documentació relacionada amb el projecte Debian Live i en particular s'aplica al programari produït pel projecte per la versió Debian 7.0 "wheezy". Una versió actualitzada es pot trobar sempre a ‹http://live.debian.net/›
Si bé live-manual es centra principalment en ajudar a construir un sistema viu i no en temes dels usuaris finals, un usuari final pot trobar informació útil en aquestes seccions: Conceptes bàsics abasta la preparació d'imatges per ser arrencadas des dels dispositius o la xarxa, i Personalització dels comportaments en temps d'execució descriu algunes de les opcions que es poden especificar durant l'arrencada del sistema, com ara la selecció de la disposició del teclat, la configuració regional i l'us de la persistència.
Algunes de les ordres esmentades en el text s'han d'executar amb privilegis de superusuari que es poden obtenir esdevenint l'usuari root amb su o mitjançant l'ús de sudo. Per distingir entre les ordres que poden ser executades per un usuari sense privilegis i aquelles que requereixen privilegis de root, s'anteposa $ o # respectivament. Aquest símbol no és part de l'ordre.
Si bé creiem que tot el que hi ha en aquest manual és important si més no per alguns dels nostres usuaris, ens adonem que hi ha una gran quantitat de material per cobrir i que és possible que es vulgui experimentar l'èxit amb el programari aviat, abans d'aprofundir en els detalls. Per tant, us recomanem llegir en el següent ordre.
En primer lloc, llegiu aquest capítol, Sobre aquest manual, des del principi i acabant amb els Termes. A continuació, saltar als tres tutorials abans dels Exemples secció dissenyada per ensenyar la creació de la imatge i alguns aspectes bàsics de la personalització. Llegiu en primer lloc Usant els exemples seguit per Tutorial 1: Una imatge estàndard, Tutorial 2: Una utilitat de navegador d'Internet i finalment, Tutorial 3: Una image personalitzada. Al final d'aquests tutorials, tindreu una idea del que es pot fer amb Debian Live.
Us animem a tornar i a fer un estudi del manual en profunditat, la propera lectura pot ser Conceptes bàsics, fregant o saltant Construcció d'una imatge netboot, i acabant per la lectura de la Visió de conjunt de la personalització i els capítols que la segueixen. En aquest punt, esperem que estigueu ben emocionats pel que es pot fer amb Debian Live i motivats per llegir la resta del manual, de principi a fi.
Llistat d'autors (en ordre alfabètic)
Aquest manual està pensat com un projecte comunitari i totes les propostes per millorar-lo i les contribucions són molt benvingudes. La millor forma d'enviar una contribució és enviar-la a la llista de correu. Si us plau, consulteu la secció Contacte per més informació.
Quan es presenta una contribució, si us plau, identificar clarament el titular dels drets d'autor i s'ha d'incloure la declaració de concessió de llicències. Recordar que per ser acceptada, la contribució ha de tenir una llicencia igual que la resta del document, a saber, la versió de la GPL 3 o superior.
Les fonts d'aquest manual es mantenen utilitzant el sistema de control de versions Git. Es pot obtenir còpia actualitzada mitjançant l'execució de:
$ git clone git://live.debian.net/git/live-manual.git
Abans de presentar una contribució, si us plau, previsualitzar el treball. Per previsualitzar el live-manual, assegurar-se que s'han instaŀlat els paquets necessaris per a la seva construcció mitjançant l'execució de:
# apt-get install make po4a sisu-complete libnokogiri-ruby
Es pot crear el live-manual des del directori de nivell superior del arbre Git mitjançant l'execució de:
$ make build
Com es necessita un cert temps per construir el manual en tots els idiomes suportats, potser resulti convenient quan es fa una prova construir per a un sol idioma, per exemple, mitjançant l'execució de:
$ make build LANGUAGES=en
També es possible crear per tipus de document, per exemple:
$ make build FORMATS=pdf
O combinar tot dos, per exemple:
$ make build LANGUAGES=it FORMATS=html
Qualsevol persona pot fer un commit directament al repositori. No obstant això, demanem que s'enviïn els canvis grans a la llista de correu per parlar-ne en primer lloc. Per fer un push al repositori, s'ha de seguir el següent procediment:
$ mkdir -p ~/.ssh/identity.d
$ wget http://live.debian.net/other/keys/git@live.debian.net \
-O ~/.ssh/identity.d/git@live.debian.net
$ wget http://live.debian.net/other/keys/git@live.debian.net.pub \
-O ~/.ssh/identity.d/git@live.debian.net.pub
$ chmod 0600 ~/.ssh/identity.d/git@live.debian.net*
$ cat >> ~/.ssh/config << EOF
Host live.debian.net
Hostname live.debian.net
User git
IdentityFile ~/.ssh/identity.d/git@live.debian.net
EOF
$ git clone git@live.debian.net:/live-manual.git
$ cd live-manual && git checkout debian-next
$ git commit -a -m "Adding a section on applying patches."
$ git push
Per començar la traducció d'un idioma nou, seguir aquests passos:
Nota: Es pot utilitzar make clean per netejar l'arbre git abans de fer un push. Aquest pas no és obligatori, gràcies al fitxer .gitignore, però és una bona pràctica per evitar enviar fitxers de forma involuntària.
Quan Debian Live va començar, ja hi havia diversos sistemes vius basats en Debian disponibles i que estaven fent una gran feina. Des de la perspectiva de Debian la majoria d'ells tenien una o més de les desavantatges següents:
Debian és el sistema operatiu universal: Debian té un sistema viu per mostrar arreu i per representar acuradament el sistema Debian amb els següents avantatges:
Només farem servir els paquets des del repositori de Debian de la secció "main". La secció non-free no és part de Debian i per tant no es pot utilitzar per les imatges oficials del sistema viu.
No canviarem cap paquet. Cada vegada que hàgim de canviar alguna cosa, ho farem en coordinació amb el mantenidor del paquet a Debian.
Com a excepció, els nostres propis paquets, com ara live-boot, live-build o live-config poden ser utilitzats temporalment des del nostre propi repositori per raons de desenvolupament (per exemple, per crear instantànies de desenvolupament). Aquests paquets es pujaran a Debian de forma regular.
En aquesta fase no es publicarà o s'instal.larà cap configuració alternativa o d'exemple. Tots els paquets són utilitzats en la seva configuració per defecte, tal com són després d'una instaŀlació normal de Debian.
Cada vegada que ens calgui una configuració per defecte diferent, ho farem en coordinació amb el mantenidor del paquet Debian.
S'hi inclou un sistema per configurar paquets mitjançant debconf que permet instal.lar paquets configurats de forma personalitzada dins d'una imatge Debian Live personalitzada, però per a les imatges en viu oficials només utilitzarem una configuració per defecte. Per obtenir més informació, veure Visió de conjunt de la personalització.
Excepció: Hi ha uns pocs canvis essencials necessaris per aconseguir que un sistema funcioni en viu. Aquests canvis essencials han de ser el més mínims possible i s'han de fusionar en el repositori de Debian si és possible.
La construcció d'imatges Debian Live té molts pocs requeriments.
Tenir en compte que no cal usar Debian o una distribució derivada de Debian ja que live-build funcionarà en gairebé qualsevol distribució amb els requisits anteriors.
Es pot instaŀlar live-build en un nombre de maneres diferentes:
Si s'utilitza Debian, la manera recomanada és instaŀlar live-build des del repositori de Debian.
Només cal instaŀlar live-build com qualsevol altre paquet:
# apt-get install live-build
o
# aptitude install live-build
live-build es desenvolupa utilitzant el sistema de control de versions Git. En els sistemes basats en Debian, això és proporcionat pel paquet git. Per comprovar l'últim codi, executar:
$ git clone git://live.debian.net/git/live-build.git
Es pot construir i instaŀlar un paquet Debian pròpi mitjançant l'execució de:
$ cd live-build
$ dpkg-buildpackage -rfakeroot -b -uc -us
$ cd ..
Ara instaŀlar qualsevol dels fitxers .deb recent construïts que ens interessen, per exemple,
# dpkg -i live-build_2.0.8-1_all.deb
Es pot instaŀlar live-build directament al sistema mitjançant l'execució de:
# make install
i desinstaŀlar amb:
# make uninstall
Si no es desitja construir o instaŀlar live-build a partir de les fonts, es pot utilitzar les instantànies. Aquestes es construeixen automàticament a partir de l'última versió del Git, i estan disponibles a ‹http://live.debian.net/debian/›.
Nota: No cal instaŀlar live-boot o live-config en el sistema per crear sistemes personalitzats de Debian Live. No obstant, això no farà cap mal i és útil per a fins de referència. Si només es vol la documentació, ara es poden instaŀlar els paquets live-boot-doc i live-config-doc per separat.
Tots dos, live-boot i live-config, estan disponibles al arxiu de Debian, d'una manera similar a Instaŀlació de live-build.
Per utilitzar les darreres fonts del git, es pot seguir el procés seguent. Assegurar-se d'estar familiaritzat amb els termes esmentats a Termes.
$ git clone git://live.debian.net/git/live-boot.git
$ git clone git://live.debian.net/git/live-config.git
Consultar les pàgines del manual de live-boot i live-config per més detalls sobre la seva personalització si aquesta és la raó per construir aquests paquets a partir de les fonts.
S'ha de crear ja sigui en la distribució de destinació o en un chroot que contingui la plataforma de destinació: és a dir, si el objectiu és wheezy llavors s'ha de construir contra wheezy.
Es pot utilitzar un constructor personal, com ara pbuilder o sbuild si es necessita crear live-boot per a una distribució de destinació diferenta del sistema de construcció. Per exemple, per a les imatges en viu de wheezy, crear live-boot en un chroot wheezy. Si la distribució de destinació per casualitat coincideix amb la distribució del sistema de construcció, es pot construir directament en el sistema de construcció amb dpkg-buildpackage (proporcionat pel paquet dpkg-dev) :
$ cd live-boot
$ dpkg-buildpackage -b -uc -us
$ cd ../live-config
$ dpkg-buildpackage -b -uc -us
Com live-boot i live-config són instaŀlats pel sistema live-build, instaŀlar els paquets en el sistema amfitrió no és suficient: S'han de tractar tots els fitxers .deb generats igual que qualsevol altre paquet personalitzat. Si us plau veure Personalització de l'instaŀlació de paquets per a més informació. S'ha de prestar especial atenció a Repositoris addicionals.
Es pot deixar que live-build utilitzi les darreres instantànies de live-boot i live-config configurant un repositori de tercers en el directori de configuració de live-build. Suposant que ja s'ha creat un arbre de configuració del directori actual amb lb config:
$ lb config --archives live.debian.net
Aquest capítol conté una breu descripció del procés de construcció i les instruccions per a l'ús dels tres tipus d'imatge més comunes. El tipus d'imatge més versàtil iso-hybrid es pot utilitzar en una màquina virtual, en medis òptics o qualsevol altre dispositiu d'emmagatzematge USB portàtil. En certs casos especials, com ara l'ús de la persistència, el tipus hdd pot ser el més adequat per als dispositius USB. El capítol acaba amb instruccions per a la construcció d'una imatge tipus net, que és una mica més complicat a causa de la configuració necessària en el servidor. Aquest és un tema una mica avançat per a algú que no està familiaritzat ja amb l'arrencada en xarxa, però s'inclou aquí perquè un cop que la configuració es porta a terme, es tracta d'una forma molt convenient per provar i desplegar imatges per a l'arrencada en xarxa local sense la molèstia de tractar amb els dispositius de les imatges.
Al llarg del capítol, sovint es fa referència als noms dels fitxers produïts per defecte per live-build. Si es descarrega una imatge prefabricada, els noms dels fitxers poden ser direrents.
Un sistema viu és un sistema operatiu que arrenca en un equip des d'un dispositiu extraïble, com un CD-ROM o una memòria USB o des d'una xarxa, a punt per fer servir sense cap tipus d'instaŀlació en la unitat(s) habitual(s), amb una configuració automàtica feta en temps d'execució (veure Termes).
Amb Debian Live, és un sistema operatiu Debian GNU/Linux, construït per una de les arquitectures suportades (actualment amd64, i386 powerpc i sparc). Conté les següents parts:
Es pot utilitzar live-build per construir la imatge del sistema amb especificacions pròpies, configurar un nucli de Linux, el initrd, i un carregador d'arrencada per executar-los, tot això en un format depenent dels dispositius (imatge ISO9660, imatge de disc, etc.)
Independentment del tipus d'imatge, s'haurà de fer els mateixos passos bàsics per construir una imatge cada vegada. Com a primer exemple, executar la següent seqüència d'ordres live-build per crear una imatge ISO híbrida de base que conté només el sistema estàndard de Debian sense X.org. És adequat per gravar en un CD o DVD, i també per copiar en una memòria USB.
En primer lloc, executar l'ordre lb config. Això crearà una jerarquia «config/» en el directori actual per ser utilitzada per altres ordres:
$ lb config
Aquí no es passa cap paràmetre a lb config, per tant s'utilitzaran les opcions per defecte. Veure L'ordre lb config per més detalls.
Ara que la jerarquia «config/» ja existeix, crear la imatge amb l'ordre lb build:
# lb build
Aquest procés tardarà una mica, depenent de la velocitat de la connexió de la xarxa. Quan hagi acabat, ha d'haver un fitxer imatge binary.hybrid.iso, a punt per ser utilitzar, en el directori actual.
Després de la construcció o la descàrrega d'una imatge ISO híbrida, que pot ser obtinguda a ‹http://www.debian.org/CD/live/›, el següent pas habitual és preparar els dispositius per a l'arrencada, ja sigui medis òptics com un CD-R(W) o DVD-R(W) o una memòria USB.
Gravar una imatge ISO és fàcil. Simplement cal instaŀlar i utilitzar wodim des de la línia d'ordres per gravar la imatge. Per exemple:
# apt-get install wodim
$ wodim binary.hybrid.iso
Les imatges ISO preparades amb l'ordre isohybrid, com les imatges binàries del tipus iso-hybrid produïdes per defecte és poden copiar directament a una memòria USB utilitzant el programa dd o un altre d'equivalent. Connectar una memòria USB amb una mida prou gran per al fitxer de la imatge i determinar quin dispositiu és, que d'ara endavant annomenarem ${USBSTICK}. Aquest és el dispositiu de la memòria com per exemple /dev/sdb, no una partició, com ara /dev/sdb1! Es pot trobar el nom del dispositiu correcte mirant la sortida de dmesg després de connectar la memòria usb o encara millor, ls -l /dev/disk/by-id.
Quan s'estigui segur de tenir el nom del dispositiu correcte, utilitzar l'ordre dd per a copiar la imatge a la memòria. Fent això es perdran definitivament tots els continguts anteriors de la memòria usb!
$ dd if=binary.hybrid.iso of=${USBSTICK}
La primera vegada que s'arrenqui els medis en viu, ja sigui des de CD, DVD, memòria USB, o PXE, pot ser necessaria alguna petita configuració al BIOS del ordinador en primer lloc. Atès que les BIOS varien molt en les seves funcions i dreceres de teclat, no podem entrar en el tema en profunditat aquí. Algunes BIOS proporcionen una tecla per obrir un menú de dispositius d'arrencada, que és la manera més fàcil si es troba disponible al sistema. En cas contrari, cal entrar al menú de configuració del BIOS i canviar l'ordre d'arrencada per situar el dispositiu del sistema en viu abans que el dispositiu d'arrencada normal.
Després d'arrencar des del dispositiu, es veurà un menu d'inici. S'ha de prémer «entrer» i el sistema s'iniciarà amb l'entrada Live i les seves opcions per defecte. Per obtenir més informació sobre les opcions d'arrencada, llegir la «ajuda» (help) al menú i també les pàgines del manual de live-boot i live-config que es troben dins del sistema en viu.
Suposant que s'ha seleccionat Live i s'ha arrencat una imatge d'escriptori per defecte, després que els missatges d'arrencada hagin passat s'haurà iniciat una sessió com a usuari user i es veurà un escriptori, a punt per ser utilitzat. Si s'ha arrencat una imatge de la consola només, com les imatges preconfigurades standard o rescue s'iniciarà una sessió com a usuari user i es veurà el indicador de la shell, a punt per ser utilitzat.
Pot ser un gran estalvi de temps per al desenvolupament d'imatges en viu executar-les en una màquina virtual (VM). Això no està exempt d'advertiments:
Sempre que es pugui treballar dins d'aquestes limitacions, examinar el programari de màquina virtual disponible i triar un que sigui adequat per a les necessitats pròpies.
La màquina virtual més versàtil dins Debian és QEMU. Si el processador té suport de maquinari per a la virtualització, utilitzar el paquet qemu-kvm; la descripció del paquet qemu-kvm enumera breument els requeriments.
Primer, instaŀlar qemu-kvm si el processador ho suporta. Si no, instaŀlar qemu, en aquest cas el nom del programa és qemu en lloc de kvm en els exemples següents. El paquet qemu-utils també és valuós per a la creació d'imatges de disc virtuals amb qemu-img.
# apt-get install qemu-kvm qemu-utils
Arrencar una imatge ISO és senzill:
$ kvm -cdrom binary.hybrid.iso
Veure les pàgines del manual per a més detalls
Per provar la ISO amb virtualbox-ose:
# apt-get install virtualbox-ose virtualbox-ose-dkms
$ virtualbox
Crear una nova màquina virtual, canviar els paràmetres d'emmagatzematge per utilitzar binary.hybrid.iso com unitat de CD/DVD i arrencar la màquina.
Nota: Per provar sistemes vius que contenen X.org amb virtualbox-ose, segurament es assenyat incloure el paquet del driver VirtualBox X.org, virtualbox-ose-guest-x11, en la configuració de live-build. En cas contrari, la resolució es limita a 800x600.
$ echo virtualbox-ose-guest-x11 >> config/package-lists/my.list.chroot
Construir una imatge HDD és similar a una ISO híbrida en tots els aspectes, excepte que s'especifiqua -b hdd que el nom del fitxer resultant és binary.img i que no es pot gravar en medis òptics. És adequada per arrencar des de dispositius USB, discs durs USB, i altres dispositius d'emmagatzematge portàtils. Normalment, una imatge ISO híbrida es pot utilitzar per aquest propòsit en el seu lloc, però si el BIOS no maneja adequadament les imatges híbrides, o es desitja utilitzar l'espai lliure en els medis per a algun propòsit, com una partició per a la persistència, cal una imatge HDD.
Nota: si s'ha creat una imatge ISO híbrida amb l'exemple anterior, s'haurà de netejar el directori de treball amb l'ordre lb clean (veure L'ordre lb clean):
# lb clean --binary
Executar l'ordre lb config com abans, excepte que aquesta vegada especificant el tipus d'imatge HDD:
$ lb config -b hdd
Ara construir la imatge amb l'ordre lb build:
# lb build
Quan la construcció acabi, hauria d'haver un fitxer binary.img al directori actual.
La imatge binària generada conté una partició VFAT i el carregador d'arrencada syslinux, llestos per ser escrits directament a una memòria USB. Donat que l'ús d'una imatge HDD és com utilitzar una imatge ISO híbrida en un USB, seguir les instruccions de Usar una imatge ISO híbrida en viu, però amb el nom de fitxer binary.img en lloc de binary.hybrid.iso.
Primer, instaŀlar qemu com s'ha descrit anteriorment a Provar una imatge ISO amb QEMU. A continuació, executar kvm o qemu, segons la versió instaŀlada al sistema amfitrió, especificant binary.img com a primer disc dur.
$ kvm -hda binary.img
Per poder utilitzar l'espai que queda lliure després de copiar binary.img en un dispositiu USB, utilitzar una eina de particionament com gparted o parted per crear una nova partició. La primera partició serà utilitzada pel sistema Debian Live.
# gparted ${USBSTICK}
Després de crear la partició, on ${PARTITION} és el nom de la partició, com ara /dev/sdb2, s'ha de crear un sistema de fitxers. Una opció possible seria ext4.
# mkfs.ext4 ${PARTITION}
Nota: Si es vol utilitzar l'espai addicional amb Windows, pel que sembla, aquest sistema operatiu normalment no pot accedir a altres particions més que a la primera. Algunes solucions a aquest problema han estat discutides a la nostra llista de correu, però sembla que no hi ha respostes fàcils.
Recordar: Cada vegada que s'instaŀli una nova binary.img al dispositiu, es perdran totes les dades perquè la taula de particions se sobreescriu amb el contingut de la imatge, de manera que es assenyat fer una còpia de seguretat de la partició addicional per restaurar les dades de nou després d'actualitzar la imatge en viu.
La següent seqüència d'ordres crearà una imatge netboot bàsica que conté el sistema estàndard de Debian sense X.org. És adequada per a l'arrencada en xarxa.
Nota: si s'ha realitzat algun dels exemples anteriors, s'haurà de netejar el directori de treball amb l'ordre lb clean:
# lb clean --binary
Executar l'ordre següent per configurar la imatge per arrencar en xarxa:
$ lb config -b net --net-root-path "/srv/debian-live" --net-root-server "192.168.0.1"
A diferència de les imatges ISO i HDD, l'arrencada en xarxa no serveix el sistema de fitxers al client, per tant els fitxers han de ser servits a través de NFS. Les opcions --net-root-path y --net-root-server especifiquen la ubicació i el servidor, respectivament, del servidor NFS on es troba la imatge de sistema de fitxers a l'hora d'arrencar. Assegurar-se que aquests s'ajusten als valors adequats per la xarxa i el servidor pròpis.
Ara construir la imatge amb l'ordre lb build:
# lb build
En l'arrencada en xarxa, el client executa una petita peça de programari que normalment es troba a la EPROM de la targeta Ethernet. Aquest programa envia una petició DHCP per obtenir una adreça IP i la informació sobre què fer a continuació. Per regla general, el següent pas és aconseguir un carregador d'arrencada de més alt nivell a través del protocol TFTP. Podria ser GRUB, pxelinux o fins i tot arrencar directament a un sistema operatiu com Linux.
Per exemple, si es descomprimeix el arxiu binary-net.tar.gz generat al directori /srv/debian-live, es trobarà la imatge del sistema de fitxers a live/filesystem.squashfs i el nucli, initrd i carregador d'arrencada pxelinux a tftpboot/debian-live/i386.
Ara hem de configurar els tres serveis al servidor per l'arrencada en xarxa: el servidor DHCP, servidor TFTP i el servidor NFS.
S'ha de configurar el servidor DHCP de la xarxa per assegurar-se que dona una adreça IP per al client del sistema d'arrencada en xarxa, i per anunciar la ubicació del carregador d'arrencada PXE.
Heus aquí un exemple per servir d'inspiració, escrit per al servidor ISC DHCP isc-dhcp-server al fitxer de configuració /etc/dhcp/dhcpd.conf:
# /etc/dhcp/dhcpd.conf - configuration file for isc-dhcp-server
ddns-update-style none;
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.1 192.168.0.254;
next-server servername;
filename "pxelinux.0";
}
Aquest serveix el nucli i el disc ram inicial per al sistema en temps d'execució.
S'ha d'instaŀlar el paquet tftpd-hpa. Aquest pot servir tots els arxius continguts dins d'un directori arrel, per regla general /srv/tftp. Perquè es serveixen els arxius dins de /srv/debian-live/tftpboot, s'ha d'executar com a root la següent ordre:
# dpkg-reconfigure -plow tftpd-hpa
i omplir el nou directori del servidor tftp quan ho hàgim de fer.
Un cop l'ordinador ha descarregat, ha arrencat el nucli de Linux i ha carregat el initrd, intentarà muntar la imatge del sistema de fitxers en viu a través d'un servidor NFS.
S'ha d'instaŀlar el paquet nfs-kernel-server
Llavors, fer que la imatge del sistema de fitxers estigui disponible a través de NFS afegint una línia com la següent a /etc/exports:
/srv/debian-live *(ro,async,no_root_squash,no_subtree_check)
i informar al servidor NFS sobre aquesta nova exportació amb la següent ordre:
# exportfs -rv
La configuració d'aquests tres serveis pot ser una mica difícil. És possible que es necessiti una mica de paciència per aconseguir que tots tres funcionin plegats. Per obtenir més informació, veure el wiki de syslinux a ‹http://syslinux.zytor.com/wiki/index.php/PXELINUX› o la secció TFTP Net Booting al Manual del Instaŀlador de Debian a ‹http://d-i.alioth.debian.org/manual/en.i386/ch04s05.html›. Això pot ajudar, ja que els seus processos són molt similars.
La creació d'imatges d'arrencada en xarxa es fa fàcil amb la màgia de live-build, però provar les imatges en màquines físiques pot costar molt de temps.
Per fer la nostra vida més fàcil, podem utilitzar la virtualització. Hi ha dues solucions.
Editar /etc/qemu-ifup:
#!/bin/sh
sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1
echo "Executing /etc/qemu-ifup"
echo "Bringing up $1 for bridged mode..."
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
echo "Adding $1 to br0..."
sudo /usr/sbin/brctl addif br0 $1
sleep 2
Descarregar o crear un grub-floppy-netboot (al svn).
Llançar qemu amb "-net nic,vlan=0 -net tap,vlan=0,ifname=tun0"
#!/usr/bin/vmware
config.version = "8"
virtualHW.version = "4"
memsize = "512"
MemAllowAutoScaleDown = "FALSE"
ide0:0.present = "FALSE"
ide1:0.present = "FALSE"
floppy0.present = "FALSE"
sound.present = "FALSE"
tools.remindInstall = "FALSE"
ethernet0.present = "TRUE"
ethernet0.addressType = "generated"
displayName = "Test Boot PXE"
guestOS = "other"
ethernet0.generatedAddress = "00:0c:29:8d:71:3b"
uuid.location = "56 4d 83 72 5c c4 de 3f-ae 9e 07 91 1d 8d 71 3b"
uuid.bios = "56 4d 83 72 5c c4 de 3f-ae 9e 07 91 1d 8d 71 3b"
ethernet0.generatedAddressOffset = "0"
This chapter contains an overview of the three main tools used in building Debian Live systems: live-build, live-boot and live-config.
live-build is a collection of scripts to build Debian Live systems. These scripts are also referred to as "commands".
The idea behind live-build is to be a framework that uses a configuration directory to completely automate and customize all aspects of building a Live image.
Many concepts are similar to those in the debhelper Debian package tools written by Joey Hess:
Unlike debhelper, live-build contains a tool to generate a skeleton configuration directory, lb config. This could be considered to be similar to tools such as dh-make. For more information about lb config, please see The lb config command.
The remainder of this section discusses the three most important commands:
As discussed in live-build, the scripts that make up live-build read their configuration with the source command from a single directory named config/. As constructing this directory by hand would be time-consuming and error-prone, the lb config command can be used to create skeleton configuration folders.
Issuing lb config without any arguments creates a config/ subdirectory which it populates with some default settings, and a skeleton auto/ subdirectory tree.
$ lb config
[2012-03-19 15:17:14] lb_config
P: Considering defaults defined in /etc/live/build.conf
P: Creating config tree for a debian system
Using lb config without any arguments would be suitable for users who need a very basic image, or who intend to later provide a more complete configuration via auto/config (see Managing a configuration for details).
Normally, you will want to specify some options. For example, to include the 'gnome' package list in your configuration:
$ lb config -p gnome
It is possible to specify many options, such as:
$ lb config --binary-images net --bootappend-live "hostname=live-machine username=live-user" ...
A full list of options is available in the lb_config man page.
The lb build command reads in your configuration from the config/ directory. It then runs the lower level commands needed to build your Live system.
It is the job of the lb clean command to remove various parts of a build so subsequent builds can start from a clean state. By default, chroot, binary and source stages are cleaned, but the cache is left intact. Also, individual stages can be cleaned. For example, if you have made changes that only affect the binary stage, use lb clean --binary prior to building a new binary. See the lb_clean man page for a full list of options.
live-boot is a collection of scripts providing hooks for the initramfs-tools, used to generate an initramfs capable of booting live systems, such as those created by live-build. This includes the Debian Live ISOs, netboot tarballs, and USB stick images.
At boot time it will look for read-only media containing a /live/ directory where a root filesystem (often a compressed filesystem image like squashfs) is stored. If found, it will create a writable environment, using aufs, for Debian like systems to boot from.
More information on initial ramfs in Debian can be found in the Debian Linux Kernel Handbook at ‹http://kernel-handbook.alioth.debian.org/› in the chapter on initramfs.
live-config consists of the scripts that run at boot time after live-boot to configure the live system automatically. It handles such tasks as setting the hostname, locales and timezone, creating the live user, inhibiting cron jobs and performing autologin of the live user.
This chapter explains how to manage a live configuration from initial creation, through successive revisions and successive releases of both the live-build software and the live image itself.
Live configurations rarely are perfect on the first try. You'll likely need to make a series of revisions until you are satisfied. However, inconsistencies can creep into your configuration from one revision to the next if you aren't careful. The main problem is, once a variable is given a default value, that value will not be recomputed from other variables that may change in later revisions.
For example, when the distribution is first set, many 'dependent' variables are given default values that suit that distribution. However, if you later decide to change the distribution, those dependent variables continue to retain old values that are no longer appropriate.
A second, related problem is that if you run lb config and then upgrade to a new version of live-build that has changed one of the variable names, you will discover this only by manual review of the variables in your config/* files, which you will then need to use to set the appropriate option again.
All of this would be a terrible nuisance if it weren't for auto/* scripts, simple wrappers to the lb config, lb build and lb clean commands that are designed to help you manage your configuration. Simply create an auto/config script containing lb config command with all desired options, and an auto/clean that removes the files containing configuration variable values, and each time you run lb config and lb clean, these files will be executed. This will ensure that your configuration is kept internally consistent from one revision to the next and from one live-build release to the next (Although you will still have to take care and read the documentation when you upgrade live-build and make adjustments as needed).
Use auto script examples such as the following as the starting point for your new live-build configuration. Take note that when you call the lb command that the auto script wraps, you must specify noauto as its parameter to ensure that the auto script isn't called again, recursively. Also, don't forget to ensure the scripts are executable (e.g. chmod 755 auto/*).
auto/config
#!/bin/sh
lb config noauto \
--package-lists "standard" \
"${@}"
auto/clean
#!/bin/sh
lb clean noauto "${@}"
rm -f config/binary config/bootstrap \
config/chroot config/common config/source
rm -f build.log
auto/build
#!/bin/sh
lb build noauto "${@}" 2>&1 | tee build.log
We now ship example auto scripts with live-build based on the examples above. You may copy those as your starting point.
$ cp /usr/share/live/build/examples/auto/* auto/
Edit auto/config, changing or adding any options as you see fit. In the example above, --package-lists standard is set to the default value. Change this to an appropriate value for your image (or delete it if you want to use the default) and add any additional options in continuation lines that follow.
This chapter gives an overview of the various ways in which you may customize a Debian Live system.
Live system configuration options are divided into build-time options which are options that are applied at build time and boot-time options which are applied at boot time. Boot-time options are further divided into those occurring early in the boot, applied by the live-boot package, and those that happen later in the boot, applied by live-config. Any boot-time option may be modified by the user by specifying it at the boot prompt. The image may also be built with default boot parameters so users can normally just boot directly to the live system without specifying any options when all of the defaults are suitable. In particular, the argument to lb --bootappend-live consists of any default kernel command line options for the Live system, such as persistence, keyboard layouts, or timezone. See Customizing locale and language, for example.
Build-time configuration options are described in the lb config man page. Boot-time options are described in the man pages for live-boot and live-config. Although the live-boot and live-config packages are installed within the live system you are building, it is recommended that you also install them on your build system for easy reference when you are working on your configuration. It is safe to do so, as none of the scripts contained within them are executed unless the system is configured as a live system.
The build process is divided into stages, with various customizations applied in sequence in each. The first stage to run is the bootstrap stage. This is the initial phase of populating the chroot directory with packages to make a barebones Debian system. This is followed by the chroot stage, which completes the construction of chroot directory, populating it with all of the packages listed in the configuration, along with any other materials. Most customization of content occurs in this stage. The final stage of preparing the live image is the binary stage, which builds a bootable image, using the contents of the chroot directory to construct the root filesystem for the Live system, and including the installer and any other additional material on the target media outside of the Live system's filesystem. After the live image is built, if enabled, the source tarball is built in the source stage.
Within each of these stages, there is a particular sequence in which commands are applied. These are arranged in such a way as to ensure customizations can be layered in a reasonable fashion. For example, within the chroot stage, preseeds are applied before any packages are installed, packages are installed before any locally included files or patches are applied, and hooks are run later, after all of the materials are in place.
Although lb config creates a skeletal configuration in the config/ directory, to accomplish your goals, you may need to provide additional files in subdirectories of config/. Depending on where the files are stored in the configuration, they may be copied into the live system's filesystem or into the binary image filesystem, or may provide build-time configurations of the system that would be cumbersome to pass as command-line options. You may include things such as custom lists of packages, custom artwork, or hook scripts to run either at build time or at boot time, boosting the already considerable flexibility of debian-live with code of your own.
The following chapters are organized by the kinds of customization task users typically perform: Customizing package installation, Customizing contents and Customizing locale and language cover just a few of the things you might want to do.
Perhaps the most basic customization of a Debian live system is the selection of packages to be included in the image. This chapter guides you through the various build-time options to customize live-build' s installation of packages. The broadest choices influencing which packages are available to install in the image are the distribution and archive areas. To ensure decent download speeds, you should choose a nearby distribution mirror. You can also add your own repositories for backports, experimental or custom packages, or include packages directly as files. You can define your own lists of packages to include, use live-build' s predefined lists, use tasksel tasks, or a combination of all three. Finally, a number of options give some control over apt, or if you prefer, aptitude, at build time when packages are installed. You may find these handy if you use a proxy, want to disable installation of recommended packages to save space, or need to control which versions of packages are installed via APT pinning, to name a few possibilities.
The distribution you choose has the broadest impact on which packages are available to include in your live image. Specify the codename, which defaults to wheezy for the wheezy version of live-build. Any current distribution carried in the Debian archive may be specified by its codename here. (See Terms for more details.) The --distribution option not only influences the source of packages within the archive, but also instructs live-build to behave as needed to build each supported distribution. For example, to build against the unstable release, sid, specify:
$ lb config --distribution sid
Within the distribution archive, archive areas are major divisions of the archive. In Debian, these are main, contrib and non-free. Only main contains software that is part of the Debian distribution, hence that is the default. One or more values may be specified, e.g.
$ lb config --archive-areas "main contrib"
Experimental support is available for some Debian derivatives through a --mode option. By default, this option is set to debian, even if you are building on a non-Debian system. If you specify --mode ubuntu or --mode emdebian, the distribution names and archive areas for the specified derivative are supported instead of the ones for Debian. The mode also modifies live-build behaviour to suit the derivatives.
Note: The projects for whom these modes were added are primarily responsible for supporting users of these options. The Debian live project, in turn, provides development support on a best-effort basis only, based on feedback from the derivative projects as we do not develop or support these derivatives ourselves.
The Debian archive is replicated across a large network of mirrors around the world so that people in each region can choose a nearby mirror for best download speed. Each of the --mirror-* options governs which distribution mirror is used at various stages of the build. Recall from Stages of the build that the bootstrap stage is when the chroot is initially populated by debootstrap with a minimal system, and the chroot stage is when the chroot used to construct the live system's filesystem is built. Thus, the corresponding mirror switches are used for those stages, and later, in the binary stage, the --mirror-binary and --mirror-binary-security values are used, superceding any mirrors used in an earlier stage.
To set the distribution mirrors used at build time to point at a local mirror, it is sufficient to set --mirror-bootstrap, --mirror-chroot-security and --mirror-chroot-backports as follows.
$ lb config --mirror-bootstrap http://localhost/debian/ \
--mirror-chroot-security http://localhost/debian-security/ \
--mirror-chroot-backports http://localhost/debian-backports/
The chroot mirror, specified by --mirror-chroot, defaults to the --mirror-bootstrap value.
The --mirror-binary* options govern the distribution mirrors placed in the binary image. These may be used to install additional packages while running the live system. The defaults employ cdn.debian.net, a service that chooses a geographically close mirror based on the user's IP number. This is a suitable choice when you cannot predict which mirror will be best for all of your users. Or you may specify your own values as shown in the example below. An image built from this configuration would only be suitable for users on a network where "mirror" is reachable.
$ lb config --mirror-binary http://mirror/debian/ \
--mirror-binary-security http://mirror/debian-security/
You may add more repositories, broadening your package choices beyond what is available in your target distribution. These may be, for example, for backports, experimental or custom packages. To configure additional repositories, create config/archives/your-repository.list.chroot, and/or config/archives/your-repository.list.binary files. As with the --mirror-* options, these govern the repositories used in the chroot stage when building the image, and in the binary stage, i.e. for use when running the live system.
For example, config/archives/live.list.chroot allows you to install packages from the debian live snapshot repository at live system build time.
deb http://live.debian.net/ sid-snapshots main contrib non-free
If you add the same line to config/archives/live.list.binary, the repository will be added to your live system's /etc/apt/sources.list.d/ directory.
If such files exist, they will be picked up automatically.
You should also put the GPG key used to sign the repository into config/archives/your-repository.key.{binary,chroot} files.
Note: some preconfigured package repositories are available for easy selection through the --archives option, e.g. for enabling live snapshots, a simple command is enough to enable it:
$ lb config --archives live.debian.net
There are a number of ways to choose which packages live-build will install in your image, covering a variety of different needs. You can simply name individual packages to install in a package list. You can also choose predefined lists of packages, or use APT tasks. And finally, you may place package files in your config/ tree, which is well suited to testing of new or experimental packages before they are available from a repository.
Package lists are a powerful way of expressing which packages should be installed. The list syntax supports included files and conditional sections which makes it easy to build lists from other lists and adapt them for use in multiple configurations. You can use predefined package lists, providing in a modular fashion package selections from each of the major desktop environments and some special purpose lists, as well as standard lists the others are based upon. You can also provide your own package lists, or use a combination of both.
Note: The behaviour of live-build when specifying a package that does not exist is determined by your choice of APT utility. See Choosing apt or aptitude for more details.
The simplest way to use lists is to specify one or more predefined lists with the --package-lists option. For example:
$ lb config --package-lists "gnome rescue"
The default location for the list files on your system is /usr/share/live/build/package-lists/. To determine the packages in a given list, read the corresponding file, paying attention to included files and conditionals as described in the following sections.
You may supplement the predefined lists using local package lists stored in config/package-lists/.
Package lists that exist in this directory need to have a .list suffix in order to be processed, and then an additional stage suffix, .chroot or .binary to indicate which stage the list is for.
Note: If you don't specify the stage suffix, the list will be used for both stages. Normally, you want to specify .list.chroot so that the packages will only be installed in the live filesystem and not have an extra copy of the .deb placed on the media.
To make a binary stage list, place a file suffixed with .list.binary in config/package-lists/. These packages are not installed in the live filesystem, but are included on the live media under pool/. You would typically use such a list with one of the non-live installer variants. As mentioned above, if you want this list to be the same as your chroot stage list, simply use the .list suffix by itself.
The package lists that are included with live-build make extensive use of includes. Refer to these in the /usr/share/live/build/package-lists/ directory, as they serve as good examples of how to write your own lists.
For example, to make a list that includes the predefined gnome list plus iceweasel, create config/package-lists/my.list.chroot with the following contents:
#include <gnome>
iceweasel
Any of the live-build configuration variables stored in config/* (minus the LB_ prefix) may be used in conditional statements in package lists. Generally, this means any lb config option uppercased and with dashes changed to underscores. But in practice, it is only the ones that influence package selection that make sense, such as DISTRIBUTION, ARCHITECTURES or ARCHIVE_AREAS.
For example, to install ia32-libs if the --architectures amd64 is specified:
#if ARCHITECTURES amd64
ia32-libs
#endif
You may test for any one of a number of values, e.g. to install memtest86+ if either --architectures i386 or --architectures amd64 is specified:
#if ARCHITECTURES i386 amd64
memtest86+
#endif
You may also test against variables that may contain more than one value, e.g. to install vrms if either contrib or non-free is specified via --archive-areas:
#if ARCHIVE_AREAS contrib non-free
vrms
#endif
A conditional may surround an #include directive:
#if ARCHITECTURES amd64
#include <gnome-full>
#endif
The nesting of conditionals is not supported.
The Debian Installer offers the user choices of a number of preselected lists of packages, each one focused on a particular kind of system, or task a system may be used for, such as "Graphical desktop environment", "Mail server" or "Laptop". These lists are called "tasks" and are supported by APT through the "Task:" field. You can specify one or more tasks in live-build by putting them in a list in config/task-lists/, as in the example below.
$ lb config
$ echo "mail-server file-server" >> config/task-lists/my.list.chroot
The primary tasks available in the Debian Installer can be listed with tasksel --list-tasks in the live system. The contents of any task, including the ones not included in this list, may be examined with tasksel --task-packages.
Desktop and language tasks are special cases that need some extra planning and configuration. Live images are different from Debian Installer images in this respect. In the Debian Installer, if the medium was prepared for a particular desktop environment flavour, the corresponding task will be automatically installed. Thus, there are internal gnome-desktop, kde-desktop, lxde-desktop and xfce-desktop tasks, none of which are offered in tasksel's menu. Likewise, there are no menu entries for tasks for languages, but the user's language choice during the install influences the selection of corresponding language tasks.
When developing a desktop live image, the image typically boots directly to a working desktop, the choices of both desktop and default language having been made at build time, not at run time as in the case of the Debian Installer. That's not to say that a live image couldn't be built to support multiple desktops or multiple languages and offer the user a choice, but that is not live-build' s default behaviour.
Because there is no provision made automatically for language tasks, which include such things as language-specific fonts and input-method packages, if you want them, you need to specify them in your configuration. For example, a GNOME desktop image containing support for Japanese might include these tasks:
$ lb config
$ echo "gnome-desktop desktop standard laptop" >> config/task-lists/my.list.chroot
$ echo "japanese japanese-desktop japanese-gnome-desktop" >> config/task-lists/my.list.chroot
Since desktop tasks are "internal" tasks, for every desktop flavour task included in the image, the corresponding value, if it differs from the default, "gnome", must be preseeded in the "tasksel/desktop" debconf variable or else tasksel will not recognize and install it. Thus:
$ lb config
$ echo 'tasksel tasksel/desktop multiselect kde' >> config/preseed/my.preseed.chroot
This parameter can take multiple values, e.g. "lxde xfce" instead of "kde".
Whilst it is against the philosophy of Debian Live, it may sometimes be necessary to build a Live system with modified versions of packages that are in the Debian repository. This may be to modify or support additional features, languages and branding, or even to remove elements of existing packages that are undesirable. Similarly, "third-party" packages may be used to add bespoke and/or proprietary functionality.
This section does not cover advice regarding building or maintaining modified packages. Joachim Breitner's 'How to fork privately' method from ‹http://www.joachim-breitner.de/blog/archives/282-How-to-fork-privately.html› may be of interest, however. The creation of bespoke packages is covered in the Debian New Maintainers' Guide at ‹http://www.debian.org/doc/maint-guide/› and elsewhere.
There are two ways of installing modified custom packages:
Using packages.chroot is simpler to achieve and useful for "one-off" customizations but has a number of drawbacks, whilst using a custom APT repository is more time-consuming to set up.
To install a custom package, simply copy it to the config/packages.chroot/ directory. Packages that are inside this directory will be automatically installed into the live system during build - you do not need to specify them elsewhere.
Packages must be named in the prescribed way. One simple way to do this is to use dpkg-name.
Using packages.chroot for installation of custom packages has disadvantages:
Unlike using packages.chroot, when using a custom APT repository you must ensure that you specify the packages elsewhere. See Choosing packages to install for details.
Whilst it may seem unnecessary effort to create an APT repository to install custom packages, the infrastructure can be easily re-used at a later date to offer updates of the modified packages.
live-build uses APT to install all packages into the live system so will therefore inherit behaviours from this program. One relevant example is that (assuming a default configuration) given a package available in two different repositories with different version numbers, APT will elect to install the package with the higher version number.
Because of this, you may wish to increment the version number in your custom packages' debian/changelog files to ensure that your modified version is installed over one in the official Debian repositories. This may also be achieved by altering the live system's APT pinning preferences - see APT pinning for more information.
You can configure APT through a number of options applied only at build time. (APT configuration used in the running live system may be configured in the normal way for live system contents, that is, by including the appropriate configurations through config/includes.chroot/.) For a complete list, look for options starting with apt in the lb_config man page.
You can elect to use either apt or aptitude when installing packages at build time. Which utility is used is governed by the --apt argument to lb config. Choose the method implementing the preferred behaviour for package installation, the notable difference being how missing packages are handled.
One commonly required APT configuration is to deal with building an image behind a proxy. You may specify your APT proxy with the --apt-ftp-proxy or --apt-http-proxy options as needed, e.g.
$ lb config --apt-http-proxy http://proxy/
You may find yourself needing to save some space on the image media, in which case one or the other or both of the following options may be of interest.
If you don't want to include APT indices in the image, you can omit those with:
$ lb config --apt-indices false
This will not influence the entries in /etc/apt/sources.list, but merely whether /var/lib/apt contains the indices files or not. The tradeoff is that APT needs those indices in order to operate in the live system, so before performing apt-cache search or apt-get install, for instance, the user must apt-get update first to create those indices.
If you find the installation of recommended packages bloats your image too much, you may disable that default option of APT with:
$ lb config --apt-recommends false
The tradeoff here is that if you don't install recommended packages for a given package, that is, "packages that would be found together with this one in all but unusual installations" (Debian Policy Manual, section 7.2), some packages that you actually need may be omitted. Therefore, we suggest you review the difference turning off recommends makes to your packages list (see the binary.packages file generated by lb build) and re-include in your list any missing packages that you still want installed. Alternatively, if you find you only want a small number of recommended packages left out, leave recommends enabled and set a negative APT pin priority on selected packages to prevent them from being installed, as explained in APT pinning.
If there is not a lb config option to alter APT's behaviour in the way you need, use --apt-options or --aptitude-options to pass any options through to your configured APT tool. See the man pages for apt and aptitude for details.
For background, please first read the apt_preferences(5) man page. APT pinning can be configured either for build time, or else for run time. For the former, create config/chroot_apt/preferences. For the latter, create config/includes.chroot/etc/apt/preferences.
Let's say you are building a wheezy live system but need all the live packages that end up in the binary image to be installed from sid at build time. You need to add sid to your APT sources and pin it so that only the packages you want are installed from it at build time and all others are taken from the target system distribution, wheezy. The following will accomplish this:
$ echo "deb http://mirror/debian sid main" > config/archives/sid.list.chroot
$ cat >> config/chroot_apt/preferences << END
Package: live-boot live-boot-initramfs-tools live-config live-config-sysvinit
Pin: release n=sid
Pin-Priority: 600
Package: *
Pin: release n=sid
Pin-Priority: 1
END
Note: Wildcards can be used in package names (e.g. Package: live-*) with Apt version 0.8.14 or higher. This means that it works with wheezy using:
$ lb config --distribution wheezy
Negative pin priorities will prevent a package from being installed, as in the case where you do not want a package that is recommended by another package. Suppose you are building an LXDE image using --package-lists lxde option, but don't want the user prompted to store wifi passwords in the keyring. This list includes gdm, which depends on gksu, which in turn recommends gnome-keyring. So you want to omit the recommended gnome-keyring package. This can be done by adding the following stanza to config/chroot_apt/preferences:
Package: gnome-keyring
Pin: version *
Pin-Priority: -1
This chapter discusses fine-tuning customization of the live system contents beyond merely choosing which packages to include. Includes allow you to add or replace arbitrary files in your Debian Live image, hooks allow you to execute arbitrary commands at different stages of the build and at boot time, and preseeding allows you to configure packages when they are installed by supplying answers to debconf questions.
While ideally a Debian live system would include files entirely provided by unmodified Debian packages, it is sometimes convenient to provide or modify some content by means of files. Using includes, it is possible to add (or replace) arbitrary files in your Debian Live image. live-build provides three mechanisms for using them:
Please see Terms for more information about the distinction between the "Live" and "binary" images.
Chroot local includes can be used to add or replace files in the chroot/Live filesystem so that they may be used in the Live system. A typical use is to populate the skeleton user directory (/etc/skel) used by the Live system to create the live user's home directory. Another is to supply configuration files that can be simply added or replaced in the image without processing; see Live/chroot local hooks if processing is needed.
To include files, simply add them to your config/includes.chroot directory. This directory corresponds to the root directory / of the live system. For example, to add a file /var/www/index.html in the live system, use:
$ mkdir -p config/includes.chroot/var/www
$ cp /path/to/my/index.html config/includes.chroot/var/www
Your configuration will then have the following layout:
-- config
[...]
|-- includes.chroot
| `-- var
| `-- www
| `-- index.html
[...]
`-- templates
Chroot local includes are installed after package installation so that files installed by packages are overwritten.
To include material such as documentation or videos on the media filesystem so that it is accessible immediately upon insertion of the media without booting the Live system, you can use binary local includes. This works in a similar fashion to chroot local includes. For example, suppose the files ~/video_demo.* are demo videos of the live system described by and linked to by an HTML index page. Simply copy the material to config/includes.binary/ as follows:
$ cp ~/video_demo.* config/includes.binary/
These files will now appear in the root directory of the live media.
live-build has some standard files (like documentation) that gets included in the default configuration on every live media. This can be disabled with:
$ lb config --includes none
Otherwise, the material will be installed by live-build in /includes/ by default on the media filesystem, or else you can specify an alternate path with --includes.
Hooks allow commands to be performed in the chroot and binary stages of the build in order to customize the image.
To run commands in the chroot stage, create a hook script with a .chroot suffix containing the commands in the config/hooks/ directory. The hook will run in the chroot after the rest of your chroot configuration has been applied, so remember to ensure your configuration includes all packages and files your hook needs in order to run. See the example chroot hook scripts for various common chroot customization tasks provided in /usr/share/live/build/examples/hooks which you can copy or symlink to use them in your own configuration.
To execute commands at boot time, you can supply live-config hooks as explained in the "Customization" section of its man page. Examine live-config' s own hooks provided in /lib/live/config/, noting the sequence numbers. Then provide your own hook prefixed with an appropriate sequence number, either as a chroot local include in config/includes.chroot/lib/live/config/, or as a custom package as discussed in Installing modified or third-party packages.
To run commands in the binary stage, create a hook script with a .binary suffix containing the commands in the config/hooks/ directory. The hook will run after all other binary commands are run, but before binary_checksums, the very last binary command. The commands in your hook do not run in the chroot, so take care to not modify any files outside of the build tree, or you may damage your build system! See the example binary hook scripts for various common binary customization tasks provided in /usr/share/live/build/examples/hooks which you can copy or symlink to use them in your own configuration.
Files in the config/preseed/ directory suffixed with .preseed followed by the stage (.chroot or .binary) are considered to be debconf preseed files and are installed by live-build using debconf-set-selections during the corresponding stage.
For more information about debconf, please see debconf(7) in the debconf package.
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.
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. 200-passwd) and add it to config/includes.chroot/lib/live/config/
When the live system boots, language is involved in three steps:
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"
This parameter can also be used at the kernel command line. You can specify a locale by a full language_country.encoding word.
Both the console and X keyboard configuration depend on the keyboard-layouts parameter of the --bootappend-live option. Valid options for X keyboard layouts can be found in /usr/share/X11/xkb/rules/base.xml (rather limited to two-letters country codes). To find the value (the two characters) corresponding to a language try searching for the english name of the nation where the language is spoken, e.g:
$ grep -i sweden -C3 /usr/share/X11/xkb/rules/base.xml | grep name
<name>se</name>
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"
A list of the valid values of the keyboards for the console can be figured with the following command:
$ for i in $(find /usr/share/keymaps/ -iname "*kmap.gz"); \
do basename $i | head -c -9; echo; done | sort | less
Alternatively, you can use the console-setup package, a tool to let you configure console layout using X (XKB) definitions; you can then set your keyboard layout more precisely with keyboard-layouts, keyboard-variant, keyboard-options and keyboard-model variables; live-boot will use also these parameters for X configuration. For example, to set up a French system with a French-Dvorak layout (called Bepo) on a TypeMatrix keyboard, both in console and X11, use:
$ lb config --bootappend-live \
"locales=fr_FR.UTF-8 keyboard-layouts=fr keyboard-variant=bepo keyboard-model=tm2030usb"
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:
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.
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).
If a user would need multiple persistence storage of the same type for different locations or testing, such as persistence-nonwork and persistence-work, the boot parameter persistence-subtext 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-subtext=subText.
live-build uses syslinux and some of its derivatives (depending on the image type) as bootloaders by default. You can easily customize them in a number of ways that range from providing a full theme to changing the boot timeout or simply adding a personalized splash image. Some of the following examples of customization make use of different methods, like includes or hooks.
If you want to use a full theme you can specify the --syslinux-theme option (see man lb_config). live-build will then retrieve the theme from the mirror and install it.
Imagine that you want to build a progress client but you prefer to include the server's theme because you want to have the help menu. Then you would launch lb config as follows:
$ lb config --mode progress --syslinux-theme progress-server
You can also create your own theme or modify an already existing one and if you do not have a mirror, you can add the package to config/packages.chroot. In this case it is not necessary to specify any option.
There is also the possibility of making smaller changes. For instance, syslinux derivatives are configured by default with a timeout of 0 (zero) which means that they will pause indefinitely at their splash screen until you press a key.
To modify the boot timeout of a default iso-hybrid image you can edit a default isolinux.cfg file specifying the timeout in units of seconds and add it to config/includes.binary/isolinux/
A modified isolinux.cfg to boot after five seconds would be similar to this:
include menu.cfg
default vesamenu.c32
prompt 0
timeout 50
An alternative way of achieving the same goal could be writing a hook and adding it to config/hooks/ Remember to add the .binary suffix to run in the binary stage. A proposed example:
#!/bin/sh
sed -i 's|timeout 0|timeout 50|' binary/isolinux/isolinux.cfg
Likewise, if you want to use a personalized splash.png image you can add a picture of 640x480 pixels to config/includes.binary/isolinux/
When creating an ISO9660 binary image, you can use the following options to add various textual metadata for your image. This can help you easily identify the version or configuration of an image without booting it.
Debian Live system images can be integrated with Debian Installer. There are a number of different types of installation, varying in what is included and how the installer operates.
Please note the careful use of capital letters when referring to the "Debian Installer" in this section - when used like this we refer explicitly to the official installer for the Debian system, not anything else. It is often seen abbreviated to "d-i".
The three main types of installer are:
"Regular" Debian Installer: This is a normal Debian Live image with a separate kernel and initrd which (when selected from the appropriate bootloader) launches into a standard Debian Installer instance, just as if you had downloaded a CD image of Debian and booted it. Images containing a live system and such an otherwise independent installer are often referred to as "combined images".
On such images, Debian is installed by fetching and installing .deb packages using debootstrap or cdebootstrap, from the local media or some network-based network, resulting in a standard Debian system being installed to the hard disk.
This whole process can be preseeded and customized in a number of ways; see the relevant pages in the Debian Installer manual for more information. Once you have a working preseeding file, live-build can automatically put it in the image and enable it for you.
"Live" Debian Installer: This is a Debian Live image with a separate kernel and initrd which (when selected from the appropriate bootloader) launches into an instance of the Debian Installer.
Installation will proceed in an identical fashion to the "Regular" installation described above, but at the actual package installation stage, instead of using debootstrap to fetch and install packages, the live filesystem image is copied to the target. This is achieved with a special udeb called live-installer.
After this stage, the Debian Installer continues as normal, installing and configuring items such as bootloaders and local users, etc.
Note: to support both normal and live installer entries in the bootloader of the same live media, you must disable live-installer by preseeding live-installer/enable=false.
"Desktop" Debian Installer: Regardless of the type of Debian Installer included, d-i can be launched from the Desktop by clicking on an icon. This is user friendlier in some situations. In order to make use of this, the debian-installer-launcher package needs to be included.
Note that by default, live-build does not include Debian Installer images in the images, it needs to be specifically enabled with lb config. Also, please note that for the "Desktop" installer to work, the kernel of the live system must match the kernel d-i uses for the specified architecture. For example:
$ lb config --architectures i386 --linux-flavours 486 \
--debian-installer live
$ echo debian-installer-launcher >> config/package-lists/my.list.chroot
As described in the Debian Installer Manual, Appendix B at ‹http://www.debian.org/releases/stable/i386/apb.html›, "Preseeding provides a way to set answers to questions asked during the installation process, without having to manually enter the answers while the installation is running. This makes it possible to fully automate most types of installation and even offers some features not available during normal installations." This kind of customization is best accomplished with live-build by placing the configuration in a preseed.cfg file included in config/binary_debian-installer/. For example, to preseed setting the locale to en_US:
$ echo "d-i debian-installer/locale string en_US" \
>> config/binary_debian-installer/preseed.cfg
For experimental or debugging purposes, you might want to include locally built d-i component udeb packages. Place these in config/packages.binary/ to include them in the image. Additional or replacement files and directories may be included in the installer initrd as well, in a similar fashion to Live/chroot local includes, by placing the material in config/includes.binary_debian-installer/.
Debian Live is far from being perfect, but we want to make it as close as possible to perfect - with your help. Do not hesitate to report a bug: it is better to fill a report twice than never. However, this chapter includes recommendations how to file good bug reports.
Per als impacients
Because Debian testing and Debian unstable distributions are a moving target, when you specify either as the target system distribution, a successful build may not always be possible.
If this causes too much difficulty for you, do not build a system based on testing or unstable, but rather, use stable. live-build does always default to the stable release.
Currently known issues are listed under the section 'status' on our homepage at ‹http://live.debian.net/›.
It is out of the scope of this manual to train you to correctly identify and fix problems in packages of the development distributions, however, there are two things you can always try: If a build fails when the target distribution is testing, try unstable. If unstable does not work either, revert to testing and pin the newer version of the failing package from unstable (see APT pinning for details).
To ensure that a particular bug is not caused by an uncleanly built system, please always rebuild the whole live system from scratch to see if the bug is reproducible.
Using outdated packages can cause significant problems when trying to reproduce (and ultimately fix) your problem. Make sure your build system is up-to-date and any packages included in your image are up-to-date as well.
Please provide enough information with your report. At least include the exact version of live-build version where the bug is encountered and steps to reproduce it. Please use common sense and include other relevant information if you think that it might help in solving the problem.
To make the most out of your bug report, we require at least the following information:
You can generate a log of the build process by using the tee command. We recommend doing this automatically with an auto/build script; (see Managing a configuration for details).
# lb build 2>&1 | tee build.log
At boot time, live-boot stores a log in /var/log/live.log (or /var/log/live-boot.log).
Additionally, to rule out other errors, it is always a good idea to tar up your config/ directory and upload it somewhere (do not send it as an attachment to the mailing list), so that we can try to reproduce the errors you encountered. If this is difficult (e.g. due to size) you can use the output of lb config --dump which produces a summary of your config tree (i.e. lists files in subdirectories of config/ but does not include them).
Remember to send in any logs that were produced with English locale settings, e.g. run your live-build commands with a leading LC_ALL=C or LC_ALL=en_US.
If possible, isolate the failing case to the smallest possible change that breaks. It is not always easy to do this, so if you can't manage it for your report, don't worry. However, if you plan your development cycle well, using small enough change sets per iteration, you may be able to isolate the problem by constructing a simpler 'base' configuration that closely matches your actual configuration plus just the broken change set added to it. If you have a hard time sorting out which of your changes broke, it may be that you are including too much in each change set and should develop in smaller increments.
Where does the bug appear?
live-build first bootstraps a basic Debian system with debootstrap or cdebootstrap. Depending on the bootstrapping tool used and the Debian distribution it is bootstrapping, it may fail. If a bug appears here, check if the error is related to a specific Debian package (most likely), or if it is related to bootstrapping tool itself.
In both cases, this is not a bug in Debian Live, but rather in Debian itself which we can not fix this directly. Please report such a bug against the bootstrapping tool or the failing package.
live-build installs additional packages from the Debian archive and depending on the Debian distribution used and the daily archive state, it can fail. If a bug appears here, check if the error is also reproducible on a normal system.
If this is the case, this is not a bug in Debian Live, but rather in Debian - please report it against the failing package. Running debootstrap separately from the Live system build or running lb bootstrap --debug will give you more information.
Also, if you are using a local mirror and/or any of sort of proxy and you are experiencing a problem, please always reproduce it first by bootstrapping from an official mirror.
If your image does not boot, please report it to the mailing list together with the information requested in Collect information. Do not forget to mention, how/when the image failed, in Qemu, Virtualbox, VMWare or real hardware. If you are using a virtualization technology of any kind, please always run it on real hardware before reporting a bug. Providing a screenshot of the failure is also very helpful.
If a package was successfully installed, but fails while actually running the Live system, this is probably a bug in Debian Live. However,
Before filing the bug, please search the web for the particular error message or symptom you are getting. As it is highly unlikely that you are the only person experiencing a particular problem, there is always a chance that it has been discussed elsewhere, and a possible solution, patch, or workaround has been proposed.
You should pay particular attention to the Debian Live mailing list, as well as the homepage, as these are likely to contain the most up-to-date information. If such information exists, always include the references to it in your bug report.
In addition, you should check the current bug lists for live-build, live-boot, and live-config to see whether something similar has been reported already.
The Debian Live project keeps track of all bugs in the Debian Bug Tracking System (BTS). For information on how to use the system, please see ‹http://bugs.debian.org/›. You can also submit the bugs by using the reportbug command from the package with the same name.
In general, you should report build time errors against the live-build package, boot time errors against live-boot, and run time errors against live-config. If you are unsure of which package is appropriate or need more help before submitting a bug report, please send a message to the mailing list and we will help you to figure it out.
Please note that bugs found in distributions derived from Debian (such as Ubuntu and others) should not be reported to the Debian BTS unless they can be also reproduced on a Debian system using official Debian packages.
This chapter documents the coding style used in live-boot and others.
Bad:
if foo; then
bar
fi
Good:
if foo
then
bar
fi
Bad:
Foo () {
bar
}
Good:
Foo ()
{
bar
}
Bad:
FOO=bar
Good:
FOO="bar"
Bad:
if [ -f "${FOO}"/foo/"${BAR}"/bar ]
then
foobar
fi
Good:
if [ -f "${FOO}/foo/${BAR}/bar" ]
then
foobar
fi
This chapter documents the procedures within the Debian Live project for various tasks that need cooperation with other teams in Debian.
Before commiting releases of a udeb in d-i svn, one has to call:
$ ../../scripts/l10n/output-l10n-changes . -d
Releasing a new stable major version of Debian includes a lot of different teams working together to make it happen. At some point, the Live team comes in and builds live system images. The requirements to do this are:
Remember to adjust both chroot and binary mirrors when building the last set of images for a Debian release after it has been moved away from ftp.debian.org to archive.debian.org. That way, old prebuilt live images are still useful without user modifications.
An annoucement mail for point releases can be generated using the template below and the following command:
$ sed \
-e 's|%major%|5.0|g' \
-e 's|%minor%|5.0.2|g' \
-e 's|%codename%|lenny|g' \
-e 's|%release_mail%|2009/msg00007.html|g'
Please check the mail carefully before sending and pass it to others for proof-reading.
Debian Live images for Debian GNU/Linux %major% updated
The Debian Live project is pleased to announce the availability of
updated Live images for its stable distribution Debian GNU/Linux %major%
(codename "%codename%").
The images are available for download at:
<http://cdimage.debian.org/cdimage/release/current-live/>
This update incorporates the changes made in the %minor% point release,
which adds corrections for security problems to the stable release
along with a few adjustments for serious problems. A full list of the
changes may be viewed at:
<http://lists.debian.org/debian-announce/%release_mail%>
It also includes the following Live-specific changes:
* [INSERT LIVE-SPECIFIC CHANGE HERE]
* [INSERT LIVE-SPECIFIC CHANGE HERE]
* [LARGER ISSUES MAY DESERVE THEIR OWN SECTION]
URLs
----
Download location of updated images:
<http://cdimage.debian.org/cdimage/release/current-live/>
Pàgina web del Projecte Debian Live:
<http://live.debian.net/>
The current stable distribution:
<http://ftp.debian.org/debian/dists/stable>
stable distribution information (release notes, errata etc.):
<http://www.debian.org/releases/stable/>
Security announcements and information:
<http://www.debian.org/security/>
About Debian
-------------
The Debian Project is an association of Free Software developers who
volunteer their time and effort in order to produce the completely free
operating system Debian GNU/Linux.
About Debian Live
-----------------
Debian Live is an official sub-project of Debian which produces Debian
systems that do not require a classical installer. Images are available
for CD/DVD discs, USB sticks and PXE netbooting as well as a bare
filesystem images for booting directly from the internet.
Contact Information
-------------------
For further information, please visit the Debian Live web pages at
<http://live.debian.net/> or alternatively send mail to
<debian-live@lists.debian.org>.
This chapter covers example builds for specific use cases with Debian Live. If you are new to building your own Debian Live images, we recommend you first look at the three tutorials in sequence, as each one teaches new techniques that will help you use and understand the remaining examples.
To use these examples you need a system to build them on that meets the requirements listed in Requirements and has live-build installed as described in Installing live-build.
Note that, for the sake of brevity, in these examples we do not specify a local mirror to use for the build. You can speed up downloads considerably if you use a local mirror. You may specify the options when you use lb config, as described in Distribution mirrors used at build time, or for more convenience, set the default for your build system in /etc/live/build.conf. Simply create this file and in it, set the corresponding LB_MIRROR_* variables to your preferred mirror. All other mirrors used in the build will be defaulted from these values. For example:
LB_MIRROR_BOOTSTRAP="http://mirror/debian"
LB_MIRROR_CHROOT_SECURITY="http://mirror/debian-security"
LB_MIRROR_CHROOT_BACKPORTS="http://mirror/debian-updates"
Use case: Create a simple first image, learning the basics of live-build.
In this tutorial, we will build a default ISO hybrid Debian Live image containing only base packages (no Xorg) and some Debian Live support packages, as a first exercise in using live-build.
You can't get much simpler than this:
$ mkdir tutorial1 ; cd tutorial1 ; lb config
Examine the contents of the config/ directory if you wish. You will see stored here a skeletal configuration, ready to customize or, in this case, use immediately to build a default image.
Now, as superuser, build the image, saving a log as you build with tee.
# lb build 2>&1 | tee build.log
Assuming all goes well, after a while, the current directory will contain binary.hybrid.iso. This ISO hybrid image can be booted directly in a virtual machine as described in Testing an ISO image with Qemu and Testing an ISO image with virtualbox-ose, or else imaged onto optical media or a USB flash device as described in Burning an ISO image to a physical medium and Copying an ISO hybrid image to a USB stick, respectively.
Use case: Create a web browser utility image, learning how to apply customizations.
In this tutorial, we will create an image suitable for use as a web browser utility, serving as an introduction to customizing Debian Live images.
$ mkdir tutorial2
$ cd tutorial2
$ lb config -p lxde
$ echo iceweasel >> config/package-lists/my.list.chroot
Our choice of LXDE for this example reflects our desire to provide a minimal desktop environment, since the focus of the image is the single use we have in mind, the web browser. We could go even further and provide a default configuration for the web browser in config/includes.chroot/etc/iceweasel/profile/, or additional support packages for viewing various kinds of web content, but we leave this as an exercise for the reader.
Build the image, again as superuser, keeping a log as in Tutorial 1:
# lb build 2>&1 | tee build.log
Again, verify the image is OK and test, as in Tutorial 1.
Use case: Create a project to build a personalized image, containing your favourite software to take with you on a USB stick wherever you go, and evolving in successive revisions as your needs and preferences change.
Since we will be changing our personalized image over a number of revisions, and we want to track those changes, trying things experimentally and possibly reverting them if things don't work out, we will keep our configuration in the popular git version control system. We will also use the best practice of autoconfiguration via auto scripts as described in Managing a configuration.
$ mkdir -p tutorial3/auto
$ cp /usr/share/live/build/examples/auto/* tutorial3/auto/
$ cd tutorial3
Edit auto/config to read as follows:
#!/bin/sh
lb config noauto \
--architectures i386 \
--linux-flavours 686-pae \
--package-lists lxde \
"${@}"
Now populate your local package list:
$ echo "iceweasel xchat" >> config/package-lists/my.list.chroot
First, --architectures i386 ensures that on our amd64 build system, we build a 32-bit version suitable for use on most machines. Second, we use --linux-flavours 686-pae because we don't anticipate using this image on much older systems. Third, we've chosen the lxde package list to give us a minimal desktop. And finally, we have added two initial favourite packages: iceweasel and xchat.
Now, build the image:
# lb build
Note that unlike in the first two tutorials, we no longer have to type 2>&1 | tee build.log as that is now included in auto/build.
Once you've tested the image (as in Tutorial 1) and are satisfied it works, it's time to initialize our git repository, adding only the auto scripts we just created, and then make the first commit:
$ git init
$ git add auto
$ git commit -a -m "Initial import."
In this revision, we're going to clean up from the first build, add the vlc package to our configuration, rebuild, test and commit.
The lb clean command will clean up all generated files from the previous build except for the cache, which saves having to re-download packages. This ensures that the subsequent lb build will re-run all stages to regenerate the files from our new configuration.
# lb clean
Now append the vlc package to our local package list in config/package-lists/my.list.chroot:
$ echo vlc >> config/package-lists/my.list.chroot
Build again:
# lb build
Test, and when you're satisfied, commit the next revision:
$ git commit -a -m "Adding vlc media player."
Of course, more complicated changes to the configuration are possible, perhaps adding files in subdirectories of config/. When you commit new revisions, just take care not to hand edit or commit the top-level files in config containing LB_* variables, as these are build products, too, and are always cleaned up by lb clean and re-created with lb config via their respective auto scripts.
We've come to the end of our tutorial series. While many more kinds of customization are possible, even just using the few features explored in these simple examples, an almost infinite variety of different images can be created. The remaining examples in this section cover several other use cases drawn from the collected experiences of users of Debian Live.
Use case: Create an image with live-build to boot directly to a VNC server.
Make a build directory and create a skeletal configuration in it built around the standard-x11 list, including gdm3, metacity and xvnc4viewer, disabling recommends to make a minimal system:
$ mkdir vnc_kiosk_client
$ cd vnc_kiosk_client
$ lb config -a i386 -k 686-pae -p standard-x11 \
--apt-recommends false
$ echo "gdm3 metacity xvnc4viewer" >> config/package-lists/my.list.chroot
Create the directory /etc/skel and put a custom .xsession in it for the default user that will launch metacity and start xvncviewer, connecting to port 5901 on a server at 192.168.1.2:
$ mkdir -p config/includes.chroot/etc/skel
$ cat > config/includes.chroot/etc/skel/.xsession << END
#!/bin/sh
/usr/bin/metacity &
/usr/bin/xvncviewer 192.168.1.2:1
exit
END
Build the image:
# lb build
Enjoy.
Use case: Create a standard image with some components removed in order to fit on a 128M USB key with space left over to use as you see fit.
When optimizing an image to fit a certain media size, you need to understand the tradeoffs you are making between size and functionality. In this example, we trim only so much as to make room for additional material within a 128M media size, but without doing anything to destroy integrity of the packages contained within, such as the purging of locale data via the localepurge package, or other such "intrusive" optimizations. Of particular note, you should not use --bootstrap-flavour minimal unless you really know what you're doing, as omitting priority important packages will most likely produce a broken live system.
$ lb config -k 486 -p minimal --apt-indices false \
--memtest none --apt-recommends false --includes none
Now, build the image in the usual way:
# lb build 2>&1 | tee build.log
On the author's system at time of writing, the above configuration produced a 78Mbyte image. This compares favourably with the 166Mbyte image produced by the default configuration in Tutorial 1.
The biggest space-saver here, compared to building a standard image on an i386 architecture system, is to select only the 486 kernel flavour instead of the default -k "486 686-pae". Leaving off APT's indices with --apt-indices false also saves a fair amount of space, the tradeoff being that you need to apt-get update before using apt in the live system. Choosing the minimal package list leaves out the large locales package and associated utilities. Dropping recommended packages with --apt-recommends false saves some additional space, at the expense of omitting some packages you might otherwise expect to be there, such as firmware-linux-free which may be needed to support certain hardware. The remaining options shave off additional small amounts of space. It's up to you to decide if the functionality that is sacrificed with each optimization is worth the loss in functionality.
Use case: Create a KDE desktop image, localized for Brazilian Portuguese and including an installer.
We want to make an iso-hybrid image for i386 architecture using our preferred desktop, in this case KDE, containing all of the same packages that would be installed by the standard Debian installer for KDE.
Our initial problem is the discovery of the names of the appropriate language tasks. Currently, live-build cannot help with this. While we might get lucky and find this by trial-and-error, there is a tool, grep-dctrl, which can be used to dig it out of the task descriptions in tasksel-data, so to prepare, make sure you have both of those things:
# apt-get install dctrl-tools tasksel-data
Now we can search for the appropriate tasks, first with:
$ grep-dctrl -FTest-lang pt_BR /usr/share/tasksel/descs/debian-tasks.desc -sTask
Task: brazilian-portuguese
By this command, we discover the task is called, plainly enough, brazilian-portuguese. Now to find the related tasks:
$ grep-dctrl -FEnhances brazilian-portuguese /usr/share/tasksel/descs/debian-tasks.desc -sTask
Task: brazilian-portuguese-desktop
Task: brazilian-portuguese-kde-desktop
At boot time we will generate the pt_BR.UTF-8 locale and select the pt-latin1 keyboard layout. We will also need to preseed our desktop choice, "kde" so that tasksel will install the correct desktop task, as it differs from the default (see Desktop and languages tasks). Now let's put the pieces together:
$ mkdir live-pt_BR-kde
$ cd live-pt_BR-kde
$ lb config \
-a i386 \
-k 486 \
--bootappend-live "locales=pt_BR.UTF-8 keyboard-layouts=pt-latin1" \
--debian-installer live
$ echo kde-desktop brazilian-portuguese brazilian-portuguese-desktop \
brazilian-portuguese-kde-desktop >> config/task-lists/my.list.chroot
$ echo debian-installer-launcher >> config/package-lists/my.list.chroot
$ echo tasksel tasksel/desktop multiselect kde >> config/preseed/my.preseed.chroot
Note that we have included the debian-installer-launcher package to launch the installer from the live desktop, and have also specified the 486 flavour kernel, as it is currently necessary to make the installer and live system kernels match for the launcher to work properly.
This section deals with some general considerations to be taken into account when writing technical documentation for live-manual. They are divided into linguistic features and recommended procedures.
Note: Authors should first read Contributing to this document
Keep in mind that a high percentage of your readers are not native speakers. So as a general rule try to use short, meaningful sentences, followed by a full stop.
This does not mean that you have to use a simplistic, naive style. It is a suggestion to try to avoid, as much as possible, complex subordinate sentences that make the text difficult to understand for non-native speakers.
The most widely spread varieties of English are British and American so it is very likely that most authors will use either one or the other. In a collaborative environment, the ideal variety would be "International English" but it is very difficult, not to say impossible, to decide on which variety among all the existing ones, is the best to use.
We expect that different varieties may mix without creating misunderstandings but in general terms you should try to be coherent and before deciding on using British, American or any other English flavour at your discretion, please take a look at how other people write and try to imitate them.
Do not be biased. Avoid including references to ideologies completely unrelated to live-manual. Technical writing should be as neutral as possible. It is in the very nature of scientific writing.
Try to avoid sexist language as much as possible. If you need to make references to the third person singular preferably use "they" rather than "he" or "she" or awkward inventions such as "s/he", "s(he)" and the like.
Go straight to the point and do not wander around aimlessly. Give as much information as necessary but do not give more information than necessary, this is to say, do not explain unnecessary details. Your readers are intelligent. Presume some previous knowledge on their part.
Keep in mind that whatever you write will have to be translated into several other languages. This implies that a number of people will have to do an extra work if you add useless or redundant information.
As suggested before, it is almost impossible to standardize a collaborative document into a perfectly unified whole. However, every effort on your side to write in a coherent way with the rest of the authors will be appreciated.
Use as many text-forming devices as necessary to make your text cohesive and unambiguous. (Text-forming devices are linguistic markers such as connectors).
It is preferable to describe the point in one or several paragraphs than merely using a number of sentences in a typical "changelog" style. Describe it! Your readers will appreciate it.
Look up the meaning of words in a dictionary or encyclopedia if you do not know how to express certain concepts in English. But keep in mind that a dictionary can either be your best friend or can turn into your worst enemy if you do not know how to use it correctly.
English has the largest vocabulary that exists (With over one million words). Many of these words are borrowings from other languages. When looking up the meaning of words in a bilingual dictionary the tendency of a non-native speaker is to choose the one that sounds more similar in their mother tongue. This often turns into an excessively formal discourse which does not sound quite natural in English.
As a general rule, if a concept can be expressed using different synonyms, it is a good advice to choose the first word proposed by the dictionary. If in doubt, choosing words of Germanic origin (Usually monosyllabic words) is often the right thing to do. Be warned that these two techniques might produce a rather informal discourse but at least your choice of words will be of wide use and generally accepted.
Using a dictionary of collocations is recommended. They are extremely helpful when it comes to know which words usually occur together.
Again it is a good practice to learn from the work of others. Using a search engine to check how other authors use certain expressions may help a lot.
Watch out for false friends. No matter how proficient you are in a foreign language you cannot help falling from time to time in the trap of the so called "false friends", words that look similar in two languages but whose meanings or uses might be completely different.
Try to avoid idioms as much as possible. "Idioms" are expressions that may convey a completely different meaning from what their individual words seem to mean. Sometimes, idioms are difficult to understand even for native speakers!
Even though you are encouraged to use plain, everyday English, technical writing belongs to the formal register of the language.
Try to avoid slang, unusual abbreviations that are difficult to understand and above all contractions that try to imitate the spoken language. Not to mention typical irc and family friendly expressions.
It is important that authors test their examples before adding them to live-manual to ensure that everything works as described. Testing on a clean chroot or VM can be a good starting point. Besides, it would be ideal if the tests were then carried out on different machines with different hardware to spot possible problems that may arise.
When providing an example try to be as specific as you can. An example is, after all, just an example.
It is often better to use a line that only applies to an specific case than using abstractions that may confuse your readers. In this case you can provide a brief explanation of the effects of the proposed example.
There may be some exceptions when the example suggests using some potentially dangerous commands that, if misused, may cause data loss or other similar undesirable effects. In this case you should provide a thorough explanation of the possible side effects.
Links to external sites should only be used when the information on those sites is crucial when it comes to understanding a special point. Even so, try to use links to external sites as sparsely as possible. Internet links are likely to change from time to time resulting in broken links and leaving your arguments in an incomplete state.
Besides, people who read the manual offline will not have the chance to follow those links.
Try to avoid branding as much as possible. Keep in mind that other downstream projects might make use of the documentation you write. So you are complicating things for them if you add certain specific material.
live-manual is licensed under the GNU GPL. This has a number of implications that apply to the distribution of the material (of any kind, including copyrighted graphics or logos) that is published with it.
- Brainstorm!. You need to organize your ideas first in a logical sequence of events.
- Once you have somehow organized those ideas in your mind write a first draft.
- Revise grammar, syntax and spelling.
- Improve your statements and redo any part if necessary.
Use the conventional numbering system for chapters and subtitles. e.g. 1, 1.1, 1.1.1, 1.1.2 ... 1.2, 1.2.1, 1.2.2 ... 2, 2.1 ... and so on. See markup below.
If you have to enumerate a series of steps or stages in your description, you can also use ordinal numbers: First, second, third ... or First, Then, After that, Finally ... Alternatively you can use bulleted items.
And last but not least, live-manual uses SiSU to process the text files and produce a multiple format output. It is recommended to take a look at SiSU's manual to get familiar with its markup, or else type:
$ sisu --help markup
Here are some markup examples that may prove useful:
- For emphasis/bold text:
*{foo}* or !{foo}!
produces: foo or foo. Use it to emphasize certain key words.
- For italics:
/{foo}/
produces: foo. Use them e.g. for the names of debian packages.
- For monospace:
#{foo}#
produces: foo. Use it e.g. for the names of commands. And also to highlight some key words or things like paths.
- For code blocks:
code{
$ foo
# bar
}code
produces:
$ foo
# bar
Use code{ to open and }code to close the tags. It is important to remember to leave a space at the beginning of each line of code.
This section deals with some general considerations to be taken into account when translating the contents of live-manual.
As a general recommendation, translators should have read and understood the translation rules that apply to their specific languages. Usually, translation groups and mailing lists provide information on how to produce translated work that complies with Debian quality standards.
Note: Translators should also read Contributing to this document. In particular the section Translation
The role of the translator is to convey as faithfully as possible the meaning of words, sentences, paragraphs and texts as written by the original authors into their target language.
So they should refrain from adding personal comments or extra bits of information of their own. If they want to add a comment for other translators working on the same documents, they can leave it in the space reserved for that. That is, the header of the strings in the po files preceded by a number sign #. Most graphical translation programs can automatically handle those types of comments.
It is perfectly acceptable however, to include a word or an expression in brackets in the translated text if, and only if, that makes the meaning of a difficult word or expression clearer to the reader. Inside the brackets the translator should make evident that the addition was theirs using the abbreviation "TN" or "Translator's Note".
Documents written in English make an extensive use of the impersonal form "you". In some other languages that do not share this characteristic, this might give the false impression that the original texts are directly addressing the reader when they are actually not doing so. Translators must be aware of that fact and reflect it in their language as accurately as possible.
The trap of "false friends" explained before especially applies to translators. Double check the meaning of suspicious false friends if in doubt.
Translators working initially with pot files and later on with po files will find many markup features in the strings. They can translate the text anyway, as long as it is translatable, but it is extremely important that they use exactly the same markup as the original English version.
Some translators decide to include the code blocks in the translated files because it is easier for them to identify what has already been translated and what has not by looking at the percentages if they use a graphical translation program.
Include the code blocks if you want to score a 100% complete translation.
On the other hand some translators prefer to leave the code blocks "untranslated" (i.e. not including them). This makes the translation easier to maintain once finished because it does not require translators intervention if the code changes.
Leave the code blocks empty (they will be automatically added then) if you want to make your translation easier to maintain.
The translated texts need to have the exact same newlines as the original texts. Be careful to press the "Enter" key or type \n if they appear in the original files. These newlines often appear, for instance, in the code blocks.
Make no mistake, this does not mean that the translated text needs to have the same length as the English version. That is nearly impossible.
Translators should never translate:
- The code names of releases
- The names of programs
- The commands given as examples
- Metadata (often between colons :metadata:)
- Links
- Paths