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

Commit 5b4b38ce authored by Yifan Hong's avatar Yifan Hong
Browse files

liblp: Expose kDefaultGroup.

kDefaultGroup is the 'default' group that is never deleted
and has no size constraints. During a virtual a/b update,
the following series of action happens:
- move partitions out of groups that will be shrunk / deleted
  (into default)
- shrink / delete these groups
- grow / add other groups
- move those partitions to their destination group.

Otherwise, the metadata is inconsistent.

Bug: 138816109
Test: builds

Change-Id: I57cf4b44dda948377c6b3153756f469caa4652bc
parent 04d91871
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@
#include <string.h>

#include <algorithm>
#include <string_view>

#include <android-base/unique_fd.h>

@@ -31,8 +30,6 @@
namespace android {
namespace fs_mgr {

static constexpr std::string_view kDefaultGroup = "default";

bool LinearExtent::AddTo(LpMetadata* out) const {
    if (device_index_ >= out->block_devices.size()) {
        LERROR << "Extent references unknown block device.";
+4 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <memory>
#include <optional>
#include <set>
#include <string_view>

#include "liblp.h"
#include "partition_opener.h"
@@ -37,6 +38,9 @@ class LinearExtent;
static const uint32_t kDefaultPartitionAlignment = 1024 * 1024;
static const uint32_t kDefaultBlockSize = 4096;

// Name of the default group in a metadata.
static constexpr std::string_view kDefaultGroup = "default";

// Abstraction around dm-targets that can be encoded into logical partition tables.
class Extent {
  public: