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

QUICKSTART

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

RUNNING INSIDE OF MOCK

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

HOW IT WORKS

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

CUSTOM TEMPLATES

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

AUTHOR

308       Weldr Team
309
311       2018, Red Hat, Inc.
312
313
314
315
31628.14.21                         Jan 09, 2019                         LORAX(1)
Impressum