Bug 1389775

Summary: docs RFE: please document the INITRD_COMPRESS environment variable in the dracut manual
Product: [Fedora] Fedora Reporter: Laszlo Ersek <lersek>
Component: dracutAssignee: dracut-maint-list
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dracut-maint-list, harald, jonathan, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-05 23:28:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Laszlo Ersek 2016-10-28 14:52:10 UTC
The INITRD_COMPRESS variable is an extremely useful knob; it allows users to control dracut's initrd compression method externally, even if dracut is executed by another program. (That is, in case when the user cannot pass the --compress=... option on the dracut command line directly.)

I tested INITRD_COMPRESS with various values, for example with

  INITRD_COMPRESS='pigz -1'

and it works flawlessly.

The documentation should advertize this feature. Please add an ENVIRONMENT section to the dracut(8) manual -- see for example the gzip(1) manual --, and explain what INITRD_COMPRESS does.

(

Background information: upstream kernel commit

    commit 1bf49dd4be0b000030c6f04c4a16a17d9affdbd3
    Author: P J P <ppandit>
    Date:   Tue Nov 12 15:11:44 2013 -0800

        ./Makefile: export initial ramdisk compression config option

and upstream dracut commit

    commit 871c8e40d1c7bb1bace48ce19ea1b956f7065458
    Author: P J P <ppandit>
    Date:   Fri Oct 11 19:26:51 2013 +0530

        Add lzo, lz4 compression and read INITRD_COMPRESS

were apparently meant to work together.

The kernel patch turned out to be incorrect, and it was practically reverted later, see:

    commit b7000adef17a5cce85636e40fa2c2d9851a89e28
    Author: Linus Torvalds <torvalds>
    Date:   Fri Dec 20 16:52:45 2013 -0800

        Don't set the INITRD_COMPRESS environment variable automatically

*However*, the INITRD_COMPRESS environment variable remains an extremely useful tool for the end-user, so it should be preserved (obviously!) and documented too.

)

One concrete use case for INITRD_COMPRESS is enhancing the upstream kernel bisection experience. On Fedora, dracut is very nicely integrated with the upstream kernel's

    make modules_install install

command. The person performing the bisection might want to control the compression of the initial RAM disk:

- if yum / dnf are configured to preserve many kernels, and the free space on /boot is limited, then it makes sense to spend more time on the compression (xz, bzip2), and generate smaller initrd files,

- if there's plenty of room on /boot, then it makes sense to shave off a few seconds in each iteration of the bisection (for example with INITRD_COMPRESS="pigz -1") at the cost of a few additional megabytes per initrd.

Thanks!

Comment 2 Laszlo Ersek 2016-11-02 18:00:07 UTC
Thanks!

Comment 3 Laszlo Ersek 2020-05-05 23:28:52 UTC
This is definitely fixed in at least Fedora 30, and probably much earlier.