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

Commit f98d6c49 authored by Mark Salyzyn's avatar Mark Salyzyn
Browse files

fs_mgr: ReadDefaultFstab suppress ReadFstabFromDt logging

Since we are moving the fstab from DT into the ramdisk fstab, the
logging from ReadFstabFromDt when reading the default fstab is
turning into logging noise.

Test: compile
Bug: 122602260
Change-Id: Icba0962c13d701afce2dc7c4f23712dd47ea0100
parent 1bcb6349
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -719,10 +719,10 @@ struct fstab* fs_mgr_read_fstab(const char* fstab_path) {
}

// Returns fstab entries parsed from the device tree if they exist
bool ReadFstabFromDt(Fstab* fstab) {
bool ReadFstabFromDt(Fstab* fstab, bool log) {
    std::string fstab_buf = read_fstab_from_dt();
    if (fstab_buf.empty()) {
        LINFO << __FUNCTION__ << "(): failed to read fstab from dt";
        if (log) LINFO << __FUNCTION__ << "(): failed to read fstab from dt";
        return false;
    }

@@ -730,13 +730,15 @@ bool ReadFstabFromDt(Fstab* fstab) {
        fmemopen(static_cast<void*>(const_cast<char*>(fstab_buf.c_str())),
                 fstab_buf.length(), "r"), fclose);
    if (!fstab_file) {
        PERROR << __FUNCTION__ << "(): failed to create a file stream for fstab dt";
        if (log) PERROR << __FUNCTION__ << "(): failed to create a file stream for fstab dt";
        return false;
    }

    if (!fs_mgr_read_fstab_file(fstab_file.get(), false, fstab)) {
        LERROR << __FUNCTION__ << "(): failed to load fstab from kernel:"
               << std::endl << fstab_buf;
        if (log) {
            LERROR << __FUNCTION__ << "(): failed to load fstab from kernel:" << std::endl
                   << fstab_buf;
        }
        return false;
    }

@@ -778,7 +780,7 @@ static std::string get_fstab_path()
// Loads the fstab file and combines with fstab entries passed in from device tree.
bool ReadDefaultFstab(Fstab* fstab) {
    Fstab dt_fstab;
    ReadFstabFromDt(&dt_fstab);
    ReadFstabFromDt(&dt_fstab, false);

    *fstab = std::move(dt_fstab);

+1 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ struct FstabEntry {
using Fstab = std::vector<FstabEntry>;

bool ReadFstabFromFile(const std::string& path, Fstab* fstab);
bool ReadFstabFromDt(Fstab* fstab);
bool ReadFstabFromDt(Fstab* fstab, bool log = true);
bool ReadDefaultFstab(Fstab* fstab);

// Temporary conversion functions.