Skip to content

sys-apps/nvme-cli: Install udev rules and systemd units in correct pl…#31159

Closed
krnowak wants to merge 1 commit intogentoo:masterfrom
kinvolk:krnowak/nvme-cli-fixes
Closed

sys-apps/nvme-cli: Install udev rules and systemd units in correct pl…#31159
krnowak wants to merge 1 commit intogentoo:masterfrom
kinvolk:krnowak/nvme-cli-fixes

Conversation

@krnowak
Copy link
Copy Markdown
Contributor

@krnowak krnowak commented May 25, 2023

…aces

This popped up when we updated the package in Flatcar - we used to have 1.16 and, after updating to 2.3, some files changed their locations. This PR tries to fix it. The diff between the nvme-cli-2.4-r{1,2} ebuilds is:

14c14
< KEYWORDS="amd64 ~arm64 ~loong ~ppc64 ~riscv x86"
---
> KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~x86"
37d36
< 	local unitdir="$(systemd_get_systemunitdir)"
42,43c41,42
< 		-Dsystemddir="${unitdir%/system}"
< 		-Dudevrulesdir="${EPREFIX}$(get_udevdir)"
---
> 		-Dsystemddir="$(systemd_get_systemunitdir)"
> 		-Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d"

Udev rules should be installed in rules.d directory (so in /usr/lib/udev/rules.d), currently they are installed in /usr/lib/udev. This mistake probably comes from a build system change, where for old build system (in version 1.16), UDEVDIR was supposed to be specified, and the build system defined UDEVRULESDIR based on the former (see
https://github.com/linux-nvme/nvme-cli/blob/v1.16/Makefile#L17-L18). The new build system expects the udev rules directory to be passed as a parameter.

Similar mistake happened for the systemd unit directory - the systemd unit files are installed in /usr/lib/systemd/system, not in /usr/lib/systemd. This one stems from a change in meaning of the systemddir option in the build system - in the old build system it meant to be /usr/lib/systemd and the system subdirectory was appended by the old build system when installing the units (see https://github.com/linux-nvme/nvme-cli/blob/v1.16/Makefile#L142-L144). The new build system does not do it any more - it just installs the units to systemddir (see
https://github.com/linux-nvme/nvme-cli/blob/v1.16/Makefile#L142-L144), thus making the systemddir option name rather misleading - probably should be named systemdunitdir, as systemddir is not used for anything else (see
https://github.com/linux-nvme/nvme-cli/blob/v2.4/Makefile#L49).

@gentoo-bot
Copy link
Copy Markdown

Pull Request assignment

Submitter: @krnowak
Areas affected: ebuilds
Packages affected: sys-apps/nvme-cli

sys-apps/nvme-cli: @gentoo/base-system

Linked bugs

No bugs to link found. If your pull request references any of the Gentoo bug reports, please add appropriate GLEP 66 tags to the commit message and request reassignment.

If you do not receive any reply to this pull request, please open or link a bug to attract the attention of maintainers.

Missing GCO sign-off

Please read the terms of Gentoo Certificate of Origin and acknowledge them by adding a sign-off to all your commits.


In order to force reassignment and/or bug reference scan, please append [please reassign] to the pull request title.

Docs: Code of ConductCopyright policy (expl.) ● DevmanualGitHub PRsProxy-maint guide

@gentoo-bot gentoo-bot added assigned PR successfully assigned to the package maintainer(s). no bug found No Bug/Closes found in the commits. no signoff One or more commits do not indicate GCO sign-off. labels May 25, 2023
…aces

Udev rules should be installed in rules.d directory (so in
`/usr/lib/udev/rules.d`), currently they are installed in
`/usr/lib/udev`. This mistake probably comes from a build system
change, where for old build system (in version 1.16), UDEVDIR was
supposed to be specified, and the build system defined UDEVRULESDIR
based on the former (see
https://github.com/linux-nvme/nvme-cli/blob/v1.16/Makefile#L17-L18). The
new build system expects the udev rules directory to be passed as a
parameter.

Similar mistake happened for the systemd unit directory - the systemd
unit files are installed in `/usr/lib/systemd/system`, not in
`/usr/lib/systemd`. This one stems from a change in meaning of the
`systemddir` option in the build system - in the old build system it
meant to be `/usr/lib/systemd` and the `system` subdirectory was
appended by the old build system when installing the units (see
https://github.com/linux-nvme/nvme-cli/blob/v1.16/Makefile#L142-L144).
The new build system does not do it any more - it just installs the
units to `systemddir` (see
https://github.com/linux-nvme/nvme-cli/blob/v1.16/Makefile#L142-L144),
thus making the `systemddir` option name rather misleading - probably
should be named `systemdunitdir`, as `systemddir` is not used for
anything else (see
https://github.com/linux-nvme/nvme-cli/blob/v2.4/Makefile#L49).

Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
@krnowak krnowak force-pushed the krnowak/nvme-cli-fixes branch from a8b5ccc to 261648a Compare May 25, 2023 14:49
@krnowak
Copy link
Copy Markdown
Contributor Author

krnowak commented May 25, 2023

Argh, fixed the signoff.

@krnowak krnowak deleted the krnowak/nvme-cli-fixes branch May 26, 2023 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

assigned PR successfully assigned to the package maintainer(s). no bug found No Bug/Closes found in the commits. no signoff One or more commits do not indicate GCO sign-off.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants