3
In order to generate the hooks for a specific image target set, call the
4
`make-hooks` script, located in `hooks.d` as
6
./make-hooks --hooks-dir ../hooks <image_set>
8
where `image_set` is the name of a series file (e.g. "vagrant") without leading
9
path components. Do *not* check in the `hooks` folder, it is automatically
10
generated by `auto/config` during Live Build runs.
13
# Hook placement and ordering
15
Scripts live in subfolders below the `hooks.d` folder. Currently the folders
16
`chroot` and `base` exist. The folder with the name `extra` is reserved for
17
private scripts, which are not included in the source of livecd-rootfs. The
18
scripts are not numbered, instead the order of their execution depends on the
19
order in which they are listed in a *series* file.
21
Series files are placed in subfolders `hooks.d/base/series` or
22
`hooks.d/extra/series`. Each series file contains a list of scripts to be
23
executed. Empty lines and lines starting with a `#` are ignored.
25
Series files in `extra/series` override files in `base/series` with the same
26
name. For example, if a series file `base/series/cloudA` exists and a series
27
file `extra/series/cloudA`, then the latter will be preferred.
29
A series file in `extra/series` may also list scripts that are located in the
30
`chroot` and `base` folders. In addition, series files can *depend* on other
31
series files. For example, the series files for most custom images look similar
35
depends extra-settings
38
Where `disk-image` and `extra-settings` may list scripts and dependencies which
39
are to be processed before the script `extra/cloudB.binary` is called.
41
ACHTUNG: live build runs scripts with the suffix ".chroot" in a batch separate
42
from scripts ending in ".binary". Even if you arrange them interleaved in your
43
series files, the chroot scripts will be run before the binary scripts.
45
# Image set selection for Live Build
47
During a Live Build, enumerated symbolic links are generated based on the
48
contents of one or more series files. The series files are selected according
49
to the contents of the `IMAGE_TARGETS` environment variable. For example, in
50
order to trigger the build of `squashfs` and `vagrant`, list them in the
51
`IMAGE_TARGETS` variable as `squashfs,vagrant`. The separator can be a comma,
52
a semi-colon or whitespace.
54
The generation of the symbolic links is triggered from the `auto/config` script,
55
from where the contents of the `IMAGE_TARGETS` environment variable are passed
56
on to the `make-hooks` script.
61
Since Live Build itself does not know about series files, a traditional `hooks`
62
folder is generated using the `make-hooks` script. The script takes as arguments
63
the names of the series files to be processed.
65
The script parses the series files and generates enumerated symbolic links for
66
all entries. Per default, these are placed into a directory named `hooks` next
67
to the `hooks.d` directory. This can be changed using the `--hooks-dir`