<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mtd-utils.git/misc-utils/flashcp.c, branch v2.3.1</title>
<subtitle>A mirror of http://git.infradead.org/mtd-utils.git</subtitle>
<id>https://git.infraroot.at/mtd-utils.git/atom?h=v2.3.1</id>
<link rel='self' href='https://git.infraroot.at/mtd-utils.git/atom?h=v2.3.1'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/'/>
<updated>2025-01-30T17:30:16+00:00</updated>
<entry>
<title>misc-utils: flashcp: Fix uninitialized variable ‘wrlast_buf’ compiling warning</title>
<updated>2025-01-30T17:30:16+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2025-01-26T06:41:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=555a652dfe40619fd316ff7016570734450daf44'/>
<id>urn:sha1:555a652dfe40619fd316ff7016570734450daf44</id>
<content type='text'>
The compiler compains following message:
 misc-utils/flashcp.c:439:3: warning: ‘wrlast_buf’ may be used
 uninitialized in this function
It won't bring any problems because variable '‘wrlast_buf’ is always
initialized before being used. Fix the warning by setting 'wrlast_buf'
as NULL when declaring it.

Signed-off-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>flashcp: Add write last option.</title>
<updated>2023-09-08T11:48:52+00:00</updated>
<author>
<name>Piotr Esden-Tempski</name>
<email>piotr@esden.net</email>
</author>
<published>2023-09-01T00:55:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=aaa77f94ce6e03d9730f62004347ec2bbf11cfb1'/>
<id>urn:sha1:aaa77f94ce6e03d9730f62004347ec2bbf11cfb1</id>
<content type='text'>
This option is useful for power fail resilient bootloader updates, for
systems that check only the partition header for validity before
attempting to load the bootloader. For example zynq.

Postponing the write of a specified amount of bytes at the beginning of
a bootloader makes sure a written bootloader slot is not considered
valid until all the data is written.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>mtd-utils: Add new syntax to get devices by name</title>
<updated>2023-05-30T09:12:12+00:00</updated>
<author>
<name>Brandon Maier</name>
<email>brandon.maier@collins.com</email>
</author>
<published>2022-12-12T18:01:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=730148bc94411f13a0171204e872b0760fbde185'/>
<id>urn:sha1:730148bc94411f13a0171204e872b0760fbde185</id>
<content type='text'>
This introduces a new feature to the MTD command line utilities that
allows MTD devices to be referenced by name instead of device node. For
example this looks like:

&gt; # Display info for the MTD device with name "data"
&gt; mtdinfo mtd:data
&gt; # Copy file to MTD device with name "data"
&gt; flashcp /my/file mtd:data

This follows the syntax supported by the kernel which allows MTD
device's to be mounted by name[1].

Add the function mtd_find_dev_node() that accepts an MTD "identifier"
and returns the MTD's device node. The function accepts a string
starting with "mtd:" which it treats as the MTD's name. It then attempts
to search for the MTD, and if found maps it back to the /dev/mtdX device
node. If the string does not start with "mtd:", then assume it's the old
style and refers directly to a MTD device node.

The function is then hooked into existing tools like flashcp, mtdinfo,
flash_unlock, etc. To load in the new MTD parsing code in a consistent
way across programs.

[1] http://www.linux-mtd.infradead.org/faq/jffs2.html#L_mtdblock

Signed-off-by: Brandon Maier &lt;brandon.maier@collins.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>misc-utils: flashcp: correct casting for percent display</title>
<updated>2023-04-24T07:01:37+00:00</updated>
<author>
<name>cchoux</name>
<email>chou.cosmo@gmail.com</email>
</author>
<published>2023-04-22T07:31:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=a2f6201c501035ec02634b2fa7d261b003ec26bb'/>
<id>urn:sha1:a2f6201c501035ec02634b2fa7d261b003ec26bb</id>
<content type='text'>
Add correct casting for written to prevent overflow that size_t is
only 32 bits on a 32-bit platform.

