Создать зависимость модуля Linux для модуля автозагрузки

Попробуйте это,

find. -mindepth 3 -maxdepth 3 ! -iname bar -type d | awk -F'/' '{print $2}'

Rep2
0
01.04.2021, 23:58
2 ответа

Вы можете добавить одну строку, определяющую такую ​​зависимость, кmodules.dep

echo "${module1}: ${module2}" >> "/lib/modules/$(uname -r)/modules.dep"

(Обратите внимание, что :запуск depmodпозже может уничтожить ваше изменение, и вам придется повторно применить)

Ссылка:

https://linux.die.net/man/5/modules.dep

0
28.04.2021, 22:54

Вы можете добавить файл конфигурации /etc/modprobe.d/vboxdrv-includes-vfat.confс помощью команды «мягкой зависимости»:

softdep vboxdrv post: vfat

Страница руководства modprobe.d (5)документирует синтаксис:

softdep modulename pre: modules... post: modules...

The softdep command allows you to specify soft, or optional, module dependencies. modulename can be used without these optional modules installed, but usually with some features missing. For example, a driver for a storage HBA might require another module be loaded in order to use management features.

pre-deps and post-deps modules are lists of names and/or aliases of other modules that modprobe will attempt to install (or remove) in order before and after the main module given in the modulename argument

В качестве альтернативы, если softdepне работает должным образом (, например. если modprobe слишком стар, чтобы понимать программные зависимости ), вы можете использовать команду установки в файле в том же каталоге для скрипта вставки модуля:

install modulename command...

This command instructs modprobe to run your command instead of inserting the module in the kernel as normal. The command can be any shell command: this allows you to do any kind of complex processing you might wish. For example, if the module "fred" works better with the module "barney" already installed (but it doesn't depend on it, so modprobe won't automatically load it), you could say "install fred /sbin/modprobe barney; /sbin/modprobe --ignore-install fred", which would do what you wanted. Note the --ignore-install, which stops the second modprobe from running the same install command again. See also remove below.

The long term future of this command as a solution to the problem of providing additional module dependencies is not assured and it is intended to replace this command with a warning about its eventual removal or deprecation at some point in a future release

2
28.04.2021, 22:54

Теги

Похожие вопросы