Skip to contentSkip to conversation

disk: part_mac: Remove the Apple Partition Map driver

PATCH In review Alexey Charkov 3 participants 4 messages Aug 27 – Aug 31

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 disk: part_mac: Remove the Apple Partition Map driver

The Apple Partition Map predates Advanced Format media by two decades. Apple never extended the format to cover 4 Kn logical blocks, has since withdrawn its documentation, and has shipped GPT on its own systems for almost as long. There is therefore no specification left to follow for the one property that matters here: where a partition map entry lives when a block is not 512 bytes.

U-Boot's implementation reflects that. All three entry points read one block into a buffer sized after a 512-byte struct, so they smash the stack on any device with larger blocks, and part_test_mac() runs during partition probing on every block device. Sizing those buffers correctly is easy; deciding what the driver should then parse is not, and guessing at a layout Apple never defined helps nobody.

Nothing in tree depends on the driver either: it has no test, no documentation and no MAINTAINERS entry, and the sole reference to PART_TYPE_MAC is its own partition driver registration.

Drop it. Anyone who needs Apple Partition Map support for emulated hardware can bring it back along with a test.

---
CI passes all green:
https://git.u-boot-project.org/u-boot/contributors/alchark/u-boot/-/pipelines/1094

---
 README                                             |   1 -
 configs/M5253DEMO_defconfig                        |   1 -
 configs/bayleybay_defconfig                        |   1 -
 configs/chromebook_coral_defconfig                 |   2 -
 configs/chromebook_link_defconfig                  |   1 -
 configs/chromebook_samus_defconfig                 |   1 -
 configs/chromebook_samus_tpl_defconfig             |   2 -
 configs/chromebox_panther_defconfig                |   1 -
 configs/clearfog_gt_8k_defconfig                   |   1 -
 ...conga-qeval20-qa3-e3845-internal-uart_defconfig |   1 -
 configs/conga-qeval20-qa3-e3845_defconfig          |   1 -
 configs/coreboot64-no-spl_defconfig                |   1 -
 configs/coreboot64_defconfig                       |   2 -
 configs/coreboot_defconfig                         |   1 -
 configs/cougarcanyon2_defconfig                    |   1 -
 configs/crownbay_defconfig                         |   1 -
 configs/dfi-bt700-q7x-151_defconfig                |   1 -
 configs/eDPU_defconfig                             |   1 -
 configs/efi-x86_app32_defconfig                    |   1 -
 configs/efi-x86_app64_defconfig                    |   1 -
 configs/efi-x86_payload32_defconfig                |   1 -
 configs/efi-x86_payload64_defconfig                |   1 -
 configs/galileo_defconfig                          |   1 -
 configs/minnowmax_defconfig                        |   1 -
 configs/mvebu_ac5_rd_defconfig                     |   1 -
 configs/mvebu_crb_cn9130_defconfig                 |   1 -
 configs/mvebu_db-88f3720_defconfig                 |   1 -
 configs/mvebu_db_armada8k_defconfig                |   1 -
 configs/mvebu_db_cn9130_defconfig                  |   1 -
 configs/mvebu_espressobin-88f3720_defconfig        |   1 -
 configs/mvebu_espressobin_ultra-88f3720_defconfig  |   1 -
 configs/mvebu_mcbin-88f8040_defconfig              |   1 -
 configs/mvebu_puzzle-m801-88f8040_defconfig        |   1 -
 configs/qemu-x86_defconfig                         |   1 -
 configs/renesas_rza1.config                        |   1 -
 configs/sandbox64_defconfig                        |   1 -
 configs/sandbox_defconfig                          |   1 -
 configs/sandbox_flattree_defconfig                 |   1 -
 configs/sandbox_noinst_defconfig                   |   1 -
 configs/sandbox_spl_defconfig                      |   1 -
 configs/sandbox_vpl_defconfig                      |   2 -
 configs/som-db5800-som-6867_defconfig              |   1 -
 configs/theadorable-x86-conga-qa3-e3845_defconfig  |   1 -
 configs/theadorable-x86-dfi-bt700_defconfig        |   1 -
 configs/turris_mox_defconfig                       |   1 -
 configs/uDPU_defconfig                             |   1 -
 configs/x250_defconfig                             |   1 -
 configs/x960_defconfig                             |   1 -
 disk/Kconfig                                       |  14 --
 disk/Makefile                                      |   1 -
 disk/part.c                                        |   3 +-
 disk/part_mac.c                                    | 237 ---------------------
 disk/part_mac.h                                    |  81 -------
 include/part.h                                     |   2 -
 54 files changed, 1 insertion(+), 389 deletions(-)
README +0 -1
index f740188a4bb4..7060bc5ac0cf 100644
@@ -309,7 +309,6 @@ The following options need to be configured:
 
 - Partition Labels (disklabels) Supported:
 		Zero or more of the following:
-		CONFIG_MAC_PARTITION   Apple's MacOS partition table.
 		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
configs/M5253DEMO_defconfig +0 -1
index e3b1f114e1b4..406cf2ed4935 100644
@@ -23,7 +23,6 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE_ETHADDR_ONCE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_HOSTNAME=y
configs/bayleybay_defconfig +0 -1
index 29b92c554977..bda46854bc2a 100644
@@ -44,7 +44,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/chromebook_coral_defconfig +0 -2
index e8ea3bb7dd10..c2c9f276e75c 100644
@@ -71,8 +71,6 @@ CONFIG_CMD_BOOTSTAGE=y
 CONFIG_CMD_TPM=y
 CONFIG_CMD_CBFS=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
-# CONFIG_SPL_MAC_PARTITION is not set
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_OF_SPL_REMOVE_PROPS="clocks clock-names interrupt-parent interrupts linux-name acpi,name acpi,path u-boot,acpi-dsdt-order u-boot,acpi-ssdt-order"
configs/chromebook_link_defconfig +0 -1
index b853051ae5e1..133c18e33aa9 100644
@@ -50,7 +50,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/chromebook_samus_defconfig +0 -1
index ab7b8c95f8e8..c1776439c2b4 100644
@@ -49,7 +49,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/chromebook_samus_tpl_defconfig +0 -2
index fd515ddf676e..3475d494a5c4 100644
@@ -65,8 +65,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
-# CONFIG_SPL_MAC_PARTITION is not set
 # CONFIG_SPL_DOS_PARTITION is not set
 CONFIG_ISO_PARTITION=y
 # CONFIG_SPL_EFI_PARTITION is not set
configs/chromebox_panther_defconfig +0 -1
index affba7f72a8a..fae4155ca405 100644
@@ -41,7 +41,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/clearfog_gt_8k_defconfig +0 -1
index a945d59d498e..ff1c6ed76aa3 100644
@@ -38,7 +38,6 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/conga-qeval20-qa3-e3845-internal-uart_defconfig +0 -1
index 2dd8b1b57e48..b7ad1e6e4de8 100644
@@ -51,7 +51,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/conga-qeval20-qa3-e3845_defconfig +0 -1
index 07b66b31a04e..8d72d32fb30d 100644
@@ -47,7 +47,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/coreboot64-no-spl_defconfig +0 -1
index 11c72d9049d9..989d18887cb6 100644
@@ -30,7 +30,6 @@ CONFIG_BOOTP_BOOTFILESIZE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_SOUND=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_BOOTFILE=y
configs/coreboot64_defconfig +0 -2
index abd874d68df8..f5c105fcffcc 100644
@@ -34,8 +34,6 @@ CONFIG_BOOTP_BOOTFILESIZE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_SOUND=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
-# CONFIG_SPL_MAC_PARTITION is not set
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_ENV_OVERWRITE=y
configs/coreboot_defconfig +0 -1
index 3fa7b517af41..4a644a2aac22 100644
@@ -34,7 +34,6 @@ CONFIG_CMD_TIME=y
 CONFIG_CMD_SOUND=y
 CONFIG_CMD_BOOTSTAGE=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_BOOTFILE=y
configs/cougarcanyon2_defconfig +0 -1
index 57c8ff78d0c7..64426267bc0c 100644
@@ -37,7 +37,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/crownbay_defconfig +0 -1
index 1457212ab678..2153382b383c 100644
@@ -40,7 +40,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/dfi-bt700-q7x-151_defconfig +0 -1
index 24e62e5f0ce2..ea2aac524caf 100644
@@ -45,7 +45,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/eDPU_defconfig +0 -1
index e227dba5a421..a97c5005e501 100644
@@ -40,7 +40,6 @@ CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/efi-x86_app32_defconfig +0 -1
index 9a1db537a8be..71065e16201f 100644
@@ -28,7 +28,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_EFI_PARTITION=y
 CONFIG_OF_EMBED=y
configs/efi-x86_app64_defconfig +0 -1
index 8b2be2d49979..273304bd8740 100644
@@ -32,7 +32,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_EFI_PARTITION=y
 CONFIG_OF_EMBED=y
configs/efi-x86_payload32_defconfig +0 -1
index 19d966820ad7..b036077fd4dc 100644
@@ -33,7 +33,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/efi-x86_payload64_defconfig +0 -1
index 5621d14bcc1c..3aff0d54088d 100644
@@ -26,7 +26,6 @@ CONFIG_CMD_USB=y
 CONFIG_BOOTP_BOOTFILESIZE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_FAT=y
 CONFIG_ENV_FAT_INTERFACE="scsi"
configs/galileo_defconfig +0 -1
index ec416d46e066..541e7e49dc7c 100644
@@ -36,7 +36,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/minnowmax_defconfig +0 -1
index 000eebce3a86..e5b885d52522 100644
@@ -50,7 +50,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/mvebu_ac5_rd_defconfig +0 -1
index d8d67ec3c95e..63adbd333c86 100644
@@ -36,7 +36,6 @@ CONFIG_CMD_TIME=y
 CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_UBI=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_GATEWAYIP=y
configs/mvebu_crb_cn9130_defconfig +0 -1
index 409e51e7be07..9573f4640be7 100644
@@ -38,7 +38,6 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_MVEBU_MMC_BOOT=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/mvebu_db-88f3720_defconfig +0 -1
index ff0f412b6d09..2fe3ad518ec8 100644
@@ -35,7 +35,6 @@ CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/mvebu_db_armada8k_defconfig +0 -1
index 7f99aea5810b..140f8592b5ef 100644
@@ -35,7 +35,6 @@ CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/mvebu_db_cn9130_defconfig +0 -1
index 34acaa499ef9..a41cbe5dbee2 100644
@@ -39,7 +39,6 @@ CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/mvebu_espressobin-88f3720_defconfig +0 -1
index 9f5eda244ac6..bedf7d08a251 100644
@@ -43,7 +43,6 @@ CONFIG_CMD_BTRFS=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_SQUASHFS=y
 CONFIG_CMD_FS_UUID=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/mvebu_espressobin_ultra-88f3720_defconfig +0 -1
index 16e0e54f657d..f4e31dd98b8b 100644
@@ -42,7 +42,6 @@ CONFIG_CMD_BTRFS=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_SQUASHFS=y
 CONFIG_CMD_FS_UUID=y
-CONFIG_MAC_PARTITION=y
 CONFIG_OF_UPSTREAM=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
configs/mvebu_mcbin-88f8040_defconfig +0 -1
index e91f9606211c..eb428680cd7b 100644
@@ -38,7 +38,6 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/mvebu_puzzle-m801-88f8040_defconfig +0 -1
index 673f84d2da85..77ccc87d8db2 100644
@@ -43,7 +43,6 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
 CONFIG_ARP_TIMEOUT=200
configs/qemu-x86_defconfig +0 -1
index dd0056ed4d01..4dd6a78e38e1 100644
@@ -39,7 +39,6 @@ CONFIG_CMD_EFIDEBUG=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_BOOTSTAGE=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_FAT=y
 CONFIG_ENV_FAT_INTERFACE="virtio"
configs/renesas_rza1.config +0 -1
index 10d817f03a77..0a6806e08133 100644
@@ -29,7 +29,6 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_HUSH_PARSER=y
 CONFIG_LED=y
 CONFIG_LED_GPIO=y
-CONFIG_MAC_PARTITION=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_OF_CONTROL=y
configs/sandbox64_defconfig +0 -1
index 2e37374d6465..144f5baf577b 100644
@@ -102,7 +102,6 @@ CONFIG_CMD_CRAMFS=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_CMD_SPAWN=y
-CONFIG_MAC_PARTITION=y
 CONFIG_AMIGA_PARTITION=y
 CONFIG_OF_LIVE=y
 CONFIG_ENV_IS_NOWHERE=y
configs/sandbox_defconfig +0 -1
index 5c97418783fc..c6edd9d24237 100644
@@ -153,7 +153,6 @@ CONFIG_CMD_SQUASHFS=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_CMD_STACKPROTECTOR_TEST=y
 CONFIG_CMD_SPAWN=y
-CONFIG_MAC_PARTITION=y
 CONFIG_OF_LIVE=y
 CONFIG_DEVICE_TREE_INCLUDES="sandbox_scripts.dtsi"
 CONFIG_ENV_IS_NOWHERE=y
configs/sandbox_flattree_defconfig +0 -1
index 4ad2bb016738..c12ffc8669de 100644
@@ -76,7 +76,6 @@ CONFIG_CMD_AES=y
 CONFIG_CMD_TPM=y
 CONFIG_CMD_TPM_TEST=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_AMIGA_PARTITION=y
 CONFIG_ENV_IS_NOWHERE=y
 CONFIG_ENV_IS_IN_FAT=y
configs/sandbox_noinst_defconfig +0 -1
index 076be6586cf5..5c5d96984e6c 100644
@@ -112,7 +112,6 @@ CONFIG_CMD_TPM_TEST=y
 CONFIG_CMD_CBFS=y
 CONFIG_CMD_CRAMFS=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_AMIGA_PARTITION=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_SPL_OF_PLATDATA=y
configs/sandbox_spl_defconfig +0 -1
index 3b6d18d7d76e..e403d8a89c4b 100644
@@ -90,7 +90,6 @@ CONFIG_CMD_TPM_TEST=y
 CONFIG_CMD_CBFS=y
 CONFIG_CMD_CRAMFS=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_AMIGA_PARTITION=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_SPL_OF_PLATDATA=y
configs/sandbox_vpl_defconfig +0 -2
index 363d73cf0307..c7df8571663d 100644
@@ -103,8 +103,6 @@ CONFIG_CMD_TPM_TEST=y
 CONFIG_CMD_CBFS=y
 CONFIG_CMD_CRAMFS=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
-# CONFIG_SPL_MAC_PARTITION is not set
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SPL_OF_CONTROL=y
configs/som-db5800-som-6867_defconfig +0 -1
index 4d9f6348f360..ced096556d5f 100644
@@ -45,7 +45,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/theadorable-x86-conga-qa3-e3845_defconfig +0 -1
index 1f386cfb23ec..ed3b1939af1c 100644
@@ -45,7 +45,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_REDUNDANT=y
configs/theadorable-x86-dfi-bt700_defconfig +0 -1
index 87db7812328c..8bb4d79ec0f4 100644
@@ -43,7 +43,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ISO_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_REDUNDANT=y
configs/turris_mox_defconfig +0 -1
index 9a00716e4a01..2ef4b07a45da 100644
@@ -48,7 +48,6 @@ CONFIG_CMD_AES=y
 CONFIG_CMD_HASH=y
 CONFIG_CMD_BTRFS=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_OF_LIST="armada-3720-turris-mox armada-3720-ripe-atlas"
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/uDPU_defconfig +0 -1
index 7c83ff17b9c0..e3cabab62e12 100644
@@ -39,7 +39,6 @@ CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/x250_defconfig +0 -1
index 2a56edf62ff3..1b5384bfb911 100644
@@ -41,7 +41,6 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_UBI=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/x960_defconfig +0 -1
index f03bca376aee..a21fa2483bec 100644
@@ -41,7 +41,6 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_UBI=y
-CONFIG_MAC_PARTITION=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
disk/Kconfig +0 -14
index 672ad46a48f2..35b6c68be379 100644
@@ -6,7 +6,6 @@ config PARTITIONS
 	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.
@@ -36,19 +35,6 @@ config TPL_PARTITIONS
 	  partition table types shold be enabled separately. This adds a
 	  small amount of size to TPL, typically 500 bytes.
 
-config MAC_PARTITION
-	bool "Enable Apple's MacOS partition table"
-	select PARTITIONS
-	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
-	default y if MAC_PARTITION
-	select SPL_PARTITIONS
-
 config TEGRA_PARTITION
 	bool "Enable Nvidia Tegra partition table"
 	select PARTITIONS
disk/Makefile +0 -1
index 2248a659f8be..09bc4a7d6d75 100644
@@ -12,7 +12,6 @@ endif
 
 # Must have BLK or SPL_LEGACY_BLOCK to support partitions
 ifneq ($(CONFIG_$(PHASE_)BLK),$(CONFIG_SPL_LEGACY_BLOCK),)
-obj-$(CONFIG_$(PHASE_)MAC_PARTITION)   += part_mac.o
 obj-$(CONFIG_$(PHASE_)DOS_PARTITION)   += part_dos.o
 obj-$(CONFIG_$(PHASE_)ISO_PARTITION)   += part_iso.o
 obj-$(CONFIG_$(PHASE_)AMIGA_PARTITION) += part_amiga.o
