Builds a Qualcomm EDL (QDL) flash directory that provisions an Arduino UNO Q with Nerves.
It starts from Arduino's eMMC bootloader bundle, keeps Qualcomm's partitions 1 to 66 and their boot firmware, replaces the last partitions of the GPT with the Nerves layout and writes the Nerves firmware into them.
The Nerves firmware is written as regions cut from a disk image produced by
fwup -t complete, so fwup stays the only thing that knows how to lay out a
firmware update.
Summary
Types
The Nerves partitions as {number, name, type GUID, first LBA, size}
Functions
The sector within the partition array and byte offset of a partition's entry.
Replaces Arduino's last partitions in its primary and backup GPT images with
the Nerves partitions. Header and partition array CRCs are fixed up by
patch0.xml while flashing, once the eMMC size is known.
The regions of the fwup image that get written to the eMMC.
The Nerves partitions at the end of the GPT.
Generates patch0.xml from Arduino's, pointing its "last partition" fix-ups
at the Nerves data partition instead of userdata.
Generates rawprogram0.xml from Arduino's: Qualcomm's boot firmware and the
GPT as before, then the Nerves image slices instead of Arduino's U-Boot,
efi, rootfs and userdata.
Writes a QDL flash directory to out_dir.
Types
@type partition() :: {pos_integer(), String.t(), String.t(), non_neg_integer(), pos_integer() | :rest}
The Nerves partitions as {number, name, type GUID, first LBA, size}
Functions
@spec entry_position(pos_integer()) :: {non_neg_integer(), non_neg_integer()}
The sector within the partition array and byte offset of a partition's entry.
Replaces Arduino's last partitions in its primary and backup GPT images with
the Nerves partitions. Header and partition array CRCs are fixed up by
patch0.xml while flashing, once the eMMC size is known.
@spec image_slices() :: [{String.t(), non_neg_integer(), pos_integer()}]
The regions of the fwup image that get written to the eMMC.
@spec partitions() :: [partition()]
The Nerves partitions at the end of the GPT.
Generates patch0.xml from Arduino's, pointing its "last partition" fix-ups
at the Nerves data partition instead of userdata.
Generates rawprogram0.xml from Arduino's: Qualcomm's boot firmware and the
GPT as before, then the Nerves image slices instead of Arduino's U-Boot,
efi, rootfs and userdata.
Writes a QDL flash directory to out_dir.
bootloader_dir is the extracted Arduino bootloader bundle and image is the
disk image from fwup -t complete.