summaryrefslogtreecommitdiff
path: root/disk/part.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-09-28 05:34:09 +0000
committerTom Rini <trini@ti.com>2012-09-28 09:15:35 -0700
commita10973e7fac1e0338c9c0bb79ae114d869b6200f (patch)
tree5b974c9e015021aa8da82eb572e653830977d689 /disk/part.c
parentcec2655c3b3b86f14a6a5c2cbb01833f7e3974be (diff)
downloadu-boot-imx-a10973e7fac1e0338c9c0bb79ae114d869b6200f.zip
u-boot-imx-a10973e7fac1e0338c9c0bb79ae114d869b6200f.tar.gz
u-boot-imx-a10973e7fac1e0338c9c0bb79ae114d869b6200f.tar.bz2
disk: allow - or empty string to fall back to $bootdevice
Commit 10a37fd "disk: get_device_and_partition() "auto" partition" prevented the use of "-" on the command-line to request fallback to the $bootdevice environment variable instead. This patch allows that, or an empty string "" to be used. Tested: setenv bootfile /boot/zImage setenv bootdevice 0:1 ext2load mmc 0:1 ext2load mmc - ext2load mmc "" Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'disk/part.c')
-rw-r--r--disk/part.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/disk/part.c b/disk/part.c
index 64d76e8..3022969 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -489,7 +489,8 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str,
disk_partition_t tmpinfo;
/* If no dev_part_str, use bootdevice environment variable */
- if (!dev_part_str)
+ if (!dev_part_str || !strlen(dev_part_str) ||
+ !strcmp(dev_part_str, "-"))
dev_part_str = getenv("bootdevice");
/* If still no dev_part_str, it's an error */