From 28ea7b000ae1d45c81663f69b3da45f3964d2ff7 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Fri, 24 May 2019 11:38:54 +0800 Subject: [PATCH] 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) --- partition.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/partition.cpp b/partition.cpp index b6e789ba..5626e5c4 100644 --- a/partition.cpp +++ b/partition.cpp @@ -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;