summaryrefslogtreecommitdiff
path: root/libmodprobe
AgeCommit message (Collapse)Author
2021-03-31libmodprobe: refactor blocklist functionalityWill McVicker
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
2021-03-23Update libmodprobe's OWNERS.Elliott Hughes
Test: treehugger Change-Id: I714516a3a655facbe447b798f7de59ab899035ea
2021-02-19[LSC] Add LOCAL_LICENSE_KINDS to system/coreBob Badour
Added SPDX-license-identifier-Apache-2.0 to: bootstat/Android.bp cli-test/Android.bp code_coverage/Android.bp cpio/Android.bp debuggerd/crasher/Android.bp debuggerd/proto/Android.bp diagnose_usb/Android.bp fs_mgr/libdm/Android.bp fs_mgr/libfiemap/Android.bp fs_mgr/liblp/Android.bp fs_mgr/libsnapshot/Android.bp fs_mgr/libstorage_literals/Android.bp fs_mgr/libvbmeta/Android.bp fs_mgr/tests/Android.bp fs_mgr/tools/Android.bp gatekeeperd/Android.bp healthd/Android.bp healthd/testdata/Android.bp init/Android.bp init/Android.mk init/sysprop/Android.bp init/test_kill_services/Android.bp init/test_service/Android.bp libappfuse/Android.bp libasyncio/Android.bp libbinderwrapper/Android.bp libcrypto_utils/Android.bp libcrypto_utils/tests/Android.bp libdiskconfig/Android.bp libgrallocusage/Android.bp libkeyutils/mini_keyctl/Android.bp libmodprobe/Android.bp libnetutils/Android.bp libpackagelistparser/Android.bp libprocessgroup/Android.bp libprocessgroup/cgrouprc/Android.bp libprocessgroup/cgrouprc_format/Android.bp libprocessgroup/profiles/Android.bp libprocessgroup/setup/Android.bp libqtaguid/Android.bp libsparse/Android.bp libstats/push_compat/Android.bp libsuspend/Android.bp libsync/Android.bp libsystem/Android.bp libsysutils/Android.bp libusbhost/Android.bp libutils/Android.bp libvndksupport/Android.bp libvndksupport/tests/Android.bp llkd/Android.bp llkd/tests/Android.bp property_service/libpropertyinfoparser/Android.bp property_service/libpropertyinfoserializer/Android.bp property_service/property_info_checker/Android.bp qemu_pipe/Android.bp reboot/Android.bp rootdir/Android.bp rootdir/Android.mk rootdir/avb/Android.bp rootdir/avb/Android.mk run-as/Android.bp sdcard/Android.bp set-verity-state/Android.bp shell_and_utilities/Android.bp storaged/Android.bp toolbox/Android.bp trusty/apploader/Android.bp trusty/confirmationui/Android.bp trusty/confirmationui/fuzz/Android.bp trusty/coverage/Android.bp trusty/fuzz/Android.bp trusty/fuzz/test/Android.bp trusty/gatekeeper/Android.bp trusty/gatekeeper/fuzz/Android.bp trusty/keymaster/Android.bp trusty/keymaster/fuzz/Android.bp trusty/libtrusty/Android.bp trusty/libtrusty/tipc-test/Android.bp trusty/secure_dpu/Android.bp trusty/storage/interface/Android.bp trusty/storage/lib/Android.bp trusty/storage/proxy/Android.bp trusty/storage/tests/Android.bp trusty/utils/spiproxyd/Android.bp trusty/utils/trusty-ut-ctrl/Android.bp usbd/Android.bp watchdogd/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to: debuggerd/Android.bp fastboot/Android.bp libkeyutils/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-MIT to: libcutils/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT to: fs_mgr/Android.bp fs_mgr/libfs_avb/Android.bp trusty/Android.bp trusty/utils/rpmb_dev/Android.bp Added SPDX-license-identifier-BSD to: fastboot/fuzzy_fastboot/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: Id740a7d2884556081fdb68876584b25eb95e1bef
2021-02-16Revert "[LSC] Add LOCAL_LICENSE_KINDS to system/core"Elliott Hughes
This reverts commit 187b7d19504ca8bdcbc6217c06a117017b4c6287. Reason for revert: system/core is multiple projects, not one. Change-Id: I790ea41741f8cd9b8b6db2f59a49e71fb0958fd6
2021-02-16[LSC] Add LOCAL_LICENSE_KINDS to system/coreBob Badour
Added SPDX-license-identifier-Apache-2.0 to: bootstat/Android.bp cli-test/Android.bp code_coverage/Android.bp cpio/Android.bp debuggerd/crasher/Android.bp debuggerd/proto/Android.bp diagnose_usb/Android.bp fs_mgr/libdm/Android.bp fs_mgr/libfiemap/Android.bp fs_mgr/liblp/Android.bp fs_mgr/libsnapshot/Android.bp fs_mgr/libstorage_literals/Android.bp fs_mgr/libvbmeta/Android.bp fs_mgr/tests/Android.bp fs_mgr/tools/Android.bp gatekeeperd/Android.bp healthd/Android.bp healthd/testdata/Android.bp init/Android.bp init/Android.mk init/sysprop/Android.bp init/test_kill_services/Android.bp init/test_service/Android.bp libappfuse/Android.bp libasyncio/Android.bp libbinderwrapper/Android.bp libcrypto_utils/Android.bp libcrypto_utils/tests/Android.bp libdiskconfig/Android.bp libgrallocusage/Android.bp libkeyutils/mini_keyctl/Android.bp libmodprobe/Android.bp libnetutils/Android.bp libpackagelistparser/Android.bp libprocessgroup/Android.bp libprocessgroup/cgrouprc/Android.bp libprocessgroup/cgrouprc_format/Android.bp libprocessgroup/profiles/Android.bp libprocessgroup/setup/Android.bp libqtaguid/Android.bp libsparse/Android.bp libstats/push_compat/Android.bp libsuspend/Android.bp libsync/Android.bp libsystem/Android.bp libsysutils/Android.bp libusbhost/Android.bp libutils/Android.bp libvndksupport/Android.bp libvndksupport/tests/Android.bp llkd/Android.bp llkd/tests/Android.bp property_service/libpropertyinfoparser/Android.bp property_service/libpropertyinfoserializer/Android.bp property_service/property_info_checker/Android.bp qemu_pipe/Android.bp reboot/Android.bp rootdir/Android.bp rootdir/Android.mk rootdir/avb/Android.bp rootdir/avb/Android.mk run-as/Android.bp sdcard/Android.bp set-verity-state/Android.bp shell_and_utilities/Android.bp storaged/Android.bp toolbox/Android.bp trusty/apploader/Android.bp trusty/confirmationui/Android.bp trusty/confirmationui/fuzz/Android.bp trusty/coverage/Android.bp trusty/fuzz/Android.bp trusty/fuzz/test/Android.bp trusty/gatekeeper/Android.bp trusty/gatekeeper/fuzz/Android.bp trusty/keymaster/Android.bp trusty/keymaster/fuzz/Android.bp trusty/libtrusty/Android.bp trusty/libtrusty/tipc-test/Android.bp trusty/secure_dpu/Android.bp trusty/storage/interface/Android.bp trusty/storage/lib/Android.bp trusty/storage/proxy/Android.bp trusty/storage/tests/Android.bp trusty/utils/spiproxyd/Android.bp trusty/utils/trusty-ut-ctrl/Android.bp usbd/Android.bp watchdogd/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to: debuggerd/Android.bp fastboot/Android.bp libkeyutils/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-MIT to: Android.bp libcutils/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT to: fs_mgr/Android.bp fs_mgr/libfs_avb/Android.bp trusty/utils/rpmb_dev/Android.bp Added SPDX-license-identifier-BSD to: fastboot/fuzzy_fastboot/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: I5bd81adb5cdcf2b4dd4141b204eb430ff526af8f
2020-12-11Add new owners to various sub-projects.Elliott Hughes
Test: treehugger Change-Id: Ia2a99c0499633ccc5d23c37a1ec93867c876d637
2020-10-19libmodprobe: Fail when modules.dep lacks colonAndrew Scull
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
2020-08-04libmodprobe: remove SetMinimumLogSeverity() from constructorTom Cherry
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
2020-06-26libmodprobe: remove unused EnableVerbose() methodMark Salyzyn
modprobe command no longer uses EnableVerbose, opting to do the associated operations directly. Test: compile Change-Id: Iffc8324f37f34de4eeb9a27e92fdf5524afa2220
2020-06-16Merge "libmodprobe: improve error reporting."Treehugger Robot
2020-06-16libmodprobe: improve error reporting.Elliott Hughes
Bug: http://b/159064719 Test: treehugger Change-Id: Ie3ea73a934a30b4674b30fd3823f59f062418ac7
2020-06-16modprobe: Use more inclusive language for libmodprobe (Part Deux)Mark Salyzyn
Remove blacklist Test: none Change-Id: I14ed08390a7db0b4b962343c61d60230751047ce
2020-06-15modprobe: Use more inclusive language for modprobe and libmodprobeMark Salyzyn
blacklist is replaced with blocklist. Test: none Change-Id: I59f9fde5900b9aee82aca1eab4a6ded3d136063b
2020-06-03add libmodprobe api to query the number of modules loadedSteve Muckle
In the short term this will be used to help implement support for multiple kernel module directories but it may be useful in other contexts as well. Bug: 157645635 Change-Id: I15a252b6e9394292c8f3557ed65112c935830441
2020-04-06first_stage_init: load modules in modules.load.recovery in recoverySteve Muckle
In recovery mode, load modules from modules.load.recovery if it exists. Otherwise load from modules.load as usual. Change-Id: I7636bb5958ed10ae9a66015f04f168129618272f
2019-12-27libmodprobe: parse kernel command line for module optionsSteve Muckle
Bug: 145808811 Test: atest libmodprobe_tests, verify on flame Change-Id: I0b41b1610fe13ae526d38f029da888f6f0d8a02d
2019-10-31libmodprobe: add strict bool argument to LoadListedModulesMark Salyzyn
Continue loading remaining modules after error if strict flag false. Test: libmodprobe_test Bug: 141311820 Change-Id: Ib21d4eade1254b16621e7bf2c9efaa173092e7c7
2019-10-30libmodprobe: Do not reload modules previously instantiatedMark Salyzyn
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-08-07Merge changes from topic "toolbox-modprobe"Treehugger Robot
* changes: toolbox: add modprobe libmodprobe: add verbose mode libmodprobe: add GetAllDependencies libmodprobe: add support to list modules libmodprobe: add support for a blacklist libmodprobe: support parameters in LoadWithAliases libmodprobe: add support to remove modules libmodprobe: make name canonical in LoadWithAliases libmodprobe: make available in vendor
2019-08-06libmodprobe: add verbose modeSteve Muckle
Change-Id: I2be18320461cd712a4828400b8f29bb5f07c801f
2019-08-06libmodprobe: add GetAllDependenciesSteve Muckle
Add a method to retrieve the dependencies (both hard and soft) of a module. Change-Id: Ie44ceb3e36856bb1a3e68c5d3c0d55a38deb0ef9
2019-08-06libmodprobe: add support to list modulesSteve Muckle
List the known modules with a name matching a given pattern. Change-Id: I7f6bd1f09a688c66682f94c5837e61d7dc61c1f7
2019-08-06libmodprobe: add support for a blacklistSteve Muckle
If the blacklist is enabled, blacklisted modules are treated as though they are not present. Change-Id: Ie8712f24298e78f92d5028b1ca3a8a3e07a9190a
2019-08-06libmodprobe: support parameters in LoadWithAliasesSteve Muckle
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-06libmodprobe: add support to remove modulesSteve Muckle
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-06libmodprobe: make name canonical in LoadWithAliasesSteve Muckle
Make the module name canonical in LoadWithAliases so it may be used more easily from outside the class. Change-Id: I7ee496b77a2beea43a6b68daed7af42660747559
2019-08-06libmodprobe: make available in vendorSteve Muckle
A toolbox implementation of modprobe will require libmodprobe. Change-Id: I7790576b828ad8cd5fae0c51926d8da9fb540d30
2019-08-05libmodprobe: add OWNERS fileSteve Muckle
Change-Id: I812c0420d982d2c927f40ca43545bdd15bc7b8be
2019-06-18create libmodprobe, integrate into first_stage_initSteve Muckle
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