Updating a full partition

16 views
Skip to first unread message

Mauro Condarelli

unread,
Apr 17, 2020, 9:20:29 AM4/17/20
to swupdate
I have to update two partitions on eMMC.
I want them to be completely overwritten (no leftovers), but they must be larger than strictly needed because:
1) I need to give ample allowance "for future expansion".
2) very specific data do need to be permanent (save, overwrite, restore).

fragment looks like:

        A = {
            images = (
                {
                    filename = "prod.ext4.gz";
                    device = "/dev/mmcblk0p5";
                    installed-directly = True;
                    version = "2020-02-02";
                    sha256 = "eff...d4f";
                    compressed = "zlib";
                    install-if-different = True;
                },
                {
                    filename = "application.ext4.gz";
                    device = "/dev/mmcblk0p7";
                    installed-directly = True;
                    version = "08.00";
                    sha256 = "74f...05a";
                    compressed = "zlib";
                    install-if-different = True;
                }
            );
       };

This means I have a <half filled 200M ext4 FileSystem which takes a very long time essentially writing zeroes to eMMC.

Is there any "smarter" way of achieving the same result?
I mean: something like not writing to disk unused sectors.

Thanks in Advance
Mauro

Stefano Babic

unread,
Apr 17, 2020, 9:45:34 AM4/17/20
to Mauro Condarelli, swupdate
Hi Mauro,

On 17/04/20 15:20, Mauro Condarelli wrote:
> I have to update two partitions on eMMC.
> I want them to be completely overwritten (no leftovers), but they must
> be larger than strictly needed because:
> 1) I need to give ample allowance "for future expansion".
> 2) very specific data do need to be permanent (save, overwrite, restore).

Why are they not stored in a separate partition, created at runtime ?

>
> fragment looks like:
>
>         A = {
>             images = (
>                 {
>                     filename = "prod.ext4.gz";
>                     device = "/dev/mmcblk0p5";
>                     installed-directly = True;
>                     version = "2020-02-02";
>                     sha256 = "eff...d4f";
>                     compressed = "zlib";
>                     install-if-different = True;
>                 },
>                 {
>                     filename = "application.ext4.gz";
>                     device = "/dev/mmcblk0p7";
>                     installed-directly = True;
>                     version = "08.00";
>                     sha256 = "74f...05a";
>                     compressed = "zlib";
>                     install-if-different = True;
>                 }
>             );
>        };
>
> This means I have a <half filled 200M ext4 FileSystem which takes a very
> long time essentially writing zeroes to eMMC.

Ok, so it is not a problem to download it because it is well compressed,
it is time consumed to write to eMMC.

>
> Is there any "smarter" way of achieving the same result?

Which is your proposal ?

> I mean: something like not writing to disk unused sectors.
>


Best regards,
Stefano Babic


--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=====================================================================

Maciej Pijanowski

unread,
Apr 17, 2020, 11:30:11 AM4/17/20
to swup...@googlegroups.com
If you are thinking about speeding up writing disk image to block
device, then
bmaptool is a tool which does exactly that:
https://github.com/intel/bmap-tools

To achieve similar result for SWUpdate, I guess you would need
a C library for bmaptool (or similar) and SWUpdate handler for that.
>>
>
> Best regards,
> Stefano Babic
>
>
--
Maciej Pijanowski
Embedded Systems Engineer
GPG: 9963C36AAC3B2B46
https://3mdeb.com | @3mdeb_com

Reply all
Reply to author
Forward
0 new messages