[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <456614823.32530.1626419772792.JavaMail.zimbra@nod.at>
Date: Fri, 16 Jul 2021 09:16:12 +0200 (CEST)
From: Richard Weinberger <richard@....at>
To: Pintu Agarwal <pintu.ping@...il.com>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
linux-mtd <linux-mtd@...ts.infradead.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Phillip Lougher <phillip@...ashfs.org.uk>,
Sean Nyekjaer <sean@...nix.com>,
Kernelnewbies <kernelnewbies@...nelnewbies.org>
Subject: Re: MTD: How to get actual image size from MTD partition
Pintu,
----- Ursprüngliche Mail -----
> Von: "Pintu Agarwal" <pintu.ping@...il.com>
> My requirement:
> To find the checksum of a real image in runtime which is flashed in an
> MTD partition.
>
> Problem:
> Currently, to find the checksum, we are using:
> $ md5sum /dev/mtd14
> This returns the proper checksum of the entire partition.
> But we wanted to find the checksum only for the actual image data
> which will be used by our C utility to validate the image.
> Here, we don't know the actual image size.
> We only know the "partition-size" and "erasesize".
>
> So, is there a mechanism to somehow find the image size at runtime?
not really, UBI manages the MTD and does wearleveling, auto growing of volumes, etc...
So as soon you attach the image once, it is changed and the checksum won't match.
It may work if you don't attach UBI and your flash program tool keeps track of
what pages it wrote.
Thanks,
//richard
Powered by blists - more mailing lists