Bug 1947892

Summary: dracut uses Recommends for hardlink, kpartx, memstrack, and pigz
Product: Red Hat Enterprise Linux 9 Reporter: Jan Pazdziora <jpazdziora>
Component: dracutAssignee: Pavel Valena <pvalena>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: dracut-maint-list, dtardon, fsumsal, pvalena, veichler
Target Milestone: betaKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dracut-055-30.git20220216.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 16:04:12 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 Jan Pazdziora 2021-04-09 13:34:50 UTC
Description of problem:

RHEL 9 Content Structure and Guidelines state that weak dependencies in BaseOS are allowed, but discouraged.

By using the Recommends weak dependencies especially for packages in @core group (Minimal host installation) or their direct dependencies, the recommended package gets pulled into the installed package set depending on the current configuration of the dnf transaction.

The dracut package Recommends hardlink, kpartx, memstrack, and pigz.

If those packages are needed by dracut for correct operation, Requires should be used.

If hardlink, kpartx, memstrack, and pigz are essential in minimal host installations, they should be listed in the @core group in the comps file, not pulled in as a weak side-effect of having dracut in @core. Note that util-linux (which provides hardlink) is listed in @core already.

If they are listed primarily for convenience, Suggests might be better option. Or just drop the weak dependency completely.

Currently, memstrack is not even available in RHEL 9 composes.

The dracut package itself is installed on minimal host installations via kexec-tools dependency.

Version-Release number of selected component (if applicable):

dracut-051-1.el9.1.x86_64

How reproducible:

Deterministic.

Steps to Reproduce:
1. dnf remove -y kpartx pigz
2. dnf reinstall -y dracut

Actual results:

================================================================================
 Package       Architecture  Version              Repository               Size
================================================================================
Reinstalling:
 dracut        x86_64        051-1.el9.1          beaker-BaseOS           326 k
Installing weak dependencies:
 kpartx        x86_64        0.8.5-4.el9          beaker-BaseOS            50 k
 pigz          x86_64        2.5-1.el9            beaker-AppStream         83 k

Expected results:

Only dracut reinstalled.

Additional info:

Comment 2 David Tardon 2021-07-27 14:27:59 UTC
hardlink is used by default during image creation -> Requires

pigz is used by default during image creation, with fallback to gzip -> either change to Requires or replace with Requires: gzip; I don't have a firm opinion about this one

memstrack is needed by optional--and quite obscure--module memstrack -> drop

kpartx is needed by modules dmraid and multipath, which are pretty important -> Requires

Comment 3 Pavel Valena 2022-02-16 01:38:53 UTC
(In reply to David Tardon from comment #2)
> hardlink is used by default during image creation -> Requires

I've found hardlink only in dracut.sh:
’’’
2098     hardlink "$initdir" 2>&1 | dinfo
’’’
This is done by defaut, so I agree.

> 
> pigz is used by default during image creation, with fallback to gzip ->
> either change to Requires or replace with Requires: gzip; I don't have a
> firm opinion about this one

I agree, as I don't see why pigz wouldn't be available, we can assume it's a good default; and set it as such (we can do some conditional requires in case someone would prefer gzip instead; if there are such requests). 

> 
> memstrack is needed by optional--and quite obscure--module memstrack -> drop

I think this is what Suggests is for.

> 
> kpartx is needed by modules dmraid and multipath, which are pretty important
> -> Requires

Yes, this would fail otherwise. Unless we want to thread them as recommends (for any reason), these are Required. 

I'll create a PR. Let me know if you want some adjustments made.

Comment 4 Pavel Valena 2022-02-16 02:11:18 UTC
Prepared: https://github.com/redhat-plumbers/dracut-rhel9/pull/32

Comment 9 Vojtech Eichler 2022-02-24 17:58:14 UTC
Moving to VERIFIED based on manual testing.

Comment 11 errata-xmlrpc 2022-05-17 16:04:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: dracut), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:4070