commit:     15b34c0a3b9c63cbedc25db05081fc5e2ed00b67
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 28 21:10:49 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Mon Jul 29 20:00:26 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=15b34c0a

genkernel: Don't install modules to /lib/modules when --kerncache is used but 
--no-install is set

Bug: https://bugs.gentoo.org/505810
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 genkernel | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/genkernel b/genkernel
index f33379c..c3aa8d1 100755
--- a/genkernel
+++ b/genkernel
@@ -280,6 +280,21 @@ if isTrue "${KERNCACHE_IS_VALID}"
 then
        if ! isTrue "${BUILD_STATIC}"
        then
+               if ! isTrue "${CMD_INSTALL}" && [ -z "${INSTALL_MOD_PATH}" ]
+               then
+                       # We have to set $INSTALL_MOD_PATH to avoid installing 
files
+                       # to /lib/modules because --no-install was set
+                       INSTALL_MOD_PATH="$(mktemp -d -p "${TEMP}" 
kerncache-modules.XXXXXXX 2>/dev/null)"
+                       if [ -z "${INSTALL_MOD_PATH}" ]
+                       then
+                               gen_die "Internal error: Variable 
'INSTALL_MOD_PATH' is empty; mktemp() for kerncache modules failed!"
+                       else
+                               print_info 5 '' 1 0
+                               print_info 5 "INSTALL_MOD_PATH set to 
'${INSTALL_MOD_PATH}' because --kerncache is used but --no-install was set ..."
+                               mkdir "${INSTALL_MOD_PATH}/lib" || gen_die 
"Failed to create '${INSTALL_MOD_PATH}/lib'!"
+                       fi
+               fi
+
                print_info 1 '' 1 0
                gen_kerncache_extract_modules
        fi

Reply via email to