summaryrefslogtreecommitdiff
path: root/cmd/bootefi.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2016-04-11 16:16:18 +0200
committerTom Rini <trini@konsulko.com>2016-04-18 17:11:36 -0400
commit8c3df0bf2e530c6e6f592f5144ef4f456c9e0260 (patch)
tree0d412d7149894a05380224ac84ad07e2643c6d2f /cmd/bootefi.c
parent4a12a97c14217a5b02791040e464449f779fce43 (diff)
downloadu-boot-imx-8c3df0bf2e530c6e6f592f5144ef4f456c9e0260.zip
u-boot-imx-8c3df0bf2e530c6e6f592f5144ef4f456c9e0260.tar.gz
u-boot-imx-8c3df0bf2e530c6e6f592f5144ef4f456c9e0260.tar.bz2
efi_loader: Add el torito support
When loading an el torito image, uEFI exposes said image as a raw block device to the payload. Let's do the same by creating new block devices with added offsets for the respective el torito partitions. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'cmd/bootefi.c')
-rw-r--r--cmd/bootefi.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 3add632..0d09aa1 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -194,12 +194,26 @@ U_BOOT_CMD(
void efi_set_bootdev(const char *dev, const char *devnr)
{
+ __maybe_unused struct blk_desc *desc;
char devname[16] = { 0 }; /* dp->str is u16[16] long */
char *colon;
/* Assemble the condensed device name we use in efi_disk.c */
snprintf(devname, sizeof(devname), "%s%s", dev, devnr);
colon = strchr(devname, ':');
+
+#ifdef CONFIG_ISO_PARTITION
+ /* For ISOs we create partition block devices */
+ desc = blk_get_dev(dev, simple_strtol(devnr, NULL, 10));
+ if (desc && (desc->type != DEV_TYPE_UNKNOWN) &&
+ (desc->part_type == PART_TYPE_ISO)) {
+ if (!colon)
+ snprintf(devname, sizeof(devname), "%s%s:1", dev,
+ devnr);
+ colon = NULL;
+ }
+#endif
+
if (colon)
*colon = '\0';