Skip to content

Proper support for DESTDIR and INSTALL_MOD_PATH #12577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 1, 2021
Merged

Proper support for DESTDIR and INSTALL_MOD_PATH #12577

merged 1 commit into from
Oct 1, 2021

Conversation

jlsalvador
Copy link
Contributor

Motivation and Context

The environment variables DESTDIR and INSTALL_MOD_PATH must
be mutually exclusive.

https://www.gnu.org/prep/standards/html_node/DESTDIR.html
https://www.kernel.org/doc/Documentation/kbuild/modules.txt

Description

This issue was discussed in this Buildroot thread:
https://lists.buildroot.org/pipermail/buildroot/2021-August/621350.html

I saw this behavior in other different projects, as:

For the above reasons, INSTALL_MOD_PATH will be set as DESTDIR
by default.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

The environment variables DESTDIR and INSTALL_MOD_PATH must
be mutually exclusive.

https://www.gnu.org/prep/standards/html_node/DESTDIR.html
https://www.kernel.org/doc/Documentation/kbuild/modules.txt

This issue was discussed in this Buildroot thread:
https://lists.buildroot.org/pipermail/buildroot/2021-August/621350.html

I saw this behavior in other different projects, as:

- Yocto Project:
  https://www.yoctoproject.org/pipermail/meta-freescale/2013-August/004307.html

- Google IA Coral:
  https://coral.googlesource.com/linux-imx-debian/+/refs/heads/master/debian/rules

For the above reasons, INSTALL_MOD_PATH will be set as DESTDIR
by default.

Signed-off-by: José Luis Salvador Rufo <[email protected]>
Signed-off-by: Romain Naour <[email protected]>
@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Sep 21, 2021
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for fixing this and proving the helpful references.

@behlendorf behlendorf self-assigned this Sep 23, 2021
@edacval
Copy link

edacval commented Sep 23, 2021

This will break Arch Linux and derivatives PKGBUILD`s because Arch places kernel modules in /usr/lib/modules : https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=zfs-linux#n53 . Maybe @eli-schwartz or @minextu can suggest an workaround ?

@jlsalvador
Copy link
Contributor Author

This will break Arch Linux and derivatives PKGBUILD`s because Arch places kernel modules in /usr/lib/modules : https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=zfs-linux#n53 . Maybe @eli-schwartz or @minextu can suggest an workaround ?

29,30c29,32
< source=("https://github.com/zfsonlinux/zfs/releases/download/zfs-${_zfsver}/zfs-${_zfsver}.tar.gz")
< sha256sums=("bd4f48d009f3b5e291390bde62b0131b8bf3fab09f4fc0fa3591b1f2e7074cff")
---
> source=("https://github.com/openzfs/zfs/releases/download/zfs-${_zfsver}/zfs-${_zfsver}.tar.gz"
>       "https://github.com/openzfs/zfs/commit/c9dabebc8eef129ab72bef6e78dbfc06f16c4c4e.patch")
> sha256sums=("bd4f48d009f3b5e291390bde62b0131b8bf3fab09f4fc0fa3591b1f2e7074cff"
>       "SKIP")
33a36,40
> prepare() {
>     cd "${srcdir}/zfs-${_zfsver}"
>     patch --forward --strip=1 --input="${srcdir}/c9dabebc8eef129ab72bef6e78dbfc06f16c4c4e.patch"
> }
> 
53c60
<     make DESTDIR="${pkgdir}" INSTALL_MOD_PATH=/usr install
---
>     make DESTDIR="${pkgdir}" INSTALL_MOD_PATH="${pkgdir}/usr" install

I'm going to publish a PR to https://github.com/archzfs/archzfs
Thanks @edacval for the info!

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Sep 27, 2021
@behlendorf behlendorf merged commit ed3a3bd into openzfs:master Oct 1, 2021
@jlsalvador jlsalvador deleted the fix-cc branch October 1, 2021 17:47
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Feb 10, 2022
The environment variables DESTDIR and INSTALL_MOD_PATH must
be mutually exclusive.

https://www.gnu.org/prep/standards/html_node/DESTDIR.html
https://www.kernel.org/doc/Documentation/kbuild/modules.txt

This issue was discussed in this Buildroot thread:
https://lists.buildroot.org/pipermail/buildroot/2021-August/621350.html

I saw this behavior in other different projects, as:

- Yocto Project:
  https://www.yoctoproject.org/pipermail/meta-freescale/2013-August/004307.html

- Google IA Coral:
  https://coral.googlesource.com/linux-imx-debian/+/refs/heads/master/debian/rules

For the above reasons, INSTALL_MOD_PATH will be set as DESTDIR
by default.

Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: José Luis Salvador Rufo <[email protected]>
Signed-off-by: Romain Naour <[email protected]>
Closes openzfs#12577
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants