Skip to content

Build cleanups - #76

Open
michich wants to merge 6 commits into
cornelisnetworks:masterfrom
michich:build-cleanups
Open

Build cleanups#76
michich wants to merge 6 commits into
cornelisnetworks:masterfrom
michich:build-cleanups

Conversation

@michich

@michich michich commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Drop support for very old kernels (2015) and distros (RHEL 6).
Fix detection of Fedora-like distros.
Change modprobe.d from /etc to /lib - sensible for distros after 2011.
Simplify the Makefile.

michich and others added 6 commits July 2, 2026 20:39
@COMPATLIB@, @COMPATMAJOR@, and @LIBPSM2_COMPAT_CONF_DIR@ do not appear
in libpsm2.spec.in, so the corresponding sed expressions were no-ops.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
40-psm.rules set MODE="0666" on hfi1 device nodes as a workaround for
old kernels that did not set proper permissions.
Since kernel commit e116a64fab650 ("IB/hfi: Properly set permissions for
user device files"), the driver itself ensures the device node access
mode is 0666. The commit is from 2015. It was included in Linux v4.3 and
backported to RHEL in version 7.2. The udev rule has been redundant for
more than 10 years.

Remove 40-psm.rules entirely and drop the redundant MODE="0666" from
40-psm-compat.rules, keeping only its SYMLINK+="ipath" directives.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Maintenance support phase for RHEL 6 ended in June 2024 ([1]).
RHEL 6 is in "Extended life cycle support" phase now. Its users likely
prefer to not touch anything, so they have no need to run the latest
upstream psm2 code.

Drop the special handling of RHEL 6 in the spec file template.

@UDEVDIR@ becomes unused. Remove the substitution in the Makefile.

[1] https://access.redhat.com/support/policy/updates/errata#Life_Cycle_Dates

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Instead of hardcoding /usr/lib for Fedora and /etc for everything else,
query kmod's pkg-config for the distconfdir variable.

kmod ships kmod.pc since version 32 (March 2024).
Older distros have no kmod.pc, so if the detection fails, fall back to
/lib. /lib/modprobe.d has been supported since module-init-tools 3.13
(May 2011), so the fallback works on all relevant distros, with or
without /usr-merge.

I considered changing the name LIBPSM2_COMPAT_CONF_DIR to
KMOD_DISTCONFDIR, but I noticed that SUSE's RPM spec sets the variable,
so I chose to keep it.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
To truly avoid adding a space, do not use the "+=" operator, but
variable expansion and concatenation.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
DISTRO's only remaining purpose was setting SPEC_FILE_RELEASE_DIST to
%{?dist} on Fedora. Replace it with a direct shell snippet that checks
whether "fedora" appears as a word in ID or ID_LIKE from /etc/os-release,
which correctly covers Fedora itself and derivatives like RHEL, CentOS,
and AlmaLinux. Drop the now-empty RHEL and SLES ifeq stubs along with
the stale comment block.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant