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