| #
0aca89f2 |
| 06-Mar-2024 |
Yifeng Zhao <yifeng.zhao@rock-chips.com> |
gpt: support ufs 4k block size
Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com> Change-Id: I6e61021ccd192c49ef92bf2f54d58b9a1c4a6882
|
| #
017aad04 |
| 07-Oct-2017 |
Tom Rini <trini@konsulko.com> |
UPSTREAM: cmd/gpt.c, cmd/nvedit.c, tools/fit_image.c: Rework recent fixes for Coverity
The recent changes to these files did not completely fix the previous issues, or introduced different (minor) i
UPSTREAM: cmd/gpt.c, cmd/nvedit.c, tools/fit_image.c: Rework recent fixes for Coverity
The recent changes to these files did not completely fix the previous issues, or introduced different (minor) issues. In cmd/gpt.c we need to dereference str_disk_guid to be sure that malloc worked. In cmd/nvedit.c we need to be careful that we can also fit in that leading space when adding to the string. And in tools/fit_image.c we need to re-work the error handling slightly in fit_import_data() so that we only call munmap() once. We have two error paths here, one where we have an fd to close and one where we do not. Adjust labels to match this.
Change-Id: I66fafd0ed8d1c290a7773bba5ece8d11bfc15b50 Reported-by: Coverity (CID: 167366, 167367, 167370) Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit bf52fcdef4aac242b5e6b6b9827acf6d69ce1951)
show more ...
|
| #
cb40c099 |
| 26-Sep-2017 |
Alison Chaiken <alison@she-devel.com> |
UPSTREAM: GPT: fix memory leaks identified by Coverity
Create a common exit for most of the error handling code in do_rename_gpt_parts. Delete the list elements in disk_partitions before calling I
UPSTREAM: GPT: fix memory leaks identified by Coverity
Create a common exit for most of the error handling code in do_rename_gpt_parts. Delete the list elements in disk_partitions before calling INIT_LIST_HEAD from get_gpt_info() a second time.
The SIZEOF_MISMATCH error is not addressed, since that problem was already fixed by "GPT: incomplete initialization in allocate_disk_part".
Change-Id: I4ec9881a86c8a50960844e07f69c04a239bc218f Signed-off-by: Alison Chaiken <alison@peloton-tech.com> Reported-by: Coverity (CID: 167222, 167235, 167237) Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit 18030d04d25d7c08d3deff85881772a520d84d49)
show more ...
|
| #
31526294 |
| 21-Sep-2017 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
UPSTREAM: GPT: incomplete initialization in allocate_disk_part
memset(newpart, '\0', sizeof(newpart)); only initializes the firest 4 or 8 bytes of *newpart and not the whole structure disk_part.
We
UPSTREAM: GPT: incomplete initialization in allocate_disk_part
memset(newpart, '\0', sizeof(newpart)); only initializes the firest 4 or 8 bytes of *newpart and not the whole structure disk_part.
We should use sizeof(struct disk_part).
Instead of malloc and memset we can use calloc.
Identified by cppcheck.
Fixes: 09a49930e41 GPT: read partition table from device into a data structure Change-Id: Ifc937b64f6ac6abc56c0c6bb3d094c2316b9268e Reported-by: Coverity (CID: 167228) Cc: Stefan Roese <sr@denx.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit f66bc0e0beeff7fa27c29f740d2f314d63b3346d)
show more ...
|
| #
00caae6d |
| 03-Aug-2017 |
Simon Glass <sjg@chromium.org> |
env: Rename getenv/_f() to env_get()
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 place
env: Rename getenv/_f() to env_get()
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 <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
382bee57 |
| 03-Aug-2017 |
Simon Glass <sjg@chromium.org> |
env: Rename setenv() to env_set()
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 <wd
env: Rename setenv() to env_set()
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 <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
2fcaa413 |
| 04-Jul-2017 |
Alison Chaiken <alison@peloton-tech.com> |
gpt: harden set_gpt_info() against non NULL-terminated strings
Strings read from devices may sometimes fail to be NULL-terminated. The functions in lib/string.c are subject to failure in this case
gpt: harden set_gpt_info() against non NULL-terminated strings
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:
=> 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=<optimized out>, str_disk_guid=str_disk_guid@entry=0x7fffffffdbe8, partitions=partitions@entry=0x7fffffffdbd8, parts_count=parts_count@entry=0x7fffffffdbcf "", dev_desc=<optimized out>) at cmd/gpt.c:415 #2 0x00000000004145b9 in gpt_verify (str_part=<optimized out>, blk_dev_desc=0x7fffef09a9d0) at cmd/gpt.c:580 #3 do_gpt (cmdtp=<optimized out>, flag=<optimized out>, argc=<optimized out>, argv=0x7fffef09a8f0) at cmd/gpt.c:783 #4 0x00000000004295b0 in cmd_call (argv=0x7fffef09a8f0, argc=0x5, flag=<optimized out>, cmdtp=0x714e20 <_u_boot_list_2_cmd_2_gpt>) at common/command.c:500 #5 cmd_process (flag=<optimized out>, argc=0x5, argv=0x7fffef09a8f0, repeatable=repeatable@entry=0x726c04 <flag_repeat>, ticks=ticks@entry=0x0) at common/command.c:539
Suggested-by: Lothar Waßmann <LW@karo-electronics.de> Signed-off-by: Alison Chaiken <alison@peloton-tech.com>
show more ...
|
| #
203f9b48 |
| 04-Jul-2017 |
Alison Chaiken <alison@peloton-tech.com> |
GPT: provide commands to selectively rename partitions
This patch provides support in u-boot for renaming GPT partitions. The renaming is accomplished via new 'gpt swap' and 'gpt rename' commands.
GPT: provide commands to selectively rename partitions
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 <alison@peloton-tech.com>
show more ...
|
| #
09a49930 |
| 04-Jul-2017 |
Alison Chaiken <alison@peloton-tech.com> |
GPT: read partition table from device into a data structure
Make the partition table available for modification by reading it from the user-specified device into a linked list. Provide an accessor
GPT: read partition table from device into a data structure
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 <alison@peloton-tech.com> [trini: Make this depend on CMD_GPT_RENAME, as it is the user of this code] Signed-off-by: Tom Rini <trini@konsulko.com>
show more ...
|
| #
73d6d18b |
| 25-Jun-2017 |
Alison Chaiken <alison@peloton-tech.com> |
GPT: add accessor function for disk GUID
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
GPT: add accessor function for disk GUID
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 <alison@peloton-tech.com>
show more ...
|
| #
9da52f8f |
| 27-Feb-2017 |
Vincent Tinelli <vincent.tinelli@intel.com> |
gpt: Fix uuid string format
Change GPT UUID string format from UUID to GUID per specification.
Signed-off-by: Vincent Tinelli <vincent.tinelli@intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
|
| #
b331cd62 |
| 27-Jan-2017 |
Patrick Delaunay <patrick.delaunay@st.com> |
cmd, disk: convert CONFIG_PARTITION_UUIDS, CMD_PART and CMD_GPT
We convert CONFIG_PARTITION_UUIDS to Kconfig first. But in order to cleanly update all of the config files we must also update CMD_PA
cmd, disk: convert CONFIG_PARTITION_UUIDS, CMD_PART and CMD_GPT
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 <patrick.delaunay@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
show more ...
|
| #
c2fdd345 |
| 29-Jul-2016 |
Kever Yang <kever.yang@rock-chips.com> |
cmd: gpt: fix the wrong size parse for the last partition
The calculation of "dev_desc->lba - 34 - 1 - offset" is not correct for size '-', because both fist_usable_lba and last_usable_lba will rem
cmd: gpt: fix the wrong size parse for the last partition
The calculation of "dev_desc->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 <kever.yang@rock-chips.com>
show more ...
|
| #
66636235 |
| 08-Jun-2016 |
Michael Trimarchi <michael@amarulasolutions.com> |
cmd: gpt: add - partition size parsing
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 Trima
cmd: gpt: add - partition size parsing
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 <michael@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
88033d73 |
| 14-Mar-2016 |
Tom Rini <trini@konsulko.com> |
Merge git://git.denx.de/u-boot-dm
|
| #
db1d9e78 |
| 29-Feb-2016 |
Simon Glass <sjg@chromium.org> |
dm: blk: Rename get_dev() to blk_get_dev()
The current name is too generic. Add a 'blk_' prefix to aid searching and make its purpose clearer.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed
dm: blk: Rename get_dev() to blk_get_dev()
The current name is too generic. Add a 'blk_' prefix to aid searching and make its purpose clearer.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
show more ...
|
| #
4101f687 |
| 29-Feb-2016 |
Simon Glass <sjg@chromium.org> |
dm: Drop the block_dev_desc_t typedef
Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long and causes 80-column violations, rename it to struct blk_desc.
Signed-off-by: Simo
dm: Drop the block_dev_desc_t typedef
Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long and causes 80-column violations, rename it to struct blk_desc.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
show more ...
|
| #
2e192b24 |
| 18-Jan-2016 |
Simon Glass <sjg@chromium.org> |
Remove the cmd_ prefix from command files
Now that they are in their own directory, we can remove this prefix. This makes it easier to find a file since the prefix does not get in the way.
Signed-o
Remove the cmd_ prefix from command files
Now that they are in their own directory, we can remove this prefix. This makes it easier to find a file since the prefix does not get in the way.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Heiko Schocher <hs@denx.de> Acked-by: Stefan Roese <sr@denx.de> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
show more ...
|