Fix the C&P from pil-squasher and describe pil-splitter arguments
properly. MBN isn't an output here.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
on newer mbn (8450+), the hash segment is the last one (so not .b01),
but still included in .mdt, and current logic fails if p_offset of .b01 is
smaller than the size of .mdt
fix by only attempting to read from .mdt for hash (type 2) segments
On unfused apq8074 the mba.mbn consists of ELF header (together with
program header entries) and a single segment for firmware itself. Handle
this corner case by writing ELF header as soon as it's read and by
writing the signature segment at the correct offset.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
There is no guarantee that there will be a segment covering the ELF
header. For example, for unfused apq8074 the mba firmware has just one
program header (for the firmware itself). Handle this case by writing
out ELF header as soon as it is read from the mdt file.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Add O_TRUNC to the flags passed to open() system call to prevent stale
data from being kept at the end of the files.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Add a tool to reverse the effect of pil-squasher: to split the mbn file
into the mdt and a series of bNN files.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>