Signed-off-by: cchoux &lt;chou.cosmo@gmail.com&gt;
Reviewed-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>misc-utils: flashcp: abort on --partition and --erase-all</title>
<updated>2022-11-07T07:24:45+00:00</updated>
<author>
<name>Brandon Maier</name>
<email>brandon.maier@collins.com</email>
</author>
<published>2022-11-02T22:47:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=5ed8f1b0b72b22754e3025f9c74b37feac6fd720'/>
<id>urn:sha1:5ed8f1b0b72b22754e3025f9c74b37feac6fd720</id>
<content type='text'>
Signed-off-by: Brandon Maier &lt;brandon.maier@collins.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>misc-utils: flashcp: verify data in --partition</title>
<updated>2022-11-07T07:24:44+00:00</updated>
<author>
<name>Brandon Maier</name>
<email>brandon.maier@collins.com</email>
</author>
<published>2022-11-02T22:47:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=7b5557499a5f2ef612a54014c4f4e8d368d35bd6'/>
<id>urn:sha1:7b5557499a5f2ef612a54014c4f4e8d368d35bd6</id>
<content type='text'>
The --partition mode is not verifying that data is being written
successfully.

Signed-off-by: Brandon Maier &lt;brandon.maier@collins.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>misc-utils: flashcp: fix buffer overflow</title>
<updated>2022-11-07T07:24:42+00:00</updated>
<author>
<name>Brandon Maier</name>
<email>brandon.maier@collins.com</email>
</author>
<published>2022-11-02T22:47:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=92d826ac57e753da120a82cded354931b3fe8e76'/>
<id>urn:sha1:92d826ac57e753da120a82cded354931b3fe8e76</id>
<content type='text'>
The DIFF_BLOCKS code requires that src and dest buffers be large enough
to hold one MTD erasesize. This is because each loop operates on one
eraseblock so that it can erase and write one whole sector. But the src
and dest buffers are fixed at BUFSIZE, so on platforms where the MTD
erasesize are larger then BUFSIZE it will overflow the buffers.

Instead allocate the buffers dynamically so that they can be sized to
fit the erasesize.

Signed-off-by: Brandon Maier &lt;brandon.maier@collins.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>misc-utils: flashcp: simplify logging</title>
<updated>2022-11-07T07:24:36+00:00</updated>
<author>
<name>Brandon Maier</name>
<email>brandon.maier@collins.com</email>
</author>
<published>2022-11-02T22:47:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=345c5bde41fc1238a3f3b9b1a52e30ec7ab99b6e'/>
<id>urn:sha1:345c5bde41fc1238a3f3b9b1a52e30ec7ab99b6e</id>
<content type='text'>
Most of the uses of log_printf fall into two styles

&gt; if (flags &amp; FLAG_VERBOSE)
&gt;     log_printf(LOG_NORMAL, ...);

or

&gt; log_printf(LOG_ERROR, ...)
&gt; exit(EXIT_FAILURE);

Replace them with log_verbose and log_failure respectively.

Signed-off-by: Brandon Maier &lt;brandon.maier@collins.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>misc-utils: flashcp: add safe_memerase</title>
<updated>2022-11-07T07:24:35+00:00</updated>
<author>
<name>Brandon Maier</name>
<email>brandon.maier@collins.com</email>
</author>
<published>2022-11-02T22:47:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=516ba62c6699b1b2d1323013161692d46ae0cbcb'/>
<id>urn:sha1:516ba62c6699b1b2d1323013161692d46ae0cbcb</id>
<content type='text'>
Signed-off-by: Brandon Maier &lt;brandon.maier@collins.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>misc-utils: flashcp: check for lseek errors</title>
<updated>2022-11-07T07:24:33+00:00</updated>
<author>
<name>Brandon Maier</name>
<email>brandon.maier@collins.com</email>
</author>
<published>2022-11-02T22:47:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=a28c5307d6c32a819521542903e678c3c544fa6c'/>
<id>urn:sha1:a28c5307d6c32a819521542903e678c3c544fa6c</id>
<content type='text'>
Add a safe_lseek wrapper to check for lseek errors.

Signed-off-by: Brandon Maier &lt;brandon.maier@collins.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
</feed>
