Commit graph

15 commits

Author SHA1 Message Date
Mark Salyzyn
ce30bb8e4b libmodprobe: remove unused EnableVerbose() method
modprobe command no longer uses EnableVerbose, opting to do the
associated operations directly.

Test: compile
Change-Id: Iffc8324f37f34de4eeb9a27e92fdf5524afa2220
2020-06-26 22:30:21 +00:00
Mark Salyzyn
9debda17ab modprobe: Use more inclusive language for libmodprobe (Part Deux)
Remove blacklist

Test: none
Change-Id: I14ed08390a7db0b4b962343c61d60230751047ce
2020-06-16 05:14:09 -07:00
Mark Salyzyn
703fb74fb5 modprobe: Use more inclusive language for modprobe and libmodprobe
blacklist is replaced with blocklist.

Test: none
Change-Id: I59f9fde5900b9aee82aca1eab4a6ded3d136063b
2020-06-15 12:51:38 -07:00
Steve Muckle
4c59323dc6 first_stage_init: load modules in modules.load.recovery in recovery
In recovery mode, load modules from modules.load.recovery if it
exists. Otherwise load from modules.load as usual.

Change-Id: I7636bb5958ed10ae9a66015f04f168129618272f
2020-04-06 12:24:16 -07:00
Steve Muckle
373a3cadd7 libmodprobe: parse kernel command line for module options
Bug: 145808811
Test: atest libmodprobe_tests, verify on flame
Change-Id: I0b41b1610fe13ae526d38f029da888f6f0d8a02d
2019-12-27 13:39:23 -08:00
Mark Salyzyn
d478271b2b libmodprobe: add strict bool argument to LoadListedModules
Continue loading remaining modules after error if strict flag false.

Test: libmodprobe_test
Bug: 141311820
Change-Id: Ib21d4eade1254b16621e7bf2c9efaa173092e7c7
2019-10-31 10:30:35 -07:00
Mark Salyzyn
8c1051918e libmodprobe: Do not reload modules previously instantiated
For modprobe operation.

For an interlocking driver set of about 50 modules, the impact of
their dependencies resulted in a 30 second impact in boot time
trying to load previously loaded modules. This impact is handily
eliminated by keeping a list of modules paths that have been loaded
and skipping them proactively.

Test: Confirmed device boot and 50 module set of drivers functions.
Test: libmodprobe_tests
Bug: 142938937
Bug: 140827934
Change-Id: Iccd11399d6043b38cbd5f93578ee202022e7770c
2019-10-30 07:20:18 -07:00
Steve Muckle
ded44c06be libmodprobe: add verbose mode
Change-Id: I2be18320461cd712a4828400b8f29bb5f07c801f
2019-08-06 13:58:13 -07:00
Steve Muckle
781aa78ee2 libmodprobe: add GetAllDependencies
Add a method to retrieve the dependencies (both hard and soft) of a
module.

Change-Id: Ie44ceb3e36856bb1a3e68c5d3c0d55a38deb0ef9
2019-08-06 13:58:13 -07:00
Steve Muckle
012cfa19b0 libmodprobe: add support to list modules
List the known modules with a name matching a given pattern.

Change-Id: I7f6bd1f09a688c66682f94c5837e61d7dc61c1f7
2019-08-06 13:58:13 -07:00
Steve Muckle
e31f840a0a libmodprobe: add support for a blacklist
If the blacklist is enabled, blacklisted modules are treated as though
they are not present.

Change-Id: Ie8712f24298e78f92d5028b1ca3a8a3e07a9190a
2019-08-06 13:58:13 -07:00
Steve Muckle
13700a69d3 libmodprobe: support parameters in LoadWithAliases
Add support to specify module parameters in LoadWithAliases. These
parameters will be appended to any which are specified for the module in
modules.options.

Change-Id: I9aff1656ea397826f815b658b3b52c1892748601
2019-08-06 13:58:13 -07:00
Steve Muckle
bb58b01574 libmodprobe: add support to remove modules
Add a remove method which will unload a given module from the kernel,
along with any modules it depended on, assuming those modules are now
unused.

Change-Id: Ie66dc153ef1771f50e26421d38d3656e95954780
2019-08-06 13:58:13 -07:00
Steve Muckle
73b2928b94 libmodprobe: make name canonical in LoadWithAliases
Make the module name canonical in LoadWithAliases so it may be used
more easily from outside the class.

Change-Id: I7ee496b77a2beea43a6b68daed7af42660747559
2019-08-06 13:58:13 -07:00
Steve Muckle
18b981ea7c create libmodprobe, integrate into first_stage_init
Modprobe functionality is required both within first stage init and also
as a standalone binary. Create a library for this using and extending
the logic in modalias_handler.cpp.

First stage init will attempt to load modules from /lib/modules.

Bug: 129780532
Change-Id: Ie3582358fd839c2f64e1b386b30ed551a86aef5d
2019-06-18 13:24:56 -07:00