partition: set fbe.data.wrappedkey automatically via flag

In change I79c2855d577156670b45c10c7c7b1fcd9fece8d9 we introduced a
property to enable wrappedkey mode. This change supports an extra
`wrappedkey` flag in fstab to automatically set the property to true.

Change-Id: I4f060d4ed6b2a5680649b8746dfa7fd903fe2d35
(cherry picked from commit 40ed06e850de2dc7cc06c2e647688212563f1ec2)
This commit is contained in:
Peter Cai
2019-05-24 11:38:54 +08:00
committed by bigbiff
parent 6c1477d974
commit 28ea7b000a

View File

@@ -158,6 +158,7 @@ enum TW_FSTAB_FLAGS {
TWFLAG_FORMATTABLE,
TWFLAG_RESIZE,
TWFLAG_KEYDIRECTORY,
TWFLAG_WRAPPEDKEY,
};
/* Flags without a trailing '=' are considered dual format flags and can be
@@ -202,6 +203,7 @@ const struct flag_list tw_flags[] = {
{ "formattable", TWFLAG_FORMATTABLE },
{ "resize", TWFLAG_RESIZE },
{ "keydirectory=", TWFLAG_KEYDIRECTORY },
{ "wrappedkey", TWFLAG_WRAPPEDKEY },
{ 0, 0 },
};
@@ -883,6 +885,13 @@ void TWPartition::Apply_TW_Flag(const unsigned flag, const char* str, const bool
LOGINFO("FBE contents '%s', filenames '%s'\n", FBE_contents.c_str(), FBE_filenames.c_str());
}
break;
case TWFLAG_WRAPPEDKEY:
// Set fbe.data.wrappedkey to true
{
property_set("fbe.data.wrappedkey", "true");
LOGINFO("FBE wrapped key enabled\n");
}
break;
case TWFLAG_FLASHIMG:
Can_Flash_Img = val;
break;