]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
disk: allow - or empty string to fall back to $bootdevice
authorStephen Warren <swarren@nvidia.com>
Fri, 28 Sep 2012 05:34:09 +0000 (05:34 +0000)
committerTom Rini <trini@ti.com>
Fri, 28 Sep 2012 16:15:35 +0000 (09:15 -0700)
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>
disk/part.c

index 64d76e8380690fcc5f9ccb9409ed40a74d72a9d0..30229692fb84c22bdbe0801721a76ccc48a9bf22 100644 (file)
@@ -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 */