Skip to content

Commit

Permalink
multirom: encmnt: Fix Support TWRP formed fstab entries
Browse files Browse the repository at this point in the history
Change-Id: Ica74d03915d66a82befd63a7865cae74680743c4
  • Loading branch information
nkk71 committed Mar 26, 2017
1 parent 063f1ec commit dacba1a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions trampoline_encmnt/encmnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ int main(int argc, char *argv[])
int cmd = CMD_NONE;
int stdout_fd;
char footer_location[256];
int found_footer_location;
struct fstab *fstab;
struct fstab_part *p;
char *argument = NULL;
Expand Down Expand Up @@ -264,16 +265,19 @@ int main(int argc, char *argv[])
goto exit;
}

strcpy(footer_location, "");
found_footer_location = 0;

if(p->options != NULL && get_footer_from_opts(footer_location,
sizeof(footer_location), p->options) < 0)
goto exit;
if(p->options)
found_footer_location = get_footer_from_opts(footer_location, sizeof(footer_location), p->options) == 0;

if(!found_footer_location && p->options2)
found_footer_location = get_footer_from_opts(footer_location, sizeof(footer_location), p->options2) == 0;

if(p->options2 != NULL && strcmp(footer_location, "") == 0 &&
get_footer_from_opts(footer_location, sizeof(footer_location),
p->options2) < 0)
if(!found_footer_location)
{
ERROR("Failed to find footer location\n");
goto exit;
}

INFO("Setting encrypted partition data to %s %s %s\n", p->device, footer_location, p->type);
set_partition_data(p->device, footer_location, p->type);
Expand Down

0 comments on commit dacba1a

Please sign in to comment.