summaryrefslogtreecommitdiffstats
path: root/lib/libdisk/create_chunk.c
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2004-04-21 23:21:13 +0000
committergrehan <grehan@FreeBSD.org>2004-04-21 23:21:13 +0000
commita76af532c5dc1e784116e7571732ee16000d2fc1 (patch)
tree424d360a1d9752b9b11b6336dd2e237be1c2f8ca /lib/libdisk/create_chunk.c
parent4173466ca4ff2e1da50f5049e8e6318eb45b1d5f (diff)
downloadFreeBSD-src-a76af532c5dc1e784116e7571732ee16000d2fc1.zip
FreeBSD-src-a76af532c5dc1e784116e7571732ee16000d2fc1.tar.gz
PowerPC support.
submitted by: Suleiman Souhlal <refugee@segfaulted.com> approved by: phk, jhb
Diffstat (limited to 'lib/libdisk/create_chunk.c')
-rw-r--r--lib/libdisk/create_chunk.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c
index c65b8f3..3d498a6 100644
--- a/lib/libdisk/create_chunk.c
+++ b/lib/libdisk/create_chunk.c
@@ -134,6 +134,24 @@ Fixup_Extended_Names(struct chunk *c)
}
#endif
+#ifdef __powerpc__
+static int
+Fixup_Apple_Names(struct chunk *c)
+{
+ struct chunk *c1;
+
+ for (c1 = c->part; c1; c1 = c1->next) {
+ if (c1->type == unused)
+ continue;
+ free(c1->name);
+ c1->name = strdup(c->name);
+ if (!c1->name)
+ return (-1);
+ }
+ return 0;
+}
+#endif
+
int
Fixup_Names(struct disk *d)
{
@@ -185,6 +203,10 @@ Fixup_Names(struct disk *d)
for (c2 = c1->part; c2; c2 = c2->next) {
if (c2->type == freebsd)
Fixup_FreeBSD_Names(c2);
+#ifdef __powerpc__
+ else if (c2->type == apple)
+ Fixup_Apple_Names(c2);
+#endif
#ifndef PC98
else if (c2->type == extended)
Fixup_Extended_Names(c2);
@@ -238,7 +260,8 @@ Create_Chunk_DWIM(struct disk *d, struct chunk *parent, daddr_t size,
if (!parent)
parent = d->chunks;
- if (parent->type == freebsd && type == part && parent->part == NULL) {
+ if ((parent->type == freebsd && type == part && parent->part == NULL)
+ || (parent->type == apple && type == part && parent->part == NULL)) {
c1 = New_Chunk();
if (c1 == NULL)
return (NULL);
OpenPOWER on IntegriCloud