disk/part.c +1 -2
index 4923dc44593c..b77ad848fd32 100644
@@ -312,8 +312,7 @@ void part_init(struct blk_desc *desc)
 
 static void print_part_header(const char *type, struct blk_desc *desc)
 {
-#if CONFIG_IS_ENABLED(MAC_PARTITION) || \
-	CONFIG_IS_ENABLED(DOS_PARTITION) || \
+#if CONFIG_IS_ENABLED(DOS_PARTITION) || \
 	CONFIG_IS_ENABLED(ISO_PARTITION) || \
 	CONFIG_IS_ENABLED(AMIGA_PARTITION) || \
 	CONFIG_IS_ENABLED(EFI_PARTITION) || \
disk/part_mac.c deleted +0 -237

237 lines not on this page · raw message

disk/part_mac.h deleted +0 -81

81 lines not on this page · raw message

include/part.h +0 -2
index 15daacd7faaa..c62b0efe57a4 100644
@@ -23,7 +23,6 @@ struct block_drvr {
 
 /* Part types */
 #define PART_TYPE_UNKNOWN	0x00
-#define PART_TYPE_MAC		0x01
 #define PART_TYPE_DOS		0x02
 #define PART_TYPE_ISO		0x03
 #define PART_TYPE_AMIGA		0x04
@@ -34,7 +33,6 @@ struct block_drvr {
 /* maximum number of partition entries supported by search */
 #define DOS_ENTRY_NUMBERS	8
 #define ISO_ENTRY_NUMBERS	64
-#define MAC_ENTRY_NUMBERS	64
 #define AMIGA_ENTRY_NUMBERS	8
 #define MTD_ENTRY_NUMBERS	64
 #define UBI_ENTRY_NUMBERS	UBI_MAX_VOLUMES

---
base-commit: f252d228be2b2d180737ad0a851f91749273cbd9
change-id: 20260826-drop-part-mac-66df760b1d97

Best regards,

Signature · 1 line
Alexey Charkov <[email protected]>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Alexey Charkov

The Apple Partition Map predates Advanced Format media by two decades. Apple never extended the format to cover 4 Kn logical blocks, has since withdrawn its documentation, and has shipped GPT on its own systems for almost as long. There is therefore no specification left to follow for the one property that matters here: where a partition map entry lives when a block is not 512 bytes.

U-Boot's implementation reflects that. All three entry points read one block into a buffer sized after a 512-byte struct, so they smash the stack on any device with larger blocks, and part_test_mac() runs during partition probing on every block device. Sizing those buffers correctly is easy; deciding what the driver should then parse is not, and guessing at a layout Apple never defined helps nobody.

Nothing in tree depends on the driver either: it has no test, no documentation and no MAINTAINERS entry, and the sole reference to PART_TYPE_MAC is its own partition driver registration.

Quoted 7 lines

Drop it. Anyone who needs Apple Partition Map support for emulated hardware can bring it back along with a test.

Thank you. LGTM.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Alexey Charkov
Quoted 18 lines · Alexey Charkov

The Apple Partition Map predates Advanced Format media by two decades. Apple never extended the format to cover 4 Kn logical blocks, has since withdrawn its documentation, and has shipped GPT on its own systems for almost as long. There is therefore no specification left to follow for the one property that matters here: where a partition map entry lives when a block is not 512 bytes.

U-Boot's implementation reflects that. All three entry points read one block into a buffer sized after a 512-byte struct, so they smash the stack on any device with larger blocks, and part_test_mac() runs during partition probing on every block device. Sizing those buffers correctly is easy; deciding what the driver should then parse is not, and guessing at a layout Apple never defined helps nobody.

Nothing in tree depends on the driver either: it has no test, no documentation and no MAINTAINERS entry, and the sole reference to PART_TYPE_MAC is its own partition driver registration.

Quoted 7 lines

Drop it. Anyone who needs Apple Partition Map support for emulated hardware can bring it back along with a test.

Signature · 1 line
Tom
#3 lore raw
In reply to Alexey Charkov
Quoted 8 lines · Alexey Charkov

The Apple Partition Map predates Advanced Format media by two decades. Apple never extended the format to cover 4 Kn logical blocks, has since withdrawn its documentation, and has shipped GPT on its own systems for almost as long. There is therefore no specification left to follow for the one property that matters here: where a partition map entry lives when a block is not 512 bytes.

[...]

Applied to u-boot/next, thanks!

[1/1] disk: part_mac: Remove the Apple Partition Map driver

      commit: acb09f16da3322098e54dcc75fe6458ed2d5bc23
Signature · 1 line
Tom