~ubuntu-branches/ubuntu/saucy/live-manual/saucy-proposed

« back to all changes in this revision

Viewing changes to manual/it/user_examples.ssi

  • Committer: Package Import Robot
  • Author(s): Daniel Baumann, Ben Armstrong, chals, Daniel Baumann
  • Date: 2012-08-10 22:48:06 UTC
  • mfrom: (29.2.6 sid)
  • Revision ID: package-import@ubuntu.com-20120810224806-i4vzvy1ijmtt32va
Tags: 1:3.0~a15-1
[ Ben Armstrong ]
* Renaming keyboard-variant to keyboard-variants, matching latest
  live-config.

[ chals ]
* Updating Spanish and French translations to keyboard-variants.

[ Ben Armstrong ]
* Beginning change from predefined package lists to metapackages.

[ chals ]
* Updating Spanish translation of user_customization-packages.ssi.po.

[ Daniel Baumann ]
* Updating the internal list of strings that get automatically a
  certain markup (like debian release codenames, debian packages
  names, etc.).

[ chals ]
* Insisting on the fact that achieving a 100% translation is important
  in respect to code blocks.
* Updating French translation of user_customization.ssi.po, after the
  addition of metapackages.
* Updating Catalan translation of user_customization-packages.ssi.po,
  after the addition of metapackages.

[ Ben Armstrong ]
* Updating apt pinning example to correct actual metapackage
  dependencies.
* Rewriting introductory package list sections around metapackages
  instead of predefined lists.

[ chals ]
* Updating translation of es/user_customization-packages.ssi (apt
  pinning).
* Updating translation of fr/user_customization-packages.ssi (apt
  pinning).
* Updating the translation of ca/user_customization-packages.ssi (apt
  pinning).
* Fixing mismatch in the indexes of the Spanish and French manuals.

[ Ben Armstrong ]
* Explaining multiple lists, dropping includes and tasks, adding
  generated lists.
* Fixing minor typo in Packages helper paragraph.

[ chals ]
* Updating Spanish translation of user_customization-packages
  (multiple lists).
* Updating French translation of user_customization-packages (multiple
  lists).
* Updating Catalan translation of user_customization-packages
  (multiple lists).
* Translating user_customization-runtime.ssi.po into Catalan.
* Revising the now unsupported '-p|--package-lists' option providing
  alternatives, thanks to Ben Armstrong for the hints.
* Copying minimal.chroot hook to config/hooks and thus making the
  example work.
* Removing 'standard-x11 list' and explaining the lists a bit better.
* Removing '--includes none' from the minimal image example as it is
  unsupported and was tested without that option.
* Providing a way to create a smaller image before the size
  optimization warning in the examples.
* Proofreading project_bugs.
* Removing the binary includes section since they were dropped.

[ Ben Armstrong ]
* Rewriting 'Managing a configuration' for greater clarity and
  introducing --config option.

[ chals ]
* Running 'make commit' to avoid conflicts and thus being able to
  commit languages individually afterwards; there are too many changes
  to cope with them all.

[ Ben Armstrong ]
* Fixing lb config --config examples: missing option.

[ chals ]
* Updating Catalan translation of user_managing a configuration, lb
  config --config.

[ Ben Armstrong ]
* Clarifying section headings relating to auto scripts.

[ chals ]
* Removing 'echo' to improve readability.
* Updating Catalan translation of the headings of auto scritps.
* Starting work to complete the Spanish translation, adding missing
  code blocks and updating user_customization-contents, project_bugs
  and user_overview.
* Starting work to complete the French translation, adding missing
  code blocks and updating user_customization-contents,
  user_customization-packages and user_overview.
* Revising the French translation of project_bugs and fixing its
  'fuzzy' string.
* Completing the French translation with user_examples and
  user_managing_a_configuration and revising po headers.
* Revising the headers in the Spanish po files that showed 'Catalan'
  by an error.

[ Ben Armstrong ]
* Updating prerequisites: Linux 3.x included.
* Updating build live-boot and live-config from source to reflect best
  practice for short-term testing.
* Clarifying example uses bash commands.

[ chals ]
* Completing the Spanish translation with
  user_managing_a_configuration, user_installation and user_examples.
* Updating French translation of user_installation.
* Updating the Catalan translation of user_installation.ssi.po.
* Fixing one title in the Spanish translation and improving one string
  in user_installation.ssi.po.

[ Ben Armstrong ]
* Clarifying --apt-recommends false has consequences for live-*
  packages.
* Updating language tasks section and examples chapter to no longer
  use task lists.

[ chals ]
* Re-adding packages left out by 'apt-recommends false' to make the
  images work properly in the examples.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
 
84
84
 $ mkdir tutorial2
85
85
 $ cd tutorial2
86
 
 $ lb config -p lxde
87
 
 $ echo iceweasel >> config/package-lists/my.list.chroot
 
86
 $ echo "task-lxde-desktop iceweasel" >> config/package-lists/my.list.chroot
88
87
 
89
88
}code
90
89
 
139
138
 lb config noauto \
140
139
     --architectures i386 \
141
140
     --linux-flavours 686-pae \
142
 
     --package-lists lxde \
143
141
     "${@}"
144
142
 
145
143
}code
157
155
 
158
156
code{
159
157
 
160
 
 $ echo "iceweasel xchat" >> config/package-lists/my.list.chroot
 
158
 $ echo "task-lxde-desktop iceweasel xchat" >> config/package-lists/my.list.chroot
161
159
 
162
160
}code
163
161
 
164
 
Per prima cosa, #{--architectures i386}# assicura che sul nostro sistema
165
 
#{amd64}# costruiamo una versione a 32-bit utilizzabile sulla maggior parte
166
 
delle macchine. In secondo luogo, usiamo #{--linux-flavours 686-pae}# dato
167
 
che non prevediamo di usare questa immagine su sistemi troppo vecchi. Terzo,
168
 
abbiamo scelto la lista di pacchetti /{lxde}/ per avere un desktop
169
 
minimale. Infine, abbiamo aggiunto due pacchetti preferiti per cominciare:
170
 
/{iceweasel}/ e /{xchat}/.
 
162
First, #{--architectures i386}# ensures that on our #{amd64}# build system,
 
163
we build a 32-bit version suitable for use on most machines. Second, we use
 
164
#{--linux-flavours 686-pae}# because we don't anticipate using this image on
 
165
much older systems. Third, we have chosen the /{lxde}/ task metapackage to
 
166
give us a minimal desktop. And finally, we have added two initial favourite
 
167
packages: /{iceweasel}/ and /{xchat}/.
171
168
 
172
169
Costruire quindi l'immagine:
173
170
 
255
252
 
256
253
*{Caso d'uso:}* creazione di un'immagine con live-build per avviare direttamente un server VNC.
257
254
 
258
 
Creare una directory con al suo interno una configurazione scheletrica
259
 
costruita sulla base dell'elenco di standard-x11, tra cui /{gdm3}/,
260
 
/{metacity}/ e /{xvnc4viewer}/, disabilitando i raccomandati per ottenere un
261
 
sistema minimale:
 
255
Make a build directory and create an skeletal configuration inside it,
 
256
disabling recommends to make a minimal system. And then create two initial
 
257
package lists: the first one generated with a script provided by live-build
 
258
named #{Packages}# (see {Generated package lists}#generated-package-lists),
 
259
and the second one including /{xorg}/, /{gdm3}/, /{metacity}/ and
 
260
/{xvnc4viewer}/.
262
261
 
263
262
code{
264
263
 
265
264
 $ mkdir vnc_kiosk_client
266
265
 $ cd vnc_kiosk_client
267
 
 $ lb config -a i386 -k 686-pae -p standard-x11 \
268
 
     --apt-recommends false
269
 
 $ echo "gdm3 metacity xvnc4viewer" >> config/package-lists/my.list.chroot
270
 
 
271
 
}code
272
 
 
273
 
Creare la directory #{/etc/skel}# e inserirvi un #{.xsession}#
274
 
personalizzato per l'utente predefinito che lancerà /{metacity}/ e avvierà
275
 
/{xvncviewer}/, connesso alla porta #{5901}# su un server all'indirizzo
276
 
#{192.168.1.2}#:
 
266
 $ lb config -a i386 -k 686-pae --apt-recommends false
 
267
 $ echo '! Packages Priority standard' > config/package-lists/standard.list.chroot
 
268
 $ echo "xorg gdm3 metacity xvnc4viewer" > config/package-lists/my.list.chroot
 
269
 
 
270
}code
 
271
 
 
272
As explained in {Tweaking APT to save space}#tweaking-apt-to-save-space you
 
