File: user_managing_a_configuration.ssi

package info (click to toggle)
live-manual 1%3A2.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,292 kB
  • ctags: 159
  • sloc: makefile: 147; ruby: 85; sh: 8
file content (95 lines) | stat: -rw-r--r-- 3,322 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
:B~ Managing a configuration

1~managing-a-configuration Managing a configuration

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.

2~ Use auto to manage configuration changes

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 #{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 (though you will still have to take care and read the
documentation when you upgrade live-build and make adjustments as needed).

2~ Example auto scripts

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}#

code{

 #!/bin/sh
 lb config noauto \
     --packages-lists "standard" \
     "${@}"

}code

#{auto/clean}#

code{

 #!/bin/sh
 lb clean noauto "${@}"
 rm -f config/binary config/bootstrap \
     config/chroot config/common config/source
 rm -f binary.log

}code

#{auto/build}#

code{

 #!/bin/sh
 lb build noauto "${@}" 2>&1 | tee binary.log

}code

We now ship example auto scripts with live-build based on the examples
above. You may copy those as your starting point.

code{

 $ cp /usr/share/live/build/examples/auto/* auto/

}code

Edit #{auto/config}#, changing or adding any options as you see fit. In the
example above, #{--packages-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.