summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-07-16 17:11:45 +0000
committerjkh <jkh@FreeBSD.org>1996-07-16 17:11:45 +0000
commitd74ad799a058d88a1d8ab3ff1d5c4972afde7bdc (patch)
treeebcb6effee80595966f4cb45c650b8295491a1a9 /usr.sbin/sysinstall
parent7a0766e7ba0e494e9adafd0e1609f06c91a6a910 (diff)
downloadFreeBSD-src-d74ad799a058d88a1d8ab3ff1d5c4972afde7bdc.zip
FreeBSD-src-d74ad799a058d88a1d8ab3ff1d5c4972afde7bdc.tar.gz
1. Fix the CD installation bogon for Novice install I mentioned.
2. Add some code for dealing with a ports collection on the second CD now.
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r--usr.sbin/sysinstall/cdrom.c6
-rw-r--r--usr.sbin/sysinstall/config.c130
-rw-r--r--usr.sbin/sysinstall/install.c17
-rw-r--r--usr.sbin/sysinstall/menus.c4
-rw-r--r--usr.sbin/sysinstall/sysinstall.h7
5 files changed, 95 insertions, 69 deletions
diff --git a/usr.sbin/sysinstall/cdrom.c b/usr.sbin/sysinstall/cdrom.c
index ee56aed..c3a6d29 100644
--- a/usr.sbin/sysinstall/cdrom.c
+++ b/usr.sbin/sysinstall/cdrom.c
@@ -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: cdrom.c,v 1.19 1996/07/13 05:09:28 jkh Exp $
+ * $Id: cdrom.c,v 1.20 1996/07/13 05:48:44 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -51,10 +51,6 @@
#include <sys/mount.h>
#undef CD9660
-#define CD_UNMOUNTED 0
-#define CD_ALREADY_MOUNTED 1
-#define CD_WE_MOUNTED_IT 2
-
/*
* This isn't static, like the others, since it's often useful to know whether
* or not we have a CDROM available in some of the other installation screens.
diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c
index 69c4849..38b9450 100644
--- a/usr.sbin/sysinstall/config.c
+++ b/usr.sbin/sysinstall/config.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: config.c,v 1.44 1996/07/05 08:35:50 jkh Exp $
+ * $Id: config.c,v 1.45 1996/07/08 08:54:23 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -48,6 +48,8 @@
static Chunk *chunk_list[MAX_CHUNKS];
static int nchunks;
+extern int cdromMounted;
+
/* arg to sort */
static int
chunk_compare(Chunk *c1, Chunk *c2)
@@ -507,62 +509,94 @@ int
configPorts(dialogMenuItem *self)
{
char *cp, *dist = NULL; /* Shut up compiler */
+ int status = DITEM_SUCCESS, tries = 0;
dialog_clear();
if (!variable_get(VAR_PORTS_PATH))
variable_set2(VAR_PORTS_PATH, dist = "/cdrom/ports");
+ dialog_clear();
while (!directory_exists(dist)) {
- dist = variable_get_value(VAR_PORTS_PATH,
- "Unable to locate a ports tree on CDROM. Please specify the\n"
- "location of the master ports directory you wish to create the\n"
- "link tree to.");
- if (!dist)
- break;
+ if (++tries > 2) {
+ msgConfirm("You appear to be having some problems with your CD drive\n"
+ "or perhaps cannot find the second CD. This step will now\n"
+ "therefore be skipped.");
+ status = DITEM_FAILURE;
+ goto fixup;
+ }
+
+ /* Even if we're running multi-user, unmount it for this case */
+ cdromMounted = CD_WE_MOUNTED_IT;
+ mediaDevice->shutdown(mediaDevice);
+
+ msgConfirm("The ports collection is now on the second CDROM due to\n"
+ "space constraints. Please remove the first CD from the\n"
+ "drive at this time and insert the second CDROM. You will\n"
+ "also need to have the second CDROM in your drive any time\n"
+ "you wish to use the ports collection. When you're ready,\n"
+ "please press [ENTER].");
+ if (!mediaDevice->init(mediaDevice)) {
+ msgConfirm("Mount failed - either the CDROM isn't in the drive or\n"
+ "you did not allow sufficient time for the drive to become\n"
+ "ready before pressing [ENTER]. Please try again.");
+ }
}
- if (dist) {
- cp = msgGetInput("/usr/ports",
- "Where would you like to create the link tree?\n"
- "(press [ENTER] for default location). The link tree should\n"
- "reside in a directory with as much free space as possible,\n"
- "as you'll need space to compile any ports.");
- if (!cp || !*cp)
- return DITEM_FAILURE;
- if (Mkdir(cp))
- return DITEM_FAILURE;
+
+ cp = msgGetInput("/usr/ports",
+ "Where would you like to create the link tree?\n"
+ "(press [ENTER] for default location). The link tree should\n"
+ "reside in a directory with as much free space as possible,\n"
+ "as you'll need space to compile any ports.");
+ if (!cp || !*cp) {
+ status = DITEM_FAILURE;
+ goto fixup;
+ }
+ if (Mkdir(cp)) {
+ status = DITEM_FAILURE;
+ goto fixup;
+ }
+ if (strcmp(cp, "/usr/ports")) {
+ unlink("/usr/ports");
+ if (symlink(cp, "/usr/ports") == -1) {
+ msgConfirm("Unable to create a symlink from /usr/ports to %s!\n"
+ "I can't continue, sorry!", cp);
+ status = DITEM_FAILURE;
+ goto fixup;
+ }
else {
- if (strcmp(cp, "/usr/ports")) {
- unlink("/usr/ports");
- if (symlink(cp, "/usr/ports") == -1) {
- msgConfirm("Unable to create a symlink from /usr/ports to %s!\n"
- "I can't continue, sorry!", cp);
- return DITEM_FAILURE;
- }
- else {
- msgConfirm("NOTE: This directory is also now symlinked to /usr/ports\n"
- "which, for a variety of reasons, is the directory the ports\n"
- "framework expects to find its files in. You should refer to\n"
- "/usr/ports instead of %s directly when you're working in the\n"
- "ports collection.", cp);
- }
- }
- msgNotify("Making a link tree from %s to %s.", dist, cp);
- if (DITEM_STATUS(lndir(dist, cp)) != DITEM_SUCCESS) {
- msgConfirm("The lndir function returned an error status and may not have.\n"
- "successfully generated the link tree. You may wish to inspect\n"
- "the /usr/ports directory carefully for any missing link files.");
- }
- else {
- msgConfirm("The /usr/ports directory is now ready to use. When the system comes\n"
- "up fully, you can cd to this directory and type `make' in any sub-\n"
- "directory for which you'd like to compile a port. You can also\n"
- "cd to /usr/ports and type `make print-index' for a complete list of all\n"
- "ports in the hierarchy.");
- }
+ msgConfirm("NOTE: This directory is also now symlinked to /usr/ports\n"
+ "which, for a variety of reasons, is the directory the ports\n"
+ "framework expects to find its files in. You should refer to\n"
+ "/usr/ports instead of %s directly when you're working in the\n"
+ "ports collection.", cp);
}
}
- else
- return DITEM_FAILURE;
- return DITEM_SUCCESS;
+ msgNotify("Making a link tree from %s to %s.", dist, cp);
+ if (DITEM_STATUS(lndir(dist, cp)) != DITEM_SUCCESS) {
+ msgConfirm("The lndir function returned an error status and may not have.\n"
+ "successfully generated the link tree. You may wish to inspect\n"
+ "the /usr/ports directory carefully for any missing link files.");
+ }
+ else {
+ msgConfirm("The /usr/ports directory is now ready to use. When the system comes\n"
+ "up fully, you can cd to this directory and type `make' in any sub-\n"
+ "directory for which you'd like to compile a port. You can also\n"
+ "cd to /usr/ports and type `make print-index' for a complete list of all\n"
+ "ports in the hierarchy.");
+ }
+fixup:
+ tries = 0;
+ while (++tries < 3) {
+ mediaDevice->shutdown(mediaDevice);
+ msgConfirm("Done with the second CD. Please remove it and reinsert the first\n"
+ "CDROM now. It may be required for subsequence installation steps.\n\n"
+ "When you've done so, please press [ENTER].");
+ if (!mediaDevice->init(mediaDevice)) {
+ msgConfirm("Mount failed - either the CDROM isn't in the drive or\n"
+ "you did not allow sufficient time for the drive to become\n"
+ "ready before pressing [ENTER]. Please try again.");
+ }
+ }
+ return status | DITEM_RESTORE;
}
/* Load gated package */
diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c
index 5f3a7ec..e5ee689 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.113 1996/07/12 11:14:06 jkh Exp $
+ * $Id: install.c,v 1.114 1996/07/13 05:13:25 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -372,18 +372,9 @@ installNovice(dialogMenuItem *self)
}
if (!mediaDevice) {
- dialog_clear();
- /* Try to set ourselves up as a CDROM if we can do that first */
- if (DITEM_STATUS(mediaSetCDROM(NULL)) == DITEM_SUCCESS) {
- /* If we can't initialize it, it's probably not a FreeBSD CDROM so punt on it */
- if (!mediaDevice->init(mediaDevice))
- mediaDevice = NULL;
- }
- if (!mediaDevice) {
- msgConfirm("Finally, you must specify an installation medium.");
- if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice)
- return DITEM_FAILURE | DITEM_RECREATE;
- }
+ msgConfirm("Finally, you must specify an installation medium.");
+ if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice)
+ return DITEM_FAILURE | DITEM_RECREATE;
}
if (DITEM_STATUS((i = installCommit(self))) == DITEM_FAILURE) {
diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c
index 1b3f18b..2f9936f 100644
--- a/usr.sbin/sysinstall/menus.c
+++ b/usr.sbin/sysinstall/menus.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: menus.c,v 1.81 1996/07/10 09:41:09 jkh Exp $
+ * $Id: menus.c,v 1.82 1996/07/11 18:37:48 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -1007,7 +1007,7 @@ software not provided in the base distributions.",
NULL, optionsEditor },
{ "8 Packages", "Install pre-packaged software for FreeBSD",
NULL, configPackages },
- { "9 Ports", "Link to FreeBSD Ports Collection on CD/NFS",
+ { "9 Ports", "Link to FreeBSD Ports Collection on CD",
NULL, configPorts },
{ "A Root Password", "Set the system manager's password",
NULL, dmenuSystemCommand, NULL, "passwd root" },
diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h
index 5f897fe..98aa679 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.73 1996/07/08 10:08:20 jkh Exp $
+ * $Id: sysinstall.h,v 1.74 1996/07/09 14:28:22 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -191,6 +191,11 @@ typedef enum {
DEVICE_TYPE_ANY,
} DeviceType;
+/* CDROM mount codes */
+#define CD_UNMOUNTED 0
+#define CD_ALREADY_MOUNTED 1
+#define CD_WE_MOUNTED_IT 2
+
/* A "device" from sysinstall's point of view */
typedef struct _device {
char name[DEV_NAME_MAX];
OpenPOWER on IntegriCloud