273
may need to re-add some recommended packages to make your image work
 
274
properly.
 
275
 
 
276
An easy way to list recommends is using /{apt-cache}/. For example:
 
277
 
 
278
code{
 
279
 
 
280
 $ apt-cache depends live-config live-boot
 
281
 
 
282
}code
 
283
 
 
284
In this example we found out that we had to re-include several packages
 
285
recommended by live-config and live-boot: #{user-setup}# to make autologin
 
286
work and #{sudo}# as an essential program to shutdown the system. Besides,
 
287
it could be handy to add #{live-tools}# to be able to copy the image to RAM
 
288
and #{eject}# to eventually eject the live media, So:
 
289
 
 
290
code{
 
291
 
 
292
$ echo "live-tools user-setup sudo eject" >
 
293
config/package-lists/recommends.list.chroot
 
294
 
 
295
}code
 
296
 
 
297
Create the directory #{/etc/skel}# in #{config/includes.chroot}# and put a
 
298
custom #{.xsession}# in it for the default user that will launch
 
299
/{metacity}/ and start /{xvncviewer}/, connecting to port #{5901}# on a
 
300
server at #{192.168.1.2}#:
277
301
 
278
302
code{
279
303
 
301
325
 
302
326
2~ Un'immagine base per una chiavetta USB da 128M
303
327
 
304
 
*{Caso d'uso:}* creazione di un'immagine standard con alcuni componenti rimossi affinché possa stare su una chiavetta USB da 128M, con lo spazio che rimane da usarsi come meglio si crede.
305
 
 
306
 
Quando si cerca di ottimizzare un'immagine affinché sia contenuta in un
307
 
supporto, è necessario capire il compromesso che si deve fare tra la
308
 
dimensione e la funzionalità. In questo esempio, taglieremo solo quanto
309
 
basta per far sì che il tutto stia in 128M, senza fare nient'altro che
310
 
distrugga l'integrità dei pacchetti contenuti, come eliminare localizzazioni
311
 
con il pacchetto /{localepurge}/ o altre ottimizzazioni "intrusive". È da
312
 
notare che non va usato #{--bootstrap-flavour minimal}# a meno che non si
313
 
sappia cosa si sta facendo, come omettere la priorità dei pacchetti
314
 
*{important}* che molto probabilmente produrrà un sistema live danneggiato.
315
 
 
316
 
code{
317
 
 
318
 
 $ lb config -k 486 -p minimal --apt-indices false \
319
 
     --memtest none --apt-recommends false --includes none
 
328
*{Use case:}* Create a standard image with some components removed in order to fit on a 128M USB key with a little space left over to use as you see fit.
 
329
 
 
330
When optimizing an image to fit a certain media size, you need to understand
 
331
the tradeoffs you are making between size and functionality. In this
 
332
example, we trim only so much as to make room for additional material within
 
333
a 128M media size, but without doing anything to destroy the integrity of
 
334
the packages contained within, such as the purging of locale data via the
 
335
/{localepurge}/ package, or other such "intrusive" optimizations. Of
 
336
particular note, in order to understand what the #{minimal.chroot}# hook
 
337
does you should take a look at #{/usr/share/doc/live-build/examples/hooks}#
 
338
 
 
339
code{
 
340
 
 
341
 $ lb config -k 486 --apt-indices false --apt-recommends false --memtest none
 
342
 $ cp /usr/share/doc/live-build/examples/hooks/minimal.chroot config/hooks
 
343
 
 
344
}code
 
345
 
 
346
To make the image work properly, we must re-add, at least, two recommended
 
347
packages which are left out by the #{--apt-recommends false}# option. See
 
348
{Tweaking APT to save space}#tweaking-apt-to-save-space
 
349
 
 
350
code{
 
351
 
 
352
 $ echo "user-setup sudo" > config/package-lists/recommends.list.chroot
320
353
 
321
354
}code
322
355
 
328
361
 
329
362
}code
330
363
 
331
 
All'autore del sistema al momento di scrivere, la seguente configurazione ha
332
 
prodotto una immagine di 78Mbyte. Comparabile favorevolmente con i 166Mbyte
333
 
prodotta dalla configurazione predefinita nel {Tutorial 1}#tutorial-1.
334
 
 
335
 
Ciò che salva più spazio, comparato alla costruzione di un'immagine standard
336
 
su un sistema con architettura #{i386}#, è la selezione del solo kernel
337
 
#{486}# invece che quello predefinito #{-k "486 686-pae"}#. Lasciando fuori
338
 
anche gli indici di APT con #{--apt-indices false}# si può salvare una certa
339
 
quantità di spazio, il compromesso è usare #{apt-get update}# prima di usare
340
 
apt nel sistema live. Scegliendo la lista #{minima}# dei pacchetti si
341
 
esclude il grosso pacchetto #{locales}# e le utilità associate. Saltare i
342
 
pacchetti raccomandati con #{--apt-recommends false}# salva altro spazio, a
343
 
scapito di alcuni pacchetti che ci si aspetta di trovare, come
344
 
/{firmware-linux-free}/ che potrebbe servire a supportare un certo
345
 
hardware. Le restanti opzioni limano altre piccole quantità di spazio. Sta a
346
 
voi decidere se le funzionalità sacrificate con ciascuna ottimizzazione
347
 
valgono la pena.
 
364
On the author's system at the time of writing this, the above configuration
 
365
produced a 95Mbyte image. This compares favourably with the 182Mbyte image
 
366
produced by the default configuration in {Tutorial 1}#tutorial-1.
 
367
 
 
368
The biggest space-saver here, compared to building a standard image on an
 
369
#{i386}# architecture system, is to select only the #{486}# kernel flavour
 
370
instead of the default #{-k "486 686-pae"}#. Leaving off APT's indices with
 
371
#{--apt-indices false}# also saves a fair amount of space, the tradeoff
 
372
being that you need to #{apt-get update}# before using apt in the live
 
373
system. Dropping recommended packages with #{--apt-recommends false}# saves
 
374
some additional space, at the expense of omitting some packages you might
 
375
otherwise expect to be there, such as /{firmware-linux-free}/ which may be
 
376
needed to support certain hardware. #{--memtest none}# prevents the
 
377
installation of a memory tester. And finally, the execution of the
 
378
#{minimal.chroot}# hook removes some unused packages and files.
 
379
 
 
380
Using other hooks, like for example the #{stripped.chroot}# hook found in
 
381
#{/usr/share/doc/live-build/examples/hooks}#, may shave off additional small
 
382
amounts of space and produce an image of 76MB. But it is up to you to decide
 
383
if the functionality that is sacrificed with each size optimization is worth
 
384
the loss of functionality.
348
385
 
349
386
2~ Un desktop KDE localizzato e l'installer
350
387
 
387
424
 
388
425
}code
389
426
 
390
 
Durante l'avvio verrà generata la localizzazione pt_BR.UTF-8 e selezionato
391
 
il layout di tastiera pt-latin1. Ci sarà anche bisogno di preconfigurare la
392
 
nostra scelta desktop, "kde" cosicché tasksel installerà il task corretto,
393
 
che differisce dal predefinito (vedere {Task per desktop e
394
 
lingua}#desktop-and-language-tasks). È ora di mettere insieme i pezzi:
 
427
At boot time we will generate the pt_BR.UTF-8 locale and select the
 
428
pt-latin1 keyboard layout. Now let's put the pieces together. Recalling from
 
429
{Using metapackages}#using-metapackages that task metapackages are prefixed
 
430
#{task-}#, we just specify these language boot parameters, then add standard
 
431
priority packages and all our discovered task metapackages to our package
 
432
list as follows:
395
433
 
396
434
code{
397
435
 
402
440
     -k 486 \
403
441
     --bootappend-live "locales=pt_BR.UTF-8 keyboard-layouts=pt-latin1" \
404
442
     --debian-installer live
405
 
 $ echo kde-desktop brazilian-portuguese brazilian-portuguese-desktop \
406
 
     brazilian-portuguese-kde-desktop >> config/task-lists/my.list.chroot
407
 
 $ echo debian-installer-launcher >> config/package-lists/my.list.chroot
408
 
 $ echo tasksel tasksel/desktop multiselect kde >> config/preseed/my.preseed.chroot
 
443
 $ echo '! Packages Priority standard' > config/package-lists/standard.list.chroot
 
444
 $ echo task-kde-desktop task-brazilian-portuguese task-brazilian-portuguese-desktop \
 
445
     task-brazilian-portuguese-kde-desktop >> config/package-lists/desktop.list.chroot
 
446
 $ echo debian-installer-launcher >> config/package-lists/installer.list.chroot
409
447
 
410
448
}code
411
449