<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/cmd/gpt.c, branch v2017.09</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>env: Rename getenv/_f() to env_get()</title>
<updated>2017-08-16T12:30:24+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2017-08-03T18:22:12+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=00caae6d47645e68d6e5277aceb69592b49381a6'/>
<id>00caae6d47645e68d6e5277aceb69592b49381a6</id>
<content type='text'>
We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.

Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.

Suggested-by: Wolfgang Denk &lt;wd@denx.de&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.

Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.

Suggested-by: Wolfgang Denk &lt;wd@denx.de&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>env: Rename setenv() to env_set()</title>
<updated>2017-08-16T12:22:18+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2017-08-03T18:22:09+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=382bee57f19b4454e2015bc19a010bc2d0ab9337'/>
<id>382bee57f19b4454e2015bc19a010bc2d0ab9337</id>
<content type='text'>
We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk &lt;wd@denx.de&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk &lt;wd@denx.de&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpt: harden set_gpt_info() against non NULL-terminated strings</title>
<updated>2017-08-05T00:38:32+00:00</updated>
<author>
<name>Alison Chaiken</name>
<email>alison@peloton-tech.com</email>
</author>
<published>2017-07-04T18:19:46+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2fcaa413b3f63f6671c90896df9a1bbd84390a4e'/>
<id>2fcaa413b3f63f6671c90896df9a1bbd84390a4e</id>
<content type='text'>
Strings read from devices may sometimes fail to be
NULL-terminated.   The functions in lib/string.c are subject to
failure in this case.   Protect against observed failures in
set_gpt_info() by switching to length-checking variants with a length
limit of the maximum possible partition table length.  At the same
time, add a few checks for NULL string pointers.

Here is an example as observed in sandbox under GDB:

    =&gt; gpt verify host 0 $partitions
    Program received signal SIGSEGV, Segmentation fault.
    0x0000000000477747 in strlen (s=0x0) at lib/string.c:267
    267             for (sc = s; *sc != '\0'; ++sc)
    (gdb) bt
    #0  0x0000000000477747 in strlen (s=0x0) at lib/string.c:267
    #1  0x00000000004140b2 in set_gpt_info (str_part=&lt;optimized out&gt;,
    str_disk_guid=str_disk_guid@entry=0x7fffffffdbe8, partitions=partitions@entry=0x7fffffffdbd8,
    parts_count=parts_count@entry=0x7fffffffdbcf "", dev_desc=&lt;optimized out&gt;) at cmd/gpt.c:415
    #2  0x00000000004145b9 in gpt_verify (str_part=&lt;optimized out&gt;, blk_dev_desc=0x7fffef09a9d0) at cmd/gpt.c:580
    #3  do_gpt (cmdtp=&lt;optimized out&gt;, flag=&lt;optimized out&gt;, argc=&lt;optimized out&gt;, argv=0x7fffef09a8f0)
    at cmd/gpt.c:783
    #4  0x00000000004295b0 in cmd_call (argv=0x7fffef09a8f0, argc=0x5, flag=&lt;optimized out&gt;,
    cmdtp=0x714e20 &lt;_u_boot_list_2_cmd_2_gpt&gt;) at common/command.c:500
    #5  cmd_process (flag=&lt;optimized out&gt;, argc=0x5, argv=0x7fffef09a8f0,
    repeatable=repeatable@entry=0x726c04 &lt;flag_repeat&gt;, ticks=ticks@entry=0x0) at common/command.c:539

Suggested-by: Lothar Waßmann &lt;LW@karo-electronics.de&gt;
Signed-off-by: Alison Chaiken &lt;alison@peloton-tech.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Strings read from devices may sometimes fail to be
NULL-terminated.   The functions in lib/string.c are subject to
failure in this case.   Protect against observed failures in
set_gpt_info() by switching to length-checking variants with a length
limit of the maximum possible partition table length.  At the same
time, add a few checks for NULL string pointers.

