~ubuntu-branches/ubuntu/precise/live-manual/precise

« back to all changes in this revision

Viewing changes to manual/en/overview.xml

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2010-06-06 15:30:21 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20100606153021-wjm839uxrii9x2ks
Tags: upstream-2.0~a1
ImportĀ upstreamĀ versionĀ 2.0~a1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="utf-8"?>
 
2
 
 
3
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
 
4
        "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
 
5
        <!ENTITY % commondata SYSTEM "common.ent" > %commondata;
 
6
]>
 
7
 
 
8
<chapter id="overview">
 
9
<title>Overview of tools</title>
 
10
 
 
11
<para>
 
12
        This chapter contains an overview of the two main tools used in building
 
13
        Debian Live systems.
 
14
</para>
 
15
 
 
16
<section id="live-helper">
 
17
<title>&live-helper;</title>
 
18
 
 
19
<para>
 
20
        &live-helper; is a collection of scripts to build Debian Live systems.
 
21
        These scripts are also referred to as "helpers".
 
22
</para>
 
23
 
 
24
<para>
 
25
        The idea behind &live-helper; is to be a framework that uses a
 
26
        configuration directory to completely automate and customize all aspects
 
27
        of building a Live image.
 
28
</para>
 
29
 
 
30
<para>
 
31
        Many concepts are similar to those in the <command>debhelper</command>
 
32
        Debian package tools written by Joey Hess:
 
33
</para>
 
34
 
 
35
<orderedlist>
 
36
 
 
37
<listitem>
 
38
<para>
 
39
        The scripts have a central location for configuring their operation.
 
40
</para>
 
41
 
 
42
<para>
 
43
        In <command>debhelper</command>, this is the <filename class="directory"
 
44
        >debian</filename> subdirectory of a package tree. For example,
 
45
        <command>dh_install</command> will look for a file called
 
46
        <filename>debian/&lt;packagename&gt;.install</filename> to determine
 
47
        which files should exist in a particular binary package. In much the
 
48
        same way, &live-helper; stores its configuration entirely under a
 
49
        <filename class="directory">config/</filename> subdirectory.
 
50
</para>
 
51
</listitem>
 
52
 
 
53
<listitem>
 
54
<para>
 
55
        The scripts are independent - that is to say, it is always safe to run
 
56
        each command.
 
57
</para>
 
58
</listitem>
 
59
 
 
60
</orderedlist>
 
61
 
 
62
<para>
 
63
        Unlike <command>debhelper</command>, &live-helper; contains a tool to
 
64
        generate a skeleton configuration directory,
 
65
        <filename>lh config</filename>. This could be considered to be similar
 
66
        to tools such as <command>dh-make</command>. For more information about
 
67
        <filename>lh config</filename>, please see <xref linkend="lh-config" />.
 
68
</para>
 
69
 
 
70
<para>
 
71
        Besides the common <filename>config/common</filename>, which is used by
 
72
        all &live-helper; helper commands, some additional files can be used to
 
73
        configure the behavior of specific helper commands. These files are
 
74
        typically named <command>config/helper</command> or
 
75
        <command>config/stage</command> (where "stage", of course, is replaced
 
76
        with the name of the stage that they belong to, and "helper" with the
 
77
        name of the helper).
 
78
</para>
 
79
 
 
80
<para>
 
81
        For example, the <command>lh bootstrap debootstrap</command> helper
 
82
        command uses files named <filename>config/bootstrap</filename> and
 
83
        <filename>config/bootstrap_debootstrap</filename> to read the options it
 
84
        will use. Generally, these files contain variables with values assigned,
 
85
        one variable per line. Some programs in &live-helper; use pairs of
 
86
        values or slightly more complicated variable assignments.
 
87
</para>
 
88
 
 
89
<para>
 
90
        &live-helper; respects environment variables which are present in the
 
91
        context of the shell it is running. If variables can be read from config
 
92
        files, then they override environment variables, and if command line
 
93
        options are used, they override values from config files. If no value
 
94
        for a given variable can be found (and is thus unset), &live-helper;
 
95
        will automatically set it to a default value.
 
96
</para>
 
