[Debian-on-mobile-maintainers] [Git][DebianOnMobile-team/mfgtools][upstream] New upstream version 1.4.72
Henry-Nicolas Tourneur
gitlab at salsa.debian.org
Sun Jan 17 15:29:07 GMT 2021
Henry-Nicolas Tourneur pushed to branch upstream at Debian On Mobile / mfgtools
Commits:
4ecbacae by Henry-Nicolas Tourneur at 2021-01-17T15:24:37+00:00
New upstream version 1.4.72
- - - - -
2 changed files:
- libuuu/fastboot.cpp
- libuuu/sparse.cpp
Changes:
=====================================
libuuu/fastboot.cpp
=====================================
@@ -670,6 +670,7 @@ int FBFlashCmd::run(CmdCtx *ctx)
for(size_t nblk=0; nblk < pfile->total_chunks && pos <= pdata->size(); nblk++)
{
pdata->request_data(pos+sizeof(chunk_header_t)+sizeof(sparse_header));
+ size_t oldpos = pos;
pheader = SparseFile::get_next_chunk(pdata->data(), pos);
pdata->request_data(pos);
@@ -678,6 +679,32 @@ int FBFlashCmd::run(CmdCtx *ctx)
{
startblock += pheader->chunk_sz;
}
+ else if (sz == 0)
+ {
+ //whole chuck have not push into data.
+ if (flash(&fb, sf.m_data.data(), sf.m_data.size()))
+ return -1;
+
+ sf.init_header(pfile->blk_sz, max / pfile->blk_sz);
+
+ chunk_header_t ct;
+ ct.chunk_type = CHUNK_TYPE_DONT_CARE;
+ ct.chunk_sz = startblock;
+ ct.reserved1 = 0;
+ ct.total_sz = sizeof(ct);
+
+ sz = sf.push_one_chuck(&ct, nullptr);
+
+ /*
+ roll back pos to previous failure chunck and let it push again into new sparse file.
+ can't push it here because next chuck may big size chuck and need split as below else logic.
+ */
+ pos = oldpos;
+ uuu_notify nt;
+ nt.type = uuu_notify::NOTIFY_TRANS_POS;
+ nt.total = startblock;
+ call_notify(nt);
+ }
else
{
size_t off = ((uint8_t*)pheader) - pdata->data() + sz + sizeof(chunk_header_t);
=====================================
libuuu/sparse.cpp
=====================================
@@ -181,15 +181,20 @@ size_t SparseFile::push_one_chuck(chunk_header_t *p, void *data)
if (p->total_sz + m_data.size() > m_max_size)
{
- size_t blk = (m_max_size - m_data.size())/pheader->blk_sz;
- if (blk < 2)
- return 0;
+ if (p->chunk_type == CHUNK_TYPE_RAW)
+ {
+ size_t blk = (m_max_size - m_data.size()) / pheader->blk_sz;
+ if (blk < 2)
+ return 0;
- blk -= 2;
+ blk -= 2;
- cheader.chunk_sz = blk;
- sz = blk * pheader->blk_sz;
- cheader.total_sz = sizeof(chunk_header_t) + sz;
+ cheader.chunk_sz = blk;
+ sz = blk * pheader->blk_sz;
+ cheader.total_sz = sizeof(chunk_header_t) + sz;
+ }
+ else
+ return 0;
}
push(&cheader, sizeof(chunk_header));
View it on GitLab: https://salsa.debian.org/DebianOnMobile-team/mfgtools/-/commit/4ecbacae851eb8d79ec69993eee781dbfd3481bf
--
View it on GitLab: https://salsa.debian.org/DebianOnMobile-team/mfgtools/-/commit/4ecbacae851eb8d79ec69993eee781dbfd3481bf
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-on-mobile-maintainers/attachments/20210117/f4a6c7cf/attachment-0001.html>
More information about the Debian-on-mobile-maintainers
mailing list