1LORAX(1)                             Lorax                            LORAX(1)
2
3
4

NAME

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

LORAX CMDLINE ARGUMENTS

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]
38                       [--dracut-arg DRACUT_ARGS] [-V]
39                       OUTPUTDIR
40
41   Positional Arguments
42       Output directory
43
44   Named Arguments
45       V      show program's version number and exit
46
47   required arguments
48       p, --product
49              product name
50
51       v, --version
52              version identifier
53
54       r, --release
55              release information
56
57       s, --source
58              source repository (may be listed multiple times)
59
60              Default: []
61
62       -repo  source dnf repository file
63
64              Default: []
65
66   Named Arguments
67       m, --mirrorlist
68              mirrorlist repository (may be listed multiple times)
69
70              Default: []
71
72       t, --variant
73              variant name
74
75              Default: ""
76
77       b, --bugurl
78              bug reporting URL for the product
79
80              Default: "your distribution provided bug reporting tool"
81
82       -isfinal
83              Default: False
84
85       c, --config
86              config file
87
88              Default: "/etc/lorax/lorax.conf"
89
90       -proxy repo proxy url:port
91
92       i, --installpkgs
93              package  glob  to install before runtime-install.tmpl runs. (may
94              be listed multiple times)
95
96              Default: []
97
98       e, --excludepkgs
99              package glob to remove before runtime-install.tmpl runs. (may be
100              listed multiple times)
101
102              Default: []
103
104       -buildarch
105              build architecture
106
107       -volid volume id
108
109       -macboot
110              Default: True
111
112       -nomacboot
113              Default: True
114
115       -noupgrade
116              Default: True
117
118       -logfile
119              Path to logfile
120
121              Default: ./lorax.log
122
123       -tmp   Top level temporary directory
124
125              Default: "/var/tmp"
126
127       -cachedir
128              DNF cache directory. Default is a temporary dir.
129
130       -workdir
131              Work  directory,  overrides  --tmp.  Default  is a temporary dir
132              under /var/tmp
133
134       -force Run even when the destination directory exists
135
136              Default: False
137
138       -add-template
139              Additional template for runtime image
140
141              Default: []
142
143       -add-template-var
144              Set variable for runtime image template
145
146              Default: []
147
148       -add-arch-template
149              Additional template for architecture-specific image
150
151              Default: []
152
153       -add-arch-template-var
154              Set variable for architecture-specific image
155
156              Default: []
157
158       -noverify
159              Do not verify the install root
160
161              Default: True
162
163       -sharedir
164              Directory containing all the templates.  Overrides  config  file
165              sharedir
166
167       -enablerepo
168              Names of repos to enable
169
170              Default: []
171
172       -disablerepo
173              Names of repos to disable
174
175              Default: []
176
177       -rootfs-size
178              Size of root filesystem in GiB. Defaults to 2.
179
180              Default: 2
181
182       -noverifyssl
183              Do not verify SSL certificates
184
185              Default: False
186
187       -dnfplugin
188              Enable a DNF plugin by name/glob, or * to enable all of them.
189
190              Default: []
191
192   dracut arguments
193       -dracut-arg
194              Argument  to  pass to dracut when rebuilding the initramfs. Pass
195              this once for each argument. NOTE: this overrides  the  default.
196              (default: )
197

QUICKSTART

199       Run this as root to create a boot.iso in ./results/:
200
201          dnf install lorax
202          setenforce 0
203          lorax -p Fedora -v 23 -r 23 \
204          -s http://dl.fedoraproject.org/pub/fedora/linux/releases/23/Everything/x86_64/os/ \
205          -s http://dl.fedoraproject.org/pub/fedora/linux/updates/23/x86_64/ \
206          ./results/
207          setenforce 1
208
209       You  can  add your own repos with -s and packages with higher NVRs will
210       override the ones in the distribution repositories.
211
212       Under ./results/ will be the release tree files: .discinfo,  .treeinfo,
213       everything  that goes onto the boot.iso, the pxeboot directory, and the
214       boot.iso under ./images/.
215

RUNNING INSIDE OF MOCK

217       If you are using lorax with mock v1.3.4 or later you will need to  pass
218       --old-chroot  to  mock. Mock now defaults to using systemd-nspawn which
219       cannot create the needed loop device nodes. Passing  --old-chroot  will
220       use the old system where /dev/loop* is setup for you.
221

