Sync with current state. Includes selection of distribution sets, tweeks

to disk detection, and floppy load.
This commit is contained in:
phil 1997-10-29 01:06:42 +00:00
parent d2016e2df0
commit d626993ee4
11 changed files with 204 additions and 103 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.3 1997/10/17 22:18:06 phil Exp $ */
/* $NetBSD: md.h,v 1.4 1997/10/29 01:07:08 phil Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -56,19 +56,34 @@ EXTERN int usefull;
/* Definition of files to retreive from ftp. */
EXTERN char ftp_prefix[STRSIZE] INIT("/binary/Tarfiles");
EXTERN char dist_postfix[STRSIZE] INIT(".tar.gz");
EXTERN char *dist_list[]
EXTERN distinfo dist_list[]
#ifdef MAIN
= { "kern%s%s", "base%s%s", "comp%s%s", "etc%s%s", "games%s%s", "man%s%s",
"misc%s%s", "text%s%s", "CKSUMS", NULL }
#endif
;
EXTERN char *fd_last[]
#ifdef MAIN
= { "ab", "ab", "ab", "ab", "ab", "ab", "ab", "ab", NULL}
= { {"kern%s%s", 1, "ae", "Kernel : "},
{"etc%s%s", 1, "aa", "System (/etc): "},
{"base%s%s", 1, "bo", "Base : "},
{"comp%s%s", 1, "bd", "Compiler : "},
{"games%s%s", 1, "am","Games : "},
{"man%s%s", 1, "ak", "Manuals : "},
{"misc%s%s", 1, "ai", "Miscellaneous: "},
{"text%s%s", 1, "ae", "Text tools : "},
{NULL, 0, NULL }
}
#endif
;
EXTERN char *fdtype INIT("msdos");
/* Disk information */
EXTERN char *disk_names[]
#ifdef MAIN
= {"wd", "sd", NULL}
#endif
;
EXTERN char *fdtype INIT("msdos");
/* Legal start character for a disk for checking input. */
#define ISDISKSTART(dn) (dn == 'w' || dn == 's')
/* prototypes */
@ -78,3 +93,4 @@ void disp_cur_geom (void);
int check_geom (void);
int partsoverlap (int, int);
void get_fdisk_info (void);

View File

