partitionmanager: support delayed adopted storage mount

* On some devices, the external mmc driver will only load the card after
  a certain delay. The original code will break and fail to mount any
  adopted storage in this case.

* Add a special fstab flag to allow the partitionmanager to retry after
  a delay.

Change-Id: I219978850ff3ba7ad9dc7ca96fc30634c9574164
This commit is contained in:
Peter Cai
2021-02-15 12:29:19 -05:00
committed by bigbiff
parent 8d7d4aed04
commit 439d60cb9d
3 changed files with 17 additions and 0 deletions
+6
View File
@@ -160,6 +160,7 @@ enum TW_FSTAB_FLAGS {
TWFLAG_RESIZE,
TWFLAG_KEYDIRECTORY,
TWFLAG_WRAPPEDKEY,
TWFLAG_ADOPTED_MOUNT_DELAY,
};
/* Flags without a trailing '=' are considered dual format flags and can be
@@ -204,6 +205,7 @@ const struct flag_list tw_flags[] = {
{ "resize", TWFLAG_RESIZE },
{ "keydirectory=", TWFLAG_KEYDIRECTORY },
{ "wrappedkey", TWFLAG_WRAPPEDKEY },
{ "adopted_mount_delay=", TWFLAG_ADOPTED_MOUNT_DELAY },
{ 0, 0 },
};
@@ -268,6 +270,7 @@ TWPartition::TWPartition() {
SlotSelect = false;
Key_Directory = "";
Is_Super = false;
Adopted_Mount_Delay = 0;
}
TWPartition::~TWPartition(void) {
@@ -1006,6 +1009,9 @@ void TWPartition::Apply_TW_Flag(const unsigned flag, const char* str, const bool
case TWFLAG_ALTDEVICE:
Alternate_Block_Device = str;
break;
case TWFLAG_ADOPTED_MOUNT_DELAY:
Adopted_Mount_Delay = atoi(str);
break;
case TWFLAG_KEYDIRECTORY:
Key_Directory = str;
break;