Bug 2370919 - Review request: dnf-plugin-protected-kmods - DNF 3/4 plugin that prevents new kernels from being updated if a protected kmod won't work with it.
Summary: Review request: dnf-plugin-protected-kmods - DNF 3/4 plugin that prevents new...
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jonathan Wright
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-06-07 07:30 UTC by Jonathan Dieter
Modified: 2025-06-22 16:50 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:
jonathan: fedora-review?


Attachments (Terms of Use)

Description Jonathan Dieter 2025-06-07 07:30:59 UTC
Spec URL: https://www.jdieter.net/downloads/dnf-plugin-protected-kmods.spec
SRPM URL: https://www.jdieter.net/downloads/dnf-plugin-protected-kmods-0.9.2-1.fc42.src.rpm
Description: DNF 3/4 plugin that prevents new kernels from being updated if a protected kmod won't work with it.
Fedora Account System Username: jdieter

Comment 1 Fedora Review Service 2025-06-07 08:53:51 UTC
The ticket summary is not in the correct format.
Expected:

    Review Request: <main package name here> - <short summary here>

Found:

    Review request: dnf-plugin-protected-kmods - DNF 3/4 plugin that prevents new kernels from being updated if a protected kmod won't work with it.

As a consequence, the package name cannot be parsed and submitted to
be automatically build. Please modify the ticket summary and trigger a
build by typing [fedora-review-service-build].


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 2 Jonathan Wright 2025-06-07 09:07:59 UTC
Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed



===== MUST items =====

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[!]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "*No copyright* Apache License 2.0",
     "*No copyright* MIT License". 19 files have unknown license. Detailed
     output of licensecheck in /home/jonathan/fedora-review/2370919-dnf-
     plugin-protected-kmods/licensecheck.txt
[x]: Package must own all directories that it creates.
     Note: Directories without known owners: /etc/dnf/plugins, /etc/dnf
[!]: Package does not own files or directories owned by other packages.
     Note: Dirs in package are owned also by: /usr/lib/python3.13/site-
     packages/dnf-plugins/__pycache__(dnf-plugin-diff, subscription-
     manager, python3-dnf, python3-dnf-plugins-extras-common)
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[-]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[x]: Package contains systemd file(s) if in need.
[x]: Package is not known to require an ExcludeArch tag.
[x]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: The License field must be a valid SPDX expression.
[x]: Package requires other packages for directories it uses.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package must not depend on deprecated() packages.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 3387 bytes in 1 files.
[x]: Packages must not store files under /srv, /opt or /usr/local

Python:
[-]: Python eggs must not download any dependencies during the build
     process.
[-]: A package which is used by another package via an egg interface should
     provide egg info.
[-]: Package meets the Packaging Guidelines::Python
[x]: Package contains BR: python2-devel or python3-devel
[x]: Packages MUST NOT have dependencies (either build-time or runtime) on
     packages named with the unversioned python- prefix unless no properly
     versioned package exists. Dependencies on Python packages instead MUST
     use names beginning with python2- or python3- as appropriate.