@ -1,4 +1,4 @@
/* $NetBSD: menus.md.eng,v 1.3 1997/10/07 04:01:36 phil Exp $ */
/* $NetBSD: menus.md.eng,v 1.4 1997/10/29 01:07:11 phil Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -160,3 +160,12 @@ menu editfsparts, y=15, exit;
option "Change g", action { editpart = G;}, sub menu edfspart;
option "Change h", action { editpart = H;}, sub menu edfspart;
menu md_distcustom, exit, title " Selection toggles inclusion";
display action { show_cur_distsets (); };
option "Compiler Tools", action { toggle_getit (3); };
option "Games", action { toggle_getit (4); };
option "Online Manual Pages", action { toggle_getit (5); };
option "Miscellaneous", action { toggle_getit (6); };
option "Text Processing Tools", action { toggle_getit (7); };

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.2 1997/10/07 04:01:37 phil Exp $ */
/* $NetBSD: md.c,v 1.3 1997/10/29 01:07:17 phil Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -50,7 +50,7 @@
#include "msg_defs.h"
#include "menu_defs.h"
void md_get_info (void)
int md_get_info (void)
{ struct disklabel disklabel;
int fd;
char devname[100];
@ -80,6 +80,8 @@ void md_get_info (void)
/* Compute minimum NetBSD partition sizes (in sectors). */
minfsdmb = (80 + 4*rammb) * (MEG / sectorsize);
return 1;
}
void md_pre_disklabel (void)
@ -212,7 +214,7 @@ void md_make_bsd_partitions (void)
}
/* update support */
void
int
md_update(void)
{
return 1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.1.1.1 1997/09/26 23:02:56 phil Exp $ */
/* $NetBSD: md.h,v 1.2 1997/10/29 01:07:21 phil Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -43,11 +43,32 @@
/* Megs required for a full X installation. */
#define XNEEDMB 50
/* Definition of files to retreive from ftp. */
EXTERN char ftp_prefix[STRSIZE] INIT("");
EXTERN char ftp_postfix[STRSIZE] INIT(".tar.gz");
EXTERN char *ftp_list[]
/* Disk names. */
EXTERN char *disk_names[]
#ifdef MAIN
= { "kern", "base", "comp", "etc", "games", "man", "misc", "text", NULL }
= {"sd", NULL}
#endif
;
/* Legal start character for a disk for checking input. */
#define ISDISKSTART(dn) (dn == 's')
/* Definition of files to retreive from ftp. */
EXTERN char ftp_prefix[STRSIZE] INIT("/binary/Tarfiles");
EXTERN char dist_postfix[STRSIZE] INIT(".tar.gz");
EXTERN distinfo dist_list[]
#ifdef MAIN
= { {"kern%s%s", 1, NULL, "Kernel : "},
{"etc%s%s", 1, NULL, "System (/etc): "},
{"base%s%s", 1, NULL, "Base : "},
{"comp%s%s", 1, NULL, "Compiler : "},
{"games%s%s", 1, NULL,"Games : "},
{"man%s%s", 1, NULL, "Manuals : "},
{"misc%s%s", 1, NULL, "Miscellaneous: "},
{"text%s%s", 1, NULL, "Text tools : "},
{NULL, 0, NULL }
}
#endif
;
EXTERN char *fdtype INIT("");

View File

@ -1,4 +1,4 @@
/* $NetBSD: menus.md.eng,v 1.2 1997/10/01 05:04:32 phil Exp $ */
/* $NetBSD: menus.md.eng,v 1.3 1997/10/29 01:07:24 phil Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -52,3 +52,10 @@ menu editfsparts, y=15, exit;
option "Change g", action { editpart = G;}, sub menu edfspart;
option "Change h", action { editpart = H;}, sub menu edfspart;
menu md_distcustom, exit, title " Selection toggles inclusion";
display action { show_cur_distsets (); };
option "Compiler Tools", action { toggle_getit (3); };
option "Games", action { toggle_getit (4); };
option "Online Manual Pages", action { toggle_getit (5); };
option "Miscellaneous", action { toggle_getit (6); };
option "Text Processing Tools", action { toggle_getit (7); };

View File

@ -1,4 +1,4 @@
/* $NetBSD: defs.h,v 1.8 1997/10/22 15:28:33 phil Exp $ */
/* $NetBSD: defs.h,v 1.9 1997/10/29 01:06:42 phil Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -66,6 +66,14 @@
#define NUMSEC(size,sizemult,cylsize) \
((sizemult == 1) ? (size) : \
(((size)*(sizemult)+(cylsize)-1)/(cylsize))*(cylsize))
/* Types */
typedef struct distinfo {
char *name;
int getit;
char *fdlast;
char *desc;
} distinfo;
/* variables */
@ -221,3 +229,6 @@ void extract_dist __P((void));
void run_makedev __P((void));
int get_via_floppy __P((void));
int get_via_cdrom __P((void));
void cd_dist_dir __P((char *));
void toggle_getit __P((int));
void show_cur_distsets __P((void));

View File

@ -1,4 +1,4 @@
/* $NetBSD: disks.c,v 1.5 1997/10/22 15:28:45 phil Exp $ */
/* $NetBSD: disks.c,v 1.6 1997/10/29 01:06:48 phil Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -50,6 +50,7 @@
#include <sys/disklabel.h>
#include "defs.h"
#include "md.h"
#include "msg_defs.h"
#include "menu_defs.h"
#include "txtwalk.h"
@ -60,8 +61,7 @@ static void foundffs (struct data *list, int num);
static void get_disks(void)
{
char *names[] = {"wd", "sd", "rd", NULL};
char **xd = names;
char **xd = disk_names;
char d_name[SSTRSIZE];
struct disklabel l;
int i;
@ -125,7 +125,7 @@ int find_disks (void)
strsep(&tp, " ");
diskdev[strlen(diskdev)+1] = 0;
diskdev[strlen(diskdev)] = ' ';
while (!(*diskdev == 'w' || *diskdev == 's') ||
while (!ISDISKSTART(*diskdev) ||
strstr(disknames, diskdev) == NULL) {
msg_prompt (MSG_badname, defname, diskdev, 10,
disknames);

View File

@ -1,4 +1,4 @@
/* $NetBSD: menus.mi.eng,v 1.8 1997/10/22 15:28:53 phil Exp $ */
/* $NetBSD: menus.mi.eng,v 1.9 1997/10/29 01:06:51 phil Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -220,12 +220,20 @@ menu selfskind, title " Select the type ", y=15;
menu distmedium, title " Select medium";
display action { msg_display (MSG_distmedium); nodist = 0; };
option "ftp", action { got_dist = get_via_ftp(); }, exit;
option "nfs", action { got_dist = get_via_nfs(); }, exit;
option "cdrom", action { got_dist = get_via_cdrom(); }, exit;
option "floppy", action { got_dist = get_via_floppy(); }, exit;
option "none", action { nodist = 1; }, exit;
option "ftp", action { process_menu (MENU_distset);
got_dist = get_via_ftp(); }, exit;
option "nfs", action { process_menu (MENU_distset);
got_dist = get_via_nfs(); }, exit;
option "cdrom", action { process_menu (MENU_distset);
got_dist = get_via_cdrom(); }, exit;
option "floppy", action { process_menu (MENU_distset);
got_dist = get_via_floppy(); }, exit;
option "none", action { nodist = 1; };
menu distset, title " Select your distribution";
display action { msg_display (MSG_distset); };
option "Full installation", exit;
option "Custom installation", next menu md_distcustom;
menu ftpsource, title " Change";
display action

View File

@ -1,4 +1,4 @@
/* $NetBSD: msg.mi.eng,v 1.8 1997/10/22 15:28:59 phil Exp $ */
/* $NetBSD: msg.mi.eng,v 1.9 1997/10/29 01:06:55 phil Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -38,6 +38,10 @@
/* MI Message catalog -- english, machine independent */
message yes {Yes}
message no {No}
message install
{install}
@ -253,6 +257,14 @@ you are ready at a later time, you may select "upgrade" from the main
menu to complete the installation.
}
message distset
{The NetBSD distribution is broken into a collection of distribution
sets. There are some basic sets that are needed by all instalations
and there are some other sets that are not needed by all installations.
You may choose to install all of them (Full installation) or you
select from the optional distribution sets.
}
message ftpsource
{The following is the ftp site, directory, user, and password currently
ready to use. If "user" is "ftp", then the password is not needed.
@ -432,16 +444,17 @@ they are upgraded. Do you want this file system upgraded?
message fddev
{What floppy device do you want to use? }
message fdload
{Do you want to load the distribution set "%s"? }
message fdmount
{Please load the floppy containing the file named "%s/%s". }
{Please load the floppy containing the file named "%s". }
message fdnotfound
{Could not find the file named "%s" on the disk. Please load the
floppy with that file on it.}
message fdremount
{The floppy was not mounted successfully. You may:
Try again and put in the floppy containing the file named "%s/%s".
Try again and put in the floppy containing the file named "%s".
Not load any more files from floppy and abort the process.
}
@ -449,3 +462,8 @@ message fdremount
message mntnetconfig
{Is the network information you entered accurate for this machine
in regular operation and do you want it installed in /etc? }
message cur_distsets
{The following is the list of distribution sets that will be used.
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: net.c,v 1.9 1997/10/22 15:29:05 phil Exp $ */
/* $NetBSD: net.c,v 1.10 1997/10/29 01:06:58 phil Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -49,7 +49,7 @@
#include "menu_defs.h"
#include "txtwalk.h"
static network_up = 0;
static int network_up = 0;
/* Get the list of network interfaces. */
@ -178,8 +178,7 @@ int config_network (void)
int
get_via_ftp (void)
{
char **list;
char realdir[STRSIZE];
distinfo *list;
char filename[SSTRSIZE];
int ret;
@ -189,31 +188,20 @@ get_via_ftp (void)
if (!yesno)
return 0;
}
cd_dist_dir ("ftp");
strncat (ftp_dir, ftp_prefix, STRSIZE-strlen(ftp_dir));
process_menu (MENU_ftpsource);
msg_prompt (MSG_distdir, dist_dir, dist_dir, STRSIZE, "ftp");
if (*dist_dir == '/')
snprintf (realdir, STRSIZE, "/mnt%s", dist_dir);
else
snprintf (realdir, STRSIZE, "/mnt/%s", dist_dir);
strcpy (dist_dir, realdir);
run_prog ("/bin/mkdir %s", realdir);
clean_dist_dir = 1;
#ifndef DEBUG
if (chdir(realdir)) {
endwin();
(void)fprintf(stderr, msg_string(MSG_realdir), realdir);
exit(1);
}
#else
printf ("chdir (%s)\n", realdir);
#endif
list = dist_list;
endwin();
while (*list) {
snprintf (filename, SSTRSIZE, *list, rels, dist_postfix);
while (list->name) {
if (!list->getit) {
list++;
continue;
}
snprintf (filename, SSTRSIZE, list->name, rels, dist_postfix);
if (strcmp ("ftp", ftp_user) == 0)
ret = run_prog("/usr/bin/ftp -a ftp://%s/%s/%s",
ftp_host, ftp_dir,

View File

@ -1,4 +1,4 @@
/* $NetBSD: util.c,v 1.6 1997/10/20 06:13:42 phil Exp $ */
/* $NetBSD: util.c,v 1.7 1997/10/29 01:07:01 phil Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -161,60 +161,38 @@ void run_makedev (void)
/* Load files from floppy. */
int get_via_floppy (void)
{
char realdir[STRSIZE];
char distname[STRSIZE];
char fddev[STRSIZE] = "/dev/fd0a";
char dirname[STRSIZE];
char fname[STRSIZE];
char fullname[STRSIZE];
char **list;
char **last;
distinfo *list;
char post[4];
int mounted = 0;
struct stat sb;
msg_prompt (MSG_distdir, dist_dir, dist_dir, STRSIZE,
"unloading from floppy");
if (*dist_dir == '/')
snprintf (realdir, STRSIZE, "/mnt%s", dist_dir);
else
snprintf (realdir, STRSIZE, "/mnt/%s", dist_dir);
strcpy (dist_dir, realdir);
run_prog ("/bin/mkdir %s", realdir);
clean_dist_dir = 1;
#ifndef DEBUG
if (chdir(realdir)) {
endwin();
(void)fprintf(stderr, msg_string(MSG_realdir), realdir);
exit(1);
}
#else
printf ("chdir (%s)\n", realdir);
#endif
cd_dist_dir ("unloading from floppy");
msg_prompt_add (MSG_fddev, fddev, fddev, STRSIZE);
list = dist_list;
last = fd_last;
while (*last) {
while (list->name) {
strcpy (post, ".aa");
snprintf (dirname, STRSIZE, *list, rels, "/" );
snprintf (distname, STRSIZE, *list, rels, dist_postfix);
msg_display (MSG_fdload, dirname);
process_menu (MENU_yesno);
while (yesno && strcmp(post,*last) <= 0) {
snprintf (fname, STRSIZE, *list, rels, post);
snprintf (fullname, STRSIZE, "/mnt2/%s%s", dirname,
fname);
snprintf (distname, STRSIZE, list->name, rels, dist_postfix);
while (list->getit && strcmp(post,list->fdlast) <= 0) {
snprintf (fname, STRSIZE, list->name, rels, post);
snprintf (fullname, STRSIZE, "/mnt2/%s", fname);
while (!mounted || stat(fullname, &sb)) {
if (mounted)
run_prog ("/sbin/umount /mnt2");
msg_display (MSG_fdmount, dirname, fname);
if (mounted) {
run_prog ("/sbin/umount /mnt2 "
"2>/dev/null");
msg_display (MSG_fdnotfound, fname);
} else
msg_display (MSG_fdmount, fname);
process_menu (MENU_ok);
while (!run_prog("/sbin/mount -t %s %s /mnt2",
while (run_prog("/sbin/mount -t %s %s /mnt2",
fdtype, fddev)) {
msg_display (MSG_fdremount, dirname,
fname);
msg_display (MSG_fdremount, fname);
process_menu (MENU_fdremount);
if (!yesno)
return 0;
@ -228,10 +206,9 @@ int get_via_floppy (void)
else
post[1]='a', post[2]++;
}
run_prog ("/sbin/umount /mnt2");
run_prog ("/sbin/umount /mnt2 2>/dev/null");
mounted = 0;
list++;
last++;
}
#ifndef DEBUG
chdir("/");
@ -260,3 +237,47 @@ get_via_cdrom(void)
mnt2_mounted = 1;
return 1;
}
void cd_dist_dir (char *forwhat)
{
char realdir[STRSIZE];
msg_prompt (MSG_distdir, dist_dir, dist_dir, STRSIZE, forwhat);
if (*dist_dir == '/')
snprintf (realdir, STRSIZE, "/mnt%s", dist_dir);
else
snprintf (realdir, STRSIZE, "/mnt/%s", dist_dir);
strcpy (dist_dir, realdir);
run_prog ("/bin/mkdir %s", realdir);
clean_dist_dir = 1;
#ifndef DEBUG
if (chdir(realdir)) {
endwin();
(void)fprintf(stderr, msg_string(MSG_realdir), realdir);
exit(1);
}
#else
printf ("chdir (%s)\n", realdir);
#endif
}
/* Support for custom distribution fetches / unpacks. */
void toggle_getit (int num)
{
dist_list[num].getit ^= 1;
}
void show_cur_distsets (void)
{
distinfo *list;
msg_display (MSG_cur_distsets);
list = dist_list;
while (list->name) {
msg_printf_add ("%s%s\n", list->desc, list->getit ?
msg_string(MSG_yes) : msg_string(MSG_no));
list++;
}
}