13 Commits

Author SHA1 Message Date
Konrad Dybcio 3c9f8b8756 Merge pull request #11 from lumag/fix-splitter-args
pil-splitter: fix usage arguments
2024-06-11 15:46:07 +02:00
Dmitry Baryshkov dbd52f8fad pil-splitter: fix usage arguments
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>
2024-06-05 11:46:35 +03:00
Konrad Dybcio e25efba9b3 Merge pull request #10 from konradybcio/topic/license
Introduce the LICENSE file
2024-03-18 17:11:38 +01:00
Konrad Dybcio 7b1f14cf5e Introduce the LICENSE file
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
2023-11-29 14:06:08 +01:00
Luca Weiss 8ac2d5cdf4 Install pil-splitter during 'make install' 2023-11-27 13:29:33 -06:00
Jonathan Marek 509cf42bdd fix pil-squasher for newer mbn files
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
2023-08-27 17:34:45 -05:00
Dmitry Baryshkov e8573feaad pil-splitter: handle the apq8074's mba.mbn corner case
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>
2023-03-31 17:40:09 -05:00
Dmitry Baryshkov 47933b5edd pil-squasher: write ELF header after reading it
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>
2023-03-31 17:40:09 -05:00
Dmitry Baryshkov ffa9dd82c4 pil-*: pass O_TRUNC to open()
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>
2023-03-31 17:40:09 -05:00
Dmitry Baryshkov cab5d5cd99 pil-splitter: a tool to split the MBN into MDT + Bnn files
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>
2023-03-07 11:40:03 -06:00
Dmitry Baryshkov 843950ff84 pil-squasher: support for squashing 64-bit files
Some of the mdt files are 64-bit ELF files (for the AArch64). Support
squashing them too.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
2021-05-29 09:54:18 -07:00
Bjorn Andersson 170b62d29f pil-squasher: Initial implementation
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-07-08 10:58:54 -07:00
Bjorn Andersson f74fbc06ee ... 2019-07-08 10:42:45 -07:00