[x]: Python packages must not contain %{pythonX_site(lib|arch)}/* in %files
[x]: Binary eggs must be removed in %prep

===== SHOULD items =====

Generic:
[!]: Sources can be downloaded from URI in Source: tag
     Note: Could not download Source0: https://github.com/ctrliq/dnf-
     plugin-protected-kmods/releases/download/v0.9.2/dnf-plugin-protected-
     kmods-0.9.2.tar.gz
     See: https://docs.fedoraproject.org/en-US/packaging-
     guidelines/SourceURL/
[-]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[x]: Final provides and requires are sane (see attachments).
[?]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[-]: SourceX tarball generation or download is documented.
     Note: Package contains tarball without URL, check comments
[-]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[-]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: dnf-plugin-protected-kmods-0.9.2-1.fc43.noarch.rpm
          dnf-plugin-protected-kmods-0.9.2-1.fc43.src.rpm
============================ rpmlint session starts ============================
rpmlint: 2.7.0
configuration:
    /usr/lib/python3.13/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
rpmlintrc: [PosixPath('/tmp/tmpsvnw526g')]
checks: 32, packages: 2

dnf-plugin-protected-kmods.noarch: E: spelling-error ('precompiled', '%description -l en_US precompiled -> recompiled, recompile, compiled')
dnf-plugin-protected-kmods.src: E: spelling-error ('precompiled', '%description -l en_US precompiled -> recompiled, recompile, compiled')
dnf-plugin-protected-kmods.noarch: W: self-obsoletion dnf-plugin-kmod-kernel <= 0.9.2-1.fc43 obsoletes dnf-plugin-kmod-kernel = 0.9.2-1.fc43
dnf-plugin-protected-kmods.spec: W: no-%check-section
 2 packages and 0 specfiles checked; 2 errors, 2 warnings, 7 filtered, 2 badness; has taken 0.1 s 




Rpmlint (installed packages)
----------------------------
============================ rpmlint session starts ============================
rpmlint: 2.7.0
configuration:
    /usr/lib/python3.13/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
checks: 32, packages: 1

dnf-plugin-protected-kmods.noarch: E: spelling-error ('precompiled', '%description -l en_US precompiled -> recompiled, p recompiled, recompile')
dnf-plugin-protected-kmods.noarch: W: self-obsoletion dnf-plugin-kmod-kernel <= 0.9.2-1.fc43 obsoletes dnf-plugin-kmod-kernel = 0.9.2-1.fc43
 1 packages and 0 specfiles checked; 1 errors, 1 warnings, 3 filtered, 1 badness; has taken 0.0 s 



Requires
--------
dnf-plugin-protected-kmods (rpmlib, GLIBC filtered):
    python(abi)
    python3-dnf



Provides
--------
dnf-plugin-protected-kmods:
    dnf-plugin-kmod-kernel
    dnf-plugin-protected-kmods



Generated by fedora-review 0.10.0 (e79b66b) last change: 2023-07-24
Command line :/usr/bin/fedora-review -b 2370919
Buildroot used: fedora-rawhide-x86_64
Active plugins: Generic, Shell-api, Python
Disabled plugins: SugarActivity, R, fonts, Ocaml, Java, C/C++, Perl, Haskell, PHP
Disabled flags: EXARCH, EPEL6, EPEL7, DISTTAG, BATCH

---

1) The license field in the spec file is "MIT" while the GitHub repo/LICENSE file reflect Apache-2.0.  Which is it?

2) Source0 URL is incorrect and should use the %{url} macro since it's just building on it.

- Source0:    https://github.com/ctrliq/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz
+ Source0:    %{url}/releases/archive/v%{version}/%{name}-%{version}.tar.gz

3) More specifically declare directory in %files

- %{_sysconfdir}/dnf/plugins/protected-kmods.d/
+ %dir %{_sysconfdir}/dnf/plugins/protected-kmods.d/

This is better and more explicit in case the build places files unexpectedly in this directory, it would fail with an rpmbuild error.

4) The output package name should be the standard python3-dnf-plugin-protected-kmods and then 'Provides' the simpler name for people to install.  This is how all other dnf plugin packages are handled.

5) Use more explicit paths in %files

- %{python3_sitelib}/dnf-plugins/*
+ %{python3_sitelib}/dnf-plugins/protected_kmods.py

https://docs.fedoraproject.org/en-US/packaging-guidelines/#_explicit_lists

This will resolve some other issues with it globbing directories that it shouldn't be cited above in the automated review.

6) We don't have explicit guidelines for dnf4 packages so after consultation with a few FPC members I looked to dnf-plugins-core for inspiration in areas that weren't covered by general packaging guidelines.

Comment 3 Jonathan Dieter 2025-06-07 09:35:40 UTC
(In reply to Jonathan Wright from comment #2)
> Package Review
> ...
> 1) The license field in the spec file is "MIT" while the GitHub repo/LICENSE
> file reflect Apache-2.0.  Which is it?

This is just embarrassing.  It's Apache-2.0.  Thanks for catching this!

> 2) Source0 URL is incorrect and should use the %{url} macro since it's just
> building on it.
> 
> - Source0:   
> https://github.com/ctrliq/%{name}/releases/download/v%{version}/%{name}-
> %{version}.tar.gz
> + Source0:    %{url}/releases/archive/v%{version}/%{name}-%{version}.tar.gz

Fixed
 
> 3) More specifically declare directory in %files
> 
> - %{_sysconfdir}/dnf/plugins/protected-kmods.d/
> + %dir %{_sysconfdir}/dnf/plugins/protected-kmods.d/
> 
> This is better and more explicit in case the build places files unexpectedly
> in this directory, it would fail with an rpmbuild error.

Done

> 4) The output package name should be the standard
> python3-dnf-plugin-protected-kmods and then 'Provides' the simpler name for
> people to install.  This is how all other dnf plugin packages are handled.

Done.  I've also obsoleted the older name < %{version}-%{release} since we do have it out in the wild (outside Fedora/EPEL)

> 5) Use more explicit paths in %files
> 
> - %{python3_sitelib}/dnf-plugins/*
> + %{python3_sitelib}/dnf-plugins/protected_kmods.py
> 
> https://docs.fedoraproject.org/en-US/packaging-guidelines/#_explicit_lists
> 
> This will resolve some other issues with it globbing directories that it
> shouldn't be cited above in the automated review.

I've fixed this, though I also had to bring in the pyc files for this plugin in
__pycache__

> 6) We don't have explicit guidelines for dnf4 packages so after consultation
> with a few FPC members I looked to dnf-plugins-core for inspiration in areas
> that weren't covered by general packaging guidelines.

Thanks again for reviewing this!

New links in the next comment.

Comment 4 Jonathan Dieter 2025-06-07 09:36:34 UTC
Spec URL: https://www.jdieter.net/downloads/python3-dnf-plugin-protected-kmods.spec
SRPM URL: https://www.jdieter.net/downloads/python3-dnf-plugin-protected-kmods-0.9.2-2.fc42.src.rpm
Description: DNF 3/4 plugin that prevents kernel updates without the matching kmods
Fedora Account System Username: jdieter

Comment 5 Jonathan Dieter 2025-06-07 20:16:05 UTC
Hey Jonathan,

Thanks for pointing out that I got the wrong handle on the naming.  Here's the second attempt at fixing (4) above:

Spec URL: https://www.jdieter.net/downloads/dnf-plugin-protected-kmods.spec
SRPM URL: https://www.jdieter.net/downloads/dnf-plugin-protected-kmods-0.9.2-2.fc42.src.rpm
Description: DNF 3/4 plugin that prevents kernel updates without the matching kmods
Fedora Account System Username: jdieter

Comment 6 Neal Gompa 2025-06-09 22:47:39 UTC
> %{python3_sitelib}/dnf-plugins/protected_kmods.py
> %{python3_sitelib}/dnf-plugins/__pycache__/protected_kmods.cpython-*.pyc

You can simplify this to "%pycached %{python3_sitelib}/dnf-plugins/protected_kmods.py"

Comment 7 Jonathan Dieter 2025-06-10 10:27:15 UTC
That's really nice, Neal!

Here's a new release with the suggested change.

Spec URL: https://www.jdieter.net/downloads/dnf-plugin-protected-kmods.spec
SRPM URL: https://www.jdieter.net/downloads/dnf-plugin-protected-kmods-0.9.2-2.fc42.src.rpm
Description: DNF 3/4 plugin that prevents kernel updates without the matching kmods
Fedora Account System Username: jdieter

Comment 8 Neal Gompa 2025-06-10 21:19:32 UTC
> mkdir -p %{buildroot}%{_docdir}/%{name}
> install -m 0644 README %{buildroot}%{_docdir}/%{name}/
> [...]
> %doc %{_docdir}/%{name}/

This is unnecessary and all of it can be replaced with "%doc README".

You can even drop the pandoc conversion (and the BR) and simply include the README.md file.

Comment 9 Jonathan Dieter 2025-06-11 10:58:16 UTC
(In reply to Neal Gompa from comment #8)
> > mkdir -p %{buildroot}%{_docdir}/%{name}
> > install -m 0644 README %{buildroot}%{_docdir}/%{name}/
> > [...]
> > %doc %{_docdir}/%{name}/
> 
> This is unnecessary and all of it can be replaced with "%doc README".

Thank you, this is now done

> You can even drop the pandoc conversion (and the BR) and simply include the
> README.md file.

I'd prefer to have a plain-text README rather than the markdown, since anyone reading it on the local filesystem will probably do so in a text-only editor.

Here's a new release with the simplified %doc.

Spec URL: https://www.jdieter.net/downloads/dnf-plugin-protected-kmods.spec
SRPM URL: https://www.jdieter.net/downloads/dnf-plugin-protected-kmods-0.9.2-2.fc42.src.rpm
Description: DNF 3/4 plugin that prevents kernel updates without the matching kmods
Fedora Account System Username: jdieter

Comment 10 Jonathan Dieter 2025-06-13 15:18:44 UTC
Well, pandoc has proven to be a real pain for certain distros, so I'm just including the plain-text README in the sources.  The pandoc BR is gone now.

Spec URL: https://www.jdieter.net/downloads/dnf-plugin-protected-kmods.spec
SRPM URL: https://www.jdieter.net/downloads/dnf-plugin-protected-kmods-0.9.3-1.fc42.src.rpm
Description: DNF 3/4 plugin that prevents kernel updates without the matching kmods
Fedora Account System Username: jdieter

Comment 11 Jonathan Dieter 2025-06-22 16:50:19 UTC
Hey Jonathan, is there anything else you or Neal need from me on this, or is this ready for your approval?


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