Here is an example as observed in sandbox under GDB:

    =&gt; gpt verify host 0 $partitions
    Program received signal SIGSEGV, Segmentation fault.
    0x0000000000477747 in strlen (s=0x0) at lib/string.c:267
    267             for (sc = s; *sc != '\0'; ++sc)
    (gdb) bt
    #0  0x0000000000477747 in strlen (s=0x0) at lib/string.c:267
    #1  0x00000000004140b2 in set_gpt_info (str_part=&lt;optimized out&gt;,
    str_disk_guid=str_disk_guid@entry=0x7fffffffdbe8, partitions=partitions@entry=0x7fffffffdbd8,
    parts_count=parts_count@entry=0x7fffffffdbcf "", dev_desc=&lt;optimized out&gt;) at cmd/gpt.c:415
    #2  0x00000000004145b9 in gpt_verify (str_part=&lt;optimized out&gt;, blk_dev_desc=0x7fffef09a9d0) at cmd/gpt.c:580
    #3  do_gpt (cmdtp=&lt;optimized out&gt;, flag=&lt;optimized out&gt;, argc=&lt;optimized out&gt;, argv=0x7fffef09a8f0)
    at cmd/gpt.c:783
    #4  0x00000000004295b0 in cmd_call (argv=0x7fffef09a8f0, argc=0x5, flag=&lt;optimized out&gt;,
    cmdtp=0x714e20 &lt;_u_boot_list_2_cmd_2_gpt&gt;) at common/command.c:500
    #5  cmd_process (flag=&lt;optimized out&gt;, argc=0x5, argv=0x7fffef09a8f0,
    repeatable=repeatable@entry=0x726c04 &lt;flag_repeat&gt;, ticks=ticks@entry=0x0) at common/command.c:539

Suggested-by: Lothar Waßmann &lt;LW@karo-electronics.de&gt;
Signed-off-by: Alison Chaiken &lt;alison@peloton-tech.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>GPT: provide commands to selectively rename partitions</title>
<updated>2017-08-05T00:35:27+00:00</updated>
<author>
<name>Alison Chaiken</name>
<email>alison@peloton-tech.com</email>
</author>
<published>2017-07-04T18:19:18+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=203f9b48adaf5ad5372ac72d82ab14465c82ee8d'/>
<id>203f9b48adaf5ad5372ac72d82ab14465c82ee8d</id>
<content type='text'>
This patch provides support in u-boot for renaming GPT
partitions.  The renaming is accomplished via new 'gpt swap'
and 'gpt rename' commands.

The 'swap' mode returns an error if no matching partition names
are found, or if the number of partitions with one name does not equal
the number with the second name.   The 'rename' variant always
succeeds as long as a partition with the provided number exists.

Rewriting the partition table has the side-effect that all partitions
end up with "msftdata" flag set.  The reason is that partition type
PARTITION_BASIC_DATA_GUID is hard-coded in the gpt_fill_pte()
function.  This does not appear to cause any harm.

Signed-off-by: Alison Chaiken &lt;alison@peloton-tech.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch provides support in u-boot for renaming GPT
partitions.  The renaming is accomplished via new 'gpt swap'
and 'gpt rename' commands.

The 'swap' mode returns an error if no matching partition names
are found, or if the number of partitions with one name does not equal
the number with the second name.   The 'rename' variant always
succeeds as long as a partition with the provided number exists.

Rewriting the partition table has the side-effect that all partitions
end up with "msftdata" flag set.  The reason is that partition type
PARTITION_BASIC_DATA_GUID is hard-coded in the gpt_fill_pte()
function.  This does not appear to cause any harm.

Signed-off-by: Alison Chaiken &lt;alison@peloton-tech.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>GPT: read partition table from device into a data structure</title>
<updated>2017-08-05T00:34:04+00:00</updated>
<author>
<name>Alison Chaiken</name>
<email>alison@peloton-tech.com</email>
</author>
<published>2017-07-04T18:18:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=09a49930e4154974dd918ed42d129d50c110c45a'/>
<id>09a49930e4154974dd918ed42d129d50c110c45a</id>
<content type='text'>
Make the partition table available for modification by reading it from
the user-specified device into a linked list.   Provide an accessor
function for command-line testing.

Signed-off-by: Alison Chaiken &lt;alison@peloton-tech.com&gt;
[trini: Make this depend on CMD_GPT_RENAME, as it is the user of this
code]
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make the partition table available for modification by reading it from
the user-specified device into a linked list.   Provide an accessor
function for command-line testing.

Signed-off-by: Alison Chaiken &lt;alison@peloton-tech.com&gt;
[trini: Make this depend on CMD_GPT_RENAME, as it is the user of this
code]
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>GPT: add accessor function for disk GUID</title>
<updated>2017-08-04T13:56:04+00:00</updated>
<author>
<name>Alison Chaiken</name>
<email>alison@peloton-tech.com</email>
</author>
<published>2017-06-25T23:43:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=73d6d18b7147c90d6f8a60acb8dad663a225e63d'/>
<id>73d6d18b7147c90d6f8a60acb8dad663a225e63d</id>
<content type='text'>
In order to read the GPT, modify the partition name strings, and then
write out a new GPT, the disk GUID is needed.  While there is an
existing accessor for the partition UUIDs, there is none yet for the
disk GUID.

