1LORAX(1) Lorax LORAX(1)
2
3
4
6 lorax - Lorax Documentation
7
8 Authors
9 Brian C. Lane <bcl@redhat.com>
10
11 "I am the Lorax. I speak for the trees [and images]."
12
13 The lorax tool is used to create the Anaconda installer boot.iso as
14 well as the basic release tree, and .treeinfo metadata file. Its depen‐
15 dencies are fairly light-weight because it needs to be able to run in a
16 mock chroot environment. It is best to run lorax from the same release
17 as is being targeted because the templates may have release specific
18 logic in them. eg. Use the rawhide version to build the boot.iso for
19 rawhide, along with the rawhide repositories.
20
22 Create the Anaconda boot.iso
23
24
25 usage: lorax [-h] -p PRODUCT -v VERSION -r RELEASE [-s REPOSITORY]
26 [--repo REPOSITORY] [-m REPOSITORY] [-t VARIANT] [-b URL]
27 [--isfinal] [-c CONFIGFILE] [--proxy HOST] [-i PACKAGE]
28 [-e PACKAGE] [--buildarch ARCH] [--volid VOLID] [--macboot]
29 [--nomacboot] [--noupgrade] [--logfile LOGFILE] [--tmp TMP]
30 [--cachedir CACHEDIR] [--workdir WORKDIR] [--force]
31 [--add-template ADD_TEMPLATES]
32 [--add-template-var ADD_TEMPLATE_VARS]
33 [--add-arch-template ADD_ARCH_TEMPLATES]
34 [--add-arch-template-var ADD_ARCH_TEMPLATE_VARS] [--noverify]
35 [--sharedir SHAREDIR] [--enablerepo [repo]]
36 [--disablerepo [repo]] [--rootfs-size ROOTFS_SIZE]
37 [--noverifyssl] [--dnfplugin DNFPLUGINS] [--squashfs-only]
38 [--skip-branding] [--dracut-conf DRACUT_CONF]
39 [--dracut-arg DRACUT_ARGS] [-V]
40 OUTPUTDIR
41
42 Positional Arguments
43 Output directory
44
45 Named Arguments
46 V show program's version number and exit
47
48 required arguments
49 p, --product
50 product name
51
52 v, --version
53 version identifier
54
55 r, --release
56 release information
57
58 s, --source
59 source repository (may be listed multiple times)
60
61 Default: []
62
63 -repo source dnf repository file
64
65 Default: []
66
67 Named Arguments
68 m, --mirrorlist
69 mirrorlist repository (may be listed multiple times)
70
71 Default: []
72
73 t, --variant
74 variant name
75
76 Default: ""
77
78 b, --bugurl
79 bug reporting URL for the product
80
81 Default: "your distribution provided bug reporting tool"
82
83 -isfinal
84 Default: False
85
86 c, --config
87 config file
88
89 Default: "/etc/lorax/lorax.conf"
90
91 -proxy repo proxy url:port
92
93 i, --installpkgs
94 package glob to install before runtime-install.tmpl runs. (may
95 be listed multiple times)
96
97 Default: []
98
99 e, --excludepkgs
100 package glob to remove before runtime-install.tmpl runs. (may be
101 listed multiple times)
102
103 Default: []
104
105 -buildarch
106 build architecture
107
108 -volid volume id
109
110 -macboot
111 Make the iso bootable on UEFI based Mac systems
112
113 Default: True
114
115 -nomacboot
116 Do not create a Mac bootable iso
117
118 Default: False
119
120 -noupgrade
121 Default: True
122
123 -logfile
124 Path to logfile
125
126 Default: ./lorax.log
127
128 -tmp Top level temporary directory
129
130 Default: "/var/tmp/lorax"
131
132 -cachedir
133 DNF cache directory. Default is a temporary dir.
134
135 -workdir
136 Work directory, overrides --tmp. Default is a temporary dir
137 under /var/tmp/lorax
138
139 -force Run even when the destination directory exists
140
141 Default: False
142
143 -add-template
144 Additional template for runtime image
145
146 Default: []
147
148 -add-template-var
149 Set variable for runtime image template
150
151 Default: []
152
153 -add-arch-template
154 Additional template for architecture-specific image
155
156 Default: []
157
158 -add-arch-template-var
159 Set variable for architecture-specific image
160
161 Default: []
162
163 -noverify
164 Do not verify the install root
165
166 Default: True
167
168 -sharedir
169 Directory containing all the templates. Overrides config file
170 sharedir
171
172 -enablerepo
173 Names of repos to enable
174
175 Default: []
176
177 -disablerepo
178 Names of repos to disable
179
180 Default: []
181
182 -rootfs-size
183 Size of root filesystem in GiB. Defaults to 2.
184
185 Default: 2
186
187 -noverifyssl
188 Do not verify SSL certificates
189
190 Default: False
191
192 -dnfplugin
193 Enable a DNF plugin by name/glob, or * to enable all of them.
194
195 Default: []
196
197 -squashfs-only
198 Use a plain squashfs filesystem for the runtime.
199
200 Default: False
201
202 -skip-branding
203 Disable automatic branding package selection. Use --installpkgs
204 to add custom branding.
205
206 Default: False
207
208 dracut arguments: (default: )
209 -dracut-conf
210 Path to a dracut.conf file to use instead of the default argu‐
211 ments. See the dracut.conf(5) manpage.
212
213 -dracut-arg
214 Argument to pass to dracut when rebuilding the initramfs. Pass
215 this once for each argument. NOTE: this overrides the defaults.
216
218 Run this as root to create a boot.iso in ./results/:
219
220 dnf install lorax
221 setenforce 0
222 lorax -p Fedora -v 23 -r 23 \
223 -s http://dl.fedoraproject.org/pub/fedora/linux/releases/23/Everything/x86_64/os/ \
224 -s http://dl.fedoraproject.org/pub/fedora/linux/updates/23/x86_64/ \
225 ./results/
226 setenforce 1
227
228 You can add your own repos with -s and packages with higher NVRs will
229 override the ones in the distribution repositories.
230
231 Under ./results/ will be the release tree files: .discinfo, .treeinfo,
232 everything that goes onto the boot.iso, the pxeboot directory, and the
233 boot.iso under ./images/.
234
236 By default lorax will search for the first package that provides sys‐
237 tem-release that doesn't start with generic- and will install it. It
238 then selects a corresponding logo package by using the first part of
239 the system-release package and appending -logos to it. eg.
240 fedora-release and fedora-logos.
241
242 Variants
243 If a variant is passed to lorax it will select a system-release package
244 that ends with the variant name. eg. Passing --variant workstation will
245 select the fedora-release-workstation package if it exists. It will
246 select a logo package the same way it does for non-variants. eg.
247 fedora-logos.
248
249 If there is no package ending with the variant name it will fall back
250 to using the first non-generic package providing system-release.
251
252 Custom Branding
253 If --skip-branding is passed to lorax it will skip selecting the sys‐
254 tem-release, and logos packages and leave it up to the user to pass any
255 branding related packages to lorax using --installpkgs. When using
256 skip-branding you must make sure that you provide all of the expected
257 files, otherwise Anaconda may not work as expected. See the contents of
258 fedora-release and fedora-logos for examples of what to include.
259
260 Note that this does not prevent something else in the dependency tree
261 from causing these packages to be included. Using --excludepkgs may
262 help if they are unexpectedly included.
263
265 As of mock version 2.0 you no longer need to pass --old-chroot. You
266 will, however, need to pass --enable-network so that the mock container
267 can download packages.
268
269 Older versions of mock, between 1.3.4 and 2.0, will need to pass
270 --old-chroot to mock. These versions of mock default to using sys‐
271 temd-nspawn which cannot create the needed loop device nodes. Passing
272 --old-chroot will use the old system where /dev/loop* is setup for you.
273
275 Lorax uses dnf to install packages into a temporary directory, sets up
276 configuration files, it then removes unneeded files to save space, and
277 creates a squashfs filesystem of the files. The iso is then built
278 using a generic initramfs and the kernel from the selected reposito‐
279 ries.
280
281 To drive these processes Lorax uses a custom template system, based on
282 Mako templates with the addition of custom commands (documented in
283 pylorax.ltmpl.LoraxTemplateRunner). Mako supports %if/%endif blocks as
284 well as free-form python code inside <% %> tags and variable substitu‐
285 tion with ${}. The default templates are shipped with lorax in
286 /usr/share/lorax/templates.d/99-generic/ and use the .tmpl extension.
287
288 runtime-install.tmpl
289 The runtime-install.tmpl template lists packages to be installed using
290 the installpkg command. This template is fairly simple, installing
291 common packages and architecture specific packages. It must end with
292 the run_pkg_transaction command which tells dnf to download and install
293 the packages.
294
295 runtime-postinstall.tmpl
296 The runtime-postinstall.tmpl template is where the system configuration
297 happens. The installer environment is similar to a normal running sys‐
298 tem, but needs some special handling. Configuration files are setup,
299 systemd is told to start the anaconda.target instead of a default sys‐
300 tem target, and a number of unneeded services are disabled, some of
301 which can interfere with the installation. A number of template com‐
302 mands are used here:
303
304 · append to add text to a file.
305
306 · chmod changes the file's mode.
307
308 · install to install a file into the installroot.
309
310 · mkdir makes a new directory.
311
312 · move to move a file into the installroot
313
314 · replace does text substitution in a file
315
316 · remove deletes a file
317
318 · runcmd run arbitrary commands.
319
320 · symlink creates a symlink
321
322 · systemctl runs systemctl in the installroot
323
324 runtime-cleanup.tmpl
325 The runtime-cleanup.tmpl template is used to remove files that aren't
326 strictly needed by the installation environment. In addition to the
327 remove template command it uses:
328
329 · removepkg remove all of a specific package's contents. A package may
330 be pulled in as a dependency, but not really used. eg. sound support.
331
332 · removefrom Removes some files from a package. A file glob can be
333 used, or the --allbut option to remove everything except a select
334 few.
335
336 · removekmod Removes kernel modules
337
338 The squashfs filesystem
339 After runtime-*.tmpl templates have finished their work lorax creates
340 an empty ext4 filesystem, copies the remaining files to it, and makes a
341 squashfs filesystem of it. This file is the / of the boot.iso's in‐
342 staller environment and is what is in the LiveOS/squashfs.img file on
343 the iso.
344
345 iso creation
346 The iso creation is handled by another set of templates. The one used
347 depends on the architecture that the iso is being created for. They are
348 also stored in /usr/share/lorax/templates.d/99-generic and are named
349 after the arch, like x86.tmpl and aarch64.tmpl. They handle creation of
350 the tree, copying configuration template files, configuration variable
351 substitution, treeinfo metadata (via the treeinfo template command).
352 Kernel and initrd are copied from the installroot to their final loca‐
353 tions and then xorrisofs is run to create the boot.iso
354
356 The default set of templates and configuration files from the
357 lorax-generic-templates package are shipped in the
358 /usr/share/lorax/templates.d/99-generic/ directory. You can make a copy
359 of them and place them into another directory under templates.d and
360 they will be used instead if their sort order is below all other direc‐
361 tories. This allows multiple packages to ship lorax templates without
362 conflict. You can (and probably should) select the specific template
363 directory by passing --sharedir to lorax.
364
366 Weldr Team
367
369 2018, Red Hat, Inc.
370
371
372
373
37433.2 Apr 28, 2020 LORAX(1)