summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-05-07 23:37:34 +0000
committerjkh <jkh@FreeBSD.org>1995-05-07 23:37:34 +0000
commit01c872638ff0b1ecd62eb5b6f8af71dfd05ae205 (patch)
tree593222abd07587a9e7c14c8a8b715068dcd3757b
parent8a8b9e96e60149210d03a8c01f441f6db78607e3 (diff)
downloadFreeBSD-src-01c872638ff0b1ecd62eb5b6f8af71dfd05ae205.zip
FreeBSD-src-01c872638ff0b1ecd62eb5b6f8af71dfd05ae205.tar.gz
Another sync up for Poul. Added a lot more error checking.
-rw-r--r--release/sysinstall/disks.c39
-rw-r--r--release/sysinstall/install.c9
-rw-r--r--release/sysinstall/sysinstall.h6
-rw-r--r--usr.sbin/sade/disks.c39
-rw-r--r--usr.sbin/sade/install.c9
-rw-r--r--usr.sbin/sade/sade.h6
-rw-r--r--usr.sbin/sysinstall/disks.c39
-rw-r--r--usr.sbin/sysinstall/install.c9
-rw-r--r--usr.sbin/sysinstall/sysinstall.h6
9 files changed, 144 insertions, 18 deletions
diff --git a/release/sysinstall/disks.c b/release/sysinstall/disks.c
index b499532..9339a8d 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.6 1995/05/07 05:58:56 jkh Exp $
+ * $Id: disks.c,v 1.7 1995/05/07 22:07:51 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -198,6 +198,7 @@ new_part(char *mpoint, Boolean newfs)
ret = (PartInfo *)safe_malloc(sizeof(PartInfo));
strncpy(ret->mountpoint, mpoint, FILENAME_MAX);
+ strcpy(ret->newfs_cmd, "newfs");
ret->newfs = newfs;
return ret;
}
@@ -258,6 +259,18 @@ get_partition_type(void)
return PART_NONE;
}
+static void
+getNewfsCmd(PartInfo *p)
+{
+ char *val;
+
+ val = msgGetInput(p->newfs_cmd,
+ "Please enter the newfs command and options you'd like to use in\ncreating this file system.");
+ if (val)
+ strncpy(p->newfs_cmd, val, NEWFS_CMD_MAX);
+}
+
+
#define MAX_MOUNT_NAME 12
#define PART_PART_COL 0
@@ -322,8 +335,10 @@ print_fbsd_chunks(void)
memset(onestr, ' ', PART_OFF - 1);
onestr[PART_OFF - 1] = '\0';
/* Go for two columns */
- if (prow == (CHUNK_PART_START_ROW + CHUNK_COLUMN_MAX))
+ if (prow == (CHUNK_PART_START_ROW + CHUNK_COLUMN_MAX)) {
pcol = PART_OFF;
+ prow = CHUNK_PART_START_ROW;
+ }
else
pcol = 0;
memcpy(onestr + PART_PART_COL, fbsd_chunk_info[i].c->name,
@@ -517,9 +532,29 @@ partition_disks(struct disk **disks)
}
break;
+ case 'N': /* Set newfs options */
+ if (fbsd_chunk_info[current_chunk].c->private &&
+ ((PartInfo *)fbsd_chunk_info[current_chunk].c->private)->newfs)
+ getNewfsCmd(fbsd_chunk_info[current_chunk].c->private);
+ else
+ msg = "newfs options not applicable for this partition";
+ break;
+
+ case 'T': /* Toggle newfs state */
+ if (fbsd_chunk_info[current_chunk].c->private)
+ ((PartInfo *)fbsd_chunk_info[current_chunk].c->private)->newfs = !((PartInfo *)fbsd_chunk_info[current_chunk].c->private)->newfs;
+ else
+ msg = "Set a mount point first.";
+ break;
+
case 27: /* ESC */
partitioning = FALSE;
break;
+
+ default:
+ beep();
+ msg = "Type F1 or ? for help";
+ break;
}
}
}
diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c
index 8ec4bb3..a96a3ee 100644
--- a/release/sysinstall/install.c
+++ b/release/sysinstall/install.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: install.c,v 1.8 1995/05/05 23:47:40 jkh Exp $
+ * $Id: install.c,v 1.9 1995/05/06 09:34:18 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -167,8 +167,10 @@ make_filesystems(struct disk **disks)
struct chunk *c2 = c1->part;
while (c2) {
- if (c2->type == part && c2->subtype != FS_SWAP)
- vsystem("newfs %s", c2->name);
+ if (c2->type == part && c2->subtype != FS_SWAP &&
+ c2->private && ((PartInfo *)c2->private)->newfs)
+ vsystem("%s %s", ((PartInfo *)c2->private)->newfs_cmd,
+ c2->name);
c2 = c2->next;
}
}
@@ -180,6 +182,7 @@ make_filesystems(struct disk **disks)
void
cpio_extract(struct disk **disks)
{
+
}
void
diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h
index ad9417d..68698a1 100644
--- a/release/sysinstall/sysinstall.h
+++ b/release/sysinstall/sysinstall.h
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: sysinstall.h,v 1.9 1995/05/06 09:34:20 jkh Exp $
+ * $Id: sysinstall.h,v 1.10 1995/05/07 02:04:29 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -177,9 +177,13 @@ typedef enum {
PART_FILESYSTEM
} PartType;
+/* The longest newfs command we'll hand to system() */
+#define NEWFS_CMD_MAX 256
+
typedef struct _part_info {
Boolean newfs;
char mountpoint[FILENAME_MAX];
+ char newfs_cmd[NEWFS_CMD_MAX];
} PartInfo;
diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c
index b499532..9339a8d 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.6 1995/05/07 05:58:56 jkh Exp $
+ * $Id: disks.c,v 1.7 1995/05/07 22:07:51 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -198,6 +198,7 @@ new_part(char *mpoint, Boolean newfs)
ret = (PartInfo *)safe_malloc(sizeof(PartInfo));
strncpy(ret->mountpoint, mpoint, FILENAME_MAX);
+ strcpy(ret->newfs_cmd, "newfs");
ret->newfs = newfs;
return ret;
}
@@ -258,6 +259,18 @@ get_partition_type(void)
return PART_NONE;
}
+static void
+getNewfsCmd(PartInfo *p)
+{
+ char *val;
+
+ val = msgGetInput(p->newfs_cmd,
+ "Please enter the newfs command and options you'd like to use in\ncreating this file system.");
+ if (val)
+ strncpy(p->newfs_cmd, val, NEWFS_CMD_MAX);
+}
+
+
#define MAX_MOUNT_NAME 12
#define PART_PART_COL 0
@@ -322,8 +335,10 @@ print_fbsd_chunks(void)
memset(onestr, ' ', PART_OFF - 1);
onestr[PART_OFF - 1] = '\0';
/* Go for two columns */
- if (prow == (CHUNK_PART_START_ROW + CHUNK_COLUMN_MAX))
+ if (prow == (CHUNK_PART_START_ROW + CHUNK_COLUMN_MAX)) {
pcol = PART_OFF;
+ prow = CHUNK_PART_START_ROW;
+ }
else
pcol = 0;
memcpy(onestr + PART_PART_COL, fbsd_chunk_info[i].c->name,
@@ -517,9 +532,29 @@ partition_disks(struct disk **disks)
}
break;
+ case 'N': /* Set newfs options */
+ if (fbsd_chunk_info[current_chunk].c->private &&
+ ((PartInfo *)fbsd_chunk_info[current_chunk].c->private)->newfs)
+ getNewfsCmd(fbsd_chunk_info[current_chunk].c->private);
+ else
+ msg = "newfs options not applicable for this partition";
+ break;
+
+ case 'T': /* Toggle newfs state */
+ if (fbsd_chunk_info[current_chunk].c->private)
+ ((PartInfo *)fbsd_chunk_info[current_chunk].c->private)->newfs = !((PartInfo *)fbsd_chunk_info[current_chunk].c->private)->newfs;
+ else
+ msg = "Set a mount point first.";
+ break;
+
case 27: /* ESC */
partitioning = FALSE;
break;
+
+ default:
+ beep();
+ msg = "Type F1 or ? for help";
+ break;
}
}
}
diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c
index 8ec4bb3..a96a3ee 100644
--- a/usr.sbin/sade/install.c
+++ b/usr.sbin/sade/install.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: install.c,v 1.8 1995/05/05 23:47:40 jkh Exp $
+ * $Id: install.c,v 1.9 1995/05/06 09:34:18 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -167,8 +167,10 @@ make_filesystems(struct disk **disks)
struct chunk *c2 = c1->part;
while (c2) {
- if (c2->type == part && c2->subtype != FS_SWAP)
- vsystem("newfs %s", c2->name);
+ if (c2->type == part && c2->subtype != FS_SWAP &&
+ c2->private && ((PartInfo *)c2->private)->newfs)
+ vsystem("%s %s", ((PartInfo *)c2->private)->newfs_cmd,
+ c2->name);
c2 = c2->next;
}
}
@@ -180,6 +182,7 @@ make_filesystems(struct disk **disks)
void
cpio_extract(struct disk **disks)
{
+
}
void
diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h
index ad9417d..68698a1 100644
--- a/usr.sbin/sade/sade.h
+++ b/usr.sbin/sade/sade.h
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: sysinstall.h,v 1.9 1995/05/06 09:34:20 jkh Exp $
+ * $Id: sysinstall.h,v 1.10 1995/05/07 02:04:29 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -177,9 +177,13 @@ typedef enum {
PART_FILESYSTEM
} PartType;
+/* The longest newfs command we'll hand to system() */
+#define NEWFS_CMD_MAX 256
+
typedef struct _part_info {
Boolean newfs;
char mountpoint[FILENAME_MAX];
+ char newfs_cmd[NEWFS_CMD_MAX];
} PartInfo;
diff --git a/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c
index b499532..9339a8d 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.6 1995/05/07 05:58:56 jkh Exp $
+ * $Id: disks.c,v 1.7 1995/05/07 22:07:51 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -198,6 +198,7 @@ new_part(char *mpoint, Boolean newfs)
ret = (PartInfo *)safe_malloc(sizeof(PartInfo));
strncpy(ret->mountpoint, mpoint, FILENAME_MAX);
+ strcpy(ret->newfs_cmd, "newfs");
ret->newfs = newfs;
return ret;
}
@@ -258,6 +259,18 @@ get_partition_type(void)
return PART_NONE;
}
+static void
+getNewfsCmd(PartInfo *p)
+{
+ char *val;
+
+ val = msgGetInput(p->newfs_cmd,
+ "Please enter the newfs command and options you'd like to use in\ncreating this file system.");
+ if (val)
+ strncpy(p->newfs_cmd, val, NEWFS_CMD_MAX);
+}
+
+
#define MAX_MOUNT_NAME 12
#define PART_PART_COL 0
@@ -322,8 +335,10 @@ print_fbsd_chunks(void)
memset(onestr, ' ', PART_OFF - 1);
onestr[PART_OFF - 1] = '\0';
/* Go for two columns */
- if (prow == (CHUNK_PART_START_ROW + CHUNK_COLUMN_MAX))
+ if (prow == (CHUNK_PART_START_ROW + CHUNK_COLUMN_MAX)) {
pcol = PART_OFF;
+ prow = CHUNK_PART_START_ROW;
+ }
else
pcol = 0;
memcpy(onestr + PART_PART_COL, fbsd_chunk_info[i].c->name,
@@ -517,9 +532,29 @@ partition_disks(struct disk **disks)
}
break;
+ case 'N': /* Set newfs options */
+ if (fbsd_chunk_info[current_chunk].c->private &&
+ ((PartInfo *)fbsd_chunk_info[current_chunk].c->private)->newfs)
+ getNewfsCmd(fbsd_chunk_info[current_chunk].c->private);
+ else
+ msg = "newfs options not applicable for this partition";
+ break;
+
+ case 'T': /* Toggle newfs state */
+ if (fbsd_chunk_info[current_chunk].c->private)
+ ((PartInfo *)fbsd_chunk_info[current_chunk].c->private)->newfs = !((PartInfo *)fbsd_chunk_info[current_chunk].c->private)->newfs;
+ else
+ msg = "Set a mount point first.";
+ break;
+
case 27: /* ESC */
partitioning = FALSE;
break;
+
+ default:
+ beep();
+ msg = "Type F1 or ? for help";
+ break;
}
}
}
diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c
index 8ec4bb3..a96a3ee 100644
--- a/usr.sbin/sysinstall/install.c
+++ b/usr.sbin/sysinstall/install.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: install.c,v 1.8 1995/05/05 23:47:40 jkh Exp $
+ * $Id: install.c,v 1.9 1995/05/06 09:34:18 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -167,8 +167,10 @@ make_filesystems(struct disk **disks)
struct chunk *c2 = c1->part;
while (c2) {
- if (c2->type == part && c2->subtype != FS_SWAP)
- vsystem("newfs %s", c2->name);
+ if (c2->type == part && c2->subtype != FS_SWAP &&
+ c2->private && ((PartInfo *)c2->private)->newfs)
+ vsystem("%s %s", ((PartInfo *)c2->private)->newfs_cmd,
+ c2->name);
c2 = c2->next;
}
}
@@ -180,6 +182,7 @@ make_filesystems(struct disk **disks)
void
cpio_extract(struct disk **disks)
{
+
}
void
diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h
index ad9417d..68698a1 100644
--- a/usr.sbin/sysinstall/sysinstall.h
+++ b/usr.sbin/sysinstall/sysinstall.h
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: sysinstall.h,v 1.9 1995/05/06 09:34:20 jkh Exp $
+ * $Id: sysinstall.h,v 1.10 1995/05/07 02:04:29 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -177,9 +177,13 @@ typedef enum {
PART_FILESYSTEM
} PartType;
+/* The longest newfs command we'll hand to system() */
+#define NEWFS_CMD_MAX 256
+
typedef struct _part_info {
Boolean newfs;
char mountpoint[FILENAME_MAX];
+ char newfs_cmd[NEWFS_CMD_MAX];
} PartInfo;
OpenPOWER on IntegriCloud