97
 
 
98
<para>
 
99
        All config files are shell scripts which are sourced by a &live-helper;
 
100
        program. That means they have to follow the normal shell syntax. You can
 
101
        also put comments in these files; lines beginning with "#" are ignored.
 
102
</para>
 
103
 
 
104
<para>
 
105
        In some rare cases you may want to have different versions of these
 
106
        files for different architectures or distributions. If files named
 
107
        <command>config/stage.arch</command> or
 
108
        <command>config/stage_helper.arch</command>, and
 
109
        <command>config/stage.dist</command> or
 
110
        <command>config/stage_helper.dist</command> exist (where "arch" is the
 
111
        same as the output of <command>dpkg --print-architecture</command> and
 
112
        "dist" is the same as the codename of the target distribution), then
 
113
        they will be used in preference to the other, more general files.
 
114
</para>
 
115
 
 
116
<para>
 
117
        Please see <xref linkend="installation" /> for information on how to
 
118
        install &live-helper;.
 
119
</para>
 
120
 
 
121
<para>
 
122
        The remainder of this section discusses the three most important
 
123
        helpers:
 
124
</para>
 
125
 
 
126
<variablelist>
 
127
 
 
128
<varlistentry>
 
129
<term><filename>lh config</filename></term>
 
130
 
 
131
<listitem>
 
132
<para>
 
133
        Responsible for initialising a Live system configuration directory. See
 
134
        <xref linkend="lh-config" /> for more information.
 
135
</para>
 
136
</listitem>
 
137
</varlistentry>
 
138
 
 
139
<varlistentry>
 
140
<term><filename>lh build</filename></term>
 
141
 
 
142
<listitem>
 
143
<para>
 
144
        Responsible for starting a Live system build. See <xref
 
145
        linkend="lh-build" /> for more information.
 
146
</para>
 
147
</listitem>
 
148
</varlistentry>
 
149
 
 
150
<varlistentry>
 
151
<term><filename>lh clean</filename></term>
 
152
 
 
153
<listitem>
 
154
<para>
 
155
        Responsible for removing parts of a Live system build. See <xref
 
156
        linkend="lh-clean" /> for more information.
 
157
</para>
 
158
</listitem>
 
159
</varlistentry>
 
160
 
 
161
</variablelist>
 
162
 
 
163
<section id="lh-config">
 
164
<title>The <filename>lh config</filename> helper</title>
 
165
 
 
166
<para>
 
167
        As discussed in <xref linkend="live-helper" />, the scripts that make up
 
168
        &live-helper; source their configuration from a single directory named
 
169
        <command>config/</command>. As constructing this directory by hand would
 
170
        be time-consuming and error-prone, the <filename>lh config</filename>
 
171
        helper can be used to create skeleton configuration folders.
 
172
</para>
 
173
 
 
174
<para>
 
175
        Issuing <filename>lh config</filename> without any arguments creates a
 
176
        <command>config</command> subdirectory which it populates with some
 
177
        default settings:
 
178
</para>
 
179
 
 
180
<para>
 
181
        <screen>$ lh config
 
182
$ ls -l
 
183
total 4.1k
 
184
drwxr-xr-x 19 user group 4.1k 2008-05-09 21:37 config
 
185
$ ls -l config/
 
186
total 104
 
187
-rw-r--r-- 1 user group 4175 2010-04-11 12:16 binary
 
188
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 binary_debian-installer
 
189
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 binary_debian-installer-includes
 
190
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 binary_grub
 
191
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 binary_local-debs
 
192
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 binary_local-hooks
 
193
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 binary_local-includes
 
194
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 binary_local-packageslists
 
195
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 binary_local-udebs
 
196
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 binary_rootfs
 
197
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 binary_syslinux
 
198
-rw-r--r-- 1 user group 2205 2010-04-11 12:16 bootstrap
 
199
-rw-r--r-- 1 user group 1599 2010-04-11 12:16 chroot
 
200
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 chroot_apt
 
201
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 chroot_local-hooks
 
202
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 chroot_local-includes
 
203
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 chroot_local-packages
 
204
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 chroot_local-packageslists
 
