Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46c6dc1a authored by Bowgo Tsai's avatar Bowgo Tsai
Browse files

fs_mgr: support reading fstab file from /odm or /vendor partition

fstab contains device- and soc- specific content that should reside in
/odm or /vendor partition. This change searches the fstab.${ro.hardware}
file from /odm/etc, /vendor/etc and /, then use the first one found.

Bug: 35811655
Test: boot sailfish
Change-Id: I82f89b41a849faedb64072a7cfc52d7424e1aaa1
parent 47d34273
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -636,8 +636,10 @@ struct fstab *fs_mgr_read_fstab_with_dt(const char *fstab_path)
    return in_place_merge(fstab_dt, fstab);
}

/* combines fstab entries passed in from device tree with
 * the ones found in /fstab.<hardware>
/*
 * tries to load default fstab.<hardware> file from /odm/etc, /vendor/etc
 * or /. loads the first one found and also combines fstab entries passed
 * in from device tree.
 */
struct fstab *fs_mgr_read_fstab_default()
{
@@ -645,7 +647,10 @@ struct fstab *fs_mgr_read_fstab_default()
    std::string default_fstab;

    if (fs_mgr_get_boot_config("hardware", &hw)) {
        default_fstab = FSTAB_PREFIX + hw;
        for (const char *prefix : {"/odm/etc/fstab.","/vendor/etc/fstab.", "/fstab."}) {
            default_fstab = prefix + hw;
            if (access(default_fstab.c_str(), F_OK) == 0) break;
        }
    } else {
        LWARNING << __FUNCTION__ << "(): failed to find device hardware name";
    }
+0 −2
Original line number Diff line number Diff line
@@ -41,8 +41,6 @@
#define PWARNING PLOG(WARNING) << FS_MGR_TAG
#define PERROR   PLOG(ERROR) << FS_MGR_TAG

const std::string FSTAB_PREFIX("/fstab.");

__BEGIN_DECLS

#define CRYPTO_TMPFS_OPTIONS "size=256m,mode=0771,uid=1000,gid=1000"