IMAGE-MINIMIZER(1)
π IMAGE-MINIMIZER π
okay bestie, so this is image-minimizer from the Lorax manual β section 1, the "you can run me" section. she's a utility script whose whole job is removing files and packages, and she is so good at it.
β¨ NAME β¨
image-minimizer β utility script to remove files and packages π
Authors
Brian C. Lane <bcl@redhat.com> π«Ά
image-minimizer is a script used as an interpreter for kickstart %post sections. basically: Anaconda just finished installing your system, and now this girl goes in and removes rpm packages and individual files off it. she's the cleanup crew. the after-party sweeper. iconic.
she processes a list of commands that tell her which files or rpms to remove⦠and which ones to keep. keeping is just as important as dropping, no cap.
π IMAGE-MINIMIZER CMDLINE ARGUMENTS π
usage: image-minimizer [-h] [-i STRING] [--dryrun] [-v] STRING
β Optional arguments
-h,--helpβ shows this help message and dips. literally just "what does this do" energy.-i STRING,--installroot STRINGβ the root path that gets prepended to all your file patterns, and the installation root for RPM operations. if you don't say anything, it defaults toINSTALL_ROOTor/mnt/sysimage/. so yeah, she needs to know where she's living.--dryrunβ if you set this, no filesystem changes are made. nothing. zero. it's giving window shopping ποΈ β you get to see the whole plan without anything actually moving.-v,--verboseβ displays every single action as it's performed. she'll narrate her own life for you, and honestly? we love a transparent queen. π
πΈ Positional arguments
STRINGβ filename to process.
π NOTES π
okay so listen. when you're using this from the kickstart%post, you cannot pass any arguments toimage-minimizer. at all. zero arguments. that's the rule, bestie. π
when you're using her from a kickstart, the image-minimizer package has to be available. she is not included on the standard boot.iso, so you're gonna need to include lorax in the %package section. fun part? you can then use image-minimizer to remove lorax from the install. she removes the very thing that brought her here. main character behavior, honestly. π₯
if you're using this with livemedia-creator, she can be installed on the host system instead, so that lorax isn't needed in the %package list β and in that case she doesn't need to be removed either. convenient. slay. β¨
π COMMANDS π
commands go one per line, followed by a space, and then the package, file, or glob. the globs are Unix style pathname patterns using *, ?, and [] character ranges. globbing is implemented using the python glob module β so, iykyk. π
drop <PATTERN>β this will remove files from the installation. bye bye π¦keep <PATTERN>β this will keep files, and it should follow anydropcommands including globs. it's the "no wait, not that one!!" move.droprpm <PATTERN>β remove matching rpm packages. dependencies are not removed, just the individual packages matching the glob. so be careful, fr fr.keeprpm <PATTERN>β do not remove matching rpm packages. it should follow anydroprpmcommands that include globs. protection detail. π‘οΈ
π EXAMPLE π
example Anaconda %post usage:
%post --interpreter=image-minimizer --nochroot
drop /lib/modules/*/kernel/fs
keep /lib/modules/*/kernel/fs/ext*
keep /lib/modules/*/kernel/fs/mbcache*
keep /lib/modules/*/kernel/fs/squashfs
droprpm make
droprpm mtools
droprpm mysql-libs
droprpm perl
droprpm perl-Pod-*
droprpm syslinux
keeprpm perl-Pod-Simple
# Not needed after image-minimizer is done
droprpm lorax
%end
likeβ¦ look at her. drop a whole directory, then keep exactly the pieces you want. that's a vibe check that passed. π
π§ AUTHOR π§
Weldr Team π
π COPYRIGHT π
2024, Red Hat, Inc.
okay that's the whole page, bestie!! π version 41.3, dated Aug 12, 2024 β mwah, love u, go minimize something responsibly. β¨π π«Ά
π¦ where this page comes from
- fedora 43: lorax 43.11-3.fc43 Β· GPL-2.0-or-later
- fedora 43: lorax 43.12-1.fc43 Β· GPL-2.0-or-later
- fedora 44: lorax 44.6-1.fc44 Β· GPL-2.0-or-later
- fedora 44: lorax 44.7-1.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms