diff options
Diffstat (limited to 'release/sysinstall/disks.c')
-rw-r--r-- | release/sysinstall/disks.c | 100 |
1 files changed, 6 insertions, 94 deletions
diff --git a/release/sysinstall/disks.c b/release/sysinstall/disks.c index c07afb0..6f8f3de 100644 --- a/release/sysinstall/disks.c +++ b/release/sysinstall/disks.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: disks.c,v 1.37 1996/03/20 14:11:21 jkh Exp $ + * $Id: disks.c,v 1.38 1996/03/24 18:57:35 joerg Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -135,92 +135,6 @@ print_command_summary() move(0, 0); } -/* Partition a disk based wholly on which variables are set */ -static void -scriptPartition(Device *dev, Disk *d) -{ - char *cp; - int i, sz; - - record_chunks(d); - cp = variable_get(VAR_GEOMETRY); - if (cp) { - msgDebug("Setting geometry from script to: %s\n", cp); - d->bios_cyl = strtol(cp, &cp, 0); - d->bios_hd = strtol(cp + 1, &cp, 0); - d->bios_sect = strtol(cp + 1, 0, 0); - } - - cp = variable_get(VAR_DISKSPACE); - if (cp) { - if (!strcmp(cp, "free")) { - /* Do free disk space case */ - for (i = 0; chunk_info[i]; i++) { - /* If a chunk is at least 10MB in size, use it. */ - if (chunk_info[i]->type == unused && chunk_info[i]->size > (10 * ONE_MEG)) { - Create_Chunk(d, chunk_info[i]->offset, chunk_info[i]->size, freebsd, 3, - (chunk_info[i]->flags & CHUNK_ALIGN)); - variable_set2(DISK_PARTITIONED, "yes"); - break; - } - } - if (!chunk_info[i]) { - dialog_clear(); - msgConfirm("Unable to find any free space on this disk!"); - return; - } - } - else if (!strcmp(cp, "all")) { - /* Do all disk space case */ - msgDebug("Warning: Devoting all of disk %s to FreeBSD.\n", d->name); - - All_FreeBSD(d, FALSE); - } - else if (!strcmp(cp, "exclusive")) { - /* Do really-all-the-disk-space case */ - msgDebug("Warning: Devoting all of disk %s to FreeBSD.\n", d->name); - - All_FreeBSD(d, TRUE); - } - else if ((sz = strtol(cp, &cp, 0))) { - /* Look for sz bytes free */ - if (*cp && toupper(*cp) == 'M') - sz *= ONE_MEG; - for (i = 0; chunk_info[i]; i++) { - /* If a chunk is at least sz MB, use it. */ - if (chunk_info[i]->type == unused && chunk_info[i]->size >= sz) { - Create_Chunk(d, chunk_info[i]->offset, sz, freebsd, 3, (chunk_info[i]->flags & CHUNK_ALIGN)); - variable_set2(DISK_PARTITIONED, "yes"); - break; - } - } - if (!chunk_info[i]) { - dialog_clear(); - msgConfirm("Unable to find %d free blocks on this disk!", sz); - return; - } - } - else if (!strcmp(cp, "existing")) { - /* Do existing FreeBSD case */ - for (i = 0; chunk_info[i]; i++) { - if (chunk_info[i]->type == freebsd) - break; - } - if (!chunk_info[i]) { - dialog_clear(); - msgConfirm("Unable to find any existing FreeBSD partitions on this disk!"); - return; - } - } - else { - dialog_clear(); - msgConfirm("`%s' is an invalid value for %s - is config file valid?", cp, VAR_DISKSPACE); - return; - } - variable_set2(DISK_PARTITIONED, "yes"); - } -} - static u_char * getBootMgr(char *dname) { @@ -533,14 +447,15 @@ partitionHook(char *str) } int -diskPartitionEditor(char *str) +diskPartitionEditor(dialogMenuItem *self) { DMenu *menu; Device **devs; int i, cnt; - char *cp; + char *cp, *str; cp = variable_get(VAR_DISK); + str= variable_get(SYSTEM_STATE); devs = deviceFind(cp, DEVICE_TYPE_DISK); cnt = deviceCount(devs); if (!cnt) { @@ -552,10 +467,7 @@ diskPartitionEditor(char *str) } else if (cnt == 1) { devs[0]->enabled = TRUE; - if (str && !strcmp(str, "script")) - scriptPartition(devs[0], (Disk *)devs[0]->private); - else - diskPartition(devs[0], (Disk *)devs[0]->private); + diskPartition(devs[0], (Disk *)devs[0]->private); i = RET_SUCCESS; variable_set2(DISK_SELECTED, "yes"); } @@ -584,7 +496,7 @@ diskPartitionEditor(char *str) } int -diskPartitionWrite(char *str) +diskPartitionWrite(dialogMenuItem *self) { Device **devs; char *cp; |