Loading fs_mgr/fs_mgr_fstab.c +25 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <string.h> #include <sys/mount.h> #include <cutils/properties.h> #include "fs_mgr_priv.h" struct fs_mgr_flag_values { Loading Loading @@ -70,6 +72,7 @@ static struct flag_list fs_mgr_flags[] = { { "zramsize=", MF_ZRAMSIZE }, { "verify", MF_VERIFY }, { "noemulatedsd", MF_NOEMULATEDSD }, { "slotselect", MF_SLOTSELECT }, { "defaults", 0 }, { 0, 0 }, }; Loading Loading @@ -307,6 +310,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); Loading Loading @@ -448,3 +468,8 @@ int fs_mgr_is_noemulatedsd(const struct fstab_rec *fstab) { return fstab->fs_mgr_flags & MF_NOEMULATEDSD; } int fs_mgr_is_slotselect(struct fstab_rec *fstab) { return fstab->fs_mgr_flags & MF_SLOTSELECT; } fs_mgr/fs_mgr_priv.h +1 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ #define MF_NOEMULATEDSD 0x800 /* no emulated sdcard daemon, sd card is the only external storage */ #define MF_FILEENCRYPTION 0x2000 #define MF_SLOTSELECT 0x8000 #define DM_BUF_SIZE 4096 Loading Loading
fs_mgr/fs_mgr_fstab.c +25 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <string.h> #include <sys/mount.h> #include <cutils/properties.h> #include "fs_mgr_priv.h" struct fs_mgr_flag_values { Loading Loading @@ -70,6 +72,7 @@ static struct flag_list fs_mgr_flags[] = { { "zramsize=", MF_ZRAMSIZE }, { "verify", MF_VERIFY }, { "noemulatedsd", MF_NOEMULATEDSD }, { "slotselect", MF_SLOTSELECT }, { "defaults", 0 }, { 0, 0 }, }; Loading Loading @@ -307,6 +310,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); Loading Loading @@ -448,3 +468,8 @@ int fs_mgr_is_noemulatedsd(const struct fstab_rec *fstab) { return fstab->fs_mgr_flags & MF_NOEMULATEDSD; } int fs_mgr_is_slotselect(struct fstab_rec *fstab) { return fstab->fs_mgr_flags & MF_SLOTSELECT; }
fs_mgr/fs_mgr_priv.h +1 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ #define MF_NOEMULATEDSD 0x800 /* no emulated sdcard daemon, sd card is the only external storage */ #define MF_FILEENCRYPTION 0x2000 #define MF_SLOTSELECT 0x8000 #define DM_BUF_SIZE 4096 Loading