diff options
author | nyan <nyan@FreeBSD.org> | 2002-11-16 16:36:01 +0000 |
---|---|---|
committer | nyan <nyan@FreeBSD.org> | 2002-11-16 16:36:01 +0000 |
commit | 0f47f00a644da2af9b6cd625bb5b1c38a77a1463 (patch) | |
tree | 73b5aa79e0af089ad3638cca90e115997606d148 /usr.sbin/sade/disks.c | |
parent | 280e9bbfe86335182d404cbcc771d72b75c955b9 (diff) | |
download | FreeBSD-src-0f47f00a644da2af9b6cd625bb5b1c38a77a1463.zip FreeBSD-src-0f47f00a644da2af9b6cd625bb5b1c38a77a1463.tar.gz |
Enable selecting the type of partition menu on pc98.
Diffstat (limited to 'usr.sbin/sade/disks.c')
-rw-r--r-- | usr.sbin/sade/disks.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c index bfa38ba..8328bf2 100644 --- a/usr.sbin/sade/disks.c +++ b/usr.sbin/sade/disks.c @@ -399,19 +399,17 @@ diskPartition(Device *dev) if (chunk_info[current_chunk]->type != unused) msg = "Slice in use, delete it first or move to an unused one."; else { - char *val, tmp[20], *cp; - int size; + char *val, tmp[20], name[16], *cp; + int size, subtype; + chunk_e partitiontype; #ifdef PC98 - char name[16]; - - snprintf(name, 16, "%s", "FreeBSD"); + snprintf(name, sizeof (name), "%s", "FreeBSD"); val = msgGetInput(name, "Please specify the name for new FreeBSD slice."); if (val) - strncpy(name, val, 16); + strncpy(name, val, sizeof (name)); #else - int subtype; - chunk_e partitiontype; + name[0] = '\0'; #endif snprintf(tmp, 20, "%lu", chunk_info[current_chunk]->size); val = msgGetInput(tmp, "Please specify the size for new FreeBSD slice in blocks\n" @@ -421,15 +419,17 @@ diskPartition(Device *dev) size *= ONE_MEG; else if (*cp && toupper(*cp) == 'G') size *= ONE_GIG; + sprintf(tmp, "%d", SUBTYPE_FREEBSD); #ifdef PC98 - Create_Chunk(d, chunk_info[current_chunk]->offset, size, - freebsd, 3, - (chunk_info[current_chunk]->flags & CHUNK_ALIGN), - name); - variable_set2(DISK_PARTITIONED, "yes", 0); - record_chunks(d); + val = msgGetInput(tmp, "Enter type of partition to create:\n\n" + "Pressing Enter will choose the default, a native FreeBSD\n" + "slice (type 50324). You can choose other types, 37218 for a\n" + "DOS partition, for example.\n\n" + "Note: If you choose a non-FreeBSD partition type, it will not\n" + "be formatted or otherwise prepared, it will simply reserve space\n" + "for you to use another tool, such as DOS FORMAT, to later format\n" + "and use the partition."); #else - sprintf(tmp, "%d", SUBTYPE_FREEBSD); val = msgGetInput(tmp, "Enter type of partition to create:\n\n" "Pressing Enter will choose the default, a native FreeBSD\n" "slice (type 165). You can choose other types, 6 for a\n" @@ -438,6 +438,7 @@ diskPartition(Device *dev) "be formatted or otherwise prepared, it will simply reserve space\n" "for you to use another tool, such as DOS FORMAT, to later format\n" "and use the partition."); +#endif /* PC98 */ if (val && (subtype = strtol(val, NULL, 0)) > 0) { if (subtype == SUBTYPE_FREEBSD) partitiontype = freebsd; @@ -453,11 +454,10 @@ diskPartition(Device *dev) else #endif Create_Chunk(d, chunk_info[current_chunk]->offset, size, partitiontype, subtype, - (chunk_info[current_chunk]->flags & CHUNK_ALIGN), ""); + (chunk_info[current_chunk]->flags & CHUNK_ALIGN), name); variable_set2(DISK_PARTITIONED, "yes", 0); record_chunks(d); } -#endif /* PC98 */ } clear(); } |