lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 10 Dec 2023 13:51:03 -0500
From:   Woody Suwalski <terraluna977@...il.com>
To:     Masahiro Yamada <masahiroy@...nel.org>,
        Michal Suchanek <msuchanek@...e.de>
Cc:     linux-modules@...r.kernel.org, Takashi Iwai <tiwai@...e.com>,
        Lucas De Marchi <lucas.de.marchi@...il.com>,
        Michal Koutný <mkoutny@...e.com>,
        Jiri Slaby <jslaby@...e.com>, Jan Engelhardt <jengelh@...i.de>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Nicolas Schier <nicolas@...sle.eu>,
        linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 1/2] depmod: Handle installing modules under a
 different directory

Masahiro Yamada wrote:
> On Thu, Dec 7, 2023 at 4:48 AM Michal Suchanek <msuchanek@...e.de> wrote:
>> Some distributions aim at shipping all files in /usr.
>>
>> The path under which kernel modules are installed is hardcoded to /lib
>> which conflicts with this goal.
>>
>> When kmod provides kmod.pc, use it to determine the correct module
>> installation path.
>>
>> With kmod that does not provide the config /lib/modules is used as
>> before.
>>
>> While pkg-config does not return an error when a variable does not exist
>> the kmod configure script puts some effort into ensuring that
>> module_directory is non-empty. With that empty module_directory from
>> pkg-config can be used to detect absence of the variable.
>>
>> Signed-off-by: Michal Suchanek <msuchanek@...e.de>
>> ---
>> v6:
>>   - use ?= instead of := to make it easier to override the value
>
> "KERNEL_MODULE_DIRECTORY=/local/usr/lib/modules make modules_install"
> will override the install destination, but
> depmod will not be not aware of it.
>
> How to avoid the depmod error?
>
>
I think the depmod -b option can be used to ran depmod in an arbitrary 
location:

The following options are useful for people managing distributions:
     -b, --basedir=DIR    Use an image of a module tree.

Woody

>
>
>
>
>
>
>
>
>
>
>
>>   - use shorter expression for determining the module directory assuming
>>     it's non-empty
>> ---
>>   Makefile | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 511b5616aa41..84f32bd563d4 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -1081,7 +1081,9 @@ export INSTALL_DTBS_PATH ?= $(INSTALL_PATH)/dtbs/$(KERNELRELEASE)
>>   # makefile but the argument can be passed to make if needed.
>>   #
>>
>> -MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
>> +export KERNEL_MODULE_DIRECTORY ?= $(or $(shell pkg-config --variable=module_directory kmod 2>/dev/null),/lib/modules)
>> +
>> +MODLIB = $(INSTALL_MOD_PATH)$(KERNEL_MODULE_DIRECTORY)/$(KERNELRELEASE)
>>   export MODLIB
>>
>>   PHONY += prepare0
>> --
>> 2.42.0
>>
>>
>
> --
> Best Regards
> Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