diff --git a/release/sysinstall/disks.c b/release/sysinstall/disks.c index 987f2ea090d4..5db2fcf69c42 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.47 1996/04/30 05:23:45 jkh Exp $ + * $Id: disks.c,v 1.48 1996/05/09 09:42:03 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -101,7 +101,7 @@ print_chunks(Disk *d) "Subtype", "Flags"); for (i = 0, row = CHUNK_START_ROW; chunk_info[i]; i++, row++) { if (i == current_chunk) - attrset(item_selected_attr); + attrset(tag_attr); mvprintw(row, 2, "%10ld %10lu %10lu %8s %8d %8s %8d\t%-6s", chunk_info[i]->offset, chunk_info[i]->size, chunk_info[i]->end, chunk_info[i]->name, @@ -271,18 +271,36 @@ diskPartition(Device *dev, Disk *d) msg = "Partition in use, delete it first or move to an unused one."; else { char *val, tmp[20], *cp; - int size; + int size, subtype; + chunk_e partitiontype; snprintf(tmp, 20, "%d", chunk_info[current_chunk]->size); - val = msgGetInput(tmp, "Please specify the size for new FreeBSD partition in blocks, or append\n" - "a trailing `M' for megabytes (e.g. 20M)."); + val = msgGetInput(tmp, "Please specify the size for new FreeBSD partition in blocks\n" + "or append a trailing `M' for megabytes (e.g. 20M)."); if (val && (size = strtol(val, &cp, 0)) > 0) { if (*cp && toupper(*cp) == 'M') size *= ONE_MEG; - Create_Chunk(d, chunk_info[current_chunk]->offset, size, freebsd, 3, + strcpy(tmp, "165"); + val = msgGetInput(tmp, "Enter type of partition to create:\n\n" + "Pressing Enter will choose the default, a native FreeBSD\n" + "partition (type 165). You can choose other types, 6 for a\n" + "DOS partition or 131 for a Linux 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."); + if (val && (subtype = strtol(val, NULL, 0)) > 0) { + if (subtype==165) + partitiontype=freebsd; + else if (subtype==6) + partitiontype=fat; + else + partitiontype=unknown; + Create_Chunk(d, chunk_info[current_chunk]->offset, size, partitiontype, subtype, (chunk_info[current_chunk]->flags & CHUNK_ALIGN)); variable_set2(DISK_PARTITIONED, "yes"); record_chunks(d); + } } } break; diff --git a/release/sysinstall/index.c b/release/sysinstall/index.c index ad537fc2e366..79a7d7236926 100644 --- a/release/sysinstall/index.c +++ b/release/sysinstall/index.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: index.c,v 1.31 1996/06/08 07:02:19 jkh Exp $ + * $Id: index.c,v 1.32 1996/06/08 07:15:48 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -383,9 +383,11 @@ int pkg_checked(dialogMenuItem *self) { PkgNodePtr kp = self->data, plist = (PkgNodePtr)self->aux; + int i; + i = index_search(plist, kp->name, NULL) ? TRUE : FALSE; if (kp->type == PACKAGE && plist) - return index_search(plist, kp->name, NULL) ? TRUE : FALSE; + return i || (!RunningAsInit && package_exists(kp->name)); else return FALSE; } @@ -402,12 +404,14 @@ pkg_fire(dialogMenuItem *self) sp = index_search(plist, kp->name, NULL); /* Not already selected? */ if (!sp) { - PkgNodePtr np = (PkgNodePtr)safe_malloc(sizeof(PkgNode)); + if (!RunningAsInit && !package_exists(kp->name)) { + PkgNodePtr np = (PkgNodePtr)safe_malloc(sizeof(PkgNode)); - *np = *kp; - np->next = plist->kids; - plist->kids = np; - msgInfo("Added %s to selection list", kp->name); + *np = *kp; + np->next = plist->kids; + plist->kids = np; + msgInfo("Added %s to selection list", kp->name); + } } else if (sp) { msgInfo("Removed %s from selection list", kp->name); diff --git a/release/sysinstall/label.c b/release/sysinstall/label.c index 850d94dcba30..0870a818e838 100644 --- a/release/sysinstall/label.c +++ b/release/sysinstall/label.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: label.c,v 1.47 1996/04/29 05:09:23 jkh Exp $ + * $Id: label.c,v 1.48 1996/05/09 09:42:08 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -400,7 +400,7 @@ print_label_chunks(void) if (label_chunk_info[i].type == PART_SLICE) { sz = space_free(label_chunk_info[i].c); if (i == here) - attrset(item_selected_attr); + attrset(tag_attr); mvprintw(srow++, 0, "Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)", label_chunk_info[i].c->disk->name, label_chunk_info[i].c->name, sz, (sz / ONE_MEG)); attrset(A_NORMAL); @@ -447,7 +447,7 @@ print_label_chunks(void) memcpy(onestr + PART_NEWFS_COL, newfs, strlen(newfs)); onestr[PART_NEWFS_COL + strlen(newfs)] = '\0'; if (i == here) - wattrset(ChunkWin, item_selected_attr); + wattrset(ChunkWin, tag_attr); mvwaddstr(ChunkWin, prow, pcol, onestr); wattrset(ChunkWin, A_NORMAL); wrefresh(ChunkWin); diff --git a/release/sysinstall/options.c b/release/sysinstall/options.c index bcfbda38f100..df6743c7238e 100644 --- a/release/sysinstall/options.c +++ b/release/sysinstall/options.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * - * $Id: options.c,v 1.35 1996/04/25 17:31:25 jkh Exp $ + * $Id: options.c,v 1.36 1996/05/09 09:42:17 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -218,7 +218,7 @@ optionsEditor(dialogMenuItem *self) /* Names are painted somewhat gratuitously each time, but it's easier this way */ mvprintw(optrow, OPT_NAME_COL + optcol, Options[i].name); if (currOpt == i) - attrset(item_selected_attr); + attrset(tag_attr); mvprintw(optrow++, OPT_VALUE_COL + optcol, value_of(Options[i])); if (currOpt == i) attrset(A_NORMAL); diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c index 987f2ea090d4..5db2fcf69c42 100644 --- a/usr.sbin/sade/disks.c +++ b/usr.sbin/sade/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.47 1996/04/30 05:23:45 jkh Exp $ + * $Id: disks.c,v 1.48 1996/05/09 09:42:03 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -101,7 +101,7 @@ print_chunks(Disk *d) "Subtype", "Flags"); for (i = 0, row = CHUNK_START_ROW; chunk_info[i]; i++, row++) { if (i == current_chunk) - attrset(item_selected_attr); + attrset(tag_attr); mvprintw(row, 2, "%10ld %10lu %10lu %8s %8d %8s %8d\t%-6s", chunk_info[i]->offset, chunk_info[i]->size, chunk_info[i]->end, chunk_info[i]->name, @@ -271,18 +271,36 @@ diskPartition(Device *dev, Disk *d) msg = "Partition in use, delete it first or move to an unused one."; else { char *val, tmp[20], *cp; - int size; + int size, subtype; + chunk_e partitiontype; snprintf(tmp, 20, "%d", chunk_info[current_chunk]->size); - val = msgGetInput(tmp, "Please specify the size for new FreeBSD partition in blocks, or append\n" - "a trailing `M' for megabytes (e.g. 20M)."); + val = msgGetInput(tmp, "Please specify the size for new FreeBSD partition in blocks\n" + "or append a trailing `M' for megabytes (e.g. 20M)."); if (val && (size = strtol(val, &cp, 0)) > 0) { if (*cp && toupper(*cp) == 'M') size *= ONE_MEG; - Create_Chunk(d, chunk_info[current_chunk]->offset, size, freebsd, 3, + strcpy(tmp, "165"); + val = msgGetInput(tmp, "Enter type of partition to create:\n\n" + "Pressing Enter will choose the default, a native FreeBSD\n" + "partition (type 165). You can choose other types, 6 for a\n" + "DOS partition or 131 for a Linux 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."); + if (val && (subtype = strtol(val, NULL, 0)) > 0) { + if (subtype==165) + partitiontype=freebsd; + else if (subtype==6) + partitiontype=fat; + else + partitiontype=unknown; + Create_Chunk(d, chunk_info[current_chunk]->offset, size, partitiontype, subtype, (chunk_info[current_chunk]->flags & CHUNK_ALIGN)); variable_set2(DISK_PARTITIONED, "yes"); record_chunks(d); + } } } break; diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c index 850d94dcba30..0870a818e838 100644 --- a/usr.sbin/sade/label.c +++ b/usr.sbin/sade/label.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: label.c,v 1.47 1996/04/29 05:09:23 jkh Exp $ + * $Id: label.c,v 1.48 1996/05/09 09:42:08 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -400,7 +400,7 @@ print_label_chunks(void) if (label_chunk_info[i].type == PART_SLICE) { sz = space_free(label_chunk_info[i].c); if (i == here) - attrset(item_selected_attr); + attrset(tag_attr); mvprintw(srow++, 0, "Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)", label_chunk_info[i].c->disk->name, label_chunk_info[i].c->name, sz, (sz / ONE_MEG)); attrset(A_NORMAL); @@ -447,7 +447,7 @@ print_label_chunks(void) memcpy(onestr + PART_NEWFS_COL, newfs, strlen(newfs)); onestr[PART_NEWFS_COL + strlen(newfs)] = '\0'; if (i == here) - wattrset(ChunkWin, item_selected_attr); + wattrset(ChunkWin, tag_attr); mvwaddstr(ChunkWin, prow, pcol, onestr); wattrset(ChunkWin, A_NORMAL); wrefresh(ChunkWin); diff --git a/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c index 987f2ea090d4..5db2fcf69c42 100644 --- a/usr.sbin/sysinstall/disks.c +++ b/usr.sbin/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.47 1996/04/30 05:23:45 jkh Exp $ + * $Id: disks.c,v 1.48 1996/05/09 09:42:03 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -101,7 +101,7 @@ print_chunks(Disk *d) "Subtype", "Flags"); for (i = 0, row = CHUNK_START_ROW; chunk_info[i]; i++, row++) { if (i == current_chunk) - attrset(item_selected_attr); + attrset(tag_attr); mvprintw(row, 2, "%10ld %10lu %10lu %8s %8d %8s %8d\t%-6s", chunk_info[i]->offset, chunk_info[i]->size, chunk_info[i]->end, chunk_info[i]->name, @@ -271,18 +271,36 @@ diskPartition(Device *dev, Disk *d) msg = "Partition in use, delete it first or move to an unused one."; else { char *val, tmp[20], *cp; - int size; + int size, subtype; + chunk_e partitiontype; snprintf(tmp, 20, "%d", chunk_info[current_chunk]->size); - val = msgGetInput(tmp, "Please specify the size for new FreeBSD partition in blocks, or append\n" - "a trailing `M' for megabytes (e.g. 20M)."); + val = msgGetInput(tmp, "Please specify the size for new FreeBSD partition in blocks\n" + "or append a trailing `M' for megabytes (e.g. 20M)."); if (val && (size = strtol(val, &cp, 0)) > 0) { if (*cp && toupper(*cp) == 'M') size *= ONE_MEG; - Create_Chunk(d, chunk_info[current_chunk]->offset, size, freebsd, 3, + strcpy(tmp, "165"); + val = msgGetInput(tmp, "Enter type of partition to create:\n\n" + "Pressing Enter will choose the default, a native FreeBSD\n" + "partition (type 165). You can choose other types, 6 for a\n" + "DOS partition or 131 for a Linux 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."); + if (val && (subtype = strtol(val, NULL, 0)) > 0) { + if (subtype==165) + partitiontype=freebsd; + else if (subtype==6) + partitiontype=fat; + else + partitiontype=unknown; + Create_Chunk(d, chunk_info[current_chunk]->offset, size, partitiontype, subtype, (chunk_info[current_chunk]->flags & CHUNK_ALIGN)); variable_set2(DISK_PARTITIONED, "yes"); record_chunks(d); + } } } break; diff --git a/usr.sbin/sysinstall/index.c b/usr.sbin/sysinstall/index.c index ad537fc2e366..79a7d7236926 100644 --- a/usr.sbin/sysinstall/index.c +++ b/usr.sbin/sysinstall/index.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: index.c,v 1.31 1996/06/08 07:02:19 jkh Exp $ + * $Id: index.c,v 1.32 1996/06/08 07:15:48 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -383,9 +383,11 @@ int pkg_checked(dialogMenuItem *self) { PkgNodePtr kp = self->data, plist = (PkgNodePtr)self->aux; + int i; + i = index_search(plist, kp->name, NULL) ? TRUE : FALSE; if (kp->type == PACKAGE && plist) - return index_search(plist, kp->name, NULL) ? TRUE : FALSE; + return i || (!RunningAsInit && package_exists(kp->name)); else return FALSE; } @@ -402,12 +404,14 @@ pkg_fire(dialogMenuItem *self) sp = index_search(plist, kp->name, NULL); /* Not already selected? */ if (!sp) { - PkgNodePtr np = (PkgNodePtr)safe_malloc(sizeof(PkgNode)); + if (!RunningAsInit && !package_exists(kp->name)) { + PkgNodePtr np = (PkgNodePtr)safe_malloc(sizeof(PkgNode)); - *np = *kp; - np->next = plist->kids; - plist->kids = np; - msgInfo("Added %s to selection list", kp->name); + *np = *kp; + np->next = plist->kids; + plist->kids = np; + msgInfo("Added %s to selection list", kp->name); + } } else if (sp) { msgInfo("Removed %s from selection list", kp->name); diff --git a/usr.sbin/sysinstall/label.c b/usr.sbin/sysinstall/label.c index 850d94dcba30..0870a818e838 100644 --- a/usr.sbin/sysinstall/label.c +++ b/usr.sbin/sysinstall/label.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: label.c,v 1.47 1996/04/29 05:09:23 jkh Exp $ + * $Id: label.c,v 1.48 1996/05/09 09:42:08 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -400,7 +400,7 @@ print_label_chunks(void) if (label_chunk_info[i].type == PART_SLICE) { sz = space_free(label_chunk_info[i].c); if (i == here) - attrset(item_selected_attr); + attrset(tag_attr); mvprintw(srow++, 0, "Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)", label_chunk_info[i].c->disk->name, label_chunk_info[i].c->name, sz, (sz / ONE_MEG)); attrset(A_NORMAL); @@ -447,7 +447,7 @@ print_label_chunks(void) memcpy(onestr + PART_NEWFS_COL, newfs, strlen(newfs)); onestr[PART_NEWFS_COL + strlen(newfs)] = '\0'; if (i == here) - wattrset(ChunkWin, item_selected_attr); + wattrset(ChunkWin, tag_attr); mvwaddstr(ChunkWin, prow, pcol, onestr); wattrset(ChunkWin, A_NORMAL); wrefresh(ChunkWin); diff --git a/usr.sbin/sysinstall/options.c b/usr.sbin/sysinstall/options.c index bcfbda38f100..df6743c7238e 100644 --- a/usr.sbin/sysinstall/options.c +++ b/usr.sbin/sysinstall/options.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * - * $Id: options.c,v 1.35 1996/04/25 17:31:25 jkh Exp $ + * $Id: options.c,v 1.36 1996/05/09 09:42:17 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -218,7 +218,7 @@ optionsEditor(dialogMenuItem *self) /* Names are painted somewhat gratuitously each time, but it's easier this way */ mvprintw(optrow, OPT_NAME_COL + optcol, Options[i].name); if (currOpt == i) - attrset(item_selected_attr); + attrset(tag_attr); mvprintw(optrow++, OPT_VALUE_COL + optcol, value_of(Options[i])); if (currOpt == i) attrset(A_NORMAL);