205
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 chroot_local-patches
 
206
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 chroot_local-preseed
 
207
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 chroot_sources
 
208
-rw-r--r-- 1 user group 2938 2010-04-11 12:16 common
 
209
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 includes
 
210
-rw-r--r-- 1 user group  206 2010-04-11 12:16 source
 
211
drwxr-xr-x 2 user group 4096 2010-04-11 12:16 templates
 
212
</screen>
 
213
</para>
 
214
 
 
215
<para>
 
216
        Using <filename>lh config</filename> without any arguments would be
 
217
        suitable for users who are either happy editing the generated files, or
 
218
        are simply happy with the defaults it creates.
 
219
</para>
 
220
 
 
221
<para>
 
222
        You can ask <filename>lh config</filename> to generate a <filename
 
223
        class="directory">config/</filename> directory "preseeded" with various
 
224
        options. This might be suitable if you do not require the default
 
225
        settings but do not need to change a large number of options. For
 
226
        example:
 
227
</para>
 
228
 
 
229
<para>
 
230
        <screen>$ lh config -p gnome</screen>
 
231
</para>
 
232
 
 
233
<para>
 
234
        will build a <filename class="directory">config/</filename> directory
 
235
        configured to include the '<command>gnome</command>' package list. It is
 
236
        possible to specify many options:
 
237
</para>
 
238
 
 
239
<para>
 
240
        <screen>$ lh config --apt aptitude --binary-images net --hostname live-machine --username live-user ...</screen>
 
241
</para>
 
242
 
 
243
<para>
 
244
        A full list of options is available in the <command>lh_config</command>
 
245
        man page. Most options have a parallel with an "<command>LH_</command>"
 
246
        prefixed variable.
 
247
</para>
 
248
 
 
249
</section>
 
250
 
 
251
<section id="lh-build">
 
252
<title>The <filename>lh build</filename> helper</title>
 
253
 
 
254
<para>
 
255
        The <filename>lh build</filename> helper reads in your configuration
 
256
        from the <filename class="directory">config/</filename> directory. It
 
257
        then runs the lower lower level commands needed to build your Live
 
258
        system.
 
259
</para>
 
260
 
 
261
</section>
 
262
 
 
263
<section id="lh-clean">
 
264
<title>The <filename>lh clean</filename> helper</title>
 
265
 
 
266
<para>
 
267
        It is the job of the <filename>lh clean</filename> helper to remove
 
268
        various parts of a Live helper build so subsequent builds can start
 
269
        from a clean state.
 
270
</para>
 
271
 
 
272
</section>
 
273
 
 
274
</section>
 
275
 
 
276
<section id="live-initramfs">
 
277
<title>The &live-initramfs; package</title>
 
278
 
 
279
<para>
 
280
        &live-initramfs; is a collection of scripts providing hooks for the
 
281
        <command>initramfs-tools</command>, used to generate an initramfs
 
282
        capable of booting live systems, such as those created by
 
283
        <command>live-helper</command>. This includes the Debian Live isos,
 
284
        netboot tarballs, and usb stick images.
 
285
</para>
 
286
 
 
287
<para>
 
288
        At boot time it will look for read-only media containing a "/live"
 
289
        directory where a root filesystem (often a compressed filesystem image
 
290
        like squashfs) is stored. If found, it will create a writable
 
291
        environment, using aufs or unionfs, for Debian like systems to boot
 
292
        from.
 
293
</para>
 
294
 
 
295
<para>
 
296
        &live-initramfs; is a fork of
 
297
        <ulink url="http://packages.ubuntu.com/casper">casper</ulink>.
 
298
</para>
 
299
 
 
300
<para>
 
301
        More information on initial ramfs in Debian can be found in the
 
302
        <ulink url="http://kernel-handbook.alioth.debian.org/">
 
303
        Debian Linux Kernel Handbook</ulink>'s chapter on 
 
304
        <ulink url="http://kernel-handbook.alioth.debian.org/ch-initramfs.html">
 
305
        initramfs</ulink>.
 
306
</para>
 
307
 
 
308
</section>
 
309
 
 
310
</chapter>