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

Commit bfd02914 authored by David Anderson's avatar David Anderson Committed by android-build-merger
Browse files

Merge "liblp: Allow the super partition to span multiple block devices."

am: 2cda71c9

Change-Id: Iae17c1951747cb20415790702a732768de850e2f
parents 46d6d26c 2cda71c9
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -75,14 +75,9 @@ static bool CreateDmTable(const LpMetadata& metadata, const LpMetadataPartition&
                target = std::make_unique<DmTargetZero>(sector, extent.num_sectors);
                break;
            case LP_TARGET_TYPE_LINEAR: {
                auto block_device = GetMetadataSuperBlockDevice(metadata);
                if (!block_device) {
                    LOG(ERROR) << "Could not identify the super block device";
                    return false;
                }

                const auto& block_device = metadata.block_devices[extent.target_source];
                std::string path;
                if (!GetPhysicalPartitionDevicePath(*block_device, &path)) {
                if (!GetPhysicalPartitionDevicePath(block_device, &path)) {
                    LOG(ERROR) << "Unable to complete device-mapper table, unknown block device";
                    return false;
                }
+207 −89

File changed.

Preview size limit exceeded, changes collapsed.

+72 −20

File changed.

Preview size limit exceeded, changes collapsed.

+39 −21

File changed.

Preview size limit exceeded, changes collapsed.

+11 −3
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ extern "C" {
#define LP_METADATA_HEADER_MAGIC 0x414C5030

/* Current metadata version. */
#define LP_METADATA_MAJOR_VERSION 7
#define LP_METADATA_MAJOR_VERSION 8
#define LP_METADATA_MINOR_VERSION 0

/* Attributes for the LpMetadataPartition::attributes field.
@@ -240,6 +240,13 @@ typedef struct LpMetadataExtent {
     * ZERO: This field must be 0.
     */
    uint64_t target_data;

    /* 20: Contents depends on target_type.
     *
     * LINEAR: Must be an index into the block devices table.
     * ZERO: This field must be 0.
     */
    uint32_t target_source;
} __attribute__((packed)) LpMetadataExtent;

/* This struct defines an entry in the groups table. Each group has a maximum
@@ -255,8 +262,9 @@ typedef struct LpMetadataPartitionGroup {
    uint64_t maximum_size;
} LpMetadataPartitionGroup;

/* This struct defines an entry in the block_devices table. There must be
 * exactly one device, corresponding to the super partition.
/* This struct defines an entry in the block_devices table. There must be at
 * least one device, and the first device must represent the partition holding
 * the super metadata.
 */
typedef struct LpMetadataBlockDevice {
    /* 0: First usable sector for allocating logical partitions. this will be
Loading