summaryrefslogtreecommitdiff
path: root/include/part.h
diff options
context:
space:
mode:
authorPetr Kulhavy <brain@jikos.cz>2016-09-09 08:27:16 (GMT)
committerTom Rini <trini@konsulko.com>2016-10-02 00:04:51 (GMT)
commitb6dd69a4d6b20862a2075f402f9edfb0de6d14ed (patch)
treecde16c70cc63077087cdfb209d812a1d7a5980b8 /include/part.h
parent87b8530fe24408b0ef41c9b80f38c395ccafad2c (diff)
downloadu-boot-b6dd69a4d6b20862a2075f402f9edfb0de6d14ed.tar.xz
fastboot: add support for writing MBR
Add special target "mbr" (otherwise configurable via CONFIG_FASTBOOT_MBR_NAME) to write MBR partition table. Partitions are now searched using the generic function which finds any partiiton by name. For MBR the partition names hda1, sda1, etc. are used. Signed-off-by: Petr Kulhavy <brain@jikos.cz> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Steve Rae <steve.rae@raedomain.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/part.h')
-rw-r--r--include/part.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/part.h b/include/part.h
index bd8fd49..b17c219 100644
--- a/include/part.h
+++ b/include/part.h
@@ -351,4 +351,27 @@ int gpt_verify_partitions(struct blk_desc *dev_desc,
gpt_header *gpt_head, gpt_entry **gpt_pte);
#endif
+#ifdef CONFIG_DOS_PARTITION
+/**
+ * is_valid_dos_buf() - Ensure that a DOS MBR image is valid
+ *
+ * @param buf - buffer which contains the MBR
+ *
+ * @return - '0' on success, otherwise error
+ */
+int is_valid_dos_buf(void *buf);
+
+/**
+ * write_mbr_partition() - write DOS MBR
+ *
+ * @param dev_desc - block device descriptor
+ * @param buf - buffer which contains the MBR
+ *
+ * @return - '0' on success, otherwise error
+ */
+int write_mbr_partition(struct blk_desc *dev_desc, void *buf);
+
+#endif
+
+
#endif /* _PART_H */