diff options
author | jkh <jkh@FreeBSD.org> | 1996-03-02 07:31:58 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-03-02 07:31:58 +0000 |
commit | ce1a5be6897e107d2762d51c2cb3c49ea6ad3aa7 (patch) | |
tree | be0a959e707248fd0c14448975fefdb7ebc40040 /usr.sbin/sysinstall | |
parent | 27eac390dd8c7d4b30209f36c1d1a84103ed11ca (diff) | |
download | FreeBSD-src-ce1a5be6897e107d2762d51c2cb3c49ea6ad3aa7.zip FreeBSD-src-ce1a5be6897e107d2762d51c2cb3c49ea6ad3aa7.tar.gz |
Miscellaneous cleanup before big round of menu restructuring (to use new
libdialog features).
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r-- | usr.sbin/sysinstall/anonFTP.c | 433 | ||||
-rw-r--r-- | usr.sbin/sysinstall/cdrom.c | 4 | ||||
-rw-r--r-- | usr.sbin/sysinstall/devices.c | 4 | ||||
-rw-r--r-- | usr.sbin/sysinstall/dmenu.c | 12 | ||||
-rw-r--r-- | usr.sbin/sysinstall/dos.c | 4 | ||||
-rw-r--r-- | usr.sbin/sysinstall/floppy.c | 8 | ||||
-rw-r--r-- | usr.sbin/sysinstall/install.c | 7 | ||||
-rw-r--r-- | usr.sbin/sysinstall/nfs.c | 4 | ||||
-rw-r--r-- | usr.sbin/sysinstall/sysinstall.h | 30 | ||||
-rw-r--r-- | usr.sbin/sysinstall/system.c | 3 | ||||
-rw-r--r-- | usr.sbin/sysinstall/tape.c | 4 | ||||
-rw-r--r-- | usr.sbin/sysinstall/tcpip.c | 5 | ||||
-rw-r--r-- | usr.sbin/sysinstall/ufs.c | 4 |
13 files changed, 260 insertions, 262 deletions
diff --git a/usr.sbin/sysinstall/anonFTP.c b/usr.sbin/sysinstall/anonFTP.c index 389f48b..e65847c 100644 --- a/usr.sbin/sysinstall/anonFTP.c +++ b/usr.sbin/sysinstall/anonFTP.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: anonFTP.c,v 1.5 1995/11/11 11:56:40 jkh Exp $ + * $Id: anonFTP.c,v 1.6 1995/11/12 07:27:55 jkh Exp $ * * Copyright (c) 1995 * Coranth Gryphon. All rights reserved. @@ -68,7 +68,7 @@ #define FTP_GROUP "operator" #define FTP_UPLOAD "incoming" #define FTP_COMMENT "Anonymous FTP Admin" -#define FTP_HOMEDIR "/usr/ftp" +#define FTP_HOMEDIR "/var/ftp" #define ANONFTP_HELPFILE "anonftp" @@ -77,7 +77,7 @@ typedef struct { - char homedir[64]; /* Home Dir for Anon FTP */ + char homedir[64]; /* Home Dir for Anon FTP */ char group[32]; /* Group */ char uid[8]; /* UID */ char comment[64]; /* PWD Comment */ @@ -114,106 +114,107 @@ typedef struct _layout { } Layout; static Layout layout[] = { -{ 2, 3, 8, ANONFTP_UID_LEN - 1, + { 2, 3, 8, ANONFTP_UID_LEN - 1, "UID:", "What user ID to assign to FTP Admin", tconf.uid, STRINGOBJ, NULL }, #define LAYOUT_UID 1 - -{ 2, 15, 15, ANONFTP_GROUP_LEN - 1, + + { 2, 15, 15, ANONFTP_GROUP_LEN - 1, "Group:", "Group name that ftp process belongs to", tconf.group, STRINGOBJ, NULL }, #define LAYOUT_GROUP 2 - -{ 2, 35, 24, ANONFTP_COMMENT_LEN - 1, + + { 2, 35, 24, ANONFTP_COMMENT_LEN - 1, "Comment:", "Password file comment for FTP Admin", tconf.comment, STRINGOBJ, NULL }, #define LAYOUT_COMMENT 3 - -{ 9, 10, 43, ANONFTP_HOMEDIR_LEN - 1, + + { 9, 10, 43, ANONFTP_HOMEDIR_LEN - 1, "FTP Root Directory:", "The top directory to chroot to when doing anonymous ftp", tconf.homedir, STRINGOBJ, NULL }, #define LAYOUT_HOMEDIR 4 - -{ 14, 20, 22, ANONFTP_UPLOAD_LEN - 1, + + { 14, 20, 22, ANONFTP_UPLOAD_LEN - 1, "Upload Subdirectory:", "Designated sub-directory that holds uploads", tconf.upload, STRINGOBJ, NULL }, #define LAYOUT_UPLOAD 5 - -{ 19, 15, 0, 0, + + { 19, 15, 0, 0, "OK", "Select this if you are happy with these settings", &okbutton, BUTTONOBJ, NULL }, #define LAYOUT_OKBUTTON 6 - -{ 19, 35, 0, 0, + + { 19, 35, 0, 0, "CANCEL", "Select this if you wish to cancel this screen", &cancelbutton, BUTTONOBJ, NULL }, #define LAYOUT_CANCELBUTTON 7 -{ NULL }, + { NULL }, }; -int createFtpUser() +int +createFtpUser() { - struct passwd *tpw; - struct group *tgrp; - char pwline[256]; - char *tptr; - int gid; - FILE *fptr; - - if ((gid = atoi(tconf.group)) <= 0) { - if (!(tgrp = getgrnam(tconf.group))) { - /* group does not exist, create it by name */ - - tptr = msgGetInput("14", "What group ID to use for group %s ?", tconf.group); - if (tptr && *tptr && ((gid = atoi(tptr)) > 0)) { - if ((fptr = fopen(_PATH_GROUP,"a"))) { - fprintf(fptr,"%s:*:%d:%s\n",tconf.group,gid,FTP_NAME); - fclose(fptr); - } - } + struct passwd *tpw; + struct group *tgrp; + char pwline[256]; + char *tptr; + int gid; + FILE *fptr; + + if ((gid = atoi(tconf.group)) <= 0) { + if (!(tgrp = getgrnam(tconf.group))) { + /* group does not exist, create it by name */ + + tptr = msgGetInput("14", "What group ID to use for group %s ?", tconf.group); + if (tptr && *tptr && ((gid = atoi(tptr)) > 0)) { + if ((fptr = fopen(_PATH_GROUP,"a"))) { + fprintf(fptr,"%s:*:%d:%s\n",tconf.group,gid,FTP_NAME); + fclose(fptr); + } + } + else + gid = FTP_GID; + } else - gid = FTP_GID; - } - else - gid = tgrp->gr_gid; + gid = tgrp->gr_gid; } - else if (!getgrgid(gid)) { + else if (!getgrgid(gid)) { /* group does not exist, create it by number */ - + tptr = msgGetInput("14", "What group name to use for gid %d ?", gid); if (tptr && *tptr) { - strcpy(tconf.group, tptr); - if ((tgrp = getgrnam(tconf.group))) { - gid = tgrp->gr_gid; - } - else if ((fptr = fopen(_PATH_GROUP,"a"))) { - fprintf(fptr,"%s:*:%d:%s\n",tconf.group,gid,FTP_NAME); - fclose(fptr); - } + strcpy(tconf.group, tptr); + if ((tgrp = getgrnam(tconf.group))) { + gid = tgrp->gr_gid; + } + else if ((fptr = fopen(_PATH_GROUP,"a"))) { + fprintf(fptr,"%s:*:%d:%s\n",tconf.group,gid,FTP_NAME); + fclose(fptr); + } } } - - if ((tpw = getpwnam(FTP_NAME))) { - if (tpw->pw_uid != FTP_UID) - msgConfirm("FTP user already exists with a different uid."); - - return (RET_SUCCESS); /* succeeds if already exists */ - } - - sprintf(pwline, "%s::%s:%d::0:0:%s:%s:/bin/date\n", FTP_NAME, tconf.uid, gid, tconf.comment, tconf.homedir); - - fptr = fopen(_PATH_MASTERPASSWD,"a"); - if (! fptr) { - msgConfirm("Could not open master password file."); - return (RET_FAIL); + + if ((tpw = getpwnam(FTP_NAME))) { + if (tpw->pw_uid != FTP_UID) + msgConfirm("FTP user already exists with a different uid."); + + return (RET_SUCCESS); /* succeeds if already exists */ } - fprintf(fptr, pwline); - fclose(fptr); - msgNotify("Remaking password file: %s", _PATH_MASTERPASSWD); - vsystem("pwd_mkdb -p %s", _PATH_MASTERPASSWD); - - return (RET_SUCCESS); + + sprintf(pwline, "%s::%s:%d::0:0:%s:%s:/bin/date\n", FTP_NAME, tconf.uid, gid, tconf.comment, tconf.homedir); + + fptr = fopen(_PATH_MASTERPASSWD,"a"); + if (! fptr) { + msgConfirm("Could not open master password file."); + return (RET_FAIL); + } + fprintf(fptr, pwline); + fclose(fptr); + msgNotify("Remaking password file: %s", _PATH_MASTERPASSWD); + vsystem("pwd_mkdb -p %s", _PATH_MASTERPASSWD); + + return (RET_SUCCESS); } /* This is it - how to get the setup values */ @@ -231,11 +232,11 @@ anonftpOpenDialog() /* We need a curses window */ ds_win = newwin(LINES, COLS, 0, 0); if (ds_win == 0) - { - beep(); - msgConfirm("Cannot open anonymous ftp dialog window!!"); - return(RET_SUCCESS); - } + { + beep(); + msgConfirm("Cannot open anonymous ftp dialog window!!"); + return(RET_SUCCESS); + } /* Say where our help comes from */ systemHelpFile(ANONFTP_HELPFILE, help); @@ -247,7 +248,7 @@ anonftpOpenDialog() mvwaddstr(ds_win, ANONFTP_DIALOG_Y, ANONFTP_DIALOG_X + 20, " Anonymous FTP Configuration "); draw_box(ds_win, ANONFTP_DIALOG_Y + 7, ANONFTP_DIALOG_X + 8, ANONFTP_DIALOG_HEIGHT - 11, ANONFTP_DIALOG_WIDTH - 17, - dialog_attr, border_attr); + dialog_attr, border_attr); wattrset(ds_win, dialog_attr); sprintf(title, " Path Configuration "); mvwaddstr(ds_win, ANONFTP_DIALOG_Y + 7, ANONFTP_DIALOG_X + 22, title); @@ -269,35 +270,35 @@ anonftpOpenDialog() #define lt layout[n] while (lt.help != NULL) { - switch (lt.type) { - case STRINGOBJ: - lt.obj = NewStringObj(ds_win, lt.prompt, lt.var, - lt.y + ANONFTP_DIALOG_Y, lt.x + ANONFTP_DIALOG_X, - lt.len, lt.maxlen); - break; - - case BUTTONOBJ: - lt.obj = NewButtonObj(ds_win, lt.prompt, lt.var, - lt.y + ANONFTP_DIALOG_Y, lt.x + ANONFTP_DIALOG_X); - break; - - default: - msgFatal("Don't support this object yet!"); - } - AddObj(&obj, lt.type, (void *) lt.obj); - n++; + switch (lt.type) { + case STRINGOBJ: + lt.obj = NewStringObj(ds_win, lt.prompt, lt.var, + lt.y + ANONFTP_DIALOG_Y, lt.x + ANONFTP_DIALOG_X, + lt.len, lt.maxlen); + break; + + case BUTTONOBJ: + lt.obj = NewButtonObj(ds_win, lt.prompt, lt.var, + lt.y + ANONFTP_DIALOG_Y, lt.x + ANONFTP_DIALOG_X); + break; + + default: + msgFatal("Don't support this object yet!"); + } + AddObj(&obj, lt.type, (void *) lt.obj); + n++; } max = n - 1; /* Find the last object we can traverse to */ last = obj; while (last->next) - last = last->next; + last = last->next; /* Find the first object in the list */ first = obj; while (first->prev) - first = first->prev; + first = first->prev; /* Some more initialisation before we go into the main input loop */ n = 0; @@ -307,89 +308,89 @@ anonftpOpenDialog() /* Incoming user data - DUCK! */ while (!quit) { - char help_line[80]; - int i, len = strlen(lt.help); - - /* Display the help line at the bottom of the screen */ - for (i = 0; i < 79; i++) - help_line[i] = (i < len) ? lt.help[i] : ' '; - help_line[i] = '\0'; - use_helpline(help_line); - display_helpline(ds_win, LINES - 1, COLS - 1); - - /* Ask for libdialog to do its stuff */ - ret = PollObj(&obj); + char help_line[80]; + int i, len = strlen(lt.help); - /* Handle special case stuff that libdialog misses. Sigh */ - switch (ret) { - /* Bail out */ - case SEL_ESC: - quit = TRUE, cancel=TRUE; - break; - - /* This doesn't work for list dialogs. Oh well. Perhaps - should special case the move from the OK button ``up'' - to make it go to the interface list, but then it gets - awkward for the user to go back and correct screw up's - in the per-interface section */ - - case KEY_UP: - if (obj->prev !=NULL ) { - obj = obj->prev; - --n; - } else { - obj = last; - n = max; - } - break; - - case KEY_DOWN: - if (obj->next != NULL) { - obj = obj->next; - ++n; - } else { - obj = first; - n = 0; - } - break; - - case SEL_TAB: - if (n < max) - ++n; - else - n = 0; - break; + /* Display the help line at the bottom of the screen */ + for (i = 0; i < 79; i++) + help_line[i] = (i < len) ? lt.help[i] : ' '; + help_line[i] = '\0'; + use_helpline(help_line); + display_helpline(ds_win, LINES - 1, COLS - 1); - /* The user has pressed enter over a button object */ - case SEL_BUTTON: - quit = TRUE; - if (cancelbutton) - cancel = TRUE; - break; + /* Ask for libdialog to do its stuff */ + ret = PollObj(&obj); - /* Generic CR handler */ - case SEL_CR: - if (n < max) - ++n; - else - n = 0; - break; + /* Handle special case stuff that libdialog misses. Sigh */ + switch (ret) { + /* Bail out */ + case SEL_ESC: + quit = TRUE, cancel=TRUE; + break; + + /* This doesn't work for list dialogs. Oh well. Perhaps + should special case the move from the OK button ``up'' + to make it go to the interface list, but then it gets + awkward for the user to go back and correct screw up's + in the per-interface section */ + + case KEY_UP: + if (obj->prev !=NULL ) { + obj = obj->prev; + --n; + } else { + obj = last; + n = max; + } + break; + + case KEY_DOWN: + if (obj->next != NULL) { + obj = obj->next; + ++n; + } else { + obj = first; + n = 0; + } + break; + + case SEL_TAB: + if (n < max) + ++n; + else + n = 0; + break; + + /* The user has pressed enter over a button object */ + case SEL_BUTTON: + quit = TRUE; + if (cancelbutton) + cancel = TRUE; + break; + + /* Generic CR handler */ + case SEL_CR: + if (n < max) + ++n; + else + n = 0; + break; + + case SEL_BACKTAB: + if (n) + --n; + else + n = max; + break; + + case KEY_F(1): + display_helpfile(); - case SEL_BACKTAB: - if (n) - --n; - else - n = max; - break; + /* They tried some key combination we don't support - tell them! */ + default: + beep(); + } - case KEY_F(1): - display_helpfile(); - - /* They tried some key combination we don't support - tell them! */ - default: - beep(); - } - } /* Clear this crap off the screen */ @@ -406,10 +407,10 @@ int configAnonFTP(char *unused) { int i; - + /* Be optimistic */ i = RET_SUCCESS; - + dialog_clear(); i = anonftpOpenDialog(); if (i != RET_SUCCESS) { @@ -417,7 +418,7 @@ configAnonFTP(char *unused) msgConfirm("Configuration of Anonymous FTP cancelled per user request."); return i; } - + /*** Use defaults for any invalid values ***/ if (atoi(tconf.uid) <= 0) sprintf(tconf.uid, "%d", FTP_UID); @@ -438,50 +439,50 @@ configAnonFTP(char *unused) /*** If HomeDir does not exist, create it ***/ - if (!directoryExists(tconf.homedir)) { - vsystem("mkdir -p %s" ,tconf.homedir); - } - - if (directoryExists(tconf.homedir)) { - msgNotify("Configuring %s for use by anon FTP.", tconf.homedir); - vsystem("chmod 555 %s && chown root.%s %s", tconf.homedir, tconf.group, tconf.homedir); - vsystem("mkdir %s/bin && chmod 555 %s/bin", tconf.homedir, tconf.homedir); - vsystem("cp /bin/ls %s/bin && chmod 111 %s/bin/ls", tconf.homedir, tconf.homedir); - vsystem("cp /bin/date %s/bin && chmod 111 %s/bin/date", tconf.homedir, tconf.homedir); - vsystem("mkdir %s/etc && chmod 555 %s/etc", tconf.homedir, tconf.homedir); - vsystem("mkdir -p %s/pub", tconf.homedir); - vsystem("mkdir -p %s/%s", tconf.homedir, tconf.upload); - vsystem("chmod 1777 %s/%s", tconf.homedir, tconf.upload); - - if (createFtpUser() == RET_SUCCESS) { - msgNotify("Copying password information for anon FTP."); - vsystem("cp /etc/pwd.db %s/etc && chmod 444 %s/etc/pwd.db", tconf.homedir, tconf.homedir); - vsystem("cp /etc/passwd %s/etc && chmod 444 %s/etc/passwd",tconf.homedir, tconf.homedir); - vsystem("cp /etc/group %s/etc && chmod 444 %s/etc/group", tconf.homedir, tconf.homedir); - vsystem("chown -R %s.%s %s/pub", FTP_NAME, tconf.group, tconf.homedir); + if (!directoryExists(tconf.homedir)) { + vsystem("mkdir -p %s" ,tconf.homedir); } - else { - dialog_clear(); - msgConfirm("Unable to create FTP user! Anonymous FTP setup failed."); - i = RET_FAIL; + + if (directoryExists(tconf.homedir)) { + msgNotify("Configuring %s for use by anon FTP.", tconf.homedir); + vsystem("chmod 555 %s && chown root.%s %s", tconf.homedir, tconf.group, tconf.homedir); + vsystem("mkdir %s/bin && chmod 555 %s/bin", tconf.homedir, tconf.homedir); + vsystem("cp /bin/ls %s/bin && chmod 111 %s/bin/ls", tconf.homedir, tconf.homedir); + vsystem("cp /bin/date %s/bin && chmod 111 %s/bin/date", tconf.homedir, tconf.homedir); + vsystem("mkdir %s/etc && chmod 555 %s/etc", tconf.homedir, tconf.homedir); + vsystem("mkdir -p %s/pub", tconf.homedir); + vsystem("mkdir -p %s/%s", tconf.homedir, tconf.upload); + vsystem("chmod 1777 %s/%s", tconf.homedir, tconf.upload); + + if (createFtpUser() == RET_SUCCESS) { + msgNotify("Copying password information for anon FTP."); + vsystem("cp /etc/pwd.db %s/etc && chmod 444 %s/etc/pwd.db", tconf.homedir, tconf.homedir); + vsystem("cp /etc/passwd %s/etc && chmod 444 %s/etc/passwd",tconf.homedir, tconf.homedir); + vsystem("cp /etc/group %s/etc && chmod 444 %s/etc/group", tconf.homedir, tconf.homedir); + vsystem("chown -R %s.%s %s/pub", FTP_NAME, tconf.group, tconf.homedir); + } + else { + dialog_clear(); + msgConfirm("Unable to create FTP user! Anonymous FTP setup failed."); + i = RET_FAIL; + } + + dialog_clear(); + if (!msgYesNo("Create a welcome message file for anonymous FTP users?")) { + char cmd[256]; + + dialog_clear(); + msgNotify("Uncompressing the editor - please wait.."); + vsystem("echo Your welcome message here. > %s/etc/%s", tconf.homedir, MOTD_FILE); + sprintf(cmd, "/stand/ee %s/etc/%s", tconf.homedir, MOTD_FILE); + systemExecute(cmd); + } } - - dialog_clear(); - if (!msgYesNo("Create a welcome message file for anonymous FTP users?")) { - char cmd[256]; - - dialog_clear(); - msgNotify("Uncompressing the editor - please wait.."); - vsystem("echo Your welcome message here. > %s/etc/%s", tconf.homedir, MOTD_FILE); - sprintf(cmd, "/stand/ee %s/etc/%s", tconf.homedir, MOTD_FILE); - systemExecute(cmd); - } - } - else { + else { dialog_clear(); msgConfirm("Invalid Directory: %s\n" "Anonymous FTP will not be set up.", tconf.homedir); i = RET_FAIL; - } - return i; + } + return i; } diff --git a/usr.sbin/sysinstall/cdrom.c b/usr.sbin/sysinstall/cdrom.c index 843c2e2..8179e0e 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.8 1995/09/18 16:52:20 peter Exp $ + * $Id: cdrom.c,v 1.9 1995/12/07 10:33:32 peter Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -110,7 +110,7 @@ mediaInitCDROM(Device *dev) } int -mediaGetCDROM(Device *dev, char *file, Boolean tentative) +mediaGetCDROM(Device *dev, char *file, Boolean probe) { char buf[PATH_MAX]; diff --git a/usr.sbin/sysinstall/devices.c b/usr.sbin/sysinstall/devices.c index 3c95d38..035234e 100644 --- a/usr.sbin/sysinstall/devices.c +++ b/usr.sbin/sysinstall/devices.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: devices.c,v 1.38 1995/12/11 16:32:29 jkh Exp $ + * $Id: devices.c,v 1.39 1996/02/10 09:33:52 phk Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -126,7 +126,7 @@ dummyInit(Device *dev) } int -dummyGet(Device *dev, char *dist, Boolean tentative) +dummyGet(Device *dev, char *dist, Boolean probe) { msgDebug("Dummy get called for %s\n", dev->name); return -1; diff --git a/usr.sbin/sysinstall/dmenu.c b/usr.sbin/sysinstall/dmenu.c index 333f9b5..64f457d 100644 --- a/usr.sbin/sysinstall/dmenu.c +++ b/usr.sbin/sysinstall/dmenu.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: dmenu.c,v 1.12.2.5 1995/10/19 15:55:00 jkh Exp $ + * $Id: dmenu.c,v 1.13 1995/12/07 10:33:44 peter Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -163,13 +163,9 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max) if (!rval) { if (menu->options & DMENU_MULTIPLE_TYPE) { - if (menu->options & DMENU_CALL_FIRST) - tmp = &(menu->items[0]); - else { - if (decode_and_dispatch_multiple(menu, result) || menu->options & DMENU_SELECTION_RETURNS) { - items_free(nitems, curr, max); - return TRUE; - } + if (decode_and_dispatch_multiple(menu, result) || menu->options & DMENU_SELECTION_RETURNS) { + items_free(nitems, curr, max); + return TRUE; } } else { diff --git a/usr.sbin/sysinstall/dos.c b/usr.sbin/sysinstall/dos.c index 6e5f65d..7c4b9b1 100644 --- a/usr.sbin/sysinstall/dos.c +++ b/usr.sbin/sysinstall/dos.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: dos.c,v 1.7 1995/09/18 16:52:26 peter Exp $ + * $Id: dos.c,v 1.8 1995/12/07 10:33:45 peter Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -86,7 +86,7 @@ mediaInitDOS(Device *dev) } int -mediaGetDOS(Device *dev, char *file, Boolean tentative) +mediaGetDOS(Device *dev, char *file, Boolean probe) { char buf[PATH_MAX]; diff --git a/usr.sbin/sysinstall/floppy.c b/usr.sbin/sysinstall/floppy.c index f4512a2..6f0c9d9 100644 --- a/usr.sbin/sysinstall/floppy.c +++ b/usr.sbin/sysinstall/floppy.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: floppy.c,v 1.7.2.8 1995/10/22 17:39:07 jkh Exp $ + * $Id: floppy.c,v 1.8 1995/12/07 10:33:46 peter Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -165,7 +165,7 @@ mediaInitFloppy(Device *dev) } int -mediaGetFloppy(Device *dev, char *file, Boolean tentative) +mediaGetFloppy(Device *dev, char *file, Boolean probe) { char buf[PATH_MAX]; int fd; @@ -173,9 +173,9 @@ mediaGetFloppy(Device *dev, char *file, Boolean tentative) snprintf(buf, PATH_MAX, "/dist/%s", file); - msgDebug("Request for %s from floppy on /dist, tentative is %d.\n", buf, tentative); + msgDebug("Request for %s from floppy on /dist, probe is %d.\n", buf, probe); if (!file_readable(buf)) { - if (tentative) + if (probe) return -1; else { while (!file_readable(buf)) { diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index db8de7e..a609c09 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.74 1996/01/14 11:45:05 jkh Exp $ + * $Id: install.c,v 1.75 1996/01/29 20:17:27 joerg Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -202,6 +202,9 @@ installInitial(void) } dialog_clear(); + /* stick a helpful shell over on the 4th VTY */ + systemCreateHoloshell(); + if (chroot("/mnt") == -1) { dialog_clear(); msgConfirm("Unable to chroot to /mnt - this is bad!"); @@ -211,8 +214,6 @@ installInitial(void) chdir("/"); variable_set2(RUNNING_ON_ROOT, "yes"); - /* stick a helpful shell over on the 4th VTY */ - systemCreateHoloshell(); alreadyDone = TRUE; return RET_SUCCESS; } diff --git a/usr.sbin/sysinstall/nfs.c b/usr.sbin/sysinstall/nfs.c index 4dc2b97..36f5ea9 100644 --- a/usr.sbin/sysinstall/nfs.c +++ b/usr.sbin/sysinstall/nfs.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: nfs.c,v 1.5.2.15 1995/11/04 11:09:16 jkh Exp $ + * $Id: nfs.c,v 1.6 1995/12/07 10:34:12 peter Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -79,7 +79,7 @@ mediaInitNFS(Device *dev) } int -mediaGetNFS(Device *dev, char *file, Boolean tentative) +mediaGetNFS(Device *dev, char *file, Boolean probe) { char buf[PATH_MAX]; diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index b8e1f43..8f15b8e 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.43 1995/09/18 16:52:35 peter Exp $ + * $Id: sysinstall.h,v 1.44 1995/12/07 10:34:14 peter Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -61,8 +61,9 @@ #define DMENU_NORMAL_TYPE 0x1 /* Normal dialog menu */ #define DMENU_RADIO_TYPE 0x2 /* Radio dialog menu */ #define DMENU_MULTIPLE_TYPE 0x4 /* Multiple choice menu */ -#define DMENU_SELECTION_RETURNS 0x8 /* Select item then exit */ -#define DMENU_CALL_FIRST 0x10 /* In multiple, use one handler */ + +/* XXX This goes away soon XXX */ +#define DMENU_SELECTION_RETURNS 0x8 /* Immediate return on item selection */ /* variable limits */ #define VAR_NAME_MAX 128 @@ -146,9 +147,6 @@ /* One MB worth of blocks */ #define ONE_MEG 2048 -/* The help file for the TCP/IP setup screen */ -#define TCP_HELPFILE "tcp" - /*** Types ***/ typedef unsigned int Boolean; typedef struct disk Disk; @@ -225,7 +223,7 @@ typedef struct _device { DeviceType type; Boolean enabled; Boolean (*init)(struct _device *dev); - int (*get)(struct _device *dev, char *file, Boolean tentative); + int (*get)(struct _device *dev, char *file, Boolean probe); Boolean (*close)(struct _device *dev, int fd); void (*shutdown)(struct _device *dev); void *private; @@ -370,7 +368,7 @@ extern int attr_parse(Attribs *attr, int fd); /* cdrom.c */ extern Boolean mediaInitCDROM(Device *dev); -extern int mediaGetCDROM(Device *dev, char *file, Boolean tentative); +extern int mediaGetCDROM(Device *dev, char *file, Boolean probe); extern void mediaShutdownCDROM(Device *dev); /* command.c */ @@ -405,11 +403,11 @@ extern Device **deviceFind(char *name, DeviceType type); extern int deviceCount(Device **devs); extern Device *new_device(char *name); extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled, - Boolean (*init)(Device *mediadev), int (*get)(Device *dev, char *file, Boolean tentative), + Boolean (*init)(Device *mediadev), int (*get)(Device *dev, char *file, Boolean probe), Boolean (*close)(Device *mediadev, int fd), void (*shutDown)(Device *mediadev), void *private); extern Boolean dummyInit(Device *dev); -extern int dummyGet(Device *dev, char *dist, Boolean tentative); +extern int dummyGet(Device *dev, char *dist, Boolean probe); extern Boolean dummyClose(Device *dev, int fd); extern void dummyShutdown(Device *dev); @@ -445,19 +443,19 @@ extern int docShowDocument(char *str); /* dos.c */ extern Boolean mediaInitDOS(Device *dev); -extern int mediaGetDOS(Device *dev, char *file, Boolean tentative); +extern int mediaGetDOS(Device *dev, char *file, Boolean probe); extern void mediaShutdownDOS(Device *dev); /* floppy.c */ extern int getRootFloppy(void); extern Boolean mediaInitFloppy(Device *dev); -extern int mediaGetFloppy(Device *dev, char *file, Boolean tentative); +extern int mediaGetFloppy(Device *dev, char *file, Boolean probe); extern void mediaShutdownFloppy(Device *dev); /* ftp_strat.c */ extern Boolean mediaCloseFTP(Device *dev, int fd); extern Boolean mediaInitFTP(Device *dev); -extern int mediaGetFTP(Device *dev, char *file, Boolean tentative); +extern int mediaGetFTP(Device *dev, char *file, Boolean probe); extern void mediaShutdownFTP(Device *dev); /* globals.c */ @@ -575,7 +573,7 @@ extern void mediaShutdownNetwork(Device *dev); /* nfs.c */ extern Boolean mediaInitNFS(Device *dev); -extern int mediaGetNFS(Device *dev, char *file, Boolean tentative); +extern int mediaGetNFS(Device *dev, char *file, Boolean probe); extern void mediaShutdownNFS(Device *dev); /* options.c */ @@ -604,7 +602,7 @@ extern int docShowDocument(char *str); /* tape.c */ extern char *mediaTapeBlocksize(void); extern Boolean mediaInitTape(Device *dev); -extern int mediaGetTape(Device *dev, char *file, Boolean tentative); +extern int mediaGetTape(Device *dev, char *file, Boolean probe); extern void mediaShutdownTape(Device *dev); /* tcpip.c */ @@ -619,7 +617,7 @@ extern int set_termcap(void); /* ufs.c */ extern void mediaShutdownUFS(Device *dev); extern Boolean mediaInitUFS(Device *dev); -extern int mediaGetUFS(Device *dev, char *file, Boolean tentative); +extern int mediaGetUFS(Device *dev, char *file, Boolean probe); /* variable.c */ extern void variable_set(char *var); diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c index d9003cb..7eb2328 100644 --- a/usr.sbin/sysinstall/system.c +++ b/usr.sbin/sysinstall/system.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: system.c,v 1.45 1995/09/18 16:52:36 peter Exp $ + * $Id: system.c,v 1.46 1995/12/07 10:34:16 peter Exp $ * * Jordan Hubbard * @@ -266,7 +266,6 @@ systemCreateHoloshell(void) } else msgDebug("Doctor: I'm unable to get the terminal attributes!\n"); - printf("Warning: This shell is chroot()'d to /mnt\n"); execlp("sh", "-sh", 0); msgDebug("Was unable to execute sh for Holographic shell!\n"); exit(1); diff --git a/usr.sbin/sysinstall/tape.c b/usr.sbin/sysinstall/tape.c index 7cc92dd1a..3da533d 100644 --- a/usr.sbin/sysinstall/tape.c +++ b/usr.sbin/sysinstall/tape.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: tape.c,v 1.6.2.11 1995/11/15 06:59:52 jkh Exp $ + * $Id: tape.c,v 1.8 1995/12/07 10:34:17 peter Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -87,7 +87,7 @@ mediaInitTape(Device *dev) } int -mediaGetTape(Device *dev, char *file, Boolean tentative) +mediaGetTape(Device *dev, char *file, Boolean probe) { char buf[PATH_MAX]; int fd; diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c index 29499c4..c7d46ea 100644 --- a/usr.sbin/sysinstall/tcpip.c +++ b/usr.sbin/sysinstall/tcpip.c @@ -1,5 +1,5 @@ /* - * $Id: tcpip.c,v 1.31 1995/09/18 16:52:38 peter Exp $ + * $Id: tcpip.c,v 1.32 1995/12/07 10:34:19 peter Exp $ * * Copyright (c) 1995 * Gary J Palmer. All rights reserved. @@ -54,6 +54,9 @@ #include "colors.h" #include "sysinstall.h" +/* The help file for the TCP/IP setup screen */ +#define TCP_HELPFILE "tcp" + /* These are nasty, but they make the layout structure a lot easier ... */ static char hostname[HOSTNAME_FIELD_LEN], domainname[HOSTNAME_FIELD_LEN], diff --git a/usr.sbin/sysinstall/ufs.c b/usr.sbin/sysinstall/ufs.c index 0176bac..fefbce0 100644 --- a/usr.sbin/sysinstall/ufs.c +++ b/usr.sbin/sysinstall/ufs.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: ufs.c,v 1.5.2.4 1995/10/22 01:33:02 jkh Exp $ + * $Id: ufs.c,v 1.6 1995/12/07 10:34:21 peter Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -50,7 +50,7 @@ /* No init or shutdown routines necessary - all done in mediaSetUFS() */ int -mediaGetUFS(Device *dev, char *file, Boolean tentative) +mediaGetUFS(Device *dev, char *file, Boolean probe) { char buf[PATH_MAX]; |