kernel loader: don't try to reload modules already loaded by init
Change-Id: I58fb2ee369bdb9f5c5f9e6c8ea3f15781ae60ece
diff --git a/twrp.cpp b/twrp.cpp
index 1b0e337..96446b2 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -119,8 +119,12 @@
PartitionManager.Setup_Super_Devices();
PartitionManager.Prepare_Super_Volume(ven);
#ifdef TW_LOAD_VENDOR_MODULES
- KernelModuleLoader::Load_Vendor_Modules(FASTBOOTD_MODE);
+ KernelModuleLoader::Load_Vendor_Modules();
+ if (android::base::GetBoolProperty("ro.virtual_ab.enabled", false)) {
+ PartitionManager.Unmap_Super_Devices();
+ }
#endif
+
gui_msg(Msg("fastboot_console_msg=Entered Fastboot mode..."));
if (gui_startPage("fastboot", 1, 1) != 0) {
LOGERR("Failed to start fastbootd page.\n");
@@ -162,9 +166,9 @@
#ifdef TW_LOAD_VENDOR_MODULES
bool fastboot_mode = cmdline.find("twrpfastboot=1") != std::string::npos;
if (fastboot_mode)
- KernelModuleLoader::Load_Vendor_Modules(RECOVERY_FASTBOOT_MODE);
+ KernelModuleLoader::Load_Vendor_Modules();
else
- KernelModuleLoader::Load_Vendor_Modules(RECOVERY_IN_BOOT_MODE);
+ KernelModuleLoader::Load_Vendor_Modules();
#endif
// We are doing this here to allow super partition to be set up prior to overriding properties