From d1dcedd3fb9fdb0db1e1607acc7259dad55e9842 Mon Sep 17 00:00:00 2001 From: Fernando Lugo Date: Wed, 22 Mar 2017 16:43:51 -0700 Subject: [PATCH 1/2] fs_mgr: adapt to new A/B support In the new A/B partition support suffixes don't have "_". So, fix fs_mgr code that assumes it has "_" Bug: 36533366 Test: boot Change-Id: I0f528cf1e8fecacb1b4ae34f6dc42e18ebe777bb Signed-off-by: Fernando Lugo --- fs_mgr/fs_mgr_slotselect.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs_mgr/fs_mgr_slotselect.cpp b/fs_mgr/fs_mgr_slotselect.cpp index f3bba7b93..f27a79db1 100644 --- a/fs_mgr/fs_mgr_slotselect.cpp +++ b/fs_mgr/fs_mgr_slotselect.cpp @@ -37,8 +37,7 @@ int fs_mgr_update_for_slotselect(struct fstab *fstab) got_suffix = 1; } - if (asprintf(&tmp, "%s%s", fstab->recs[n].blk_device, - suffix.c_str()) > 0) { + if (asprintf(&tmp, "%s_%s", fstab->recs[n].blk_device, suffix.c_str()) > 0) { free(fstab->recs[n].blk_device); fstab->recs[n].blk_device = tmp; } else { From ce9d7db979bffb9539431418b8e7d8bfb0cc93f1 Mon Sep 17 00:00:00 2001 From: Fernando Lugo Date: Wed, 22 Mar 2017 18:57:47 -0700 Subject: [PATCH 2/2] fs_mgr: allow using legacy A/B suffix Right now all platforms supporting A/B have not fixed androidboot.slot_suffix kernel command line parameter. To avoid breaking all those platform allow using legacy support bootloaders get fixed. Bug: 36533366 Test: boot Change-Id: I0ad349f262d0b7f4897f3e184cb053b1440b2d5b Signed-off-by: Fernando Lugo --- fs_mgr/fs_mgr_slotselect.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs_mgr/fs_mgr_slotselect.cpp b/fs_mgr/fs_mgr_slotselect.cpp index f27a79db1..a536b22ec 100644 --- a/fs_mgr/fs_mgr_slotselect.cpp +++ b/fs_mgr/fs_mgr_slotselect.cpp @@ -35,6 +35,8 @@ int fs_mgr_update_for_slotselect(struct fstab *fstab) return -1; } got_suffix = 1; + // remove below line when bootloaders fix androidboot.slot_suffix param + if (suffix[0] == '_') suffix.erase(suffix.begin()); } if (asprintf(&tmp, "%s_%s", fstab->recs[n].blk_device, suffix.c_str()) > 0) {