All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: partitions: mac: record Apple partition names
@ 2026-11-18  2:10 Tim Douglas
  0 siblings, 0 replies; only message in thread
From: Tim Douglas @ 2026-11-18  2:10 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel

Early root=PARTLABEL= lookup fails on Apple Partition Map disks
because the on-disk names are absent from the kernel's partition
metadata. Copy the name from each entry and append a NUL terminator
so that names that fill the 32-byte field can be used.

Tested on an arm64 QEMU guest with Linux v7.4-rc3 and no initramfs.
Before the patch, boot failed with PARTLABEL and succeeded with
the device path for the same partition. With the patch, boot succeeded
with both a short name and a 32-byte name. Boot with
root=PARTLABEL=6200-Linux was also verified on a Performa 6200CD
using a kernel with local platform support.

AI assistance was used to investigate early root lookup and draft
the change.

Signed-off-by: Tim Douglas <me@timdoug.com>
---
 block/partitions/mac.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/block/partitions/mac.c b/block/partitions/mac.c
index f372392af..da170a65d 100644
--- a/block/partitions/mac.c
+++ b/block/partitions/mac.c
@@ -100,6 +100,12 @@ int mac_partition(struct parsed_partitions *state)
 			(sector_t)be32_to_cpu(part->start_block) * (secsize/512),
 			(sector_t)be32_to_cpu(part->block_count) * (secsize/512));
 
+		/* Expose the APM name for early root=PARTLABEL lookup. */
+		memcpy(state->parts[slot].info.volname, part->name,
+		       sizeof(part->name));
+		state->parts[slot].info.volname[sizeof(part->name)] = '\0';
+		state->parts[slot].has_info = true;
+
 		if (!strncasecmp(part->type, "Linux_RAID", 10))
 			state->parts[slot].flags = ADDPART_FLAG_RAID;
 #ifdef CONFIG_PPC_PMAC

base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
-- 
2.39.5


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-18  2:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18  2:10 [PATCH] block: partitions: mac: record Apple partition names Tim Douglas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.