diff options
Diffstat (limited to 'disk')
-rw-r--r-- | disk/Kconfig | 108 | ||||
-rw-r--r-- | disk/Makefile | 10 | ||||
-rw-r--r-- | disk/part.c | 18 | ||||
-rw-r--r-- | disk/part_amiga.h | 2 | ||||
-rw-r--r-- | disk/part_dos.c | 6 | ||||
-rw-r--r-- | disk/part_efi.c | 8 | ||||
-rw-r--r-- | disk/part_mac.h | 2 |
7 files changed, 131 insertions, 23 deletions
diff --git a/disk/Kconfig b/disk/Kconfig new file mode 100644 index 0000000..16ff52d --- /dev/null +++ b/disk/Kconfig @@ -0,0 +1,108 @@ + +menu "Partition Types" + +config PARTITIONS + bool "Enable Partition Labels (disklabels) support" + default y + help + Partition Labels (disklabels) Supported: + Zero or more of the following: + - CONFIG_MAC_PARTITION Apple's MacOS partition table. + - CONFIG_DOS_PARTITION MS Dos partition table, traditional on the + Intel architecture, USB sticks, etc. + - CONFIG_ISO_PARTITION ISO partition table, used on CDROM etc. + - CONFIG_EFI_PARTITION GPT partition table, common when EFI is the + bootloader. Note 2TB partition limit; see + disk/part_efi.c + - CONFIG_MTD_PARTITIONS Memory Technology Device partition table. + If IDE or SCSI support is enabled (CONFIG_CMD_IDE or CONFIG_SCSI) + you must configure support for at least one non-MTD partition type + as well. + +config MAC_PARTITION + bool "Enable Apple's MacOS partition table" + depends on PARTITIONS + default y if SPARC + help + Say Y here if you would like to use device under U-Boot which + were partitioned on a Macintosh. + +config SPL_MAC_PARTITION + bool "Enable Apple's MacOS partition table for SPL" + depends on SPL && PARTITIONS + default y if MAC_PARTITION + +config DOS_PARTITION + bool "Enable MS Dos partition table" + depends on PARTITIONS + default y if DISTRO_DEFAULTS + default y if x86 || SPARC || CMD_FAT || USB_STORAGE + help + traditional on the Intel architecture, USB sticks, etc. + +config SPL_DOS_PARTITION + bool "Enable MS Dos partition table for SPL" + depends on SPL && PARTITIONS + default y if DOS_PARTITION + +config ISO_PARTITION + bool "Enable ISO partition table" + depends on PARTITIONS + default y if DISTRO_DEFAULTS + default y if SPARC || MIPS || TEGRA + +config SPL_ISO_PARTITION + bool "Enable ISO partition table for SPL" + depends on SPL && PARTITIONS + default y if ISO_PARTITION + +config AMIGA_PARTITION + bool "Enable AMIGA partition table" + depends on PARTITIONS + help + Say Y here if you would like to use device under U-Boot which + were partitioned under AmigaOS. + +config SPL_AMIGA_PARTITION + bool "Enable AMIGA partition table for SPL" + depends on SPL && PARTITIONS + default y if AMIGA_PARTITION + +config EFI_PARTITION + bool "Enable EFI GPT partition table" + depends on PARTITIONS + default y if DISTRO_DEFAULTS + default y if TEGRA + help + Say Y here if you would like to use device under U-Boot which + were partitioned using EFI GPT. + common when EFI is the bootloader. Note 2TB partition limit; + see disk/part_efi.c + +config SPL_EFI_PARTITION + bool "Enable EFI GPT partition table for SPL" + depends on SPL && PARTITIONS + default y if EFI_PARTITION + +config PARTITION_UUIDS + bool "Enable support of UUID for partition" + depends on PARTITIONS + default y if DISTRO_DEFAULTS + default y if EFI_PARTITION + help + Activate the configuration of UUID for partition + +config SPL_PARTITION_UUIDS + bool "Enable support of UUID for partition in SPL" + depends on SPL && PARTITIONS + default y if SPL_EFI_PARTITION + +config PARTITION_TYPE_GUID + bool "Enable support of GUID for partition type" + depends on PARTITIONS + depends on EFI_PARTITION + help + Activate the configuration of GUID type + for EFI partition + +endmenu diff --git a/disk/Makefile b/disk/Makefile index 6970cec..12c0531 100644 --- a/disk/Makefile +++ b/disk/Makefile @@ -8,8 +8,8 @@ #ccflags-y += -DET_DEBUG -DDEBUG obj-$(CONFIG_PARTITIONS) += part.o -obj-$(CONFIG_MAC_PARTITION) += part_mac.o -obj-$(CONFIG_DOS_PARTITION) += part_dos.o -obj-$(CONFIG_ISO_PARTITION) += part_iso.o -obj-$(CONFIG_AMIGA_PARTITION) += part_amiga.o -obj-$(CONFIG_EFI_PARTITION) += part_efi.o +obj-$(CONFIG_$(SPL_)MAC_PARTITION) += part_mac.o +obj-$(CONFIG_$(SPL_)DOS_PARTITION) += part_dos.o +obj-$(CONFIG_$(SPL_)ISO_PARTITION) += part_iso.o +obj-$(CONFIG_$(SPL_)AMIGA_PARTITION) += part_amiga.o +obj-$(CONFIG_$(SPL_)EFI_PARTITION) += part_efi.o diff --git a/disk/part.c b/disk/part.c index 4e37735..cd44702 100644 --- a/disk/part.c +++ b/disk/part.c @@ -234,11 +234,11 @@ void part_init(struct blk_desc *dev_desc) static void print_part_header(const char *type, struct blk_desc *dev_desc) { -#if defined(CONFIG_MAC_PARTITION) || \ - defined(CONFIG_DOS_PARTITION) || \ - defined(CONFIG_ISO_PARTITION) || \ - defined(CONFIG_AMIGA_PARTITION) || \ - defined(CONFIG_EFI_PARTITION) +#if CONFIG_IS_ENABLED(MAC_PARTITION) || \ + CONFIG_IS_ENABLED(DOS_PARTITION) || \ + CONFIG_IS_ENABLED(ISO_PARTITION) || \ + CONFIG_IS_ENABLED(AMIGA_PARTITION) || \ + CONFIG_IS_ENABLED(EFI_PARTITION) puts ("\nPartition Map for "); switch (dev_desc->if_type) { case IF_TYPE_IDE: @@ -299,7 +299,7 @@ int part_get_info(struct blk_desc *dev_desc, int part, #ifdef HAVE_BLOCK_DEVICE struct part_driver *drv; -#ifdef CONFIG_PARTITION_UUIDS +#if CONFIG_IS_ENABLED(PARTITION_UUIDS) /* The common case is no UUID support */ info->uuid[0] = 0; #endif @@ -416,7 +416,7 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str, info->bootable = 0; strcpy((char *)info->type, BOOT_PART_TYPE); strcpy((char *)info->name, "Sandbox host"); -#ifdef CONFIG_PARTITION_UUIDS +#if CONFIG_IS_ENABLED(PARTITION_UUIDS) info->uuid[0] = 0; #endif #ifdef CONFIG_PARTITION_TYPE_GUID @@ -442,7 +442,7 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str, memset(info, 0, sizeof(*info)); strcpy((char *)info->type, BOOT_PART_TYPE); strcpy((char *)info->name, "UBI"); -#ifdef CONFIG_PARTITION_UUIDS +#if CONFIG_IS_ENABLED(PARTITION_UUIDS) info->uuid[0] = 0; #endif return 0; @@ -526,7 +526,7 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str, info->bootable = 0; strcpy((char *)info->type, BOOT_PART_TYPE); strcpy((char *)info->name, "Whole Disk"); -#ifdef CONFIG_PARTITION_UUIDS +#if CONFIG_IS_ENABLED(PARTITION_UUIDS) info->uuid[0] = 0; #endif #ifdef CONFIG_PARTITION_TYPE_GUID diff --git a/disk/part_amiga.h b/disk/part_amiga.h index 0f04e97..a3fe1a9 100644 --- a/disk/part_amiga.h +++ b/disk/part_amiga.h @@ -10,7 +10,7 @@ #define _DISK_PART_AMIGA_H #include <common.h> -#ifdef CONFIG_ISO_PARTITION +#if CONFIG_IS_ENABLED(ISO_PARTITION) /* Make the buffers bigger if ISO partition support is enabled -- CD-ROMS have 2048 byte blocks */ #define DEFAULT_SECTOR_SIZE 2048 diff --git a/disk/part_dos.c b/disk/part_dos.c index ed78334..c77d881 100644 --- a/disk/part_dos.c +++ b/disk/part_dos.c @@ -189,7 +189,7 @@ static int part_get_info_extended(struct blk_desc *dev_desc, return -1; } -#ifdef CONFIG_PARTITION_UUIDS +#if CONFIG_IS_ENABLED(PARTITION_UUIDS) if (!ext_part_sector) disksig = le32_to_int(&buffer[DOS_PART_DISKSIG_OFFSET]); #endif @@ -214,7 +214,7 @@ static int part_get_info_extended(struct blk_desc *dev_desc, /* sprintf(info->type, "%d, pt->sys_ind); */ strcpy((char *)info->type, "U-Boot"); info->bootable = is_bootable(pt); -#ifdef CONFIG_PARTITION_UUIDS +#if CONFIG_IS_ENABLED(PARTITION_UUIDS) sprintf(info->uuid, "%08x-%02x", disksig, part_num); #endif return 0; @@ -249,7 +249,7 @@ static int part_get_info_extended(struct blk_desc *dev_desc, info->blksz = DOS_PART_DEFAULT_SECTOR; info->bootable = 0; strcpy((char *)info->type, "U-Boot"); -#ifdef CONFIG_PARTITION_UUIDS +#if CONFIG_IS_ENABLED(PARTITION_UUIDS) info->uuid[0] = 0; #endif return 0; diff --git a/disk/part_efi.c b/disk/part_efi.c index 1924338..b5928e5 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -171,7 +171,7 @@ static void prepare_backup_gpt_header(gpt_header *gpt_h) gpt_h->header_crc32 = cpu_to_le32(calc_crc32); } -#ifdef CONFIG_EFI_PARTITION +#if CONFIG_IS_ENABLED(EFI_PARTITION) /* * Public Functions (include/part.h) */ @@ -279,7 +279,7 @@ int part_get_info_efi(struct blk_desc *dev_desc, int part, print_efiname(&gpt_pte[part - 1])); strcpy((char *)info->type, "U-Boot"); info->bootable = is_bootable(&gpt_pte[part - 1]); -#ifdef CONFIG_PARTITION_UUIDS +#if CONFIG_IS_ENABLED(PARTITION_UUIDS) uuid_bin_to_str(gpt_pte[part - 1].unique_partition_guid.b, info->uuid, UUID_STR_FORMAT_GUID); #endif @@ -397,7 +397,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e, le64_to_cpu(gpt_h->last_usable_lba); int i, k; size_t efiname_len, dosname_len; -#ifdef CONFIG_PARTITION_UUIDS +#if CONFIG_IS_ENABLED(PARTITION_UUIDS) char *str_uuid; unsigned char *bin_uuid; #endif @@ -452,7 +452,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e, &PARTITION_BASIC_DATA_GUID, 16); #endif -#ifdef CONFIG_PARTITION_UUIDS +#if CONFIG_IS_ENABLED(PARTITION_UUIDS) str_uuid = partitions[i].uuid; bin_uuid = gpt_e[i].unique_partition_guid.b; diff --git a/disk/part_mac.h b/disk/part_mac.h index 7b754e1..6735144 100644 --- a/disk/part_mac.h +++ b/disk/part_mac.h @@ -73,7 +73,7 @@ typedef struct mac_partition { __u32 boot_cksum; /* boot code checksum */ uchar processor[16]; /* Type of Processor */ __u16 part_pad[188]; /* reserved */ -#ifdef CONFIG_ISO_PARTITION +#if CONFIG_IS_ENABLED(ISO_PARTITION) uchar iso_dummy[2048];/* Reservere enough room for an ISO partition block to fit */ #endif } mac_partition_t; |