From 91d97512540deddfc5ec16f4b25928801effe746 Mon Sep 17 00:00:00 2001 From: marcel Date: Tue, 4 Nov 2003 02:04:36 +0000 Subject: o Don't tell that there's such a thing as a C suffix for specifying a partition size on ia64. It's not true. o Ask for a mountpoint for EFI partitions as well and check that it isn't "/". o On ia64 we may need to add EFI partitions. Make sure we pass the right arguments to Create_Chunk_DWIM() in that case. --- usr.sbin/sade/label.c | 29 ++++++++++++++++++++++------- usr.sbin/sysinstall/label.c | 29 ++++++++++++++++++++++------- 2 files changed, 44 insertions(+), 14 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c index f1ccad1..5b4a51c 100644 --- a/usr.sbin/sade/label.c +++ b/usr.sbin/sade/label.c @@ -999,7 +999,11 @@ diskLabel(Device *dev) sprintf(osize, "%d", sz); val = msgGetInput(osize, "Please specify the partition size in blocks or append a trailing G for\n" +#ifdef __ia64__ + "gigabytes, M for megabytes.\n" +#else "gigabytes, M for megabytes, or C for cylinders.\n" +#endif "%d blocks (%dMB) are free.", sz, sz / ONE_MEG); if (!val || (size = strtol(val, &cp, 0)) <= 0) { @@ -1029,14 +1033,21 @@ diskLabel(Device *dev) break; } - if (type == PART_FILESYSTEM) { + if (type == PART_FILESYSTEM || type == PART_EFI) { if ((p = get_mountpoint(NULL)) == NULL) { clear_wins(); beep(); break; } - else if (!strcmp(p->mountpoint, "/")) - flags |= CHUNK_IS_ROOT; + else if (!strcmp(p->mountpoint, "/")) { + if (type != PART_FILESYSTEM) { + clear_wins(); + beep(); + break; + } + else + flags |= CHUNK_IS_ROOT; + } else flags &= ~CHUNK_IS_ROOT; } @@ -1049,10 +1060,14 @@ diskLabel(Device *dev) "partitions should usually be at least %dMB in size", ROOT_MIN_SIZE); } tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, - label_chunk_info[here].c, - size, part, - (type == PART_SWAP) ? FS_SWAP : FS_BSDFFS, - flags); + label_chunk_info[here].c, size, +#ifdef __ia64__ + (type == PART_EFI) ? efi : part, + (type == PART_EFI) ? 0 : (type == PART_SWAP) ? FS_SWAP : FS_BSDFFS, +#else + part, (type == PART_SWAP) ? FS_SWAP : FS_BSDFFS, +#endif + flags); if (!tmp) { msgConfirm("Unable to create the partition. Too big?"); clear_wins(); diff --git a/usr.sbin/sysinstall/label.c b/usr.sbin/sysinstall/label.c index f1ccad1..5b4a51c 100644 --- a/usr.sbin/sysinstall/label.c +++ b/usr.sbin/sysinstall/label.c @@ -999,7 +999,11 @@ diskLabel(Device *dev) sprintf(osize, "%d", sz); val = msgGetInput(osize, "Please specify the partition size in blocks or append a trailing G for\n" +#ifdef __ia64__ + "gigabytes, M for megabytes.\n" +#else "gigabytes, M for megabytes, or C for cylinders.\n" +#endif "%d blocks (%dMB) are free.", sz, sz / ONE_MEG); if (!val || (size = strtol(val, &cp, 0)) <= 0) { @@ -1029,14 +1033,21 @@ diskLabel(Device *dev) break; } - if (type == PART_FILESYSTEM) { + if (type == PART_FILESYSTEM || type == PART_EFI) { if ((p = get_mountpoint(NULL)) == NULL) { clear_wins(); beep(); break; } - else if (!strcmp(p->mountpoint, "/")) - flags |= CHUNK_IS_ROOT; + else if (!strcmp(p->mountpoint, "/")) { + if (type != PART_FILESYSTEM) { + clear_wins(); + beep(); + break; + } + else + flags |= CHUNK_IS_ROOT; + } else flags &= ~CHUNK_IS_ROOT; } @@ -1049,10 +1060,14 @@ diskLabel(Device *dev) "partitions should usually be at least %dMB in size", ROOT_MIN_SIZE); } tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, - label_chunk_info[here].c, - size, part, - (type == PART_SWAP) ? FS_SWAP : FS_BSDFFS, - flags); + label_chunk_info[here].c, size, +#ifdef __ia64__ + (type == PART_EFI) ? efi : part, + (type == PART_EFI) ? 0 : (type == PART_SWAP) ? FS_SWAP : FS_BSDFFS, +#else + part, (type == PART_SWAP) ? FS_SWAP : FS_BSDFFS, +#endif + flags); if (!tmp) { msgConfirm("Unable to create the partition. Too big?"); clear_wins(); -- cgit v1.1