Changes since v6: none.

Signed-off-by: Alison Chaiken &lt;alison@peloton-tech.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In order to read the GPT, modify the partition name strings, and then
write out a new GPT, the disk GUID is needed.  While there is an
existing accessor for the partition UUIDs, there is none yet for the
disk GUID.

Changes since v6: none.

Signed-off-by: Alison Chaiken &lt;alison@peloton-tech.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpt: Fix uuid string format</title>
<updated>2017-03-17T18:15:10+00:00</updated>
<author>
<name>Vincent Tinelli</name>
<email>vincent.tinelli@intel.com</email>
</author>
<published>2017-02-27T14:11:15+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9da52f8f67b32a21a687602681f6b6b6b7df480b'/>
<id>9da52f8f67b32a21a687602681f6b6b6b7df480b</id>
<content type='text'>
Change GPT UUID string format from UUID to GUID per specification.

Signed-off-by: Vincent Tinelli &lt;vincent.tinelli@intel.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change GPT UUID string format from UUID to GUID per specification.

Signed-off-by: Vincent Tinelli &lt;vincent.tinelli@intel.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd, disk: convert CONFIG_PARTITION_UUIDS, CMD_PART and CMD_GPT</title>
<updated>2017-01-28T13:48:03+00:00</updated>
<author>
<name>Patrick Delaunay</name>
<email>patrick.delaunay@st.com</email>
</author>
<published>2017-01-27T10:00:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b331cd6204ffdc568cd6c06bd18e72aa9bc61f22'/>
<id>b331cd6204ffdc568cd6c06bd18e72aa9bc61f22</id>
<content type='text'>
We convert CONFIG_PARTITION_UUIDS to Kconfig first.  But in order to cleanly
update all of the config files we must also update CMD_PART and CMD_GPT to also
be in Kconfig in order to avoid complex logic elsewhere to update all of the
config files.

Signed-off-by: Patrick Delaunay &lt;patrick.delaunay@st.com&gt;
Signed-off-by: Patrick Delaunay &lt;patrick.delaunay73@gmail.com&gt;
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We convert CONFIG_PARTITION_UUIDS to Kconfig first.  But in order to cleanly
update all of the config files we must also update CMD_PART and CMD_GPT to also
be in Kconfig in order to avoid complex logic elsewhere to update all of the
config files.

Signed-off-by: Patrick Delaunay &lt;patrick.delaunay@st.com&gt;
Signed-off-by: Patrick Delaunay &lt;patrick.delaunay73@gmail.com&gt;
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd: gpt: fix the wrong size parse for the last partition</title>
<updated>2016-08-06T00:55:16+00:00</updated>
<author>
<name>Kever Yang</name>
<email>kever.yang@rock-chips.com</email>
</author>
<published>2016-07-29T03:12:18+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c2fdd34569145ad281aeea5ef16fff83d7075830'/>
<id>c2fdd34569145ad281aeea5ef16fff83d7075830</id>
<content type='text'>
The calculation of "dev_desc-&gt;lba - 34  - 1 - offset" is not correct for
size '-', because both fist_usable_lba and last_usable_lba will remain
34 sectors.

We can simply use 0 for size '-' because the part_efi module will decode
the size and auto extend the size to maximum available size.

Signed-off-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The calculation of "dev_desc-&gt;lba - 34  - 1 - offset" is not correct for
size '-', because both fist_usable_lba and last_usable_lba will remain
34 sectors.

We can simply use 0 for size '-' because the part_efi module will decode
the size and auto extend the size to maximum available size.

Signed-off-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd: gpt: add - partition size parsing</title>
<updated>2016-06-12T17:14:57+00:00</updated>
<author>
<name>Michael Trimarchi</name>
<email>michael@amarulasolutions.com</email>
</author>
<published>2016-06-08T08:18:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=666362356e1ccc0df91c03b1d3f97939968b9c04'/>
<id>666362356e1ccc0df91c03b1d3f97939968b9c04</id>
<content type='text'>
This patch try to parse name=userdata,size=-,uuid=${uuid_gpt_userdata};

gpt mmc write 0 $partitions
gpt mmc verify 0 $partitions

Signed-off-by: Michael Trimarchi &lt;michael@amarulasolutions.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch try to parse name=userdata,size=-,uuid=${uuid_gpt_userdata};

gpt mmc write 0 $partitions
gpt mmc verify 0 $partitions

Signed-off-by: Michael Trimarchi &lt;michael@amarulasolutions.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
