Bug 1389775 - docs RFE: please document the INITRD_COMPRESS environment variable in the dracut manual
Summary: docs RFE: please document the INITRD_COMPRESS environment variable in the dra...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: dracut-maint-list
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-28 14:52 UTC by Laszlo Ersek
Modified: 2020-05-05 23:28 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-05-05 23:28:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.