From 24ab0000c9f2dcb66cec774b99c5db8a13327d71 Mon Sep 17 00:00:00 2001
From: marcel <marcel@FreeBSD.org>
Date: Sat, 2 Nov 2002 12:05:16 +0000
Subject: [PATCH] Add support for ia64. This is almost identical to i386,
 except that with GPT chunks of type "part" do not necessarily live under
 chunks of type "freebsd". We don't necessarily have a disklabel.

---
 lib/libdisk/chunk.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/lib/libdisk/chunk.c b/lib/libdisk/chunk.c
index ceabae1720fc..819e7b33c801 100644
--- a/lib/libdisk/chunk.c
+++ b/lib/libdisk/chunk.c
@@ -253,6 +253,26 @@ Add_Chunk(struct disk *d, long offset, u_long size, const char *name,
 			return(-1);
 		}
 		break;
+	case p_ia64:
+		switch (type) {
+		case freebsd:
+			subtype = 0xa5;
+			/* FALL THROUGH */
+		case fat:
+		case mbr:
+			c1 = Find_Mother_Chunk(d->chunks, offset, end, whole);
+			break;
+		case part:
+			c1 = Find_Mother_Chunk(d->chunks, offset, end,
+			    freebsd);
+			if (!c1)
+				c1 = Find_Mother_Chunk(d->chunks, offset, end,
+				    whole);
+			break;
+		default:
+			return (-1);
+		}
+		break;
 	case p_pc98:
 		switch (type) {
 		case freebsd: