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

Commit 0be4406e authored by Tom Cherry's avatar Tom Cherry Committed by android-build-merger
Browse files

Merge "Add android::fs_mgr namespace for new Fstab code" am: 990807a9 am: 9594188e

am: 5217b136

Change-Id: I3e79fc9c02a1fa39c8502df587619a6a47334559
parents 89b92c12 5217b136
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ cc_library {
    static_libs: [
        "libminui",
        "libotautil",
        "libfstab",
    ],

    shared_libs: [
@@ -157,6 +158,7 @@ cc_defaults {
        "libhealthhalutils",
        "libvintf_recovery",
        "libvintf",
        "libfstab",
    ],
}

@@ -260,6 +262,7 @@ cc_binary {

    static_libs: [
        "libotautil",
        "libfstab",
    ],

    init_rc: [
@@ -287,6 +290,7 @@ cc_binary {

    static_libs: [
        "libotautil",
        "libfstab",
    ],

    init_rc: [
+3 −0
Original line number Diff line number Diff line
@@ -29,6 +29,9 @@
#include <android-base/unique_fd.h>
#include <fstab/fstab.h>

using android::fs_mgr::Fstab;
using android::fs_mgr::ReadDefaultFstab;

static std::string get_misc_blk_device(std::string* err) {
  Fstab fstab;
  if (!ReadDefaultFstab(&fstab)) {
+5 −4
Original line number Diff line number Diff line
@@ -45,6 +45,10 @@
#include "otautil/mounts.h"
#include "otautil/sysutil.h"

using android::fs_mgr::Fstab;
using android::fs_mgr::FstabEntry;
using android::fs_mgr::ReadDefaultFstab;

static Fstab fstab;

extern struct selabel_handle* sehandle;
@@ -69,10 +73,7 @@ void load_volume_table() {
}

Volume* volume_for_mount_point(const std::string& mount_point) {
  auto it = std::find_if(fstab.begin(), fstab.end(), [&mount_point](const auto& entry) {
    return entry.mount_point == mount_point;
  });
  return it == fstab.end() ? nullptr : &*it;
  return android::fs_mgr::GetEntryForMountPoint(&fstab, mount_point);
}

// Mount the volume specified by path at the given mount_point.
+3 −1
Original line number Diff line number Diff line
@@ -19,7 +19,9 @@

#include <string>

typedef struct FstabEntry Volume;
#include <fstab/fstab.h>

using Volume = android::fs_mgr::FstabEntry;

// Load and parse volume data from /etc/recovery.fstab.
void load_volume_table();
+3 −0
Original line number Diff line number Diff line
@@ -119,6 +119,9 @@

#include "otautil/error_code.h"

using android::fs_mgr::Fstab;
using android::fs_mgr::ReadDefaultFstab;

static constexpr int WINDOW_SIZE = 5;
static constexpr int FIBMAP_RETRY_LIMIT = 3;