- 12 8月, 2019 1 次提交
-
-
由 Simon Glass 提交于
Move env_set() over to the new header file. Acked-by: NJoe Hershberger <joe.hershberger@ni.com> Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 03 5月, 2019 1 次提交
-
-
由 Eugeniu Rosca 提交于
Apply the following changes: - Guard the 'gpt read' command by 'ifdef CONFIG_CMD_GPT_RENAME', since 'gpt read' is not available on CMD_GPT_RENAME=n - Prefix the {read,swap,rename} commands with one space for consistency - Prefix the 'guid' commands with 'gpt' for consistency Signed-off-by: NEugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: NHeinrich Schuchardt <xypron.glpk@gmx.de>
-
- 07 5月, 2018 1 次提交
-
-
由 Tom Rini 提交于
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: NTom Rini <trini@konsulko.com>
-
- 24 10月, 2017 1 次提交
-
-
由 Patrick Delaunay 提交于
don't use prettyprint_part_size() in create_gpt_partitions_list() that avoid to align offset and size to 1 MiB and increase precision for start and size. This patch avoid the risk to change partition size and lost data during rename or swap. Signed-off-by: NPatrick Delaunay <patrick.delaunay@st.com> Acked-by: NStephen Warren <swarren@nvidia.com> Tested-by: NStephen Warren <swarren@nvidia.com>
-
- 07 10月, 2017 1 次提交
-
-
由 Tom Rini 提交于
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. Reported-by: Coverity (CID: 167366, 167367, 167370) Signed-off-by: NTom Rini <trini@konsulko.com>
-
- 06 10月, 2017 1 次提交
-
-
由 Alison Chaiken 提交于
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". Signed-off-by: NAlison Chaiken <alison@peloton-tech.com> Reported-by: Coverity (CID: 167222, 167235, 167237) Reviewed-by: NTom Rini <trini@konsulko.com>
-
- 27 9月, 2017 1 次提交
-
-
由 Heinrich Schuchardt 提交于
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: 09a49930 GPT: read partition table from device into a data structure Reported-by: Coverity (CID: 167228) Cc: Stefan Roese <sr@denx.de> Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: NStefan Roese <sr@denx.de> Reviewed-by: NSimon Glass <sjg@chromium.org>
-
- 16 8月, 2017 2 次提交
-
-
由 Simon Glass 提交于
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: NWolfgang Denk <wd@denx.de> Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
We are now using an env_ prefix for environment functions. Rename setenv() for consistency. Also add function comments in common.h. Suggested-by: NWolfgang Denk <wd@denx.de> Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 05 8月, 2017 3 次提交
-
-
由 Alison Chaiken 提交于
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: NLothar Waßmann <LW@karo-electronics.de> Signed-off-by: NAlison Chaiken <alison@peloton-tech.com>
-
由 Alison Chaiken 提交于
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: NAlison Chaiken <alison@peloton-tech.com>
-
由 Alison Chaiken 提交于
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: NAlison Chaiken <alison@peloton-tech.com> [trini: Make this depend on CMD_GPT_RENAME, as it is the user of this code] Signed-off-by: NTom Rini <trini@konsulko.com>
-
- 04 8月, 2017 1 次提交
-
-
由 Alison Chaiken 提交于
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: NAlison Chaiken <alison@peloton-tech.com>
-
- 18 3月, 2017 1 次提交
-
-
由 Vincent Tinelli 提交于
Change GPT UUID string format from UUID to GUID per specification. Signed-off-by: NVincent Tinelli <vincent.tinelli@intel.com> Reviewed-by: NSimon Glass <sjg@chromium.org>
-
- 28 1月, 2017 1 次提交
-
-
由 Patrick Delaunay 提交于
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: NPatrick Delaunay <patrick.delaunay@st.com> Signed-off-by: NPatrick Delaunay <patrick.delaunay73@gmail.com> Signed-off-by: NTom Rini <trini@konsulko.com>
-
- 06 8月, 2016 1 次提交
-
-
由 Kever Yang 提交于
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: NKever Yang <kever.yang@rock-chips.com>
-
- 13 6月, 2016 1 次提交
-
-
由 Michael Trimarchi 提交于
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: NMichael Trimarchi <michael@amarulasolutions.com> Reviewed-by: NSimon Glass <sjg@chromium.org>
-
- 15 3月, 2016 2 次提交
-
-
由 Simon Glass 提交于
The current name is too generic. Add a 'blk_' prefix to aid searching and make its purpose clearer. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NBin Meng <bmeng.cn@gmail.com> Tested-by: NStephen Warren <swarren@nvidia.com>
-
由 Simon Glass 提交于
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: NSimon Glass <sjg@chromium.org> Reviewed-by: NBin Meng <bmeng.cn@gmail.com> Tested-by: NStephen Warren <swarren@nvidia.com>
-
- 25 1月, 2016 2 次提交
-
-
由 Simon Glass 提交于
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: NSimon Glass <sjg@chromium.org> Reviewed-by: NBin Meng <bmeng.cn@gmail.com> Reviewed-by: NHeiko Schocher <hs@denx.de> Acked-by: NStefan Roese <sr@denx.de> Acked-by: NPrzemyslaw Marczak <p.marczak@samsung.com>
-
由 Simon Glass 提交于
There are a lot of unrelated files in common, including all of the commands. Moving them into their own directory makes them easier to find and is more logical. Some commands include non-command code, such as cmd_scsi.c. This should be sorted out at some point so that the function can be enabled with or without the associated command. Unfortunately, with m68k I get this error: m68k: + M5329AFEE +arch/m68k/cpu/mcf532x/start.o: In function `_start': +arch/m68k/cpu/mcf532x/start.S:159:(.text+0x452): relocation truncated to fit: R_68K_PC16 against symbol `board_init_f' defined in .text.board_init_f section in common/built-in.o I hope someone can shed some light on what this means. I hope it isn't depending on the position of code in the image. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NBin Meng <bmeng.cn@gmail.com> Reviewed-by: NHeiko Schocher <hs@denx.de> Acked-by: NStefan Roese <sr@denx.de> Acked-by: NPrzemyslaw Marczak <p.marczak@samsung.com>
-
- 24 11月, 2015 3 次提交
-
-
由 Patrick Delaunay 提交于
The optional parameter bootable is added in gpt command to set the partition attribute flag "Legacy BIOS bootable" This flag is used in extlinux and so in with distro to select the boot partition where is located the configuration file (please check out doc/README.distro for details). With this parameter, U-Boot can be used to create the boot partition needed for device using distro. example of use: setenv partitions "name=u-boot,size=60MiB;name=boot,size=60Mib,bootable;\ name=rootfs,size=0" > gpt write mmc 0 $partitions > part list mmc 0 Partition Map for MMC device 0 -- Partition Type: EFI Part Start LBA End LBA Name Attributes Type GUID Partition GUID 1 0x00000022 0x0001e021 "u-boot" attrs: 0x0000000000000000 type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 guid: cceb0b18-39cb-d547-9db7-03b405fa77d4 2 0x0001e022 0x0003c021 "boot" attrs: 0x0000000000000004 type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 guid: d4981a2b-0478-544e-9607-7fd3c651068d 3 0x0003c022 0x003a9fde "rootfs" attrs: 0x0000000000000000 type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 guid: 6d6c9a36-e919-264d-a9ee-bd00379686c7 > part list mmc 0 -bootable devplist > printenv devplist devplist=2 Then the distro scripts will search extlinux in partition 2 and not in the first partition. Signed-off-by: NPatrick Delaunay <patrick.delaunay73@gmail.com>
-
由 Lukasz Majewski 提交于
This commit adds support for "gpt verify" command, which verifies correctness of on-board stored GPT partition table. As the optional parameter one can provide '$partitons' environment variable to check if partition data (size, offset, name) is correct. This command should be regarded as complementary one to "gpt restore". Signed-off-by: NLukasz Majewski <l.majewski@majess.pl> Reviewed-by: NTom Rini <trini@konsulko.com> Reviewed-by: NPrzemyslaw Marczak <p.marczak@samsung.com>
-
由 Lukasz Majewski 提交于
Signed-off-by: NLukasz Majewski <l.majewski@majess.pl> Reviewed-by: NTom Rini <trini@konsulko.com>
-
- 23 11月, 2015 1 次提交
-
-
由 Lukasz Majewski 提交于
Exactly the same check is performed in set_gpt_info() function executed just after this check. Signed-off-by: NLukasz Majewski <l.majewski@majess.pl> Reviewed-by: NTom Rini <trini@konsulko.com>
-
- 13 11月, 2015 1 次提交
-
-
由 Patrick Delaunay 提交于
code under flag CONFIG_PARTITION_TYPE_GUID add parameter "type" to select partition type guid example of use with gpt command : partitions = uuid_disk=${uuid_gpt_disk}; \ name=boot,size=0x6bc00,uuid=${uuid_gpt_boot}; \ name=root,size=0x7538ba00,uuid=${uuid_gpt_root}, \ type=0fc63daf-8483-4772-8e79-3d69d8477de4; gpt write mmc 0 $partitions Signed-off-by: NPatrick Delaunay <patrick.delaunay73@gmail.com>
-
- 06 3月, 2015 2 次提交
-
-
由 Rob Herring 提交于
Currently, an environment variable must be used to store the randomly generated UUID for each partition. This is not necessary, so make storing the UUID optional. Now passing uuid_disk and uuid are optional when random UUIDs are enabled. Signed-off-by: NRob Herring <robh@kernel.org> Acked-by: NPrzemyslaw Marczak <p.marczak@samsung.com>
-
由 Rob Herring 提交于
The gpt command always reports success even if writing the partition table failed. Propagate the return value of gpt_restore so we get proper status reported. Signed-off-by: NRob Herring <robh@kernel.org> Reviewed-by: NPrzemyslaw Marczak <p.marczak@samsung.com>
-
- 03 4月, 2014 1 次提交
-
-
由 Przemyslaw Marczak 提交于
Changes: - randomly generate partition uuid if any is undefined and CONFIG_RAND_UUID is defined - print debug info about set/unset/generated uuid - update doc/README.gpt Signed-off-by: NPrzemyslaw Marczak <p.marczak@samsung.com> Acked-by: NLukasz Majewski <l.majewski@samsung.com> Cc: Piotr Wilczek <p.wilczek@samsung.com> Cc: Tom Rini <trini@ti.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: Lukasz Majewski <l.majewski@samsung.com>
-
- 09 11月, 2013 1 次提交
-
-
由 Egbert Eich 提交于
The gpt command was only implemented for mmc devices. There is no reason why this command should not be generalized and be applied all other storage device classes. This change both simplifies the implementation and eliminates a build failure for systems that don't support mmcs. Signed-off-by: NEgbert Eich <eich@suse.com> Tested-by: NPiotr Wilczek <p.wilczek@samsung.com> [trini: Change coding style slightly] Signed-off-by: NTom Rini <trini@ti.com>
-
- 20 9月, 2013 1 次提交
-
-
由 Robert P. J. Day 提交于
Typoes fixed: "partion" -> "partition" "retrive", "retreive" -> "retrieve" "th" -> "to" Signed-off-by: NRobert P. J. Day <rpjday@crashcourse.ca>
-
- 24 7月, 2013 1 次提交
-
-
由 Wolfgang Denk 提交于
Signed-off-by: NWolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: NTom Rini <trini@ti.com>
-
- 20 2月, 2013 1 次提交
-
-
由 Piotr Wilczek 提交于
Currently, in gpt command, partion size is converted from string to unsigned long type using 'ustrtol' function. That type limits the partition size to 4GB. This patch changes the conversion function to 'ustrtoll' to return unsigned long long type. Signed-off-by: NPiotr Wilczek <p.wilczek@samsung.com> Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
-
- 14 12月, 2012 1 次提交
-
-
由 Piotr Wilczek 提交于
New command - "gpt" is supported. It restores the GPT partition table. It looks into the given environment variable for partitions definition. It can be enabled at target configuration file with CONFIG_CMD_GPT. Signed-off-by: NLukasz Majewski <l.majewski@samsung.com> Signed-off-by: NPiotr Wilczek <p.wilczek@samsung.com> Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
-