Fix "make install" with DESTDIR set #16995
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
"DESTDIR=/path/to/target/root/ make install" may fail when installing to a root that contains an existing lib/modules structure. When run as root we may even affect the wrong kernel (the build system's one, or, if running a different version, some other directory in /lib/modules, but not the desired one installed in DESTDIR).
Add a missing reference to the INSTALL_MOD_PATH root when calling "depmod" during "make install"
Also add a switch "DONT_DELETE_MODULES_FILES=1" that skips the removal of files named "modules.*" prior to running depmod.
Signed-off-by: Christian Kohlschütter [email protected]
Closes #16994
Motivation and Context
Fixes an important build issue when installing to DESTDIR.
see issue #16994
Description
In addition to the details in #16994:
I'm sure there's a reason why the current makefile deletes files starting with "modules.*", so I'm only adding a switch that can disable that functionality when not desired.
With this change, I can now install zfs nto my target root as follows:
How Has This Been Tested?
Tested on Alpine Linux 3.21.2 using the following zfs build instructions
Types of changes
Checklist:
Signed-off-by
.