[U-Boot] [PATCH v2 4/4] fastboot: move FASTBOOT_FLASH options into Kconfig

Petr Kulhavy brain at jikos.cz
Fri Sep 9 10:27:18 CEST 2016


Move FASTBOOT_MBR_NAME and FASTBOOT_GPT_NAME into Kconfig.
Add dependency on the FASTBOOT_FLASH setting (also for FASTBOOT_MBR_NAME).
Remove the now redundant GPT_ENTRY_NAME.

Signed-off-by: Petr Kulhavy <brain at jikos.cz>
---
v2: initial

 README               |  2 +-
 cmd/fastboot/Kconfig | 24 ++++++++++++++++++++++++
 common/fb_mmc.c      |  9 ---------
 include/part_efi.h   |  1 -
 4 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/README b/README
index f6ef8b8..9852f88 100644
--- a/README
+++ b/README
@@ -1680,7 +1680,7 @@ The following options need to be configured:
 		to generate and write the Backup GUID Partition Table.)
 		This occurs when the specified "partition name" on the
 		"fastboot flash" command line matches this value.
-		Default is GPT_ENTRY_NAME (currently "gpt") if undefined.
+		The default is "gpt" if undefined.
 
 		CONFIG_FASTBOOT_MBR_NAME
 		The fastboot "flash" command supports writing the downloaded
diff --git a/cmd/fastboot/Kconfig b/cmd/fastboot/Kconfig
index a93d1c0..5d2facc 100644
--- a/cmd/fastboot/Kconfig
+++ b/cmd/fastboot/Kconfig
@@ -50,11 +50,35 @@ config FASTBOOT_FLASH
 
 config FASTBOOT_FLASH_MMC_DEV
 	int "Define FASTBOOT MMC FLASH default device"
+	depends on FASTBOOT_FLASH
 	help
 	  The fastboot "flash" command requires additional information
 	  regarding the non-volatile storage device. Define this to
 	  the eMMC device that fastboot should use to store the image.
 
+config FASTBOOT_GPT_NAME
+	string "Target name for updating GPT"
+	depends on FASTBOOT_FLASH
+	default "gpt"
+	help
+	  The fastboot "flash" command supports writing the downloaded
+	  image to the Protective MBR and the Primary GUID Partition
+	  Table. (Additionally, this downloaded image is post-processed
+	  to generate and write the Backup GUID Partition Table.)
+	  This occurs when the specified "partition name" on the
+	  "fastboot flash" command line matches the value defined here.
+	  The default target name for updating GPT is "gpt".
+
+config FASTBOOT_MBR_NAME
+	string "Target name for updating MBR"
+	depends on FASTBOOT_FLASH
+	default "mbr"
+	help
+	  The fastboot "flash" command allows to write the downloaded image
+	  to the Master Boot Record. This occurs when the "partition name"
+	  specified on the "fastboot flash" command line matches the value
+	  defined here. The default target name for updating MBR is "mbr".
+
 endif # USB_FUNCTION_FASTBOOT
 
 endmenu
diff --git a/common/fb_mmc.c b/common/fb_mmc.c
index 4bc68a7..ea8ec4a 100644
--- a/common/fb_mmc.c
+++ b/common/fb_mmc.c
@@ -14,15 +14,6 @@
 #include <mmc.h>
 #include <div64.h>
 
-#if defined(CONFIG_EFI_PARTITION) && !defined(CONFIG_FASTBOOT_GPT_NAME)
-#define CONFIG_FASTBOOT_GPT_NAME GPT_ENTRY_NAME
-#endif
-
-
-#if defined(CONFIG_DOS_PARTITION) && !defined(CONFIG_FASTBOOT_MBR_NAME)
-#define CONFIG_FASTBOOT_MBR_NAME "mbr"
-#endif
-
 struct fb_mmc_sparse {
 	struct blk_desc	*dev_desc;
 };
diff --git a/include/part_efi.h b/include/part_efi.h
index c8fc873..317c044 100644
--- a/include/part_efi.h
+++ b/include/part_efi.h
@@ -27,7 +27,6 @@
 #define GPT_HEADER_SIGNATURE 0x5452415020494645ULL
 #define GPT_HEADER_REVISION_V1 0x00010000
 #define GPT_PRIMARY_PARTITION_TABLE_LBA 1ULL
-#define GPT_ENTRY_NAME "gpt"
 #define GPT_ENTRY_NUMBERS		128
 #define GPT_ENTRY_SIZE			128
 
-- 
2.7.4



More information about the U-Boot mailing list