All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Douglas <me@timdoug.com>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] block: partitions: mac: record Apple partition names
Date: Tue, 17 Nov 2026 21:10:59 -0500	[thread overview]
Message-ID: <20261118021059.84192-1-me@timdoug.com> (raw)

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


                 reply	other threads:[~2026-11-18  2:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261118021059.84192-1-me@timdoug.com \
    --to=me@timdoug.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.