am eb65ce0a: resolved conflicts for merge of 7c4ed6af
to stage-aosp-master
* commit 'eb65ce0a240f9591019b8a40e17d25e86a131e35': fs_mgr: Add support for A/B partitions
This commit is contained in:
commit
11f0d159a1
|
@ -22,6 +22,8 @@
|
|||
#include <sys/mount.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <cutils/properties.h>
|
||||
|
||||
#include "fs_mgr_priv.h"
|
||||
|
||||
struct fs_mgr_flag_values {
|
||||
|
@ -74,6 +76,7 @@ static struct flag_list fs_mgr_flags[] = {
|
|||
{ "noemulatedsd", MF_NOEMULATEDSD },
|
||||
{ "notrim", MF_NOTRIM },
|
||||
{ "formattable", MF_FORMATTABLE },
|
||||
{ "slotselect", MF_SLOTSELECT },
|
||||
{ "defaults", 0 },
|
||||
{ 0, 0 },
|
||||
};
|
||||
|
@ -329,6 +332,23 @@ struct fstab *fs_mgr_read_fstab(const char *fstab_path)
|
|||
fstab->recs[cnt].partnum = flag_vals.partnum;
|
||||
fstab->recs[cnt].swap_prio = flag_vals.swap_prio;
|
||||
fstab->recs[cnt].zram_size = flag_vals.zram_size;
|
||||
|
||||
/* If an A/B partition, modify block device to be the real block device */
|
||||
if (fstab->recs[cnt].fs_mgr_flags & MF_SLOTSELECT) {
|
||||
char propbuf[PROPERTY_VALUE_MAX];
|
||||
char *tmp;
|
||||
|
||||
/* use the kernel parameter if set */
|
||||
property_get("ro.boot.slot_suffix", propbuf, "");
|
||||
|
||||
if (asprintf(&tmp, "%s%s", fstab->recs[cnt].blk_device, propbuf) > 0) {
|
||||
free(fstab->recs[cnt].blk_device);
|
||||
fstab->recs[cnt].blk_device = tmp;
|
||||
} else {
|
||||
ERROR("Error updating block device name\n");
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
fclose(fstab_file);
|
||||
|
@ -480,3 +500,8 @@ int fs_mgr_is_formattable(struct fstab_rec *fstab)
|
|||
{
|
||||
return fstab->fs_mgr_flags & (MF_FORMATTABLE);
|
||||
}
|
||||
|
||||
int fs_mgr_is_slotselect(struct fstab_rec *fstab)
|
||||
{
|
||||
return fstab->fs_mgr_flags & MF_SLOTSELECT;
|
||||
}
|
||||
|
|
|
@ -79,6 +79,7 @@
|
|||
#define MF_NOTRIM 0x1000
|
||||
#define MF_FILEENCRYPTION 0x2000
|
||||
#define MF_FORMATTABLE 0x4000
|
||||
#define MF_SLOTSELECT 0x8000
|
||||
|
||||
#define DM_BUF_SIZE 4096
|
||||
|
||||
|
|
Loading…
Reference in New Issue