From 3ea9b3c64fbf9f43f0a19c20d54dd948f43e0dc4 Mon Sep 17 00:00:00 2001 From: jkh Date: Wed, 24 May 1995 01:27:15 +0000 Subject: Add a final configuration menu and the beginnings of the backing code for it. The ftp installation method is working well enough to test. Many more bug fixes, says Gary. --- usr.sbin/sade/config.c | 15 +++++++++++- usr.sbin/sade/install.c | 3 ++- usr.sbin/sade/menus.c | 52 ++++++++++++++++++++++------------------ usr.sbin/sade/sade.h | 5 +++- usr.sbin/sysinstall/config.c | 15 +++++++++++- usr.sbin/sysinstall/ftp.c | 38 +++++++++++++++++++---------- usr.sbin/sysinstall/install.c | 3 ++- usr.sbin/sysinstall/menus.c | 52 ++++++++++++++++++++++------------------ usr.sbin/sysinstall/sysinstall.h | 5 +++- usr.sbin/sysinstall/tcpip.c | 4 +--- 10 files changed, 124 insertions(+), 68 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/sade/config.c b/usr.sbin/sade/config.c index 881d875..c15d364 100644 --- a/usr.sbin/sade/config.c +++ b/usr.sbin/sade/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.1 1995/05/23 02:40:50 jkh Exp $ + * $Id: config.c,v 1.2 1995/05/23 18:06:12 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -212,3 +212,16 @@ config_resolv(void) fclose(fp); alreadyDone = TRUE; } + +int +config_packages(char *str) +{ + return 0; +} + +int +config_ports(char *str) +{ + return 0; +} + diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index ba2bdfa..8a0f1fe 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.48 1995/05/23 02:41:05 jkh Exp $ + * $Id: install.c,v 1.49 1995/05/23 18:06:13 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -435,4 +435,5 @@ cpio_extract(void) static void do_final_setup(void) { + dmenuOpenSimple(&MenuConfigure); } diff --git a/usr.sbin/sade/menus.c b/usr.sbin/sade/menus.c index c7c99c2..6b40740 100644 --- a/usr.sbin/sade/menus.c +++ b/usr.sbin/sade/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.24 1995/05/21 18:24:34 jkh Exp $ + * $Id: menus.c,v 1.25 1995/05/23 02:41:13 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -205,7 +205,7 @@ To specify a URL not in this list, chose \"other\".", DMENU_SET_VARIABLE, (void *)"ftp=ftp://ftp.freebsd.org/pub/FreeBSD/2.0.5-ALPHA", 0, 0 }, { "Secondary Site", "freefall.cdrom.com", DMENU_SET_VARIABLE, (void *)"ftp=ftp://freefall.cdrom.com/pub/FreeBSD/2.0.5-ALPHA", 0, 0 }, - { "Other", "Specify another ftp site by URL (e.g. ftp://some.site/pub/FreeBSD/..)", + { "Other", "Specify some other ftp site by URL", DMENU_SET_VARIABLE, (void *)"ftp=other", 0, 0 }, { "Australia", "ftp.physics.usyd.edu.au", DMENU_SET_VARIABLE, (void *)"ftp=ftp://ftp.physics.usyd.edu.au/FreeBSD/2.0.5-ALPHA", 0, 0 }, @@ -377,7 +377,7 @@ selecting OK at this stage will chose them as defaults.", { "src", "Sources for everything but DES [120MB]", DMENU_CALL, (void *)distSetSrc, 0 }, { "XFree86", "The XFree86 3.1.1L distribution [?]", - DMENU_SUBMENU, (void *)&MenuXF86, 0 }, + DMENU_SUBMENU, (void *)&MenuXF86Select, 0 }, { NULL } }, }; @@ -421,26 +421,6 @@ you wish to install.", { NULL } }, }; -DMenu MenuXF86 = { - DMENU_NORMAL_TYPE, - "XFree86 3.1.1u1 Distribution", - "Welcome to the XFree86 3.1.1u1 distribution from The XFree86\n\ -Project, Inc. Our recommended sequence is to Select the desired\n\ -release components, Configure XFree86 and then (optionally)\n\ -Start it up!", - "Press F1 to read the XFree86 release notes for FreeBSD", - "XFree86.hlp", - { { "Select", "Select and load components of the XFree86 distribution", - DMENU_SUBMENU, &MenuXF86Select, 0, 0 }, - { "Configure", "Configure an installed XFree86 distribution", - DMENU_SYSTEM_COMMAND, "PATH=/usr/bin:/bin:/usr/X11R6/bin xf86config", - 0, 0 }, - { "Start", "Try to start the server up", - DMENU_SYSTEM_COMMAND, "PATH=/usr/bin:/bin:/usr/X11R6/bin startx", - 0, 0 }, - { NULL } } -}; - DMenu MenuXF86Select = { DMENU_NORMAL_TYPE, "XFree86 3.1.1u1 Distribution", @@ -652,3 +632,29 @@ boot record to be untouched, then select \"none\".", DMENU_CALL, (void *)diskPartitionEditor, 0, 0 }, { NULL } }, }; + +/* Final configuration menu */ +DMenu MenuConfigure = { + DMENU_NORMAL_TYPE, + "FreeBSD Configuration Menu", /* title */ + "Congradulations! If you're seeing this menu, FreeBSD is now\n\ +installed on your hard disk and just about ready to boot. There\n\ +are a last few things you may wish to set up at this point to make\n\ +your FreeBSD system more generally usable and which may be selected\n\ +from the menu below. When you're done, select Cancel.", + "Press F1 for more information on these options", + "configure.hlp", + { { "Time Zone", "Set which time zone you're in", + DMENU_SYSTEM_COMMAND, "tzsetup", 0, 0 }, + { "Add User", "Add users to the system", + DMENU_SYSTEM_COMMAND, "adduser", 0, 0 }, + { "Root Pass", "Set the system manager's password", + DMENU_SYSTEM_COMMAND, "passwd root", 0, 0 }, + { "Packages", "Install extra FreeBSD packaged software", + DMENU_CALL, config_packages, 0, 1 }, + { "Ports", "Enable the FreeBSD Ports Collection from CD", + DMENU_CALL, config_ports, 0, 1 }, + { "XFree86", "Configure XFree86 (if installed)", + DMENU_SYSTEM_COMMAND, "PATH=/usr/bin:/bin:/usr/X11R6/bin xf86config", 0, 0 }, + { NULL } }, +}; diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index c735f22..7e9f83e 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.27 1995/05/23 02:41:16 jkh Exp $ + * $Id: sysinstall.h,v 1.28 1995/05/23 18:06:16 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -204,6 +204,7 @@ extern unsigned int XF86FontDists; /* The XFree86 fonts we want */ extern DMenu MenuInitial; /* Initial installation menu */ extern DMenu MenuMBRType; /* Type of MBR to write on the disk */ +extern DMenu MenuConfigure; /* Final configuration menu */ extern DMenu MenuDocumentation; /* Documentation menu */ extern DMenu MenuOptions; /* Installation options */ extern DMenu MenuOptionsLanguage; /* Language options menu */ @@ -240,6 +241,8 @@ extern void command_func_add(char *key, commandFunc func, void *data); extern void config_fstab(void); extern void config_sysconfig(void); extern void config_resolv(void); +extern int config_ports(char *str); +extern int config_packages(char *str); /* decode.c */ extern DMenuItem *decode(DMenu *menu, char *name); diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c index 881d875..c15d364 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.1 1995/05/23 02:40:50 jkh Exp $ + * $Id: config.c,v 1.2 1995/05/23 18:06:12 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -212,3 +212,16 @@ config_resolv(void) fclose(fp); alreadyDone = TRUE; } + +int +config_packages(char *str) +{ + return 0; +} + +int +config_ports(char *str) +{ + return 0; +} + diff --git a/usr.sbin/sysinstall/ftp.c b/usr.sbin/sysinstall/ftp.c index 0d0cf17..4a908e5 100644 --- a/usr.sbin/sysinstall/ftp.c +++ b/usr.sbin/sysinstall/ftp.c @@ -114,11 +114,12 @@ int FtpOpen(FTP_t ftp, char *host, char *user, char *passwd) { - struct hostent *he, hdef; - struct servent *se, sdef; - struct sockaddr_in sin; - int s; - char a,*p,buf[BUFSIZ]; + struct hostent *he, hdef; + struct servent *se, sdef; + struct sockaddr_in sin; + int s; + char a,*p,buf[BUFSIZ]; + unsigned long temp; if (!user) user = "ftp"; @@ -126,17 +127,28 @@ FtpOpen(FTP_t ftp, char *host, char *user, char *passwd) if (!passwd) passwd = "??@??(FreeBSD:libftp)"; /* XXX */ - he = gethostbyname(host); - if (!he) - return ENOENT; + msgDebug("FtpOpen(ftp, %s, %s, %s)\n", host, user, passwd); - se = getservbyname("ftp","tcp"); - if (!se) + temp = inet_addr(host); + if (temp != INADDR_NONE) + { + msgDebug("Using dotted IP address `%s'\n", host); + ftp->addrtype = sin.sin_family = AF_INET; + sin.sin_addr.s_addr = temp; + } else { + msgDebug("Trying to resolve `%s'\n", host); + he = gethostbyname(host); + if (!he) + { + msgDebug("Lookup of `%s' failed!\n", host); return ENOENT; + } + ftp->addrtype = sin.sin_family = he->h_addrtype; + bcopy(he->h_addr, (char *)&sin.sin_addr, he->h_length); + } + + sin.sin_port = htons(21); - ftp->addrtype = sin.sin_family = he->h_addrtype; - bcopy(he->h_addr, (char *)&sin.sin_addr, he->h_length); - sin.sin_port = se->s_port; if ((s = socket(he->h_addrtype, SOCK_STREAM, 0)) < 0) return s; diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index ba2bdfa..8a0f1fe 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.48 1995/05/23 02:41:05 jkh Exp $ + * $Id: install.c,v 1.49 1995/05/23 18:06:13 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -435,4 +435,5 @@ cpio_extract(void) static void do_final_setup(void) { + dmenuOpenSimple(&MenuConfigure); } diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c index c7c99c2..6b40740 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.24 1995/05/21 18:24:34 jkh Exp $ + * $Id: menus.c,v 1.25 1995/05/23 02:41:13 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -205,7 +205,7 @@ To specify a URL not in this list, chose \"other\".", DMENU_SET_VARIABLE, (void *)"ftp=ftp://ftp.freebsd.org/pub/FreeBSD/2.0.5-ALPHA", 0, 0 }, { "Secondary Site", "freefall.cdrom.com", DMENU_SET_VARIABLE, (void *)"ftp=ftp://freefall.cdrom.com/pub/FreeBSD/2.0.5-ALPHA", 0, 0 }, - { "Other", "Specify another ftp site by URL (e.g. ftp://some.site/pub/FreeBSD/..)", + { "Other", "Specify some other ftp site by URL", DMENU_SET_VARIABLE, (void *)"ftp=other", 0, 0 }, { "Australia", "ftp.physics.usyd.edu.au", DMENU_SET_VARIABLE, (void *)"ftp=ftp://ftp.physics.usyd.edu.au/FreeBSD/2.0.5-ALPHA", 0, 0 }, @@ -377,7 +377,7 @@ selecting OK at this stage will chose them as defaults.", { "src", "Sources for everything but DES [120MB]", DMENU_CALL, (void *)distSetSrc, 0 }, { "XFree86", "The XFree86 3.1.1L distribution [?]", - DMENU_SUBMENU, (void *)&MenuXF86, 0 }, + DMENU_SUBMENU, (void *)&MenuXF86Select, 0 }, { NULL } }, }; @@ -421,26 +421,6 @@ you wish to install.", { NULL } }, }; -DMenu MenuXF86 = { - DMENU_NORMAL_TYPE, - "XFree86 3.1.1u1 Distribution", - "Welcome to the XFree86 3.1.1u1 distribution from The XFree86\n\ -Project, Inc. Our recommended sequence is to Select the desired\n\ -release components, Configure XFree86 and then (optionally)\n\ -Start it up!", - "Press F1 to read the XFree86 release notes for FreeBSD", - "XFree86.hlp", - { { "Select", "Select and load components of the XFree86 distribution", - DMENU_SUBMENU, &MenuXF86Select, 0, 0 }, - { "Configure", "Configure an installed XFree86 distribution", - DMENU_SYSTEM_COMMAND, "PATH=/usr/bin:/bin:/usr/X11R6/bin xf86config", - 0, 0 }, - { "Start", "Try to start the server up", - DMENU_SYSTEM_COMMAND, "PATH=/usr/bin:/bin:/usr/X11R6/bin startx", - 0, 0 }, - { NULL } } -}; - DMenu MenuXF86Select = { DMENU_NORMAL_TYPE, "XFree86 3.1.1u1 Distribution", @@ -652,3 +632,29 @@ boot record to be untouched, then select \"none\".", DMENU_CALL, (void *)diskPartitionEditor, 0, 0 }, { NULL } }, }; + +/* Final configuration menu */ +DMenu MenuConfigure = { + DMENU_NORMAL_TYPE, + "FreeBSD Configuration Menu", /* title */ + "Congradulations! If you're seeing this menu, FreeBSD is now\n\ +installed on your hard disk and just about ready to boot. There\n\ +are a last few things you may wish to set up at this point to make\n\ +your FreeBSD system more generally usable and which may be selected\n\ +from the menu below. When you're done, select Cancel.", + "Press F1 for more information on these options", + "configure.hlp", + { { "Time Zone", "Set which time zone you're in", + DMENU_SYSTEM_COMMAND, "tzsetup", 0, 0 }, + { "Add User", "Add users to the system", + DMENU_SYSTEM_COMMAND, "adduser", 0, 0 }, + { "Root Pass", "Set the system manager's password", + DMENU_SYSTEM_COMMAND, "passwd root", 0, 0 }, + { "Packages", "Install extra FreeBSD packaged software", + DMENU_CALL, config_packages, 0, 1 }, + { "Ports", "Enable the FreeBSD Ports Collection from CD", + DMENU_CALL, config_ports, 0, 1 }, + { "XFree86", "Configure XFree86 (if installed)", + DMENU_SYSTEM_COMMAND, "PATH=/usr/bin:/bin:/usr/X11R6/bin xf86config", 0, 0 }, + { NULL } }, +}; diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index c735f22..7e9f83e 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.27 1995/05/23 02:41:16 jkh Exp $ + * $Id: sysinstall.h,v 1.28 1995/05/23 18:06:16 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -204,6 +204,7 @@ extern unsigned int XF86FontDists; /* The XFree86 fonts we want */ extern DMenu MenuInitial; /* Initial installation menu */ extern DMenu MenuMBRType; /* Type of MBR to write on the disk */ +extern DMenu MenuConfigure; /* Final configuration menu */ extern DMenu MenuDocumentation; /* Documentation menu */ extern DMenu MenuOptions; /* Installation options */ extern DMenu MenuOptionsLanguage; /* Language options menu */ @@ -240,6 +241,8 @@ extern void command_func_add(char *key, commandFunc func, void *data); extern void config_fstab(void); extern void config_sysconfig(void); extern void config_resolv(void); +extern int config_ports(char *str); +extern int config_packages(char *str); /* decode.c */ extern DMenuItem *decode(DMenu *menu, char *name); diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c index 8a876ec..69ecc08 100644 --- a/usr.sbin/sysinstall/tcpip.c +++ b/usr.sbin/sysinstall/tcpip.c @@ -1,5 +1,5 @@ /* - * $Id: tcpip.c,v 1.10 1995/05/21 15:40:54 jkh Exp $ + * $Id: tcpip.c,v 1.11 1995/05/23 18:06:16 jkh Exp $ * * Copyright (c) 1995 * Gary J Palmer. All rights reserved. @@ -566,8 +566,6 @@ tcpDeviceSelect(void) msgFatal("Unable to create network device menu! Argh!"); dmenuOpenSimple(menu); free(menu); - if (netDevice->init) - (*netDevice->init)(netDevice); return netDevice; } -- cgit v1.1