1IMAGE-MINIMIZER(1)                   Lorax                  IMAGE-MINIMIZER(1)
2
3
4

NAME

6       image-minimizer - Utility script to remove files and packages
7
8       Authors
9              Brian C. Lane <bcl@redhat.com>
10
11       image-minimizer  is a script used as an interpreter for kickstart %post
12       sections. It is used to remove rpm packages and individual  files  from
13       the system that Anaconda has just installed.
14
15       It processes a list of commands that tell it which files or rpms to re‐
16       move, and which to keep.
17

IMAGE-MINIMIZER CMDLINE ARGUMENTS

19          usage: image-minimizer [-h] [-i STRING] [--dryrun] [-v] STRING
20
21   Optional arguments
22          -h, --help
23                 show this help message and exit
24
25          -i STRING, --installroot STRING
26                 Root path to prepend to all file  patterns  and  installation
27                 root   for   RPM  operations.  Defaults  to  INSTALL_ROOT  or
28                 /mnt/sysimage/
29
30          --dryrun
31                 If set, no filesystem changes are made.
32
33          -v, --verbose
34                 Display every action as it is performed.
35
36   Positional arguments
37          STRING Filename to process
38

NOTES

40       You cannot pass any arguments to image-minimizer when using it from the
41       kickstart %post.
42
43       When  using  this from a kickstart the image-minimizer package needs to
44       be available.  It is not included on the standard boot.iso, so you will
45       need  to include lorax in the %package section. You can use image-mini‐
46       mizer to remove lorax from the install.
47
48       If you are using this with livemedia-creator it can be installed on the
49       host  system  so  that  lorax isn't needed in the %package list, and it
50       doesn't need to be removed.
51

COMMANDS

53       Commands are listed one per line, followed by a space, and then by  the
54       package,  file,  or  glob.  The globs used are Unix style pathname pat‐
55       terns using *, ?, and [] character ranges. globbing is implemented  us‐
56       ing the python glob module.
57
58       • drop <PATTERN> This will remove files from the installation.
59
60       • keep  <PATTERN> This will keep files, and should follow any drop com‐
61         mands including globs.
62
63       • droprpm <PATTERN> Remove matching rpm packages. Dependencies are  not
64         remove, just individual packages matching the glob.
65
66       • keeprpm <PATTERN> Do not remove matching rpm packages, it should fol‐
67         low any droprpm commands that include globs.
68

EXAMPLE

70       Example Anaconda %post usage:
71
72          %post --interpreter=image-minimizer --nochroot
73
74          drop /lib/modules/*/kernel/fs
75          keep /lib/modules/*/kernel/fs/ext*
76          keep /lib/modules/*/kernel/fs/mbcache*
77          keep /lib/modules/*/kernel/fs/squashfs
78
79          droprpm make
80          droprpm mtools
81          droprpm mysql-libs
82          droprpm perl
83          droprpm perl-Pod-*
84          droprpm syslinux
85          keeprpm perl-Pod-Simple
86
87          # Not needed after image-minimizer is done
88          droprpm lorax
89
90          %end
91

AUTHOR

93       Weldr Team
94
96       2018, Red Hat, Inc.
97
98
99
100
10137.1                             May 11, 2022               IMAGE-MINIMIZER(1)
Impressum