HOW IT WORKS

223       Lorax  uses dnf to install packages into a temporary directory, sets up
224       configuration files, it then removes unneeded files to save space,  and
225       creates  a  squashfs  filesystem  of  the files.  The iso is then built
226       using a generic initramfs and the kernel from  the  selected  reposito‐
227       ries.
228
229       To  drive these processes Lorax uses a custom template system, based on
230       Mako templates with the addition  of  custom  commands  (documented  in
231       pylorax.ltmpl.LoraxTemplateRunner).  Mako supports %if/%endif blocks as
232       well as free-form python code inside <% %> tags and variable  substitu‐
233       tion  with  ${}.  The  default  templates  are  shipped  with  lorax in
234       /usr/share/lorax/templates.d/99-generic/ and use the .tmpl extension.
235
236   runtime-install.tmpl
237       The runtime-install.tmpl template lists packages to be installed  using
238       the  installpkg  command.   This  template is fairly simple, installing
239       common packages and architecture specific packages. It  must  end  with
240       the run_pkg_transaction command which tells dnf to download and install
241       the packages.
242
243   runtime-postinstall.tmpl
244       The runtime-postinstall.tmpl template is where the system configuration
245       happens.  The installer environment is similar to a normal running sys‐
246       tem, but needs some special handling. Configuration  files  are  setup,
247       systemd  is told to start the anaconda.target instead of a default sys‐
248       tem target, and a number of unneeded services  are  disabled,  some  of
249       which  can  interfere  with the installation. A number of template com‐
250       mands are used here:
251
252       · append to add text to a file.
253
254       · chmod changes the file's mode.
255
256       · install to install a file into the installroot.
257
258       · mkdir makes a new directory.
259
260       · move to move a file into the installroot
261
262       · replace does text substitution in a file
263
264       · remove deletes a file
265
266       · runcmd run arbitrary commands.
267
268       · symlink creates a symlink
269
270       · systemctl runs systemctl in the installroot
271
272   runtime-cleanup.tmpl
273       The runtime-cleanup.tmpl template is used to remove files  that  aren't
274       strictly  needed  by  the  installation environment. In addition to the
275       remove template command it uses:
276
277       · removepkg remove all of a specific package's contents. A package  may
278         be pulled in as a dependency, but not really used. eg. sound support.
279
280       · removefrom  Removes  some  files  from  a package. A file glob can be
281         used, or the --allbut option to remove  everything  except  a  select
282         few.
283
284       · removekmod Removes kernel modules
285
286   The squashfs filesystem
287       After  runtime-*.tmpl  templates have finished their work lorax creates
288       an empty ext4 filesystem, copies the remaining files to it, and makes a
289       squashfs  filesystem  of  it.  This file is the / of the boot.iso's in‐
290       staller environment and is what is in the LiveOS/squashfs.img  file  on
291       the iso.
292
293   iso creation
294       The  iso  creation is handled by another set of templates. The one used
295       depends on the architecture that the iso is being created for. They are
296       also  stored  in  /usr/share/lorax/templates.d/99-generic and are named
297       after the arch, like x86.tmpl and aarch64.tmpl. They handle creation of
298       the  tree, copying configuration template files, configuration variable
299       substitution, treeinfo metadata (via the  treeinfo  template  command).
300       Kernel  and initrd are copied from the installroot to their final loca‐
301       tions and then mkisofs is run to create the boot.iso
302

CUSTOM TEMPLATES

304       The  default  set  of  templates  and  configuration  files  from   the
305       lorax-generic-templates      package     are     shipped     in     the
306       /usr/share/lorax/templates.d/99-generic/ directory. You can make a copy
307       of  them  and  place  them into another directory under templates.d and
308       they will be used instead if their sort order is below all other direc‐
309       tories.  This  allows multiple packages to ship lorax templates without
310       conflict. You can (and probably should) select  the  specific  template
311       directory by passing --sharedir to lorax.
312

AUTHOR

314       Weldr Team
315
317       2018, Red Hat, Inc.
318
319
320
321
32229.21                            Nov 29, 2018                         LORAX(1)
Impressum