class DevicePartitioner

Defined at line 96 of file ../../src/firmware/paver/device-partitioner.h

Abstract device partitioner definition.

This class defines common APIs for interacting with a device partitioner.

Public Methods

zx::result<std::unique_ptr<abr::Client>> CreateAbrClient ()

Creates the ABR client for the partitioner.

NOTE: The ABR client must not outlive the partitioner.

const paver::BlockDevices & Devices ()

Returns an accessor for the block devices managed by the partitioner.

fidl::UnownedClientEnd<fuchsia_io::Directory> SvcRoot ()

Returns the service root for the partitioner.

bool IsFvmWithinFtl ()

Whether or not the Fuchsia Volume Manager exists within an FTL.

bool SupportsPartition (const PartitionSpec & spec)

Checks if the device supports the given partition spec.

This is the only function that will definitively say whether a spec is

supported or not. Other partition functions may return ZX_ERR_NOT_SUPPORTED

on unsupported spec, but they may also return it for other reasons such as

a lower-level driver error. They also may return other errors even if given

an unsupported spec if something else goes wong.

zx::result<std::unique_ptr<PartitionClient>> FindPartition (const PartitionSpec & spec)

Returns a PartitionClient matching |spec| if one exists.

zx::result<> WipeFvm ()

Wipes Fuchsia Volume Manager partition.

zx::result<> ResetPartitionTables ()

Reset partition tables to a board-specific initial state.

This is only supported on some boards; in general it is preferred to use fastboot to

reinitialize partition tables.

zx::result<> ValidatePayload (const PartitionSpec & spec, std::span<const uint8_t> data)

Determine if the given data file is a valid image for this device.

This analysis is best-effort only, providing only basic safety checks.

zx::result<> Flush ()

Flush all buffered write to persistant storage.

zx::result<> OnStop ()

Called by paver when Lifetime::Stop event is received

Can be used to update ABR oneshot flags for reboot.

void ~DevicePartitioner ()

Defined at line 98 of file ../../src/firmware/paver/device-partitioner.h