summaryrefslogtreecommitdiff
path: root/doc/man/debos.1
blob: 44148a000023a48ec0395c270b464ce8d95b6ff7 (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
.\" Automatically generated by Pandoc 2.2.1
.\"
.TH "debos" "1" "" "" ""
.hy
.SH NAME
.IP
.nf
\f[C]
debos\ \-\ \ Debian\ OS\ images\ builder
\f[]
.fi
.SH SYPNOSIS
.IP
.nf
\f[C]
debos\ [options]\ <recipe\ file\ in\ YAML>
debos\ [\-\-help]
\f[]
.fi
.PP
Application Options:
.IP
.nf
\f[C]
\ \ \ \ \ \ \-\-artifactdir=
\ \ \-t,\ \-\-template\-var=\ \ \ Template\ variables
\ \ \ \ \ \ \-\-debug\-shell\ \ \ \ \ Fall\ into\ interactive\ shell\ on\ error
\ \ \-s,\ \-\-shell=\ \ \ \ \ \ \ \ \ \ Redefine\ interactive\ shell\ binary\ (default:\ bash)
\ \ \ \ \ \ \-\-scratchsize=\ \ \ \ Size\ of\ disk\ backed\ scratch\ space
\ \ \-e,\ \-\-environ\-var=\ \ \ \ Environment\ variables
\f[]
.fi
.SH DESCRIPTION
.PP
debos is a tool to make the creation of various Debian\-based OS images
simpler.
While most other tools focus on specific use\-cases, debos is more meant
as a tool\-chain to make common actions trivial while providing enough
rope to do whatever tweaking that might be required behind the scene.
.PP
debos expects a YAML file as input and will run the actions listed in
the file sequentially.
These actions should be self\-contained and independent of each other.
.PP
Some of the actions provided by debos to customize and produce images
are:
.IP \[bu] 2
apt: install packages and their dependencies with `apt'
.IP \[bu] 2
debootstrap: construct the target rootfs with debootstrap
.IP \[bu] 2
download: download a single file from the internet
.IP \[bu] 2
filesystem\-deploy: deploy a root filesystem to an image previously
created
.IP \[bu] 2
image\-partition: create an image file, make partitions and format them
.IP \[bu] 2
ostree\-commit: create an OSTree commit from rootfs
.IP \[bu] 2
ostree\-deploy: deploy an OSTree branch to the image
.IP \[bu] 2
overlay: do a recursive copy of directories or files to the target
filesystem
.IP \[bu] 2
pack: create a tarball with the target filesystem
.IP \[bu] 2
raw: directly write a file to the output image at a given offset
.IP \[bu] 2
run: allows to run a command or script in the filesystem or in the host
.IP \[bu] 2
unpack: unpack files from archive in the filesystem
.PP
A full syntax description of all the debos actions can be found at:
https://godoc.org/github.com/go\-debos/debos/actions
.SH INSTALLATION (UNDER DEBIAN)
.IP
.nf
\f[C]
sudo\ apt\ install\ golang\ git\ libglib2.0\-dev\ libostree\-dev\ qemu\-system\-x86\ \\
\ \ \ \ \ qemu\-user\-static\ debootstrap\ systemd\-container
export\ GOPATH=/opt/src/gocode\ #\ or\ whatever\ suites\ your\ needs
go\ get\ \-u\ github.com/go\-debos/debos/cmd/debos
/opt/src/gocode/bin/debos\ \-\-help
\f[]
.fi
.SH SIMPLE EXAMPLE
.PP
The following example will create a arm64 image, install several
packages in it, change the file /etc/hostname to \[lq]debian\[rq] and
finally make a tarball.
.IP
.nf
\f[C]
{{\-\ $image\ :=\ or\ .image\ "debian.tgz"\ \-}}

architecture:\ arm64

actions:
\ \ \-\ action:\ debootstrap
\ \ \ \ suite:\ "buster"
\ \ \ \ components:
\ \ \ \ \ \ \-\ main
\ \ \ \ \ \ \-\ non\-free
\ \ \ \ mirror:\ https://deb.debian.org/debian
\ \ \ \ variant:\ minbase

\ \ \-\ action:\ apt
\ \ \ \ packages:\ [\ sudo,\ openssh\-server,\ adduser,\ systemd\-sysv,\ firmware\-linux\ ]

\ \ \-\ action:\ run
\ \ \ \ chroot:\ true
\ \ \ \ command:\ echo\ debian\ >\ /etc/hostname

\ \ \-\ action:\ pack
\ \ \ \ file:\ {{\ $image\ }}
\ \ \ \ compression:\ gz
\f[]
.fi
.PP
To run it, create a file named \f[C]example.yaml\f[] and run:
.IP
.nf
\f[C]
debos\ example.yaml
\f[]
.fi
.PP
The final tarball will be named \[lq]debian.tgz\[rq] if you would like
to modify this name, you can provided a different name for the variable
image like this:
.IP
.nf
\f[C]
debos\ \-t\ image:"debian\-arm64.tgz"\ example.yaml
\f[]
.fi
.SH OTHER EXAMPLES
.PP
This example builds a customized image for a Raspberry Pi 3.
https://github.com/go\-debos/debos\-recipes
.SH ENVIRONMENT VARIABLES
.PP
debos read a predefined list of environment variables from the host and
propagates it to fakemachine.
The set of environment variables is defined by environ_vars on
cmd/debos/debos.go.
Currently the list of environment variables includes the proxy
environment variables as documented at:
.PP
https://wiki.archlinux.org/index.php/proxy_settings
.PP
The list of environment variables currently exported to fakemachine is:
.IP
.nf
\f[C]
http_proxy,\ https_proxy,\ ftp_proxy,\ rsync_proxy,\ all_proxy,\ no_proxy
\f[]
.fi
.PP
While the elements of environ_vars are in lower case, for each element
both lower and upper case variants are probed on the host, and if found
propagated to fakemachine.
So if the host has the environment variables HTTP_PROXY and no_proxy
defined, both will be propagated to fakemachine respecting the case.
.PP
The command line options \[en]environ\-var and \-e can be used to
specify, overwrite, and unset environment variables for fakemachine with
the syntax:
.PP
$ debos \-e ENVIRONVAR:VALUE \&...
.PP
To unset an enviroment variable, or in other words, to prevent an
environment variable to be propagated to fakemachine, use the same
syntax without a value.
debos accept multiple \-e simultaneously.
.SH PROXY CONFIGURATION
.PP
While the proxy related environment variables are exported from the host
to fakemachine, there are two known sources of issues:
.IP \[bu] 2
Using localhost will not work from fakemachine.
Prefer using an address that is valid on your network.
debos will warn if environment variables contain localhost.
.IP \[bu] 2
In case you are running applications and/or scripts inside fakemachine
you may need to check which are the proxy environment variables they
use.
Different apps are known to use different environment variable names and
different case for environment variable names.
.SH SEE ALSO
.PP
fakemachine at https://github.com/go\-debos/fakemachine