| 1 |
Introduction |
| 2 |
------------ |
| 3 |
|
| 4 |
Variants enable debian-cd to include extra functionality in a built |
| 5 |
image which is somewhat orthogonal to the usual DISKTYPE and ARCH |
| 6 |
configurations. |
| 7 |
|
| 8 |
Variants are enabled by setting the VARIANTS environment variable to a |
| 9 |
space separated list of the variants to enable or by passing the -V |
| 10 |
option (multiple times if desired) to the easy-build.sh script. |
| 11 |
|
| 12 |
Available Variants |
| 13 |
------------------ |
| 14 |
|
| 15 |
* `xen' [i386, amd64 only] |
| 16 |
|
| 17 |
This variant includes a kernel and installer initrd which is |
| 18 |
compatible with the Xen hypervisor in `install.<arch>/xen' and |
| 19 |
includes matching kernel module .udebs as well as a suitable kernel |
| 20 |
.deb for installation into the final system. |
| 21 |
|
| 22 |
Implementation |
| 23 |
-------------- |
| 24 |
|
| 25 |
Variants impact several aspects of the debian-cd infrastructure: |
| 26 |
|
| 27 |
environment variable |
| 28 |
-------------------- |
| 29 |
|
| 30 |
The $VARIANTS environment variable is available to any scripts etc |
| 31 |
which are run as part of the build process and is a space separated |
| 32 |
list of the variants which are enabled. |
| 33 |
|
| 34 |
In particular this maybe used by the per-archtecture |
| 35 |
tools/boot/<distro>/boot-* scripts which make an image bootable on a |
| 36 |
particular architecure. To facilitate this |
| 37 |
tools/boot/<distro>/common.sh defines a function `variant_enabled' |
| 38 |
which takes a variant name as an argument and returns true if that |
| 39 |
variant is enabled. |
| 40 |
|
| 41 |
deb package lists |
| 42 |
----------------- |
| 43 |
|
| 44 |
A variant may wish to include extra .deb packages in the image. The |
| 45 |
package lists are preprocessed using `cpp' as part of the build |
| 46 |
process and a C-preprocessor variable `VARIANT_<x>' will be defined |
| 47 |
to 1 for each variant which is enabled. |
| 48 |
|
| 49 |
udeb package lists |
| 50 |
------------------ |
| 51 |
|
| 52 |
Similarly a variant may which to include extra .udeb packages in the |
| 53 |
image. The list of udebs to include in an image is generated using |
| 54 |
tools/generate_di_list which reads one or more udeb exclude files |
| 55 |
from data/<distribution>/*. The syntax of these exclude files allows |
| 56 |
a udeb to be excluded or included based on which variants are |
| 57 |
enabled. |
| 58 |
|
| 59 |
Each line in an exclude file specifies a glob pattern, a udeb whose |
| 60 |
name matches the glob will _not_ be included in the image. After the |
| 61 |
udeb glob each line can optionally contain on or more space |
| 62 |
separated conditions. At least one of these conditions must be met |
| 63 |
in order to exclude the udeb. A condition may either be: |
| 64 |
- a positive `variant' condition, in which case the udeb is |
| 65 |
excluded when that variant is enabled |
| 66 |
- a negative `!variant' condition, in which case the udeb is |
| 67 |
excluded when that variant is not enabled. |