Bug 2239566 - Review Request: kdump-utils - Kernel crash dump collection utilities
Summary: Review Request: kdump-utils - Kernel crash dump collection utilities
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Carl George 🤠
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-09-19 04:34 UTC by Coiby
Modified: 2024-04-25 10:53 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:
carl: fedora-review?


Attachments (Terms of Use)

Description Coiby 2023-09-19 04:34:49 UTC
Spec URL: https://coiby.fedorapeople.org/kdump-utils.spec
SRPM URL: https://coiby.fedorapeople.org/kdump-utils-1.0.42-10.fc41.src.rpm

Description: kdump-utils is responsible for collecting the crash kernel dump. It builds and loads the kdump initramfs so when a kernel crashes, the system will boot the kdump kernel and initramfs to save the collected crash kernel dump to specified target.

Fedora Account System Username: coiby

Note this package is split from current kexec-tools.

Comment 1 Carl George 🤠 2023-09-25 21:42:18 UTC
This may be exempt from needing a review.  FPC is currently discussing.

https://pagure.io/packaging-committee/issue/1303

Assigning to myself for now to avoid other reviewers taking it.

Comment 2 Carl George 🤠 2023-12-08 21:10:52 UTC
Ultimately FPC decided that this package is not exempt, so I'll proceed with the review.

On a first pass I noticed the following issues:


================================================================================

There is no URL tag, resulting in an rpmlint warning.  On a related note, there are quite a few source files in this package.  Would it be possible to establish an upstream repository somewhere like GitHub or GitLab that can be used to obtain tarballs of the source files?  That upstream could also determine the versions.  Right now it's not clear where the version of 1.0.42 is coming from.  No other file in the SRPM besides the spec file has that string.

================================================================================

/usr/lib/dracut/modules.d/99kdumpbase/monitor_dd_progress has some inconsistencies with other scripts in that directory.  It is missing the .sh extension and is not executable.  The latter is resulting in an rpmlint error.  If none of these scripts should be executable, then the rpmlint error can be cleared by removing the shebang lines.

This file also is triggering an rpmlint warning for "potential-bashisms".  I'm not sure if this is something that can be resolved or not, but please look into it.  The checkbashisms CLI tool is flagging the usage of `echo -e` on line 24.

================================================================================

rpmlint is also reporting an error that this architecture-specific package does not contain any architecture-specific binaries.  Should it be marked as noarch?

================================================================================

Consider converting instances of $RPM_BUILD_ROOT to %{buildroot}.  This is not required, as the guidelines only say that you need to use one or the other consistently, but the latter is considered more modern and is more common in Fedora spec files.

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

================================================================================

I noticed the remove_prefix helper function in the spec file.  Is that really necessary?  It's more characters than just using the filename directly in the install commands.  Fedora spec files aim for legibility, and I think using a helper function that requires more characters to invoke than just being explicit with the installed filename is less legible.

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

================================================================================

fedora-review and rpmlint are flagging an issue with /usr/lib/udev/rules.d (and recursively applying to 98-kexec.rules in that directory) being marked as %config.  %config should only be used on files in /etc.

================================================================================

I noticed there are systemd service files and a target file installed to /usr/lib/dracut/modules.d/99kdumpbase.  Should those be installed to the regular systemd directories, or do they need to be here?

================================================================================

This package has a license tag of GPL-2.0-only, but /usr/lib/dracut/modules.d/99kdumpbase/kdump-capture.service and /usr/lib/dracut/modules.d/99kdumpbase/kdump-emergency.target have headers that indicate they are licensed as LGPL-2.1-or-later.  Please refer to the license guidelines to set the license tag appropriately.

https://docs.fedoraproject.org/en-US/legal/license-field/#_conjunctive_and_licensing

================================================================================

fedora-review is also flagging this as uninstallable, but upon closer inspection this appears to be because it needs makedumpfile present first.  We may want to finish that review first for simplicity.

Comment 3 Carl George 🤠 2023-12-08 21:13:59 UTC
One more thing I just noticed after hitting submit on my last comment, in your %files section you have man pages listed with an explicit .gz extension.  It is required to mark these with a wildcard for the extension in case RPM is every changed to use a different compression format.

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

Comment 4 Philipp Rudo 2023-12-15 15:27:43 UTC
Hi Carl,

thanks for the thorough review. It's very much appreciated!

Please find a my questions/comments below.

(In reply to Carl George 🤠 from comment #2)
[...]
> =============================================================================
> ===
> 
> There is no URL tag, resulting in an rpmlint warning.  On a related note,
> there are quite a few source files in this package.  Would it be possible to
> establish an upstream repository somewhere like GitHub or GitLab that can be
> used to obtain tarballs of the source files?  That upstream could also
> determine the versions.  Right now it's not clear where the version of
> 1.0.42 is coming from.  No other file in the SRPM besides the spec file has
> that string.

I see your point and agree that having an upstream repo would be beneficial. But in my opinion splitting the current rpm is already a pretty big task. That's why I would prefer to do the change in a subsequent step after the split has been completed.

[...]

> =============================================================================
> ===
> 
> rpmlint is also reporting an error that this architecture-specific package
> does not contain any architecture-specific binaries.  Should it be marked as
> noarch?

Ok, that's one area where I'm not entirely sure.
Thing is that while we don't ship arch-specific binaries we do ship arch-specific udev rules and dracut modules. In addition there are some arch-specific dependencies. My problem is that I don't know exactly when those arch-specific parts in the spec file are evaluated. In case that is done during build time I'm afraid we need to stick with the arch-specific rpms. If not we should mark it as noarch.

[...]

> =============================================================================
> ===
> 
> I noticed there are systemd service files and a target file installed to
> /usr/lib/dracut/modules.d/99kdumpbase.  Should those be installed to the
> regular systemd directories, or do they need to be here?

Those need to stay here. Reason is that those services are only needed in the initrd that contain the kdump module. But those initrds are special purpose and cannot be used for a "normal" boot. In fact those services won't even start after a "normal" boot.

> =============================================================================
> ===
[...]

Thanks
Philipp

Comment 5 Coiby 2024-01-16 05:29:27 UTC
Hi Carl,

Thank you for providing such a detailed review! I've applied most of your suggestions to latest version (if it make it easier for you to review, I've created separate commits for each suggestion in https://src.fedoraproject.org/rpms/kexec-tools/pull-request/17). For creating an upstream repo, I agree with you and Philipp that this is a good idea but it will take time to do so. For making the package architecture independent, it is also good to have but will take time. As reminded by my manager Dave, RHEL10 beta compose will start Feb 8th around. So can we leave these two issues to the future?


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