diff options
-rw-r--r-- | usr.sbin/sade/install.c | 30 | ||||
-rw-r--r-- | usr.sbin/sade/label.c | 30 | ||||
-rw-r--r-- | usr.sbin/sysinstall/install.c | 30 | ||||
-rw-r--r-- | usr.sbin/sysinstall/label.c | 30 |
4 files changed, 100 insertions, 20 deletions
diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index a45c3bf..e52d0e2 100644 --- a/usr.sbin/sade/install.c +++ b/usr.sbin/sade/install.c @@ -109,11 +109,14 @@ checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vd if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); for (c1 = disk->chunks->part; c1; c1 = c1->next) { -#ifndef __ia64__ - if (c1->type == freebsd) { +#ifdef __ia64__ + c2 = c1; +#elif defined(__powerpc__) + if (c1->type == apple) { for (c2 = c1->part; c2; c2 = c2->next) { #else - c2 = c1; + if (c1->type == freebsd) { + for (c2 = c1->part; c2; c2 = c2->next) { #endif if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) { if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/")) { @@ -196,11 +199,15 @@ checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vd if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); for (c1 = disk->chunks->part; c1; c1 = c1->next) { -#ifndef __ia64__ - if (c1->type == freebsd) { + +#ifdef __ia64__ + c2 = c1; +#elif defined(__powerpc__) + if (c1->type == apple) { for (c2 = c1->part; c2; c2 = c2->next) { #else - c2 = c1; + if (c1->type == freebsd) { + for (c2 = c1->part; c2; c2 = c2->next) { #endif if (c2->type == part && c2->subtype == FS_SWAP && !swapdev) { swapdev = c2; @@ -1036,13 +1043,16 @@ installFilesystems(dialogMenuItem *self) return DITEM_FAILURE | DITEM_RESTORE; } for (c1 = disk->chunks->part; c1; c1 = c1->next) { -#ifndef __ia64__ - if (c1->type == freebsd) { - for (c2 = c1->part; c2; c2 = c2->next) { -#else +#ifdef __ia64__ if (c1->type == part) { c2 = c1; { +#elif defined(__powerpc__) + if (c1->type == apple) { + for (c2 = c1->part; c2; c2 = c2->next) { +#else + if (c1->type == freebsd) { + for (c2 = c1->part; c2; c2 = c2->next) { #endif if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) { PartInfo *tmp = (PartInfo *)c2->private_data; diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c index e75da48..3f27e589 100644 --- a/usr.sbin/sade/label.c +++ b/usr.sbin/sade/label.c @@ -290,6 +290,13 @@ record_label_chunks(Device **devs, Device *dev) label_chunk_info[j].c = c1; ++j; } +#ifdef __powerpc__ + if (c1->type == apple) { + label_chunk_info[j].type = PART_SLICE; + label_chunk_info[j].c = c1; + ++j; + } +#endif } } @@ -332,6 +339,20 @@ record_label_chunks(Device **devs, Device *dev) ++j; } #endif +#ifdef __powerpc__ + else if (c1->type == apple) { + for (c2 = c1->part; c2; c2 = c2->next) { + if (c2->type == part) { + if (c2->subtype == FS_SWAP) + label_chunk_info[j].type = PART_SWAP; + else + label_chunk_info[j].type = PART_FILESYSTEM; + label_chunk_info[j].c = c2; + ++j; + } + } + } +#endif } } label_chunk_info[j].c = NULL; @@ -1000,6 +1021,12 @@ diskLabel(Device *dev) char osize[80]; u_long flags = 0; +#ifdef __powerpc__ + /* Always use the maximum size for apple partitions */ + if (label_chunk_info[here].c->type == apple) + size = sz; + else { +#endif sprintf(osize, "%jd", (intmax_t)sz); val = msgGetInput(osize, "Please specify the partition size in blocks or append a trailing G for\n" @@ -1030,6 +1057,9 @@ diskLabel(Device *dev) clear_wins(); break; } +#ifdef __powerpc__ + } +#endif type = get_partition_type(); if (type == PART_NONE) { clear_wins(); diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index a45c3bf..e52d0e2 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.c @@ -109,11 +109,14 @@ checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vd if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); for (c1 = disk->chunks->part; c1; c1 = c1->next) { -#ifndef __ia64__ - if (c1->type == freebsd) { +#ifdef __ia64__ + c2 = c1; +#elif defined(__powerpc__) + if (c1->type == apple) { for (c2 = c1->part; c2; c2 = c2->next) { #else - c2 = c1; + if (c1->type == freebsd) { + for (c2 = c1->part; c2; c2 = c2->next) { #endif if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) { if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/")) { @@ -196,11 +199,15 @@ checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vd if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); for (c1 = disk->chunks->part; c1; c1 = c1->next) { -#ifndef __ia64__ - if (c1->type == freebsd) { + +#ifdef __ia64__ + c2 = c1; +#elif defined(__powerpc__) + if (c1->type == apple) { for (c2 = c1->part; c2; c2 = c2->next) { #else - c2 = c1; + if (c1->type == freebsd) { + for (c2 = c1->part; c2; c2 = c2->next) { #endif if (c2->type == part && c2->subtype == FS_SWAP && !swapdev) { swapdev = c2; @@ -1036,13 +1043,16 @@ installFilesystems(dialogMenuItem *self) return DITEM_FAILURE | DITEM_RESTORE; } for (c1 = disk->chunks->part; c1; c1 = c1->next) { -#ifndef __ia64__ - if (c1->type == freebsd) { - for (c2 = c1->part; c2; c2 = c2->next) { -#else +#ifdef __ia64__ if (c1->type == part) { c2 = c1; { +#elif defined(__powerpc__) + if (c1->type == apple) { + for (c2 = c1->part; c2; c2 = c2->next) { +#else + if (c1->type == freebsd) { + for (c2 = c1->part; c2; c2 = c2->next) { #endif if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) { PartInfo *tmp = (PartInfo *)c2->private_data; diff --git a/usr.sbin/sysinstall/label.c b/usr.sbin/sysinstall/label.c index e75da48..3f27e589 100644 --- a/usr.sbin/sysinstall/label.c +++ b/usr.sbin/sysinstall/label.c @@ -290,6 +290,13 @@ record_label_chunks(Device **devs, Device *dev) label_chunk_info[j].c = c1; ++j; } +#ifdef __powerpc__ + if (c1->type == apple) { + label_chunk_info[j].type = PART_SLICE; + label_chunk_info[j].c = c1; + ++j; + } +#endif } } @@ -332,6 +339,20 @@ record_label_chunks(Device **devs, Device *dev) ++j; } #endif +#ifdef __powerpc__ + else if (c1->type == apple) { + for (c2 = c1->part; c2; c2 = c2->next) { + if (c2->type == part) { + if (c2->subtype == FS_SWAP) + label_chunk_info[j].type = PART_SWAP; + else + label_chunk_info[j].type = PART_FILESYSTEM; + label_chunk_info[j].c = c2; + ++j; + } + } + } +#endif } } label_chunk_info[j].c = NULL; @@ -1000,6 +1021,12 @@ diskLabel(Device *dev) char osize[80]; u_long flags = 0; +#ifdef __powerpc__ + /* Always use the maximum size for apple partitions */ + if (label_chunk_info[here].c->type == apple) + size = sz; + else { +#endif sprintf(osize, "%jd", (intmax_t)sz); val = msgGetInput(osize, "Please specify the partition size in blocks or append a trailing G for\n" @@ -1030,6 +1057,9 @@ diskLabel(Device *dev) clear_wins(); break; } +#ifdef __powerpc__ + } +#endif type = get_partition_type(); if (type == PART_NONE) { clear_wins(); |