Bug 1947871

Summary: crypto-policies-scripts uses Recommends for grubby
Product: Red Hat Enterprise Linux 9 Reporter: Jan Pazdziora (Red Hat) <jpazdziora>
Component: crypto-policiesAssignee: Alexander Sosedkin <asosedki>
Status: CLOSED ERRATA QA Contact: Ondrej Moriš <omoris>
Severity: low Docs Contact:
Priority: low    
Version: 9.0CC: jpazdziora, jwboyer, omoris, pvrabec
Target Milestone: betaKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: crypto-policies-20210628-1.gitdd7d273.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 15:54:31 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 (Red Hat) 2021-04-09 12:57:57 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 crypto-policies-scripts package Recommends grubby.

If that package is needed by crypto-policies-scripts for correct operation, Requires should be used.

If grubby essential in minimal host installations, it should be listed in the @core group in the comps file, not pulled in as a weak side-effect of having crypto-policies-scripts in @core.

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

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

crypto-policies-scripts-20210218-1.git2246c55.el9.noarch

How reproducible:

Deterministic.

Steps to Reproduce:
1. dnf remove -y grubby
2. dnf reinstall -y crypto-policies-scripts

Actual results:

================================================================================
 Package                 Arch   Version                     Repository     Size
================================================================================
Reinstalling:
 crypto-policies-scripts noarch 20210218-1.git2246c55.el9   beaker-BaseOS  67 k
Installing weak dependencies:
 grubby                  x86_64 8.40-51.el9                 beaker-BaseOS  37 k

Expected results:

Only crypto-policies-scripts reinstalled.

Additional info:

Comment 2 Alexander Sosedkin 2021-05-11 15:13:22 UTC
> If that package is needed by crypto-policies-scripts for correct operation, Requires should be used.

> If grubby essential in minimal host installations, it should be listed in the @core group in the comps file, not pulled in as a weak side-effect of having crypto-policies-scripts in @core.

> If it is listed primarily for convenience, Suggests might be better option. Or just drop the weak dependency completely.

IMO neither of these three apply 100%, can I just CLOSE WONTFIX this bug?

Comment 3 Jan Pazdziora (Red Hat) 2021-05-11 15:17:36 UTC
So what is the reason for that Recommends? Doesn't pulling in grubby make sense for example only when kernel is installed, so boolean dependencies would be more appropriate?

Comment 4 Alexander Sosedkin 2021-05-11 15:29:20 UTC
For reconfiguring the kernel cmdline as part of fips-mode-setup; not used outside of switching into FIPS mode.

Comment 5 Jan Pazdziora (Red Hat) 2021-05-14 13:19:00 UTC
So would

  Requires: (grubby if kernel)

be a more precise and descriptive representation of the intent?

Comment 6 Alexander Sosedkin 2021-05-14 13:35:10 UTC
No, most of the customers aren't FIPS-aware and crypto-policies has no need to depend on any bootloader configuration tools for switching policies other than FIPS.

Comment 7 Jan Pazdziora (Red Hat) 2021-05-14 13:43:52 UTC
So

   Recommends: (grubby if kernel)

?

Note that currently crypto-policies-scripts depends on grubby in most deployments because few admins disable weak dependencies. Yes, the admin can remove grubby (either from the installation transaction or ex-post) but it will get installed again during crypto-policies-scripts.

Making the dependency conditional on the package that the tooling is expected to manage seems very much what the boolean dependencies are for.

Josh, what is your opinion about boolean dependencies for situations like this?

Comment 8 Josh Boyer 2021-05-14 18:15:16 UTC
(In reply to Jan Pazdziora from comment #7)
> So
> 
>    Recommends: (grubby if kernel)
> 
> ?
> 
> Note that currently crypto-policies-scripts depends on grubby in most
> deployments because few admins disable weak dependencies. Yes, the admin can
> remove grubby (either from the installation transaction or ex-post) but it
> will get installed again during crypto-policies-scripts.
> 
> Making the dependency conditional on the package that the tooling is
> expected to manage seems very much what the boolean dependencies are for.
> 
> Josh, what is your opinion about boolean dependencies for situations like
> this?

The boolean seems to make sense to me.

Stepping back and looking at the overall scenario, grubby is going to be on 90% of systems anyway.

Comment 9 Alexander Sosedkin 2021-05-18 13:03:29 UTC
I'm OK with the `Recommends: (grubby if kernel)` suggestion; note that it keeps the Recommends though.

Comment 17 errata-xmlrpc 2022-05-17 15:54:31 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: crypto-policies), 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:3953