basename can have different behavior based on whether the glibc
or posix version is used, and musl doens't provide the glibc version
at all. Avoid the problem by using the one in libbase instead.
Test: m USE_HOST_MUSL=true host-native -k
Change-Id: If17c7622ed9b9cffc218567a46afb059b608d3c9
Removing find-check while removing modules in loop.
Test: Normal/Recovery Boot to home
Bug: 261678056
Change-Id: I5ff41b3e8cf633dc687f819a146404b863d2ae0a
Signed-off-by: Wasim Nazir <quic_wasimn@quicinc.com>
This reverts commit a0e6703f73.
Reason for revert: the failed devices has disabled the feature now, we'll fixed the problem later so releand this patch first
Change-Id: Ib12b84edbd9489d769a4988908bb89f45c13ca43
This reverts commit 3e6c9dbee8.
Reason for revert: This is breaking boot on several devices.
Bug: 267836481
Bug: 261678056
Change-Id: I67c4b784936828c448a53e3092af70d949fcbc65
Load all hard-dependent-modules even if they are not listed in *.load.
Defer softdep module loading to InsmodWithDeps, as loading it parallel
breaks the purpose of softdep which is used to load the modules
according to dependency/sequence(pre/post) added.
Test: Normal/Recovery Boot to home
Bug: 261678056
Change-Id: I0aea7580545affbf4caa9205281868aad00a2bb0
Signed-off-by: Wasim Nazir <quic_wasimn@quicinc.com>
1. integrate modules which have soft dependencies into parallel loading flow. First, check the soft dependencies are in `module.load` list. If yes, regard soft dependencies as hard dependencies and load the modules only when their dependencies are loaded. If not, abandon these soft dependencies.
2. also add an allowlist and use the term "load_sequential=1" to load specific modules in sequential.
Test: R4 saves 350ms+ (48%) to load all modules
Bug: 229794277
Signed-off-by: chungkai <chungkai@google.com>
Change-Id: I904fe31cd02f9d499dadc537335cadc88d8add70
First, we load independent module in parallel, then we singly load
modules which have soft-dependencies. then remove them from dependency
list of other modules. Repeat these steps until all modules are loaded.
Bug: 180676019
Test: boot successfully, and save more than 400 ms on Pixel 6 Pro.
Signed-off-by: chungkai <chungkai@google.com>
Change-Id: Ib844cfee72d4049bd951528692c818b4fa6c8e8f
Remove the function EnableBlocklist() and add a constructor argument to
enable/disable the use of modules.blocklist. In all cases, the
enabling/disabling of the blocklist happens immediately after creating
the Modprobe object. So this simplies libmodprobe.
Additionally, the use of the blocklist by libmodprobe should be enabled
by default unless explicitly disabled during creation of the Modprobe
object. Currently, only modprobe(8) defaults to not using the blocklist
and includes the argument -b BLOCKLIST for enabling it. That
functionality remains.
This refactor allows us to use the blocklist during first stage init.
However, additional logic is needed to not return an error for the
blocked non-aliased modules during first stage init; otherwise, the
error would result in an init crash leading to a device reboot. So fixup
LoadListedModules() to allow blocking modules without returning an
error.
Bug: 182582036
Test: boot test on pixel 5 with a module in modules.blocklist
Change-Id: I394b5aa98fa98821011982cfe693749010c381f7
The first argument in a modules.dep line must end with a colon so fail
if that condition is not met.
Test: libmodprobe_tests
Change-Id: I6f3a22758302f16b924e5a16f7af9bf35f1a56f3
Only the parent executable, not libraries should set this value.
Note that `modprobe` in toolbox and first stage init, the two primary
users of this library already set this same minimum log severity.
Test: build
Change-Id: I888968deede3323cc270efc3cfd1b40fc521d2da
modprobe command no longer uses EnableVerbose, opting to do the
associated operations directly.
Test: compile
Change-Id: Iffc8324f37f34de4eeb9a27e92fdf5524afa2220
In recovery mode, load modules from modules.load.recovery if it
exists. Otherwise load from modules.load as usual.
Change-Id: I7636bb5958ed10ae9a66015f04f168129618272f
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
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
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
Make the module name canonical in LoadWithAliases so it may be used
more easily from outside the class.
Change-Id: I7ee496b77a2beea43a6b68daed7af42660747559
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