summaryrefslogtreecommitdiff
path: root/data/build-flavors/README.md
blob: 19716255672b0702be9ce4af0c1c2344c730897d (plain)
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
# VyOS build flavors

VyOS supports multiple different hardware and virtual platforms.
Those platforms often need custom packages and may require custom
configs. To make maintenance of existing flavors simpler
and to allow everyone to make and maintain their own flavors,
the build scripts support storing flavor configuration in [TOML](https://toml.io) files.

Flavor files must be in `data/build-flavors`. Here's an example:

```toml
# Generic (aka "universal") ISO image

image_format = "iso"

# Include these packages in the image regardless of the architecture
packages = [
  # QEMU and Xen guest tools exist for multiple architectures
  "qemu-guest-agent",
  "vyos-xe-guest-utilities",
]

[architectures.amd64]
  # Hyper-V and VMware guest tools are x86-only
  packages = ["hyperv-daemons", "vyos-1x-vmware"]
```

## Image format

The `image_format` option specifies the default format to build.

```toml
image_format = "iso"
```

**Note:** currently, ISO is the only supported format,
support for different flavors is in progress.

## Including custom packages

If you want the build scripts to include custom packages from repositories
in the image, you can list them in the `packages` field.

For example, this is how to include the GNU Hello package:

```toml
packages = ['hello']
```

It's possible to include packages only in images with certain build architectures
by placing them in a subtable.

If you want to include GNU Hello only in AMD64 images, do this:

```toml
[architectures.amd64]
  packages = ['hello']
```

## Including custom files

You can include files inside the SquashFS filesystem by adding entries
to the `includes_chroot` array. 

```toml
[[includes_chroot]]
  path = "etc/question.txt"
  data = '''
Can you guess how this file ended up in the image?
  '''

  path = "etc/answer.txt"
  data = '''
It was in the flavor file!
  '''
```