0a76d1ca4176938217a0f438c9f6e868f9dfa20a
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / doc / cirros-init.txt
1 cirros-ds
2 cirros-query
3 cirros-apply
4 cirros-per
5
6 cirros-ds calls each of the datasources configured.  They're expected
7 to be in the path or in /lib/cirros/ds/.
8  datasources are called with:
9    mode: 'local' or 'net'
10    out_d: directory to copy data to
11  datasource should exit 0 on success.
12  non-zero means failure.
13  expect to populate out_d/result with '0' on success.
14  exit of 0 without that means "no source found"
15
16 cirros-query
17   datasource: list the datasource
18   available: list available fields for datasource
19   get field: dump field
20
21 cirros-apply
22   take a mode of local or net
23   for 'local' could do things like copy network interfaces
24   basically this is something like cloud-init's boothooks
25
26 cirros-per
27   run a command at given frequency
28   this handles checking if the command name has already been
29   run and running if not.
30
31 datasources:
32  called in 1 of 4 modes:
33    * local
34    * apply-local
35    * net
36    * apply-net
37
38  Each receives the second argument of a directory. 
39
40  for 'local' and 'net' this is the output directory that should be populated.
41  The ds should created a data/ directory underneith this
42
43  for 'apply' and 'apply-net' this is the directory previously provided to
44  'local' or 'net' respectively.
45
46 jobs in /etc/init.d
47   - S35 cirros-ds-local
48   - S36 cirros-apply-local
49   - S40 network
50   - S45 cirros-net-ds
51   - S46 cirros-apply-net
52   - S95 cirros-userdata    : run #!
53   - S98 cirros-final       : print status info
54   - S99 cirros-logo        : logo
55
56 kernel cmdline:
57  - dslist=nocloud,nocloud-net,configdrive,configdrive-net,ec2
58
59 datasources:
60  - nocloud
61  - configdrive
62  - ec2
63
64 config:
65  - /etc/cirros/ds.conf
66    DATA_PATH=/run/cirros/ds
67    SOURCES=