Latest raft of changes.

Added another couple of menu item types.

Reshuffled the menus and added a few more.  Sure wish I could figure out
how to initialize a menu with _one_ initializer rather than two! :(
This commit is contained in:
Jordan K. Hubbard 1995-04-27 18:03:55 +00:00
parent bc8b14f125
commit ef42570d65
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8107
15 changed files with 660 additions and 288 deletions

View File

@ -6,7 +6,7 @@ CLEANFILES= makedevs.c rtermcap
SRCS = globals.c main.c dmenu.c menus.c \
misc.c msg.c system.c install.c \
termcap.c makedevs.c
termcap.c makedevs.c media.c
CFLAGS += -Wall -g -static
LDADD = -ldialog -lncurses -lmytinfo
@ -19,11 +19,11 @@ BOOTS=${.CURDIR}/../../sys/i386/boot/biosboot
.endif
makedevs.c: dev2c.sh Makefile rtermcap
mkdir -p dev
cp ${.CURDIR}/../../etc/etc.i386/MAKEDEV dev
( cd dev; sh ./MAKEDEV all )
sh ${.CURDIR}/dev2c.sh dev > makedevs.tmp
rm -rf dev
# mkdir -p dev
# cp ${.CURDIR}/../../etc/etc.i386/MAKEDEV dev
# ( cd dev; sh ./MAKEDEV all )
# sh ${.CURDIR}/dev2c.sh dev > makedevs.tmp
# rm -rf dev
uudecode < ${.CURDIR}/bteasy17.uu
file2c 'const unsigned char boot0[] = {' '};' \
< bteasy17 >> makedevs.tmp

View File

@ -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$
* $Id: dmenu.c,v 1.1.1.1 1995/04/27 12:50:34 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -96,6 +96,8 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
return;
}
switch (tmp->type) {
/* User whapped ESC twice and wants a sub-shell */
case MENU_SHELL_ESCAPE:
if (file_executable("/bin/sh"))
sh = "/bin/sh";
@ -123,6 +125,7 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
DialogActive = TRUE;
break;
/* We want to simply display a file */
case MENU_DISPLAY_FILE: {
char buf[FILENAME_MAX], *cp, *fname = NULL;
@ -151,6 +154,7 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
}
break;
/* It's a sub-menu; recurse on it */
case MENU_SUBMENU: {
int choice, scroll, curr, max;
@ -159,14 +163,27 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
break;
}
/* Execute it as a system command */
case MENU_SYSTEM_COMMAND:
(void)systemExecute((char *)tmp->ptr);
break;
case MENU_CALL:
((void (*)())tmp->ptr)();
/* Same as above, but execute it in a prgbox */
case MENU_SYSTEM_COMMAND_BOX:
dialog_prgbox(tmp->title, (char *)tmp->ptr, 22, 76, 1, 1);
break;
case MENU_CALL:
if (((int (*)())tmp->ptr)()) {
items_free(nitems, curr, max);
return;
}
break;
case MENU_CANCEL:
items_free(nitems, curr, max);
return;
case MENU_SET_VARIABLE: {
Variable *newvar;
@ -179,6 +196,7 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
strncpy(newvar->value, tmp->ptr, 1024);
newvar->next = VarHead;
VarHead = newvar;
msgInfo("Set variable %s", newvar->value);
}
break;

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id$
* $Id: install.c,v 1.1.1.1 1995/04/27 12:50:35 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -43,14 +43,17 @@
#include "sysinstall.h"
void
installExpress(void)
{
msgInfo("Doing an express installation");
}
void
int
installCustom(void)
{
msgInfo("Doing a custom installation");
msgInfo("Installating the system custom");
return 0;
}
int
installExpress(void)
{
msgInfo("Installating the system express");
return 0;
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id$
* $Id: menus.c,v 1.1.1.1 1995/04/27 12:50:34 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -50,70 +50,160 @@
* expansion.
*/
DMenuItem documentation_items[] = {
{ "README", "Read this for a general description of FreeBSD",
MENU_DISPLAY_FILE, (void *)"help/readme.hlp", 0 },
{ "Hardware", "The FreeBSD survival guide for PC hardware.",
MENU_DISPLAY_FILE, (void *)"help/hardware.hlp", 0 },
{ "Install", "A step-by-step guide to installing FreeBSD.",
MENU_DISPLAY_FILE, (void *)"help/install.hlp", 0 },
{ "FAQ", "Frequently Asked Questions about FreeBSD.",
MENU_DISPLAY_FILE, (void *)"help/faq.hlp", 0 },
{ NULL },
extern DMenu MenuDocumentation;
extern DMenu MenuMedia;
extern DMenu MenuInstallType;
extern DMenu MenuInstallOptions;
/*
* Bloody C won't let me nest these initializers properly - do the
* items and the menus containing them as two seperate initializers
* done in two groups.
*/
/* First, the lists of items */
/* Documentation menu */
DMenuItem _doc_items[] = {
{ "README", "Read this for a general description of FreeBSD", /* R */
MENU_DISPLAY_FILE, (void *)"help/readme.hlp", 0 },
{ "Hardware", "The FreeBSD survival guide for PC hardware.", /* H */
MENU_DISPLAY_FILE, (void *)"help/hardware.hlp", 0 },
{ "Install", "A step-by-step guide to installing FreeBSD.", /* I */
MENU_DISPLAY_FILE, (void *)"help/install.hlp", 0 },
{ "FAQ", "Frequently Asked Questions about FreeBSD.", /* F */
MENU_DISPLAY_FILE, (void *)"help/faq.hlp", 0 },
{ NULL }
};
DMenu MenuDocumentation = {
"Documentation for FreeBSD 2.0.5", /* Title */
"Blah blah", /* Prompt */
NULL, /* No help line */
NULL, /* No help file */
documentation_items,
};
DMenuItem language_items[] = {
{ "English", "The system default.",
MENU_SET_VARIABLE, (void *)"LANG=en", 0 },
{ "French", "French language and character set (ISO-8859-1)",
MENU_SET_VARIABLE, (void *)"LANG=fr", 0 },
{ "German", "German language and character set (ISO-8859-1)",
MENU_SET_VARIABLE, (void *)"LANG=de", 0 },
{ "Japanese", "Japanese language and character set (JIS?)",
MENU_SET_VARIABLE, (void *)"LANG=jp", 0 },
{ "Russian", "Russian language and character set (cp866-8x14)",
MENU_SET_VARIABLE, (void *)"LANG=ru", 0 },
{ NULL },
};
DMenu MenuLanguage = {
"Set your preferred language",
"Blah blah",
NULL,
NULL,
language_items,
};
DMenuItem initial_items[] = {
{ "Usage", "Quick start - How to use this menu system.", /* U */
MENU_DISPLAY_FILE, (void *)"help/initial.hlp", 0 },
{ "Doc", "More detailed documentation on FreeBSD.", /* D */
MENU_SUBMENU, (void *)&MenuDocumentation, 0 },
{ "Lang", "Select natural language options.", /* L */
MENU_SUBMENU, (void *)&MenuLanguage, 0 },
{ "Express", "Express installation (don't ask)", /* E */
MENU_CALL, (void *)installExpress, 0 },
{ "Custom", "Custom installation (please ask)", /* C */
MENU_CALL, (void *)installCustom, 0 },
{ NULL },
/* Language menu */
DMenuItem _lang_items[] = {
{ "English", "The system default language", /* E */
MENU_SET_VARIABLE, (void *)"LANG=en", 0 },
{ "French", "French language and character set (ISO-8859-1)", /* F */
MENU_SET_VARIABLE, (void *)"LANG=fr", 0 },
{ "German", "German language and character set (ISO-8859-1)", /* G */
MENU_SET_VARIABLE, (void *)"LANG=de", 0 },
{ "Japanese", "Japanese language and character set (JIS?)", /* J */
MENU_SET_VARIABLE, (void *)"LANG=jp", 0 },
{ "Russian", "Russian language and character set (cp866-8x14)", /* R */
MENU_SET_VARIABLE, (void *)"LANG=ru", 0 },
{ NULL },
};
/* The first menu */
DMenuItem _initial_items[] = {
{ "Usage", "Quick start - How to use this menu system.", /* U */
MENU_DISPLAY_FILE, (void *)"help/initial.hlp", 0 },
{ "Doc", "More detailed documentation on FreeBSD.", /* D */
MENU_SUBMENU, (void *)&MenuDocumentation, 0 },
{ "Lang", "Select natural language options.", /* L */
MENU_SUBMENU, (void *)&MenuLanguage, 0 },
{ "Express", "Express installation (don't ask)", /* E */
MENU_CALL, (void *)installExpress, 0 },
{ "Custom", "Custom installation (please ask)", /* C */
MENU_CALL, (void *)installCustom, 0 },
{ NULL },
};
/* Installation media menu */
DMenuItem _media_items[] = {
{ "CDROM", "Install from a FreeBSD CDROM",
MENU_CALL, (void *)mediaSetCDROM, 0 },
{ NULL },
};
/* Installation main menu */
DMenuItem _install_items[] = {
{ "Media", "Choose Installation media type", /* M */
MENU_SUBMENU, (void *)&MenuMedia, 0 },
{ "Type", "Choose the type of installation you want", /* T */
MENU_SUBMENU, (void *)&MenuInstallType, 0 },
{ "Options", "Specify installation options", /* O */
MENU_SUBMENU, (void *)&MenuInstallOptions, 0 },
{ "Proceed", "Proceed with installation", /* P */
MENU_CANCEL, (void *)NULL, 0 },
{ NULL },
};
DMenuItem _null_items[] = {
{ NULL },
};
/* Start the menu outer bodies */
DMenu MenuInitial = {
"Welcome to FreeBSD 2.0.5!", /* title */
"This is the main menu of the FreeBSD installation system. Please\n\
"Welcome to FreeBSD 2.0.5!", /* title */
"This is the main menu of the FreeBSD installation system. Please\n\
select one of the options below by using the arrow keys or typing the\n\
first character of the option name you're interested in. Invoke an\n\
option by pressing enter.", /* prompt */
"Press F1 for further help", /* help line */
"help/initial.hlp", /* help file */
initial_items, /* items */
option by pressing enter.", /* prompt */
"Press F1 for further help", /* help line */
"help/initial.hlp", /* help file */
_initial_items,
};
DMenu MenuDocumentation = {
"Documentation for FreeBSD 2.0.5", /* Title */
"If you are at all unsure about the configuration of your hardware\n
or are looking to build a system specifically for FreeBSD, read the\n\
Hardware guide! New users should also read the Install document for\n\
a step-by-step tutorial on installing FreeBSD. For general information,\n\
consult the README file. If you're having other problems, you may find\n\
answers in the FAQ.",
"Having trouble? Press F1 for help!", /* help line */
"help/usage.hlp", /* help file */
_doc_items,
};
DMenu MenuLanguage = {
"Natural language selection", /* title */
"Please specify the language you'd like to use by default.\n\
While a large amount of the system's documentation is still\n\
written in english (and may never be translated), there are some\n\
guides and system documentation that may be written in your\n\
preferred language. When such are found, they will be used instead\n\
of the english versions.", /* prompt */
"Press F1 for more information", /* help line */
"help/language.hlp", /* help file */
_lang_items,
};
DMenu MenuMedia = {
"Choose Installation Media",
"FreeBSD can be installed from a variety of different installation\n\
media, from floppies to the Internet. If you're installing FreeBSD from\n\
a supported CDROM drive then this is generally the best method to\n\
use unless you have some overriding reason for using another method.",
NULL,
NULL,
_media_items,
};
DMenu MenuInstallType = {
"Choose Installation Type",
"blah blah",
NULL,
NULL,
_null_items,
};
DMenu MenuInstallOptions = {
"Choose Installation Options",
"blah blah",
NULL,
NULL,
_null_items,
};
DMenu MenuInstall = {
"Choose Installation Options", /* title */
"Before installation can continue, you need to specify a few items\n\
of information regarding the location of the distribution and the kind\n\
of installation you want to have (and where). There are also a number\n\
of options you can specify in the Options menu. If you do not wish to\n\
install FreeBSD at this time, you may select Cancel to leave this menu",
"You may wish to read the install guide - press F1 to do so",
"help/install.hlp",
_install_items,
};

View File

@ -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$
* $Id: sysinstall.h,v 1.1.1.1 1995/04/27 12:50:34 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -54,28 +54,30 @@
typedef unsigned int Boolean;
typedef enum {
MENU_SHELL_ESCAPE,
MENU_DISPLAY_FILE,
MENU_SUBMENU,
MENU_SYSTEM_COMMAND,
MENU_SET_VARIABLE,
MENU_CALL
MENU_SHELL_ESCAPE, /* Fork a shell */
MENU_DISPLAY_FILE, /* Display a file's contents */
MENU_SUBMENU, /* Recurse into another menu */
MENU_SYSTEM_COMMAND, /* Run shell commmand */
MENU_SYSTEM_COMMAND_BOX, /* Same as above, but in prgbox */
MENU_SET_VARIABLE, /* Set an environment/system var */
MENU_CALL, /* Call back a C function */
MENU_CANCEL, /* Cancel out of this menu */
} DMenuItemType;
typedef struct _dmenuItem {
char *title;
char *prompt;
DMenuItemType type;
void *ptr;
int disabled;
char *title; /* Our title */
char *prompt; /* Our prompt */
DMenuItemType type; /* What type of item we are */
void *ptr; /* Generic data ptr */
int disabled; /* Are we temporarily disabled? */
} DMenuItem;
typedef struct _dmenu {
char *title;
char *prompt;
char *helpline;
char *helpfile;
DMenuItem *items;
char *title; /* Our title */
char *prompt; /* Our prompt */
char *helpline; /* Line of help at bottom */
char *helpfile; /* Help file for "F1" */
DMenuItem *items; /* Array of menu items */
} DMenu;
/* A sysconfig variable */
@ -98,19 +100,25 @@ extern DMenu MenuDocumenation, MenuInitial, MenuLanguage;
/* Prototypes */
/* globals.c */
extern void globalsInit(void);
extern void installExpress(void);
extern void installCustom(void);
/* install.c */
extern int installCustom(void);
extern int installExpress(void);
/* system.c */
extern void systemInitialize(int argc, char **argv);
extern void systemShutdown(void);
extern void systemWelcome(void);
extern int systemExecute(char *cmd);
/* dmenu.c */
extern void dmenuOpen(DMenu *menu, int *choice, int *scroll,
int *curr, int *max);
/* misc.c */
extern Boolean file_readable(char *fname);
extern Boolean file_executable(char *fname);
extern char *string_concat(char *p1, char *p2);
@ -120,12 +128,17 @@ extern void safe_free(void *ptr);
extern char **item_add(char **list, char *item, int *curr, int *max);
extern void items_free(char **list, int *curr, int *max);
/* termcap.c */
extern int set_termcap(void);
/* msg.c */
extern void msgInfo(char *fmt, ...);
extern void msgWarn(char *fmt, ...);
extern void msgError(char *fmt, ...);
extern void msgFatal(char *fmt, ...);
/* media.c */
extern int mediaSetCDROM(void);
#endif
/* _SYSINSTALL_H_INCLUDE */

View File

@ -6,7 +6,7 @@ CLEANFILES= makedevs.c rtermcap
SRCS = globals.c main.c dmenu.c menus.c \
misc.c msg.c system.c install.c \
termcap.c makedevs.c
termcap.c makedevs.c media.c
CFLAGS += -Wall -g -static
LDADD = -ldialog -lncurses -lmytinfo
@ -19,11 +19,11 @@ BOOTS=${.CURDIR}/../../sys/i386/boot/biosboot
.endif
makedevs.c: dev2c.sh Makefile rtermcap
mkdir -p dev
cp ${.CURDIR}/../../etc/etc.i386/MAKEDEV dev
( cd dev; sh ./MAKEDEV all )
sh ${.CURDIR}/dev2c.sh dev > makedevs.tmp
rm -rf dev
# mkdir -p dev
# cp ${.CURDIR}/../../etc/etc.i386/MAKEDEV dev
# ( cd dev; sh ./MAKEDEV all )
# sh ${.CURDIR}/dev2c.sh dev > makedevs.tmp
# rm -rf dev
uudecode < ${.CURDIR}/bteasy17.uu
file2c 'const unsigned char boot0[] = {' '};' \
< bteasy17 >> makedevs.tmp

View File

@ -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$
* $Id: dmenu.c,v 1.1.1.1 1995/04/27 12:50:34 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -96,6 +96,8 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
return;
}
switch (tmp->type) {
/* User whapped ESC twice and wants a sub-shell */
case MENU_SHELL_ESCAPE:
if (file_executable("/bin/sh"))
sh = "/bin/sh";
@ -123,6 +125,7 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
DialogActive = TRUE;
break;
/* We want to simply display a file */
case MENU_DISPLAY_FILE: {
char buf[FILENAME_MAX], *cp, *fname = NULL;
@ -151,6 +154,7 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
}
break;
/* It's a sub-menu; recurse on it */
case MENU_SUBMENU: {
int choice, scroll, curr, max;
@ -159,14 +163,27 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
break;
}
/* Execute it as a system command */
case MENU_SYSTEM_COMMAND:
(void)systemExecute((char *)tmp->ptr);
break;
case MENU_CALL:
((void (*)())tmp->ptr)();
/* Same as above, but execute it in a prgbox */
case MENU_SYSTEM_COMMAND_BOX:
dialog_prgbox(tmp->title, (char *)tmp->ptr, 22, 76, 1, 1);
break;
case MENU_CALL:
if (((int (*)())tmp->ptr)()) {
items_free(nitems, curr, max);
return;
}
break;
case MENU_CANCEL:
items_free(nitems, curr, max);
return;
case MENU_SET_VARIABLE: {
Variable *newvar;
@ -179,6 +196,7 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
strncpy(newvar->value, tmp->ptr, 1024);
newvar->next = VarHead;
VarHead = newvar;
msgInfo("Set variable %s", newvar->value);
}
break;

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id$
* $Id: install.c,v 1.1.1.1 1995/04/27 12:50:35 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -43,14 +43,17 @@
#include "sysinstall.h"
void
installExpress(void)
{
msgInfo("Doing an express installation");
}
void
int
installCustom(void)
{
msgInfo("Doing a custom installation");
msgInfo("Installating the system custom");
return 0;
}
int
installExpress(void)
{
msgInfo("Installating the system express");
return 0;
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id$
* $Id: menus.c,v 1.1.1.1 1995/04/27 12:50:34 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -50,70 +50,160 @@
* expansion.
*/
DMenuItem documentation_items[] = {
{ "README", "Read this for a general description of FreeBSD",
MENU_DISPLAY_FILE, (void *)"help/readme.hlp", 0 },
{ "Hardware", "The FreeBSD survival guide for PC hardware.",
MENU_DISPLAY_FILE, (void *)"help/hardware.hlp", 0 },
{ "Install", "A step-by-step guide to installing FreeBSD.",
MENU_DISPLAY_FILE, (void *)"help/install.hlp", 0 },
{ "FAQ", "Frequently Asked Questions about FreeBSD.",
MENU_DISPLAY_FILE, (void *)"help/faq.hlp", 0 },
{ NULL },
extern DMenu MenuDocumentation;
extern DMenu MenuMedia;
extern DMenu MenuInstallType;
extern DMenu MenuInstallOptions;
/*
* Bloody C won't let me nest these initializers properly - do the
* items and the menus containing them as two seperate initializers
* done in two groups.
*/
/* First, the lists of items */
/* Documentation menu */
DMenuItem _doc_items[] = {
{ "README", "Read this for a general description of FreeBSD", /* R */
MENU_DISPLAY_FILE, (void *)"help/readme.hlp", 0 },
{ "Hardware", "The FreeBSD survival guide for PC hardware.", /* H */
MENU_DISPLAY_FILE, (void *)"help/hardware.hlp", 0 },
{ "Install", "A step-by-step guide to installing FreeBSD.", /* I */
MENU_DISPLAY_FILE, (void *)"help/install.hlp", 0 },
{ "FAQ", "Frequently Asked Questions about FreeBSD.", /* F */
MENU_DISPLAY_FILE, (void *)"help/faq.hlp", 0 },
{ NULL }
};
DMenu MenuDocumentation = {
"Documentation for FreeBSD 2.0.5", /* Title */
"Blah blah", /* Prompt */
NULL, /* No help line */
NULL, /* No help file */
documentation_items,
};
DMenuItem language_items[] = {
{ "English", "The system default.",
MENU_SET_VARIABLE, (void *)"LANG=en", 0 },
{ "French", "French language and character set (ISO-8859-1)",
MENU_SET_VARIABLE, (void *)"LANG=fr", 0 },
{ "German", "German language and character set (ISO-8859-1)",
MENU_SET_VARIABLE, (void *)"LANG=de", 0 },
{ "Japanese", "Japanese language and character set (JIS?)",
MENU_SET_VARIABLE, (void *)"LANG=jp", 0 },
{ "Russian", "Russian language and character set (cp866-8x14)",
MENU_SET_VARIABLE, (void *)"LANG=ru", 0 },
{ NULL },
};
DMenu MenuLanguage = {
"Set your preferred language",
"Blah blah",
NULL,
NULL,
language_items,
};
DMenuItem initial_items[] = {
{ "Usage", "Quick start - How to use this menu system.", /* U */
MENU_DISPLAY_FILE, (void *)"help/initial.hlp", 0 },
{ "Doc", "More detailed documentation on FreeBSD.", /* D */
MENU_SUBMENU, (void *)&MenuDocumentation, 0 },
{ "Lang", "Select natural language options.", /* L */
MENU_SUBMENU, (void *)&MenuLanguage, 0 },
{ "Express", "Express installation (don't ask)", /* E */
MENU_CALL, (void *)installExpress, 0 },
{ "Custom", "Custom installation (please ask)", /* C */
MENU_CALL, (void *)installCustom, 0 },
{ NULL },
/* Language menu */
DMenuItem _lang_items[] = {
{ "English", "The system default language", /* E */
MENU_SET_VARIABLE, (void *)"LANG=en", 0 },
{ "French", "French language and character set (ISO-8859-1)", /* F */
MENU_SET_VARIABLE, (void *)"LANG=fr", 0 },
{ "German", "German language and character set (ISO-8859-1)", /* G */
MENU_SET_VARIABLE, (void *)"LANG=de", 0 },
{ "Japanese", "Japanese language and character set (JIS?)", /* J */
MENU_SET_VARIABLE, (void *)"LANG=jp", 0 },
{ "Russian", "Russian language and character set (cp866-8x14)", /* R */
MENU_SET_VARIABLE, (void *)"LANG=ru", 0 },
{ NULL },
};
/* The first menu */
DMenuItem _initial_items[] = {
{ "Usage", "Quick start - How to use this menu system.", /* U */
MENU_DISPLAY_FILE, (void *)"help/initial.hlp", 0 },
{ "Doc", "More detailed documentation on FreeBSD.", /* D */
MENU_SUBMENU, (void *)&MenuDocumentation, 0 },
{ "Lang", "Select natural language options.", /* L */
MENU_SUBMENU, (void *)&MenuLanguage, 0 },
{ "Express", "Express installation (don't ask)", /* E */
MENU_CALL, (void *)installExpress, 0 },
{ "Custom", "Custom installation (please ask)", /* C */
MENU_CALL, (void *)installCustom, 0 },
{ NULL },
};
/* Installation media menu */
DMenuItem _media_items[] = {
{ "CDROM", "Install from a FreeBSD CDROM",
MENU_CALL, (void *)mediaSetCDROM, 0 },
{ NULL },
};
/* Installation main menu */
DMenuItem _install_items[] = {
{ "Media", "Choose Installation media type", /* M */
MENU_SUBMENU, (void *)&MenuMedia, 0 },
{ "Type", "Choose the type of installation you want", /* T */
MENU_SUBMENU, (void *)&MenuInstallType, 0 },
{ "Options", "Specify installation options", /* O */
MENU_SUBMENU, (void *)&MenuInstallOptions, 0 },
{ "Proceed", "Proceed with installation", /* P */
MENU_CANCEL, (void *)NULL, 0 },
{ NULL },
};
DMenuItem _null_items[] = {
{ NULL },
};
/* Start the menu outer bodies */
DMenu MenuInitial = {
"Welcome to FreeBSD 2.0.5!", /* title */
"This is the main menu of the FreeBSD installation system. Please\n\
"Welcome to FreeBSD 2.0.5!", /* title */
"This is the main menu of the FreeBSD installation system. Please\n\
select one of the options below by using the arrow keys or typing the\n\
first character of the option name you're interested in. Invoke an\n\
option by pressing enter.", /* prompt */
"Press F1 for further help", /* help line */
"help/initial.hlp", /* help file */
initial_items, /* items */
option by pressing enter.", /* prompt */
"Press F1 for further help", /* help line */
"help/initial.hlp", /* help file */
_initial_items,
};
DMenu MenuDocumentation = {
"Documentation for FreeBSD 2.0.5", /* Title */
"If you are at all unsure about the configuration of your hardware\n
or are looking to build a system specifically for FreeBSD, read the\n\
Hardware guide! New users should also read the Install document for\n\
a step-by-step tutorial on installing FreeBSD. For general information,\n\
consult the README file. If you're having other problems, you may find\n\
answers in the FAQ.",
"Having trouble? Press F1 for help!", /* help line */
"help/usage.hlp", /* help file */
_doc_items,
};
DMenu MenuLanguage = {
"Natural language selection", /* title */
"Please specify the language you'd like to use by default.\n\
While a large amount of the system's documentation is still\n\
written in english (and may never be translated), there are some\n\
guides and system documentation that may be written in your\n\
preferred language. When such are found, they will be used instead\n\
of the english versions.", /* prompt */
"Press F1 for more information", /* help line */
"help/language.hlp", /* help file */
_lang_items,
};
DMenu MenuMedia = {
"Choose Installation Media",
"FreeBSD can be installed from a variety of different installation\n\
media, from floppies to the Internet. If you're installing FreeBSD from\n\
a supported CDROM drive then this is generally the best method to\n\
use unless you have some overriding reason for using another method.",
NULL,
NULL,
_media_items,
};
DMenu MenuInstallType = {
"Choose Installation Type",
"blah blah",
NULL,
NULL,
_null_items,
};
DMenu MenuInstallOptions = {
"Choose Installation Options",
"blah blah",
NULL,
NULL,
_null_items,
};
DMenu MenuInstall = {
"Choose Installation Options", /* title */
"Before installation can continue, you need to specify a few items\n\
of information regarding the location of the distribution and the kind\n\
of installation you want to have (and where). There are also a number\n\
of options you can specify in the Options menu. If you do not wish to\n\
install FreeBSD at this time, you may select Cancel to leave this menu",
"You may wish to read the install guide - press F1 to do so",
"help/install.hlp",
_install_items,
};

View File

@ -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$
* $Id: sysinstall.h,v 1.1.1.1 1995/04/27 12:50:34 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -54,28 +54,30 @@
typedef unsigned int Boolean;
typedef enum {
MENU_SHELL_ESCAPE,
MENU_DISPLAY_FILE,
MENU_SUBMENU,
MENU_SYSTEM_COMMAND,
MENU_SET_VARIABLE,
MENU_CALL
MENU_SHELL_ESCAPE, /* Fork a shell */
MENU_DISPLAY_FILE, /* Display a file's contents */
MENU_SUBMENU, /* Recurse into another menu */
MENU_SYSTEM_COMMAND, /* Run shell commmand */
MENU_SYSTEM_COMMAND_BOX, /* Same as above, but in prgbox */
MENU_SET_VARIABLE, /* Set an environment/system var */
MENU_CALL, /* Call back a C function */
MENU_CANCEL, /* Cancel out of this menu */
} DMenuItemType;
typedef struct _dmenuItem {
char *title;
char *prompt;
DMenuItemType type;
void *ptr;
int disabled;
char *title; /* Our title */
char *prompt; /* Our prompt */
DMenuItemType type; /* What type of item we are */
void *ptr; /* Generic data ptr */
int disabled; /* Are we temporarily disabled? */
} DMenuItem;
typedef struct _dmenu {
char *title;
char *prompt;
char *helpline;
char *helpfile;
DMenuItem *items;
char *title; /* Our title */
char *prompt; /* Our prompt */
char *helpline; /* Line of help at bottom */
char *helpfile; /* Help file for "F1" */
DMenuItem *items; /* Array of menu items */
} DMenu;
/* A sysconfig variable */
@ -98,19 +100,25 @@ extern DMenu MenuDocumenation, MenuInitial, MenuLanguage;
/* Prototypes */
/* globals.c */
extern void globalsInit(void);
extern void installExpress(void);
extern void installCustom(void);
/* install.c */
extern int installCustom(void);
extern int installExpress(void);
/* system.c */
extern void systemInitialize(int argc, char **argv);
extern void systemShutdown(void);
extern void systemWelcome(void);
extern int systemExecute(char *cmd);
/* dmenu.c */
extern void dmenuOpen(DMenu *menu, int *choice, int *scroll,
int *curr, int *max);
/* misc.c */
extern Boolean file_readable(char *fname);
extern Boolean file_executable(char *fname);
extern char *string_concat(char *p1, char *p2);
@ -120,12 +128,17 @@ extern void safe_free(void *ptr);
extern char **item_add(char **list, char *item, int *curr, int *max);
extern void items_free(char **list, int *curr, int *max);
/* termcap.c */
extern int set_termcap(void);
/* msg.c */
extern void msgInfo(char *fmt, ...);
extern void msgWarn(char *fmt, ...);
extern void msgError(char *fmt, ...);
extern void msgFatal(char *fmt, ...);
/* media.c */
extern int mediaSetCDROM(void);
#endif
/* _SYSINSTALL_H_INCLUDE */

View File

@ -6,7 +6,7 @@ CLEANFILES= makedevs.c rtermcap
SRCS = globals.c main.c dmenu.c menus.c \
misc.c msg.c system.c install.c \
termcap.c makedevs.c
termcap.c makedevs.c media.c
CFLAGS += -Wall -g -static
LDADD = -ldialog -lncurses -lmytinfo
@ -19,11 +19,11 @@ BOOTS=${.CURDIR}/../../sys/i386/boot/biosboot
.endif
makedevs.c: dev2c.sh Makefile rtermcap
mkdir -p dev
cp ${.CURDIR}/../../etc/etc.i386/MAKEDEV dev
( cd dev; sh ./MAKEDEV all )
sh ${.CURDIR}/dev2c.sh dev > makedevs.tmp
rm -rf dev
# mkdir -p dev
# cp ${.CURDIR}/../../etc/etc.i386/MAKEDEV dev
# ( cd dev; sh ./MAKEDEV all )
# sh ${.CURDIR}/dev2c.sh dev > makedevs.tmp
# rm -rf dev
uudecode < ${.CURDIR}/bteasy17.uu
file2c 'const unsigned char boot0[] = {' '};' \
< bteasy17 >> makedevs.tmp

View File

@ -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$
* $Id: dmenu.c,v 1.1.1.1 1995/04/27 12:50:34 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -96,6 +96,8 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
return;
}
switch (tmp->type) {
/* User whapped ESC twice and wants a sub-shell */
case MENU_SHELL_ESCAPE:
if (file_executable("/bin/sh"))
sh = "/bin/sh";
@ -123,6 +125,7 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
DialogActive = TRUE;
break;
/* We want to simply display a file */
case MENU_DISPLAY_FILE: {
char buf[FILENAME_MAX], *cp, *fname = NULL;
@ -151,6 +154,7 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
}
break;
/* It's a sub-menu; recurse on it */
case MENU_SUBMENU: {
int choice, scroll, curr, max;
@ -159,14 +163,27 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
break;
}
/* Execute it as a system command */
case MENU_SYSTEM_COMMAND:
(void)systemExecute((char *)tmp->ptr);
break;
case MENU_CALL:
((void (*)())tmp->ptr)();
/* Same as above, but execute it in a prgbox */
case MENU_SYSTEM_COMMAND_BOX:
dialog_prgbox(tmp->title, (char *)tmp->ptr, 22, 76, 1, 1);
break;
case MENU_CALL:
if (((int (*)())tmp->ptr)()) {
items_free(nitems, curr, max);
return;
}
break;
case MENU_CANCEL:
items_free(nitems, curr, max);
return;
case MENU_SET_VARIABLE: {
Variable *newvar;
@ -179,6 +196,7 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
strncpy(newvar->value, tmp->ptr, 1024);
newvar->next = VarHead;
VarHead = newvar;
msgInfo("Set variable %s", newvar->value);
}
break;

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id$
* $Id: install.c,v 1.1.1.1 1995/04/27 12:50:35 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -43,14 +43,17 @@
#include "sysinstall.h"
void
installExpress(void)
{
msgInfo("Doing an express installation");
}
void
int
installCustom(void)
{
msgInfo("Doing a custom installation");
msgInfo("Installating the system custom");
return 0;
}
int
installExpress(void)
{
msgInfo("Installating the system express");
return 0;
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id$
* $Id: menus.c,v 1.1.1.1 1995/04/27 12:50:34 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -50,70 +50,160 @@
* expansion.
*/
DMenuItem documentation_items[] = {
{ "README", "Read this for a general description of FreeBSD",
MENU_DISPLAY_FILE, (void *)"help/readme.hlp", 0 },
{ "Hardware", "The FreeBSD survival guide for PC hardware.",
MENU_DISPLAY_FILE, (void *)"help/hardware.hlp", 0 },
{ "Install", "A step-by-step guide to installing FreeBSD.",
MENU_DISPLAY_FILE, (void *)"help/install.hlp", 0 },
{ "FAQ", "Frequently Asked Questions about FreeBSD.",
MENU_DISPLAY_FILE, (void *)"help/faq.hlp", 0 },
{ NULL },
extern DMenu MenuDocumentation;
extern DMenu MenuMedia;
extern DMenu MenuInstallType;
extern DMenu MenuInstallOptions;
/*
* Bloody C won't let me nest these initializers properly - do the
* items and the menus containing them as two seperate initializers
* done in two groups.
*/
/* First, the lists of items */
/* Documentation menu */
DMenuItem _doc_items[] = {
{ "README", "Read this for a general description of FreeBSD", /* R */
MENU_DISPLAY_FILE, (void *)"help/readme.hlp", 0 },
{ "Hardware", "The FreeBSD survival guide for PC hardware.", /* H */
MENU_DISPLAY_FILE, (void *)"help/hardware.hlp", 0 },
{ "Install", "A step-by-step guide to installing FreeBSD.", /* I */
MENU_DISPLAY_FILE, (void *)"help/install.hlp", 0 },
{ "FAQ", "Frequently Asked Questions about FreeBSD.", /* F */
MENU_DISPLAY_FILE, (void *)"help/faq.hlp", 0 },
{ NULL }
};
DMenu MenuDocumentation = {
"Documentation for FreeBSD 2.0.5", /* Title */
"Blah blah", /* Prompt */
NULL, /* No help line */
NULL, /* No help file */
documentation_items,
};
DMenuItem language_items[] = {
{ "English", "The system default.",
MENU_SET_VARIABLE, (void *)"LANG=en", 0 },
{ "French", "French language and character set (ISO-8859-1)",
MENU_SET_VARIABLE, (void *)"LANG=fr", 0 },
{ "German", "German language and character set (ISO-8859-1)",
MENU_SET_VARIABLE, (void *)"LANG=de", 0 },
{ "Japanese", "Japanese language and character set (JIS?)",
MENU_SET_VARIABLE, (void *)"LANG=jp", 0 },
{ "Russian", "Russian language and character set (cp866-8x14)",
MENU_SET_VARIABLE, (void *)"LANG=ru", 0 },
{ NULL },
};
DMenu MenuLanguage = {
"Set your preferred language",
"Blah blah",
NULL,
NULL,
language_items,
};
DMenuItem initial_items[] = {
{ "Usage", "Quick start - How to use this menu system.", /* U */
MENU_DISPLAY_FILE, (void *)"help/initial.hlp", 0 },
{ "Doc", "More detailed documentation on FreeBSD.", /* D */
MENU_SUBMENU, (void *)&MenuDocumentation, 0 },
{ "Lang", "Select natural language options.", /* L */
MENU_SUBMENU, (void *)&MenuLanguage, 0 },
{ "Express", "Express installation (don't ask)", /* E */
MENU_CALL, (void *)installExpress, 0 },
{ "Custom", "Custom installation (please ask)", /* C */
MENU_CALL, (void *)installCustom, 0 },
{ NULL },
/* Language menu */
DMenuItem _lang_items[] = {
{ "English", "The system default language", /* E */
MENU_SET_VARIABLE, (void *)"LANG=en", 0 },
{ "French", "French language and character set (ISO-8859-1)", /* F */
MENU_SET_VARIABLE, (void *)"LANG=fr", 0 },
{ "German", "German language and character set (ISO-8859-1)", /* G */
MENU_SET_VARIABLE, (void *)"LANG=de", 0 },
{ "Japanese", "Japanese language and character set (JIS?)", /* J */
MENU_SET_VARIABLE, (void *)"LANG=jp", 0 },
{ "Russian", "Russian language and character set (cp866-8x14)", /* R */
MENU_SET_VARIABLE, (void *)"LANG=ru", 0 },
{ NULL },
};
/* The first menu */
DMenuItem _initial_items[] = {
{ "Usage", "Quick start - How to use this menu system.", /* U */
MENU_DISPLAY_FILE, (void *)"help/initial.hlp", 0 },
{ "Doc", "More detailed documentation on FreeBSD.", /* D */
MENU_SUBMENU, (void *)&MenuDocumentation, 0 },
{ "Lang", "Select natural language options.", /* L */
MENU_SUBMENU, (void *)&MenuLanguage, 0 },
{ "Express", "Express installation (don't ask)", /* E */
MENU_CALL, (void *)installExpress, 0 },
{ "Custom", "Custom installation (please ask)", /* C */
MENU_CALL, (void *)installCustom, 0 },
{ NULL },
};
/* Installation media menu */
DMenuItem _media_items[] = {
{ "CDROM", "Install from a FreeBSD CDROM",
MENU_CALL, (void *)mediaSetCDROM, 0 },
{ NULL },
};
/* Installation main menu */
DMenuItem _install_items[] = {
{ "Media", "Choose Installation media type", /* M */
MENU_SUBMENU, (void *)&MenuMedia, 0 },
{ "Type", "Choose the type of installation you want", /* T */
MENU_SUBMENU, (void *)&MenuInstallType, 0 },
{ "Options", "Specify installation options", /* O */
MENU_SUBMENU, (void *)&MenuInstallOptions, 0 },
{ "Proceed", "Proceed with installation", /* P */
MENU_CANCEL, (void *)NULL, 0 },
{ NULL },
};
DMenuItem _null_items[] = {
{ NULL },
};
/* Start the menu outer bodies */
DMenu MenuInitial = {
"Welcome to FreeBSD 2.0.5!", /* title */
"This is the main menu of the FreeBSD installation system. Please\n\
"Welcome to FreeBSD 2.0.5!", /* title */
"This is the main menu of the FreeBSD installation system. Please\n\
select one of the options below by using the arrow keys or typing the\n\
first character of the option name you're interested in. Invoke an\n\
option by pressing enter.", /* prompt */
"Press F1 for further help", /* help line */
"help/initial.hlp", /* help file */
initial_items, /* items */
option by pressing enter.", /* prompt */
"Press F1 for further help", /* help line */
"help/initial.hlp", /* help file */
_initial_items,
};
DMenu MenuDocumentation = {
"Documentation for FreeBSD 2.0.5", /* Title */
"If you are at all unsure about the configuration of your hardware\n
or are looking to build a system specifically for FreeBSD, read the\n\
Hardware guide! New users should also read the Install document for\n\
a step-by-step tutorial on installing FreeBSD. For general information,\n\
consult the README file. If you're having other problems, you may find\n\
answers in the FAQ.",
"Having trouble? Press F1 for help!", /* help line */
"help/usage.hlp", /* help file */
_doc_items,
};
DMenu MenuLanguage = {
"Natural language selection", /* title */
"Please specify the language you'd like to use by default.\n\
While a large amount of the system's documentation is still\n\
written in english (and may never be translated), there are some\n\
guides and system documentation that may be written in your\n\
preferred language. When such are found, they will be used instead\n\
of the english versions.", /* prompt */
"Press F1 for more information", /* help line */
"help/language.hlp", /* help file */
_lang_items,
};
DMenu MenuMedia = {
"Choose Installation Media",
"FreeBSD can be installed from a variety of different installation\n\
media, from floppies to the Internet. If you're installing FreeBSD from\n\
a supported CDROM drive then this is generally the best method to\n\
use unless you have some overriding reason for using another method.",
NULL,
NULL,
_media_items,
};
DMenu MenuInstallType = {
"Choose Installation Type",
"blah blah",
NULL,
NULL,
_null_items,
};
DMenu MenuInstallOptions = {
"Choose Installation Options",
"blah blah",
NULL,
NULL,
_null_items,
};
DMenu MenuInstall = {
"Choose Installation Options", /* title */
"Before installation can continue, you need to specify a few items\n\
of information regarding the location of the distribution and the kind\n\
of installation you want to have (and where). There are also a number\n\
of options you can specify in the Options menu. If you do not wish to\n\
install FreeBSD at this time, you may select Cancel to leave this menu",
"You may wish to read the install guide - press F1 to do so",
"help/install.hlp",
_install_items,
};

View File

@ -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$
* $Id: sysinstall.h,v 1.1.1.1 1995/04/27 12:50:34 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -54,28 +54,30 @@
typedef unsigned int Boolean;
typedef enum {
MENU_SHELL_ESCAPE,
MENU_DISPLAY_FILE,
MENU_SUBMENU,
MENU_SYSTEM_COMMAND,
MENU_SET_VARIABLE,
MENU_CALL
MENU_SHELL_ESCAPE, /* Fork a shell */
MENU_DISPLAY_FILE, /* Display a file's contents */
MENU_SUBMENU, /* Recurse into another menu */
MENU_SYSTEM_COMMAND, /* Run shell commmand */
MENU_SYSTEM_COMMAND_BOX, /* Same as above, but in prgbox */
MENU_SET_VARIABLE, /* Set an environment/system var */
MENU_CALL, /* Call back a C function */
MENU_CANCEL, /* Cancel out of this menu */
} DMenuItemType;
typedef struct _dmenuItem {
char *title;
char *prompt;
DMenuItemType type;
void *ptr;
int disabled;
char *title; /* Our title */
char *prompt; /* Our prompt */
DMenuItemType type; /* What type of item we are */
void *ptr; /* Generic data ptr */
int disabled; /* Are we temporarily disabled? */
} DMenuItem;
typedef struct _dmenu {
char *title;
char *prompt;
char *helpline;
char *helpfile;
DMenuItem *items;
char *title; /* Our title */
char *prompt; /* Our prompt */
char *helpline; /* Line of help at bottom */
char *helpfile; /* Help file for "F1" */
DMenuItem *items; /* Array of menu items */
} DMenu;
/* A sysconfig variable */
@ -98,19 +100,25 @@ extern DMenu MenuDocumenation, MenuInitial, MenuLanguage;
/* Prototypes */
/* globals.c */
extern void globalsInit(void);
extern void installExpress(void);
extern void installCustom(void);
/* install.c */
extern int installCustom(void);
extern int installExpress(void);
/* system.c */
extern void systemInitialize(int argc, char **argv);
extern void systemShutdown(void);
extern void systemWelcome(void);
extern int systemExecute(char *cmd);
/* dmenu.c */
extern void dmenuOpen(DMenu *menu, int *choice, int *scroll,
int *curr, int *max);
/* misc.c */
extern Boolean file_readable(char *fname);
extern Boolean file_executable(char *fname);
extern char *string_concat(char *p1, char *p2);
@ -120,12 +128,17 @@ extern void safe_free(void *ptr);
extern char **item_add(char **list, char *item, int *curr, int *max);
extern void items_free(char **list, int *curr, int *max);
/* termcap.c */
extern int set_termcap(void);
/* msg.c */
extern void msgInfo(char *fmt, ...);
extern void msgWarn(char *fmt, ...);
extern void msgError(char *fmt, ...);
extern void msgFatal(char *fmt, ...);
/* media.c */
extern int mediaSetCDROM(void);
#endif
/* _SYSINSTALL_H_INCLUDE */