Rework the installation loop so that it is possible to change the source

of the sets after an error.
A side effect is that it now does fetch-install-fetch-install..., not
fetch-...-fetch-install-...install.
The set selection code now uses a byte per set (not a bit-pattern) removing
the restriction of 32 sets, and allowing a per set status display (TBC).
Also TBC is deleting sets from /usr/INSTALL.
However I believe it works...
This commit is contained in:
dsl 2006-01-12 22:02:44 +00:00
parent 9277c02ebe
commit 9fc0a7f722
31 changed files with 888 additions and 967 deletions

View File

@ -1,7 +1,9 @@
# $NetBSD: Makefile.inc,v 1.41 2005/09/10 21:38:40 dsl Exp $
# $NetBSD: Makefile.inc,v 1.42 2006/01/12 22:02:44 dsl Exp $
#
# Makefile for sysinst
COPTS += -Os
PROG= sysinst
NOMAN= # defined

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.13 2004/12/28 17:56:40 joff Exp $ */
/* $NetBSD: md.h,v 1.14 2006/01/12 22:02:44 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -56,7 +56,7 @@
#define SET_KERNEL_5_NAME "kern-TEAMASA_NPWR"
#define SET_KERNEL_6_NAME "kern-TS7200"
#define MD_SETS_SELECTED (SET_SYSTEM)
#define MD_SETS_SELECTED SET_SYSTEM
/*
* Machine-specific command to write a new label to a disk.

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.11 2004/06/06 06:07:00 christos Exp $ */
/* $NetBSD: md.h,v 1.12 2006/01/12 22:02:44 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -71,7 +71,7 @@
*/
#define SET_KERNEL_1_NAME "kern-GENERIC"
#define MD_SETS_VALID (SET_KERNEL | SET_SYSTEM | (SET_X11 & ~SET_X11_SERVERS))
#define MD_SETS_VALID SET_KERNEL, SET_SYSTEM, SET_X11_NOSERVERS
/*
* Disk names accepted as valid targets for a from-scratch installation.

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.1 2005/05/14 14:54:00 chs Exp $ */
/* $NetBSD: md.h,v 1.2 2006/01/12 22:02:44 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -62,7 +62,7 @@
*/
#define SET_KERNEL_1_NAME "kern-GENERIC"
#define MD_SETS_VALID (SET_KERNEL | SET_SYSTEM | (SET_X11 & ~SET_X11_SERVERS))
#define MD_SETS_VALID SET_KERNEL, SET_SYSTEM, SET_X11_NOSERVERS
/*
* Machine-specific command to write a new label to a disk.

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.108 2005/09/13 23:43:22 jdarrow Exp $ */
/* $NetBSD: md.c,v 1.109 2006/01/12 22:02:45 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -320,12 +320,9 @@ md_post_newfs(void)
&& (condev & ~3) == 0x800) {
/* Motherboard serial port */
boottype.bp_consdev = (condev & 3) + 1;
td = open("/dev/console", O_RDONLY, 0);
if (td != -1) {
if (tcgetattr(td, &t) != -1)
boottype.bp_conspeed = t.c_ispeed;
close(td);
}
/* Defaulting the baud rate to that of stdin should suffice */
if (tcgetattr(0, &t) != -1)
boottype.bp_conspeed = t.c_ispeed;
}
process_menu(MENU_getboottype, &boottype);
@ -476,7 +473,7 @@ md_cleanup_install(void)
* For GENERIC_TINY, do not enable any extra screens or wsmux.
* Otherwise, run getty on 4 VTs.
*/
if (sets_selected & SET_KERNEL_TINY)
if (get_kernel_set() == SET_KERNEL_TINY)
run_program(0, "sed -an -e '/^screen/s/^/#/;/^mux/s/^/#/;"
"H;$!d;g;w %s/etc/wscons.conf' %s/etc/wscons.conf",
tp, tp);
@ -607,7 +604,7 @@ md_init(void)
{
/* Default to install same type of kernel as we are running */
sets_selected = (sets_selected & ~SET_KERNEL) | get_bootmodel();
set_kernel_set(get_bootmodel());
}
static char *

View File

@ -1,4 +1,4 @@
/* $NetBSD: menus.md,v 1.10 2003/11/30 14:36:45 dsl Exp $ */
/* $NetBSD: menus.md,v 1.11 2006/01/12 22:02:45 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -41,18 +41,20 @@
menu getboottype, title MSG_Bootblocks_selection, y=10, exit, no clear;
display action { msg_display(MSG_getboottype);
switch (((struct x86_boot_params *)arg)->bp_consdev) {
case ~0:
msg_display_add(MSG_console_unchanged);
break;
default:
case 0:
msg_display_add(MSG_console_PC);
break;
default:
case 1: case 2: case 3: case 4:
menu->cursel = ((struct x86_boot_params *)arg)->bp_consdev;
msg_display_add(MSG_console_com,
((struct x86_boot_params *)arg)->bp_consdev - 1,
((struct x86_boot_params *)arg)->bp_conspeed);
}
};
((struct x86_boot_params *)arg)->bp_consdev - 1,
((struct x86_boot_params *)arg)->bp_conspeed);
break;
case ~0:
msg_display_add(MSG_console_unchanged);
break;
}};
option MSG_Use_normal_bootblocks, action
{((struct x86_boot_params *)arg)->bp_consdev = 0; m->cursel = 7;};
option MSG_Use_serial_com0, action

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.44 2004/11/14 13:34:53 he Exp $ */
/* $NetBSD: md.c,v 1.45 2006/01/12 22:02:45 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -1150,10 +1150,10 @@ md_init()
/*
* Running the SBC Installation Kernel, so enable GENERICSBC
*/
sets_selected = (sets_selected & ~SET_KERNEL) | SET_KERNEL_2;
set_kernel_set(SET_KERNEL_2);
else
/*
* Running the GENERIC Installation Kernel, so enable GENERIC
*/
sets_selected = (sets_selected & ~SET_KERNEL) | SET_KERNEL_1;
set_kernel_set(SET_KERNEL_1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.10 2004/06/06 06:07:01 christos Exp $ */
/* $NetBSD: md.h,v 1.11 2006/01/12 22:02:45 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -64,7 +64,7 @@
* or upgrade.
*/
#define SET_KERNEL_1_NAME "kern-GENERIC"
#define MD_SETS_VALID (SET_KERNEL | SET_SYSTEM | (SET_X11 & ~SET_X11_SERVERS))
#define MD_SETS_VALID SET_KERNEL, SET_SYSTEM, SET_X11_NOSERVERS
/*
* Machine-specific command to write a new label to a disk.

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.11 2004/06/06 06:07:01 christos Exp $ */
/* $NetBSD: md.h,v 1.12 2006/01/12 22:02:45 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -70,7 +70,7 @@
* base etc comp games man misc text xbase xcomp xetc xfont xserver
*/
#define SET_KERNEL_1_NAME "kern-GENERIC"
#define MD_SETS_VALID (SET_KERNEL | SET_SYSTEM | (SET_X11 & ~SET_X11_SERVERS))
#define MD_SETS_VALID SET_KERNEL, SET_SYSTEM, SET_X11_NOSERVERS
/*
* Machine-specific command to write a new label to a disk.

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.20 2004/06/06 06:07:01 christos Exp $ */
/* $NetBSD: md.h,v 1.21 2006/01/12 22:02:45 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -63,8 +63,7 @@
#define SET_KERNEL_1_NAME "kern-GENERIC"
#define SET_KERNEL_2_NAME "kern-GENERIC_TINY"
#define MD_SETS_SELECTED (SET_KERNEL_1 | SET_SYSTEM | \
(SET_X11 & ~SET_X11_SERVERS))
#define MD_SETS_SELECTED SET_KERNEL_1, SET_SYSTEM, SET_X11_NOSERVERS
/*
* Machine-specific command to write a new label to a disk.

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.10 2004/06/06 06:07:01 christos Exp $ */
/* $NetBSD: md.h,v 1.11 2006/01/12 22:02:45 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -61,8 +61,7 @@
* or upgrade.
*/
#define SET_KERNEL_1_NAME "kern-GENERIC"
#define MD_SETS_SELECTED (SET_KERNEL_1 | SET_SYSTEM | \
(SET_X11 & ~SET_X11_SERVERS))
#define MD_SETS_SELECTED SET_KERNEL_1, SET_SYSTEM, SET_X11_NOSERVERS
/*
* Machine-specific command to write a new label to a disk.

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.12 2004/06/06 06:07:01 christos Exp $ */
/* $NetBSD: md.h,v 1.13 2006/01/12 22:02:45 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -65,7 +65,7 @@
* base, etc, comp, games, man, misc, text
*/
#define SET_KERNEL_1_NAME "kern-GENERIC"
#define MD_SETS_VALID (SET_KERNEL | SET_SYSTEM)
#define MD_SETS_VALID SET_KERNEL, SET_SYSTEM
/*
* Machine-specific command to write a new label to a disk.

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.12 2004/06/06 06:07:01 christos Exp $ */
/* $NetBSD: md.h,v 1.13 2006/01/12 22:02:45 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -74,8 +74,7 @@
* from floppy.
*/
#define SET_KERNEL_1_NAME "kern-GENERIC"
#define MD_SETS_SELECTED (SET_KERNEL_1 | SET_SYSTEM | \
(SET_X11 & ~SET_X11_SERVERS))
#define MD_SETS_SELECTED SET_KERNEL_1, SET_SYSTEM, SET_X11_NOSERVERS
/*
* Machine-specific command to write a new label to a disk.

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.18 2004/11/14 18:36:11 dsl Exp $ */
/* $NetBSD: md.c,v 1.19 2006/01/12 22:02:45 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -203,9 +203,9 @@ md_init()
*/
uname(&instsys);
if (strstr(instsys.version, "(INSTALL32_IP3x)"))
sets_selected = (sets_selected & ~SET_KERNEL) | SET_KERNEL_2;
set_kernel_set(SET_KERNEL_2);
else if (strstr(instsys.version, "(INSTALL32_IP2x)"))
sets_selected = (sets_selected & ~SET_KERNEL) | SET_KERNEL_1;
set_kernel_set(SET_KERNEL_1);
else if (strstr(instsys.version, "(GENERIC32_IP12)"))
sets_selected = (sets_selected & ~SET_KERNEL) | SET_KERNEL_3;
set_kernel_set(SET_KERNEL_3);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.20 2004/11/13 11:49:08 sekiya Exp $ */
/* $NetBSD: md.h,v 1.21 2006/01/12 22:02:45 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -78,7 +78,7 @@
#define SET_KERNEL_1_NAME "kern-GENERIC32_IP2x"
#define SET_KERNEL_2_NAME "kern-GENERIC32_IP3x"
#define SET_KERNEL_3_NAME "kern-GENERIC32_IP12"
#define MD_SETS_SELECTED (SET_KERNEL_1 | SET_SYSTEM)
#define MD_SETS_SELECTED SET_KERNEL_1, SET_SYSTEM
/*
* Default fileystem type for floppy disks.

View File

@ -1,4 +1,4 @@
/* $NetBSD: bsddisklabel.c,v 1.38 2006/01/09 15:25:20 tsutsui Exp $ */
/* $NetBSD: bsddisklabel.c,v 1.39 2006/01/12 22:02:44 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -389,7 +389,7 @@ get_ptn_sizes(int part_start, int sectors, int no_swap)
/* If there is a swap partition elsewhere, don't add one here.*/ if (no_swap)
pi.ptn_sizes[PI_SWAP].size = 0;
/* If installing X increase default size of /usr */
if (sets_selected & SET_X11)
if (set_X11_selected())
pi.ptn_sizes[PI_USR].dflt_size += XNEEDMB;
/* Start of planning to give free space to / */

View File

@ -1,4 +1,4 @@
/* $NetBSD: defs.h,v 1.123 2005/02/26 17:40:49 dsl Exp $ */
/* $NetBSD: defs.h,v 1.124 2006/01/12 22:02:44 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -67,6 +67,14 @@ deconst(const void *p)
#define T_FILE 0
#define T_OUTPUT 1
/* Some install status/response values */
#define SET_OK 0 /* Set extracted */
#define SET_RETRY 1 /* Retry */
#define SET_SKIP 2 /* Skip this set */
#define SET_SKIP_GROUP 3 /* Skip this set and rest of group */
#define SET_ABANDON 4 /* Abandon installation */
#define SET_CONTINUE 5 /* Continue (copy from floppy loop) */
/* run_prog flags */
#define RUN_DISPLAY 0x0001 /* Display program output */
#define RUN_FATAL 0x0002 /* errors are fatal */
@ -76,39 +84,64 @@ deconst(const void *p)
#define RUN_ERROR_OK 0x0040 /* Don't wait for error confirmation */
#define RUN_PROGRESS 0x0080 /* Output is just progess test */
#define RUN_NO_CLEAR 0x0100 /* Leave program output after error */
#define RUN_XFER_DIR 0x0200 /* cd to xfer_dir in child */
/* Installation sets */
#define SET_KERNEL 0x000000ffu /* allow 8 kernels */
#define SET_KERNEL_1 0x00000001u /* Usually GENERIC */
#define SET_KERNEL_2 0x00000002u /* MD kernel... */
#define SET_KERNEL_3 0x00000004u /* MD kernel... */
#define SET_KERNEL_4 0x00000008u /* MD kernel... */
#define SET_KERNEL_5 0x00000010u /* MD kernel... */
#define SET_KERNEL_6 0x00000020u /* MD kernel... */
#define SET_KERNEL_7 0x00000040u /* MD kernel... */
#define SET_KERNEL_8 0x00000080u /* MD kernel... */
enum {
SET_NONE,
SET_KERNEL_FIRST,
SET_KERNEL_1, /* Usually GENERIC */
SET_KERNEL_2, /* MD kernel... */
SET_KERNEL_3, /* MD kernel... */
SET_KERNEL_4, /* MD kernel... */
SET_KERNEL_5, /* MD kernel... */
SET_KERNEL_6, /* MD kernel... */
SET_KERNEL_7, /* MD kernel... */
SET_KERNEL_8, /* MD kernel... */
SET_KERNEL_LAST, /* allow 8 kernels */
#define SET_SYSTEM 0x000fff00u /* all system sets */
#define SET_BASE 0x00000100u /* base */
#define SET_ETC 0x00000200u /* /etc */
#define SET_COMPILER 0x00000400u /* compiler tools */
#define SET_GAMES 0x00000800u /* text games */
#define SET_MAN_PAGES 0x00001000u /* online manual pages */
#define SET_MISC 0x00002000u /* miscellaneuous */
#define SET_TEXT_TOOLS 0x00004000u /* text processing tools */
/* System sets */
SET_BASE, /* base */
SET_ETC, /* /etc */
SET_COMPILER, /* compiler tools */
SET_GAMES, /* text games */
SET_MAN_PAGES, /* online manual pages */
SET_MISC, /* miscellaneuous */
SET_TEXT_TOOLS, /* text processing tools */
#define SET_X11 0x0ff00000u /* All X11 sets */
#define SET_X11_BASE 0x00100000u /* X11 base and clients */
#define SET_X11_FONTS 0x00200000u /* X11 fonts */
#define SET_X11_SERVERS 0x00400000u /* X11 servers */
#define SET_X11_PROG 0x00800000u /* X11 programming */
#define SET_X11_ETC 0x01000000u /* X11 config */
/* X11 sets */
SET_X11_FIRST,
SET_X11_BASE, /* X11 base and clients */
SET_X11_FONTS, /* X11 fonts */
SET_X11_SERVERS, /* X11 servers */
SET_X11_PROG, /* X11 programming */
SET_X11_ETC, /* X11 config */
SET_X11_LAST,
#define SET_MD 0xf0000000u /* All machine dependant sets */
#define SET_MD_1 0x10000000u /* Machine dependant set */
#define SET_MD_2 0x20000000u /* Machine dependant set */
#define SET_MD_3 0x40000000u /* Machine dependant set */
#define SET_MD_4 0x80000000u /* Machine dependant set */
/* Machine dependant sets */
SET_MD_1, /* Machine dependant set */
SET_MD_2, /* Machine dependant set */
SET_MD_3, /* Machine dependant set */
SET_MD_4, /* Machine dependant set */
SET_LAST,
SET_GROUP, /* Start of submenu */
SET_GROUP_END, /* End of submenu */
};
/* Initialisers to select sets */
/* All kernels */
#define SET_KERNEL SET_KERNEL_1, SET_KERNEL_2, SET_KERNEL_3, SET_KERNEL_4, \
SET_KERNEL_5, SET_KERNEL_6, SET_KERNEL_7, SET_KERNEL_8
/* All system sets */
#define SET_SYSTEM SET_BASE, SET_ETC, SET_COMPILER, SET_GAMES, \
SET_MAN_PAGES, SET_MISC, SET_TEXT_TOOLS
/* All X11 sets */
#define SET_X11_NOSERVERS SET_X11_BASE, SET_X11_FONTS, SET_X11_PROG, SET_X11_ETC
#define SET_X11 SET_X11_NOSERVERS, SET_X11_SERVERS
/* All machine dependant sets */
#define SET_MD SET_MD_1, SET_MD_2, SET_MD_3, SET_MD_4
/* Macros */
#define nelem(x) (sizeof (x) / sizeof *(x))
@ -209,8 +242,8 @@ char bsddiskname[DISKNAME_SIZE];
const char *doessf;
/* Relative file name for storing a distribution. */
char dist_dir[STRSIZE];
int clean_dist_dir;
char xfer_dir[STRSIZE];
int clean_xfer_dir;
/* Absolute path name where the distribution should be extracted from. */
#if !defined(SYSINST_FTP_HOST)
@ -227,12 +260,16 @@ char ext_dir[STRSIZE];
/* Place we look in all fs types */
char set_dir[STRSIZE];
char ftp_host[STRSIZE];
char ftp_dir[STRSIZE] ;
char ftp_user[SSTRSIZE];
char ftp_pass[STRSIZE];
char ftp_proxy[STRSIZE];
struct {
char host[STRSIZE];
char dir[STRSIZE] ;
char user[SSTRSIZE];
char pass[STRSIZE];
char proxy[STRSIZE];
const char *xfer_type; /* "ftp" or "http" */
} ftp;
int (*fetch_fn)(const char *);
char nfs_host[STRSIZE];
char nfs_dir[STRSIZE];
@ -243,18 +280,11 @@ char localfs_fs[SSTRSIZE];
char localfs_dir[STRSIZE];
char targetroot_mnt[SSTRSIZE];
char distfs_mnt[SSTRSIZE];
int mnt2_mounted;
char dist_postfix[SSTRSIZE];
/* selescted sets */
extern distinfo dist_list[];
extern unsigned int sets_valid;
extern unsigned int sets_selected;
extern unsigned int sets_installed;
/* needed prototypes */
void set_menu_numopts(int, int);
@ -337,7 +367,6 @@ void restore_etc(void);
int dir_exists_p(const char *);
int file_exists_p(const char *);
int file_mode_match(const char *, unsigned int);
int distribution_sets_exist_p(const char *);
uint get_ramsize(void);
void ask_sizemult(int);
void run_makedev(void);
@ -345,9 +374,12 @@ int get_via_floppy(void);
int get_via_cdrom(void);
int get_via_localfs(void);
int get_via_localdir(void);
void cd_dist_dir(const char *);
void get_xfer_dir(const char *);
void show_cur_distsets(void);
void make_ramdisk_dir(const char *);
void set_kernel_set(unsigned int);
unsigned int get_kernel_set(void);
unsigned int set_X11_selected(void);
int get_and_unpack_sets(int, msg, msg, msg);
int sanity_check(void);
int set_timezone(void);

View File

@ -1,4 +1,4 @@
/* $NetBSD: disks.c,v 1.91 2006/01/09 10:00:34 tsutsui Exp $ */
/* $NetBSD: disks.c,v 1.92 2006/01/12 22:02:44 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -79,7 +79,6 @@ static int foundffs(struct data *, size_t);
#ifdef USE_SYSVBFS
static int foundsysvbfs(struct data *, size_t);
#endif
static int mount_root(void);
static int fsck_preen(const char *, int, const char *);
static void fixsb(const char *, const char *, char);
@ -106,7 +105,7 @@ get_disks(struct disk_desc *dd)
strlcpy(dd->dd_name, *xd, sizeof dd->dd_name - 2);
cp = strchr(dd->dd_name, ':');
if (cp != NULL)
dd->dd_no_mbr = ~strcmp(cp, ":no_mbr");
dd->dd_no_mbr = !strcmp(cp, ":no_mbr");
else {
dd->dd_no_mbr = 0;
cp = strchr(dd->dd_name, 0);
@ -191,6 +190,9 @@ find_disks(const char *doingwhat)
disk = disks + selected_disk;
strlcpy(diskdev, disk->dd_name, sizeof diskdev);
/* Use as a default disk if the user has the sets on a local disk */
strlcpy(localfs_dev, disk->dd_name, sizeof localfs_dev);
sectorsize = disk->dd_secsize;
dlcyl = disk->dd_cyl;
dlhead = disk->dd_head;
@ -636,7 +638,7 @@ fixsb(const char *prog, const char *disk, char ptn)
/*
* fsck and mount the root partition.
*/
int
static int
mount_root(void)
{
int error;
@ -677,7 +679,10 @@ mount_disks(void)
static size_t numfstabbuf = sizeof(fstabbuf) / sizeof(struct lookfor);
/* First the root device. */
if (!target_already_root()) {
if (target_already_root())
/* avoid needing to call target_already_root() again */
targetroot_mnt[0] = 0;
else {
error = mount_root();
if (error != 0 && error != EBUSY)
return 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.48 2004/11/11 20:17:48 dsl Exp $ */
/* $NetBSD: main.c,v 1.49 2006/01/12 22:02:44 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -55,7 +55,6 @@
#include "txtwalk.h"
int main(int, char **);
static void init(void);
static void select_language(void);
static void usage(void);
static void miscsighandler(int);
@ -73,36 +72,53 @@ FILE *script; /* script file */
extern int log_flip(void);
#endif
/* String defaults and stuff for processing the -f file argument. */
struct f_arg {
const char *name;
const char *dflt;
char *var;
int size;
};
static const struct f_arg fflagopts[] = {
{"release", REL, rel, sizeof rel},
{"machine", MACH, machine, sizeof machine},
{"xfer dir", "/usr/INSTALL", xfer_dir, sizeof xfer_dir},
{"ext dir", "", ext_dir, sizeof ext_dir},
{"ftp host", SYSINST_FTP_HOST, ftp.host, sizeof ftp.host},
{"ftp dir", SYSINST_FTP_DIR, ftp.dir, sizeof ftp.dir},
{"ftp prefix", "/" MACH "/binary/sets", set_dir, sizeof set_dir},
{"ftp user", "ftp", ftp.user, sizeof ftp.user},
{"ftp pass", "", ftp.pass, sizeof ftp.pass},
{"ftp proxy", "", ftp.proxy, sizeof ftp.proxy},
{"nfs host", "", nfs_host, sizeof nfs_host},
{"nfs dir", "/bsd/release", nfs_dir, sizeof nfs_dir},
{"cd dev", "cd0a", cdrom_dev, sizeof cdrom_dev},
{"local dev", "", localfs_dev, sizeof localfs_dev},
{"local fs", "ffs", localfs_fs, sizeof localfs_fs},
{"local dir", "release", localfs_dir, sizeof localfs_dir},
{"targetroot mount", "/targetroot", targetroot_mnt, sizeof targetroot_mnt},
{"dist postfix", ".tgz", dist_postfix, sizeof dist_postfix},
{"diskname", "mydisk", bsddiskname, sizeof bsddiskname},
{NULL}
};
static void
init(void)
{
(void)strlcpy(rel, REL, SSTRSIZE);
(void)strlcpy(machine, MACH, SSTRSIZE);
const struct f_arg *arg;
sizemult = 1;
(void)strlcpy(diskdev, "", SSTRSIZE);
disktype = "unknown";
tmp_mfs_size = 0;
(void)strlcpy(bsddiskname, "mydisk", DISKNAME_SIZE);
doessf = "";
(void)strlcpy(dist_dir, "/usr/INSTALL", STRSIZE);
clean_dist_dir = 0;
(void)strlcpy(ext_dir, "", STRSIZE);
(void)strlcpy(set_dir, "/" MACH "/binary/sets", STRSIZE);
(void)strlcpy(ftp_host, SYSINST_FTP_HOST, STRSIZE);
(void)strlcpy(ftp_dir, SYSINST_FTP_DIR, STRSIZE);
(void)strlcpy(ftp_user, "ftp", SSTRSIZE);
(void)strlcpy(ftp_pass, "", STRSIZE);
(void)strlcpy(ftp_proxy, "", STRSIZE);
(void)strlcpy(nfs_host, "", STRSIZE);
(void)strlcpy(nfs_dir, "/bsd/release", STRSIZE);
(void)strlcpy(cdrom_dev, "cd0a", SSTRSIZE);
(void)strlcpy(localfs_dev, "sd0a", SSTRSIZE);
(void)strlcpy(localfs_fs, "ffs", SSTRSIZE);
(void)strlcpy(localfs_dir, "release", STRSIZE);
(void)strlcpy(targetroot_mnt, "/targetroot", SSTRSIZE);
(void)strlcpy(distfs_mnt, "/mnt2", SSTRSIZE);
clean_xfer_dir = 0;
mnt2_mounted = 0;
(void)strlcpy(dist_postfix, ".tgz", SSTRSIZE);
for (arg = fflagopts; arg->name != NULL; arg++)
strlcpy(arg->var, arg->dflt, arg->size);
}
int
@ -133,7 +149,7 @@ main(int argc, char **argv)
break;
case 'r':
/* Release name other than compiled in release. */
strncpy(rel, optarg, SSTRSIZE);
strncpy(rel, optarg, sizeof rel);
break;
case 'f':
/* Definition file to read. */
@ -153,8 +169,8 @@ main(int argc, char **argv)
}
/*
* XXX the following is bogus. if screen is too small, message
* XXX window will be overwritten by menus.
* Put 'messages' in a window that has a one-character border
* on the real screen.
*/
win = newwin(getmaxy(stdscr) - 2, getmaxx(stdscr) - 2, 1, 1);
if (win == NULL) {
@ -396,104 +412,43 @@ cleanup(void)
}
/* Stuff for processing the -f file argument. */
/* Data definitions ... */
static char *rel_ptr = rel;
static char *machine_ptr = machine;
static char *dist_dir_ptr = dist_dir;
static char *ext_dir_ptr = ext_dir;
static char *ftp_host_ptr = ftp_host;
static char *ftp_dir_ptr = ftp_dir;
static char *set_dir_ptr = set_dir;
static char *ftp_user_ptr = ftp_user;
static char *ftp_pass_ptr = ftp_pass;
static char *ftp_proxy_ptr = ftp_proxy;
static char *nfs_host_ptr = nfs_host;
static char *nfs_dir_ptr = nfs_dir;
static char *cdrom_dev_ptr = cdrom_dev;
static char *localfs_dev_ptr = localfs_dev;
static char *localfs_fs_ptr = localfs_fs;
static char *localfs_dir_ptr = localfs_dir;
static char *targetroot_mnt_ptr = targetroot_mnt;
static char *distfs_mnt_ptr = distfs_mnt;
static char *dist_postfix_ptr = dist_postfix;
struct lookfor fflagopts[] = {
{"release", "release = %s", "a $0", &rel_ptr, 1, SSTRSIZE, NULL},
{"machine", "machine = %s", "a $0", &machine_ptr, 1, SSTRSIZE, NULL},
{"dist dir", "dist dir = %s", "a $0", &dist_dir_ptr, 1, STRSIZE, NULL},
{"ext dir", "ext dir = %s", "a $0", &ext_dir_ptr, 1, STRSIZE, NULL},
{"ftp host", "ftp host = %s", "a $0", &ftp_host_ptr, 1, STRSIZE, NULL},
{"ftp dir", "ftp dir = %s", "a $0", &ftp_dir_ptr, 1, STRSIZE, NULL},
{"ftp prefix", "set dir = %s", "a $0", &set_dir_ptr, 1, STRSIZE, NULL},
{"ftp user", "ftp user = %s", "a $0", &ftp_user_ptr, 1, STRSIZE, NULL},
{"ftp pass", "ftp pass = %s", "a $0", &ftp_pass_ptr, 1, STRSIZE, NULL},
{"ftp proxy", "ftp proxy = %s", "a $0", &ftp_proxy_ptr, 1, STRSIZE,
NULL},
{"nfs host", "nfs host = %s", "a $0", &nfs_host_ptr, 1, STRSIZE, NULL},
{"nfs dir", "ftp dir = %s", "a $0", &nfs_dir_ptr, 1, STRSIZE, NULL},
{"cd dev", "cd dev = %s", "a $0", &cdrom_dev_ptr, 1, STRSIZE, NULL},
{"local dev", "local dev = %s", "a $0", &localfs_dev_ptr, 1, STRSIZE,
NULL},
{"local fs", "local fs = %s", "a $0", &localfs_fs_ptr, 1, STRSIZE,
NULL},
{"local dir", "local dir = %s", "a $0", &localfs_dir_ptr, 1, STRSIZE,
NULL},
{"targetroot mount", "targetroot mount = %s", "a $0",
&targetroot_mnt_ptr, 1, STRSIZE, NULL},
{"distfs mount", "distfs mount = %s", "a $0", &distfs_mnt_ptr, 1,
STRSIZE, NULL},
{"dist postfix", "dist postfix = %s", "a $0", &dist_postfix_ptr, 1,
STRSIZE, NULL},
};
/* process function ... */
void
process_f_flag(char *f_name)
{
char *buffer;
int fd;
int fsize;
char buffer[STRSIZE];
int len;
const struct f_arg *arg;
FILE *fp;
char *cp, *cp1;
/* open the file */
fd = open(f_name, O_RDONLY, 0);
if (fd < 0) {
fp = fopen(f_name, "r");
if (fp == NULL) {
fprintf(stderr, msg_string(MSG_config_open_error), f_name);
exit(1);
}
/* get file size */
fsize = lseek(fd, 0, SEEK_END);
lseek(fd, 0, SEEK_SET);
if (fsize == -1) {
fprintf(stderr, msg_string(MSG_not_regular_file), f_name);
exit(1);
while (fgets(buffer, sizeof buffer, fp) != NULL) {
cp = buffer + strspn(buffer, " \t");
if (strchr("#\r\n", *cp) != NULL)
continue;
for (arg = fflagopts; arg->name != NULL; arg++) {
len = strlen(arg->name);
if (memcmp(cp, arg->name, len) != 0)
continue;
cp1 = cp + len;
cp1 += strspn(cp1, " \t");
if (*cp1++ != '=')
continue;
cp1 += strspn(cp1, " \t");
len = strcspn(cp1, " \n\r\t");
cp1[len] = 0;
strlcpy(arg->var, cp1, arg->size);
break;
}
}
/* allocate buffer (error reported) */
buffer = malloc(fsize + 1);
if (buffer == NULL) {
fprintf(stderr, msg_string(MSG_out_of_memory));
exit(1);
}
/* read the file */
if (read(fd,buffer, fsize) != fsize) {
fprintf(stderr, msg_string(MSG_config_read_error), f_name);
exit(1);
}
buffer[fsize] = 0;
/* close the file */
close(fd);
/* Walk the buffer */
walk(buffer, fsize, fflagopts,
sizeof(fflagopts)/sizeof(struct lookfor));
/* free the buffer */
free(buffer);
fclose(fp);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: menus.mi,v 1.22 2005/08/27 16:34:15 xtraeme Exp $ */
/* $NetBSD: menus.mi,v 1.23 2006/01/12 22:02:44 dsl Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -210,7 +210,7 @@ menu sizechoice, sub menu, y=0, title MSG_Choose_your_size_specifier;
multname = msg_string(MSG_secname);
};
menu distmedium, title MSG_Select_medium;
menu distmedium, title MSG_Select_medium, y=-1;
display action { umount_mnt2(); msg_display(MSG_distmedium); };
option MSG_cdrom, exit, action { *(int *)arg = get_via_cdrom(); };
option MSG_ftp, exit, action { *(int *)arg = get_via_ftp("ftp"); };
@ -219,7 +219,9 @@ menu distmedium, title MSG_Select_medium;
option MSG_floppy, exit, action { *(int *)arg = get_via_floppy(); };
option MSG_local_fs, exit, action { *(int *)arg = get_via_localfs(); };
option MSG_local_dir, exit, action { *(int *)arg = get_via_localdir();};
option MSG_none, exit, action { *(int *)arg = -2; };
option MSG_Skip_set, exit, action { *(int *)arg = SET_SKIP; };
option MSG_Skip_group,exit, action { *(int *)arg = SET_SKIP_GROUP; };
option MSG_Abandon, exit, action { *(int *)arg = SET_ABANDON; };
menu distset, title MSG_Select_your_distribution;
display action { msg_display (MSG_distset); };
@ -229,45 +231,48 @@ menu distset, title MSG_Select_your_distribution;
menu ftpsource, title MSG_Change;
display action {
msg_clear();
msg_table_add(MSG_ftpsource, arg, ftp_host, ftp_dir, set_dir,
ftp_user, strcmp(ftp_user, "ftp") == 0 || ftp_pass[0] == 0
? ftp_pass : msg_string(MSG_hidden),
ftp_proxy);
msg_table_add(MSG_ftpsource, arg, ftp.host, ftp.dir, set_dir,
ftp.user, strcmp(ftp.user, "ftp") == 0 || ftp.pass[0] == 0
? ftp.pass : msg_string(MSG_hidden),
ftp.proxy, xfer_dir);
};
option MSG_Host, action
{ msg_prompt_win(MSG_Host, -1, 12, 0, 0,
ftp_host, ftp_host, sizeof ftp_host); };
ftp.host, ftp.host, sizeof ftp.host); };
option MSG_Base_dir, action
{ msg_prompt_win(MSG_Base_dir, -1, 12, 0, 0,
ftp_dir, ftp_dir, sizeof ftp_dir); };
ftp.dir, ftp.dir, sizeof ftp.dir); };
option MSG_Set_dir, action
{ msg_prompt_win(MSG_Set_dir, -1, 12, 0, 0,
set_dir, set_dir, sizeof set_dir); };
option MSG_User, action
{ msg_prompt_win(MSG_User, -1, 12, 0, 0,
ftp_user, ftp_user, sizeof ftp_user);
ftp_pass[0] = 0;
ftp.user, ftp.user, sizeof ftp.user);
ftp.pass[0] = 0;
};
option MSG_Password, action
{ if (strcmp(ftp_user, "ftp") == 0)
{ if (strcmp(ftp.user, "ftp") == 0)
msg_prompt_win(MSG_email, -1, 12, 0, 0,
ftp_pass, ftp_pass, sizeof ftp_pass);
ftp.pass, ftp.pass, sizeof ftp.pass);
else {
msg_prompt_noecho(MSG_Password, "",
ftp_pass, sizeof ftp_pass);
ftp.pass, sizeof ftp.pass);
}
};
option MSG_Proxy, action
{ msg_prompt_win(MSG_Proxy, -1, 12, 0, 0,
ftp_proxy, ftp_proxy, sizeof ftp_proxy);
if (strcmp(ftp_proxy, "") == 0) {
ftp.proxy, ftp.proxy, sizeof ftp.proxy);
if (strcmp(ftp.proxy, "") == 0) {
unsetenv("ftp_proxy");
unsetenv("http_proxy");
} else {
setenv("ftp_proxy", ftp_proxy, 1);
setenv("http_proxy", ftp_proxy, 1);
setenv("ftp_proxy", ftp.proxy, 1);
setenv("http_proxy", ftp.proxy, 1);
}
};
option MSG_Xfer_dir, action
{ msg_prompt_win(MSG_Xfer_dir, -1, 12, 0, 0,
xfer_dir, xfer_dir, sizeof xfer_dir); };
option MSG_Get_Distribution, exit;
menu nfssource, title MSG_Change;
@ -284,24 +289,15 @@ menu nfssource, title MSG_Change;
set_dir, set_dir, sizeof set_dir); };
option MSG_Continue, exit;
menu nfsbadmount, title MSG_What_do_you_want_to_do;
option MSG_Try_again, exit, sub menu nfssource, action
{ yesno = 1; ignorerror = 0; };
option MSG_Give_up, exit, action
{ yesno = 0; ignorerror = 0; };
option MSG_Ignore_continue_anyway, exit, action
{ yesno = 1; ignorerror = 1; };
menu fdremount, title MSG_What_do_you_want_to_do;
option MSG_Try_again, exit, action { yesno = 1; };
option MSG_Set_finished, exit, action { yesno = 2; };
option MSG_Abort_install, exit, action { yesno = 0; };
option MSG_Try_again, exit, action { *(int *)arg = SET_CONTINUE; };
option MSG_Set_finished, exit, action { *(int *)arg = SET_OK; };
option MSG_Abort_install, exit, action { *(int *)arg = SET_RETRY; };
menu fdok, title MSG_Hit_enter_to_continue;
option MSG_OK, exit, action { yesno = 1; };
option MSG_Set_finished, exit, action { yesno = 2; };
option MSG_Abort_install, exit, action { yesno = 0; };
menu fdok, title MSG_What_do_you_want_to_do;
option MSG_OK, exit, action { *(int *)arg = SET_CONTINUE; };
option MSG_Set_finished, exit, action { *(int *)arg = SET_OK; };
option MSG_Abort_install, exit, action { *(int *)arg = SET_RETRY; };
menu crypttype, title MSG_Password_cipher, y=16;
option MSG_DES, exit, action { yesno = 1; };
@ -320,15 +316,6 @@ menu cdromsource, title MSG_Change;
set_dir, set_dir, sizeof set_dir); };
option MSG_Continue, exit;
menu cdrombadmount, title MSG_What_do_you_want_to_do;
display action
{ msg_display(MSG_cdrombadmount, cdrom_dev); };
option MSG_Try_again, exit, action
{ yesno = 1; };
option MSG_Give_up, exit, action
{ yesno = 0; };
menu localfssource, title MSG_Change;
display action
{ msg_display(MSG_localfssource, localfs_dev, localfs_fs,
@ -347,14 +334,6 @@ menu localfssource, title MSG_Change;
set_dir, set_dir, sizeof set_dir); };
option MSG_Continue, exit;
menu localfsbadmount, title MSG_What_do_you_want_to_do;
option MSG_Try_again, exit, sub menu localfssource, action
{ yesno = 1; ignorerror = 0; };
option MSG_Give_up, exit, action
{ yesno = 0; ignorerror = 0; };
option MSG_Ignore_continue_anyway, exit, action
{ yesno = 1; ignorerror = 1; };
menu localdirsource, title MSG_Change;
display action
{ msg_display(MSG_localdir, localfs_dir, set_dir); };

View File

@ -1,4 +1,4 @@
/* $NetBSD: msg.mi.de,v 1.24 2005/09/09 23:20:33 dsl Exp $ */
/* $NetBSD: msg.mi.de,v 1.25 2006/01/12 22:02:44 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -471,12 +471,8 @@ message distmedium
{Ihre Festplatte ist nun bereit für die Installation der Kernel- und
Distributionspakete. Wie im INSTALL Dokument beschrieben, haben Sie nun
mehrere Optionen.
Für FTP oder NFS müssen Sie mit einem Netzwerk verbunden sein und Zugriff auf
die entsprechenden Server haben. Wenn Sie zu diesem Zeitpunkt noch nicht
bereit sind diese Installation zu vollenden, können Sie 'kein' auswählen,
wodurch Sie zum Hauptmenü zurückkehren. Sie können dann zu einem späteren
Zeitpunkt die Installation erneut starten und im Hauptmenü "Aktualisierung"
wählen.
Für FTP oder NFS müssen Sie mit einem Netzwerk verbunden sein und
Zugriff auf die entsprechenden Server haben.
}
message distset
@ -493,13 +489,14 @@ message ftpsource
Dies sind die Daten zum Aufbau einer %s Verbindung.
Falls der Benutzer "ftp" ist, benötigen Sie kein Passwort.
Server: %s
Basispfad: %s
Verzeichnis: %s
Benutzer: %s
Passwort: %s
Proxy: %s
}
Server: %s
Basispfad: %s
Verzeichnis: %s
Benutzer: %s
Passwort: %s
Proxy: %s
Zwischenspeicher %s
} /* fix XLAT */
message email
{E-Mail Adresse}
@ -517,9 +514,6 @@ Basispfad: %s
Verzeichnis: %s
}
message nfsbadmount
{Das Verzeichnis %s:%s konnte nicht gemountet werden.}
message cdromsource
{Geben Sie das CD-Laufwerk und das entsprechende Verzeichnis
an, in dem die Distribution zu finden ist.
@ -552,12 +546,6 @@ Verzeichnis: %s
message filesys
{Dateisystem}
message cdrombadmount
{Die CD in %s konnte nicht gemountet werden.}
message localfsbadmount
{%s konnte auf dem Laufwerk %s nicht gemountet werden.}
message badlocalsetdir
{%s ist kein Verzeichnis.}
@ -598,7 +586,7 @@ message net_host
message net_ip
{IPv4 Adresse}
message net_ip_2nd
message net_srv_ip
{IPv4 Adressse des Servers}
message net_mask
@ -679,10 +667,10 @@ message ftperror
{"ftp" konnte eine Datei nicht herunterladen.
Wollen Sie es erneut versuchen?}
message distdir
message xferdir
{Welches Verzeichnis möchten Sie für %s nutzen?}
message delete_dist_files
message delete_xfer_files
{Wollen Sie die NetBSD Pakete von %s löschen?
(Sie können diese auch dazu beibehalten ein weiteres System zu installieren
oder zu erneuern.)}
@ -807,10 +795,10 @@ message fddev
{Welches Diskettenlaufwerk wollen Sie nutzen? }
message fdmount
{Bitte legen Sie die Diskette ein, auf der sich die Datei "%s" befindet. }
{Bitte legen Sie die Diskette ein, auf der sich die Datei "%s.%s" befindet. }
message fdnotfound
{Ich konnte die Datei "%s" nicht finden. Bitte legen Sie die entsprechende
{Ich konnte die Datei "%s.%s" nicht finden. Bitte legen Sie die entsprechende
Diskette ein.
Wenn dies die letzte Diskette des Paketes war, wählen Sie "Paket fertig",
um zum nächsten Paket überzugehen - falls ein weiteres Paket folgt.}
@ -820,7 +808,7 @@ message fdremount
Sie sollten:
Erneut probieren, die Diskette mit der Datei "%s" einzulegen.
Erneut probieren, die Diskette mit der Datei "%s.%s" einzulegen.
Keine weiteren Disketten für dieses Paket laden, und stattdessen mit dem
nächsten Paket fortfahren - falls ein weiteres existiert.
@ -879,17 +867,11 @@ message set_X11_fonts
message set_X11_servers
{X11 Server}
message set_X_contrib
{X zusätzliche Clientsoftware}
message set_X11_prog
{X11 Programmierung}
message set_X11_misc
{X11 Diverses}
message cur_distsets_row
{%-27s %3s\n}
{%-27s %3s}
message select_all
{Alle oben angezeigten Pakete auswählen}
@ -1058,6 +1040,7 @@ message hidden {** versteckt **}
message Host {Host}
message Base_dir {Basispfad}
message Set_dir {Verzeichnis}
message Xfer_dir {Zwischenspeicher}
message Directory {Verzeichnis}
message User {Benutzer}
message Password {Passwort}
@ -1069,6 +1052,9 @@ message Try_again {Versuchen Sie es erneut}
message Give_up {Aufgeben}
message Ignore_continue_anyway {Ignorieren und dennoch fortsetzen}
message Set_finished {Paket fertig}
message Skip_set {Paket skip} /* XXX */
message Skip_group {Paket skip group} /* XXX */
message Abandon {Abandon installation} /* XXX */
message Abort_install {Installation abbrechen}
message Password_cipher {Passwort Verschlüsselungsverfahren}
message DES {DES}

View File

@ -1,4 +1,4 @@
/* $NetBSD: msg.mi.en,v 1.138 2005/09/09 23:20:33 dsl Exp $ */
/* $NetBSD: msg.mi.en,v 1.139 2006/01/12 22:02:44 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -456,10 +456,7 @@ message distmedium
{Your disk is now ready for installing the kernel and the distribution
sets. As noted in your INSTALL notes, you have several options. For
ftp or nfs, you must be connected to a network with access to the proper
machines. If you are not ready to complete the installation at this time,
you may select "none" and you will be returned to the main menu. When
you are ready at a later time, you may select "upgrade" from the main
menu to complete the installation.
machines.
}
message distset
@ -474,12 +471,13 @@ message ftpsource
{The following are the %s site, directory, user, and password that
will be used. If "user" is "ftp", then the password is not needed.
host: %s
base directory: %s
set directory: %s
user: %s
password: %s
proxy: %s
host: %s
base directory: %s
set directory: %s
user: %s
password: %s
proxy: %s
transfer directory: %s
}
message email
@ -498,9 +496,6 @@ base directory: %s
set directory: %s
}
message nfsbadmount
{The directory %s:%s could not be nfs mounted.}
message cdromsource
{Enter the CDROM device to be used and directory on the CDROM where
the distribution is located.
@ -532,12 +527,6 @@ set directory: %s
message filesys
{file system}
message cdrombadmount
{The CDROM /dev/%s could not be mounted.}
message localfsbadmount
{%s could not be mounted on local device %s.}
message badlocalsetdir
{%s is not a directory}
@ -577,7 +566,7 @@ message net_host
message net_ip
{Your IPv4 number}
message net_ip_2nd
message net_srv_ip
{Server IPv4 number}
message net_mask
@ -653,10 +642,10 @@ message ftperror
{Ftp could not retrieve a file.
Do you want to try again?}
message distdir
message xferdir
{What directory shall I use for %s? }
message delete_dist_files
message delete_xfer_files
{Do you want to delete the NetBSD sets from %s?
(You can keep them to install/upgrade a second system.)}
@ -772,10 +761,10 @@ message fddev
{What floppy device do you want to use? }
message fdmount
{Please load the floppy containing the file named "%s". }
{Please load the floppy containing the file named "%s.%s". }
message fdnotfound
{Could not find the file named "%s" on the disk. Please load the
{Could not find the file named "%s.%s" on the disk. Please load the
floppy with that file on it.
If this was the last set's disk, hit "Set finished" to continue on
@ -784,7 +773,7 @@ the next set, if any.}
message fdremount
{The floppy was not mounted successfully. You may:
Try again and put in the floppy containing the file named "%s".
Try again and put in the floppy containing the file named "%s.%s".
Not load any more files from this set and continue on the next one, if any.
@ -841,17 +830,11 @@ message set_X11_fonts
message set_X11_servers
{X11 servers}
message set_X_contrib
{X contrib clients}
message set_X11_prog
{X11 programming}
message set_X11_misc
{X11 Misc.}
message cur_distsets_row
{%-27s %3s\n}
{%-27s %3s}
message select_all
{Select all the above sets}
@ -1020,6 +1003,7 @@ message hidden {** hidden **}
message Host {Host}
message Base_dir {Base directory}
message Set_dir {Set directory}
message Xfer_dir {Transfer directory}
message Directory {Directory}
message User {User}
message Password {Password}
@ -1031,6 +1015,9 @@ message Try_again {Try again}
message Give_up {Give up}
message Ignore_continue_anyway {Ignore, continue anyway}
message Set_finished {Set finished}
message Skip_set {Skip set}
message Skip_group {Skip set group}
message Abandon {Abandon installation}
message Abort_install {Abort install}
message Password_cipher {Password cipher}
message DES {DES}

View File

@ -1,4 +1,4 @@
/* $NetBSD: msg.mi.es,v 1.8 2005/12/13 14:23:06 xtraeme Exp $ */
/* $NetBSD: msg.mi.es,v 1.9 2006/01/12 22:02:44 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -465,10 +465,7 @@ message distmedium
{Su disco está ahora preparado para la instalación el nucleo y los conjuntos
de la distribución. Como se apunta en las notas INSTALL, tiene diversas
opciones. Para ftp o nfs, tiene que estar conectado a una red con acceso
a las maquinas apropiadas. Si no está preparado para completar la
instalación en este momento, puede seleccionar «ninguno» y será retornado
al menú principal. Cuando más adelante esté preparado, deberá seleccionar
«actualizar» desde el menú principal para completar la instalación.
a las maquinas apropiadas.
}
message distset
@ -489,6 +486,7 @@ dir. de conjuntos: %s
usuario: %s
contraseña: %s
proxy: %s
dir de xfer: %s
}
message email
@ -507,9 +505,6 @@ directorio base: %s
dir de conjuntos: %s
}
message nfsbadmount
{El directorio %s:%s no pudo ser montado por nfs.}
message cdromsource
{Introduzca el dispositivo de CDROM a usar y el directorio del CDROM
donde se encuentre la distribución.
@ -541,12 +536,6 @@ dir de conjuntos: %s
message filesys
{sistema de ficheros}
message cdrombadmount
{No se ha podido montar el CDROM /dev/%s.}
message localfsbadmount
{No se ha podido montar %s en el dispositivo local %s.}
message badlocalsetdir
{%s no es un directorio}
@ -588,7 +577,7 @@ message net_host
message net_ip
{Su número IPv4}
message net_ip_2nd
message net_srv_ip
{Número servidor IPv4}
message net_mask
@ -665,10 +654,10 @@ message ftperror
{Ftp no ha podido descargar un fichero.
¿Desea intentarlo de nuevo?}
message distdir
message xferdir
{¿Qué directorio debería usar para %s? }
message delete_dist_files
message delete_xfer_files
{¿Quiere borrar los conjuntos de NetBSD de %s?
(Puede dejarlos para instalar/actualizar un segundo sistema.)}
@ -793,10 +782,10 @@ message fddev
{¿Qué dispositivo de disquete quiere usar? }
message fdmount
{Por favor, inserte el disquete que contiene el fichero «%s». }
{Por favor, inserte el disquete que contiene el fichero «%s.%s». }
message fdnotfound
{No se ha encontrado el fichero «%s» en el disco. Por favor, inserte
{No se ha encontrado el fichero «%s.%s» en el disco. Por favor, inserte
el disquete que lo contenga.
Si éste era el último disco del conjunto, pulse «Conjunto acabado» para
@ -805,7 +794,7 @@ continuar con el siguiente conjunto, si lo hay.}
message fdremount
{El disquete no ha sido montado correctamente. Puede:
Intentarlo de nuevo e insertar el disquete que contenga el fichero «%s».
Intentarlo de nuevo e insertar el disquete que contenga el fichero «%s.%s».
No cargar ningún otro fichero de este conjunto y continuar con el siguiente,
si lo hay.
@ -863,17 +852,11 @@ message set_X11_fonts
message set_X11_servers
{Servidores X11}
message set_X_contrib
{Clientes de X contrib}
message set_X11_prog
{Programación de X11}
message set_X11_misc
{X11 Misc.}
message cur_distsets_row
{%-27s %3s\n}
{%-27s %3s}
message select_all
{Seleccionar todos los conjuntos anteriores}
@ -1046,6 +1029,7 @@ message hidden {** oculto **}
message Host {Máquina}
message Base_dir {Directorio base}
message Set_dir {Directorio de conjuntos}
message Xfer_dir {Directorio a transferir a} /* XXX translation */
message Directory {Directorio}
message User {Usuario}
message Password {Contraseña}
@ -1057,6 +1041,9 @@ message Try_again {Reintentar}
message Give_up {Abandonar}
message Ignore_continue_anyway {Ignorar, continuar de todos modos}
message Set_finished {Conjunto finalizado}
message Skip_set {Skip set} /* XXX translation */
message Skip_group {Skip set group} /* XXX translation */
message Abandon {Abandon installation} /* XXX */
message Abort_install {Interrumpir la instalación}
message Password_cipher {Cifrado de las contraseñas}
message DES {DES}
@ -1087,4 +1074,17 @@ apuntaba a un sistema de ficheros desmontado. Se le ha dado la extension
'.old'. Cuando vuelva a arrancar su sistema actualizado, puede que necesite
preocuparse de fundir el directorio /emul/aout nuevamente creado con el viejo.
}
.endif
.endif
.if xxxx
Si no está preparado para completar la
instalación en este momento, puede seleccionar «ninguno» y será retornado
al menú principal. Cuando más adelante esté preparado, deberá seleccionar
«actualizar» desde el menú principal para completar la instalación.
message cdrombadmount
{No se ha podido montar el CDROM /dev/%s.}
message localfsbadmount
{No se ha podido montar %s en el dispositivo local %s.}
.endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: msg.mi.fr,v 1.87 2005/09/10 21:51:12 dsl Exp $ */
/* $NetBSD: msg.mi.fr,v 1.88 2006/01/12 22:02:44 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -460,9 +460,6 @@ Comme indiqu
plusieurs possibilités.
Pour une installation via nfs ou ftp, vous devez être
connecté au réseau et avoir accès au bon serveur.
Si vous n'êtes pas prêt pour terminer l'installation maintenant,
choisissez "aucun" puis retournerez au menu principal.
Vous pourrez choisir l'option "mise à jour" pour terminer l'installation.
}
message distset
@ -486,7 +483,8 @@ r
utilisateur: %s
mot de passe: %s
proxy: %s
}
répertoire de transfer: %s
} /* fix XLAT */
message email
{adresse e-mail}
@ -506,9 +504,6 @@ r
répertoire des composants: %s
}
message nfsbadmount
{Le répertoire %s:%s n'est pas montable par nfs.}
message cdromsource
{Donnez le nom de périphérique du CD-Rom à utiliser ainsi que
le répertoire qui contient les composants.
@ -543,12 +538,6 @@ R
message filesys
{système de fichiers}
message cdrombadmount
{Le CDROM ne peut pas être monté depuis le device %s.}
message localfsbadmount
{%s ne peut pas être monté depuis le device %s.}
message badlocalsetdir
{%s n'est pas un répertoire}
@ -592,7 +581,7 @@ message net_host
message net_ip
{Votre adresse IPv4}
message net_ip_2nd
message net_srv_ip
{Server IPv4 number}
message net_mask
@ -672,10 +661,10 @@ message ftperror
{Impossible de télécharger un fichier par ftp.
Voulez vous réessayer ?}
message distdir
message xferdir
{Quel répertoire dois je utiliser pour %s ?}
message delete_dist_files
message delete_xfer_files
{Voulez-vous supprimer les fichiers de distribution de NetBSD de %s ?
Vous pouvez les conserver pour installer ou mettre a jour d'autre systèmes.}
@ -803,16 +792,16 @@ message fddev
{Quel lecteur de disquette voulez vous utiliser? }
message fdmount
{Veuillez insérer la disquette contenant le fichier "%s". }
{Veuillez insérer la disquette contenant le fichier "%s.%s". }
message fdnotfound
{Impossible de trouver le fichier "%s" sur la disquette.
{Impossible de trouver le fichier "%s.%s" sur la disquette.
}
message fdremount
{La disquette n'a pas été montée correctement. Vous devez :
Insérer une disquette contenant le fichier %s.
Insérer une disquette contenant le fichier %s.%s.
Ne plus charger d'autre fichiers depuis la disquette et interrompre le
processus
@ -868,17 +857,11 @@ message set_X11_fonts
message set_X11_servers
{X11 serveurs}
message set_X_contrib
{X11 clients contribués}
message set_X11_prog
{X11 développement}
message set_X11_misc
{X11 Misc.}
message cur_distsets_row
{%-33s %3s\n}
{%-33s %3s}
message select_all
{Sélectionner tout les composants}
@ -1044,6 +1027,7 @@ message hidden {** cach
message Host {Serveur ftp}
message Base_dir {Répertoire de base}
message Set_dir {Répertoire des composants}
message Xfer_dir {Répertoire de transfer} /* fix XLAT */
message Directory {Répertoire}
message User {Utilisateur}
message Password {Mot de passe}
@ -1055,6 +1039,9 @@ message Try_again {R
message Give_up {Abandonner}
message Ignore_continue_anyway {Ignorer les erreurs, continuer quand même}
message Set_finished {Extraction terminée}
message Skip_set {Skip set} /* XXX translate */
message Skip_group {Skip set group} /* XXX translate */
message Abandon {Abandon installation} /* XXX */
message Abort_install {Annuler l'installation}
message Password_cipher {Password cipher}
message DES {DES}

View File

@ -1,4 +1,4 @@
/* $NetBSD: msg.mi.pl,v 1.48 2005/09/10 21:51:12 dsl Exp $ */
/* $NetBSD: msg.mi.pl,v 1.49 2006/01/12 22:02:44 dsl Exp $ */
/* Based on english version: */
/* NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp */
@ -446,11 +446,7 @@ zatrzyma sie na trybie jednego-uzytkownika.
message distmedium
{Twoj dysk jest teraz gotowy na zainstalowanie jadra oraz pakietow
dystrybucyjnych. Jak napisano w pliku INSTALL masz terz kilka opcji. Dla
ftp lub nfs, musisz byc podlaczony do sieci z dostepem do odpowidnich
maszyn. Jesli nie jestes gotowy aby zakonczyc instalacje teraz, mozesz
wybrac "none" i zostaniesz przeniesiony do glownego menu. Kiedy bedziesz
juz pozniej gotowy, mozesz wybrac "aktualizuj" z glownego menu, aby
zakonczyc instalacje.
ftp lub nfs, musisz byc podlaczony do sieci z dostepem do odpowidnich maszyn.
}
message distset
@ -464,13 +460,14 @@ message ftpsource
{Ponizej masz site %s, katalog, uzytkownika, oraz haslo gotowe do uzycia.
Jesli "uzytkownik" to "ftp", wtedy haslo nie jest wymagane.
host: %s
katalog: %s
katalog: %s
uzytkownik: %s
haslo: %s
proxy: %s
}
host: %s
katalog: %s
katalog: %s
uzytkownik: %s
haslo: %s
proxy: %s
transfer katalog: %s
} /* fix XLAT */
message email
{adres e-mail}
@ -488,9 +485,6 @@ katalog: %s
katalog: %s
}
message nfsbadmount
{Katalog %s:%s jest niedostepny dla nfs.}
message cdromsource
{Podaj urzadzenie CDROM oraz katalog na CDROMie, w ktorym znajduje sie
dystrybucja.
@ -522,12 +516,6 @@ katalog: %s
message filesys
{system plikow}
message cdrombadmount
{CDROM nie moze zostac zamountowany na %s.}
message localfsbadmount
{%s nie mogl byc zamountowany na lokalnym urzadzeniu %s.}
message badlocalsetdir
{%s nie jest katalogiem}
@ -567,7 +555,7 @@ message net_host
message net_ip
{Twoj adres IPv4}
message net_ip_2nd
message net_srv_ip
{Server IPv4 number}
message net_mask
@ -646,10 +634,10 @@ message ftperror
{Ftp nie moze sciagnac pliku.
Czy chcesz sprobowac jeszcze raz?}
message distdir
message xferdir
{Jakiego katalogu powinienem uzyc dla %s? }
message delete_dist_files
message delete_xfer_files
{Czy chcesz usunac pakiety NetBSD z %s?
(Mozesz je zachowac aby zainstalowac/zaktualizowac kolejny system.)}
@ -763,16 +751,16 @@ message fddev
{Ktorego urzadzenia dyskietek chcesz uzyc ? }
message fdmount
{Wloz dyskietke zawierajaca plik "%s". }
{Wloz dyskietke zawierajaca plik "%s.%s". }
message fdnotfound
{Nie moglem znalezc pliku "%s" na dysku. Wloz dyskietke
{Nie moglem znalezc pliku "%s.%s" na dysku. Wloz dyskietke
zawierajaca ten plik.}
message fdremount
{Dyskietka nie zostala pomyslnie zamountowana. Mozesz:
Sprobowac jeszcze raz i wlozyc dyskietke z plikiem "%s".
Sprobowac jeszcze raz i wlozyc dyskietke z plikiem "%s.%s".
Nie wgrywac wiecej plikow z dyskietek i przerwac proces.
}
@ -827,17 +815,11 @@ message set_X11_fonts
message set_X11_servers
{Serwery X11}
message set_X_contrib
{Klienci dodatkowi X}
message set_X11_prog
{Programowanie X11}
message set_X11_misc
{Inne X11}
message cur_distsets_row
{%-30s %3s\n}
{%-30s %3s}
message select_all
{Wybierz wszystkie powyzsze pakiety}
@ -1002,6 +984,7 @@ message hidden {** ukryte **}
message Host {Host}
message Base_dir {Katalog}
message Set_dir {Katalog}
message Xfer_dir {Transfer Katalog} /* fix XLAT */
message Directory {Katalog}
message User {Uzytkownik}
message Password {Haslo}
@ -1013,6 +996,9 @@ message Try_again {Sprobowac jeszcze raz}
message Give_up {Poddac sie}
message Ignore_continue_anyway {Zignorowac, kontynuowac}
message Set_finished {Ustawianie zakonczone}
message Skip_set {Skip set} /* XXX translate */
message Skip_group {Skip set group} /* XXX translate */
message Abandon {Abandon installation} /* XXX */
message Abort_install {Przerwac instalacje}
message Password_cipher {Kodowanie hasel}
message DES {DES}

View File

@ -1,4 +1,4 @@
/* $NetBSD: net.c,v 1.106 2005/05/08 19:46:33 christos Exp $ */
/* $NetBSD: net.c,v 1.107 2006/01/12 22:02:44 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -71,9 +71,9 @@ static char *net_up;
static char net_dev[STRSIZE];
static char net_domain[STRSIZE];
static char net_host[STRSIZE];
static char net_ip[STRSIZE];
static char net_ip_2nd[STRSIZE];
static char net_mask[STRSIZE];
static char net_ip[SSTRSIZE];
static char net_srv_ip[SSTRSIZE];
static char net_mask[SSTRSIZE];
static char net_namesvr[STRSIZE];
static char net_defroute[STRSIZE];
static char net_media[STRSIZE];
@ -490,7 +490,7 @@ config_network(void)
const char *prompt;
char *textbuf;
int octet0;
int pass, dhcp_config;
int dhcp_config;
int slip;
int pid, status;
@ -512,6 +512,7 @@ config_network(void)
get_ifconfig_info();
if (net_up != NULL) {
/* XXX: some retry loops come here... */
/* active interfaces found */
msg_display(MSG_netup, net_up);
process_menu(MENU_yesno, NULL);
@ -546,14 +547,16 @@ again:
}
free(defname);
slip = strncmp(net_dev, "sl", 2) == 0;
slip = net_dev[0] == 's' && net_dev[1] == 'l' &&
isdigit((unsigned char)net_dev[2]);
if (!slip) {
if (slip)
dhcp_config = 0;
else {
/* Preload any defaults we can find */
get_ifinterface_info();
get_if6interface_info();
get_host_info();
pass = net_mask[0] == '\0' ? 0 : 1;
/* domain and host */
msg_display(MSG_netinfo);
@ -653,8 +656,7 @@ again:
strlcpy(net_host, dhcp_host, sizeof net_host);
}
}
} else
dhcp_config = 0;
}
msg_prompt_add(MSG_net_domain, net_domain, net_domain,
sizeof net_domain);
@ -663,9 +665,13 @@ again:
if (!dhcp_config) {
/* Manually configure IPv4 */
msg_prompt_add(MSG_net_ip, net_ip, net_ip, sizeof net_ip);
if (!slip) {
if (slip)
msg_prompt_add(MSG_net_srv_ip, net_srv_ip, net_srv_ip,
sizeof net_srv_ip);
else {
/* We don't want netmasks for SLIP */
octet0 = atoi(net_ip);
if (!pass) {
if (!net_mask[0]) {
if (0 <= octet0 && octet0 <= 127)
strlcpy(net_mask, "0xff000000",
sizeof(net_mask));
@ -676,16 +682,13 @@ again:
strlcpy(net_mask, "0xffffff00",
sizeof(net_mask));
}
} else
msg_prompt_add(MSG_net_ip_2nd, net_ip_2nd, net_ip_2nd, STRSIZE);
/* We don't want netmasks for SLIP,
just in case of ... */
if (!slip)
msg_prompt_add(MSG_net_mask, net_mask, net_mask,
sizeof net_mask);
sizeof net_mask);
}
msg_prompt_add(MSG_net_defroute, net_defroute, net_defroute,
sizeof net_defroute);
}
if (!dhcp_config || net_namesvr[0] == 0)
msg_prompt_add(MSG_net_namesrv, net_namesvr, net_namesvr,
sizeof net_namesvr);
@ -712,7 +715,7 @@ again:
if (slip)
msg_display(MSG_netok_slip, net_domain, net_host, net_dev,
*net_ip == '\0' ? "<none>" : net_ip,
*net_ip_2nd == '\0' ? "<none>" : net_ip_2nd,
*net_srv_ip == '\0' ? "<none>" : net_srv_ip,
*net_mask == '\0' ? "<none>" : net_mask,
*net_namesvr == '\0' ? "<none>" : net_namesvr,
*net_defroute == '\0' ? "<none>" : net_defroute,
@ -733,7 +736,6 @@ again:
process_menu(MENU_yesno, deconst(MSG_netok_ok));
if (!yesno)
msg_display(MSG_netagain);
pass++;
if (!yesno)
goto again;
@ -788,11 +790,15 @@ again:
if (net_ip[0] != '\0') {
if (slip) {
/* XXX: needs 'ifconfig sl0 create' much earlier */
/* Set SLIP interface UP */
run_program(0, "/sbin/ifconfig %s inet %s %s up", net_dev, net_ip, net_ip_2nd);
run_program(0, "/sbin/ifconfig %s inet %s %s up",
net_dev, net_ip, net_srv_ip);
strcpy(sl_flags, "-s 115200 -l /dev/tty00");
msg_prompt_add(MSG_slattach, sl_flags, sl_flags, 255);
msg_prompt_win(MSG_slattach, -1, 12, 70, 0,
sl_flags, sl_flags, 255);
/* XXX: wtf isn't run_program() used here? */
pid = fork();
if (pid == 0) {
strcpy(buffer, "/sbin/slattach ");
@ -863,17 +869,63 @@ again:
return network_up;
}
int
get_via_ftp(const char *xfer_type)
static int
ftp_fetch(const char *set_name)
{
distinfo *list;
const char *ftp_opt;
char ftp_user_encoded[STRSIZE];
char ftp_dir_encoded[STRSIZE];
int ret;
int got_one = 0;
char *cp;
const char *ftp_opt;
int cwd;
int rval;
/*
* Invoke ftp to fetch the file.
*
* ftp.pass is quite likely to contain unsafe characters
* that need to be encoded in the URL (for example,
* "@", ":" and "/" need quoting). Let's be
* paranoid and also encode ftp.user and ftp.dir. (For
* example, ftp.dir could easily contain '~', which is
* unsafe by a strict reading of RFC 1738).
*/
if (strcmp("ftp", ftp.user) == 0 && ftp.pass[0] == 0) {
/* do anon ftp */
ftp_opt = "-a ";
ftp_user_encoded[0] = 0;
} else {
ftp_opt = "";
cp = url_encode(ftp_user_encoded, ftp.user,
ftp_user_encoded + sizeof ftp_user_encoded - 1,
RFC1738_SAFE_LESS_SHELL, 0);
*cp++ = ':';
cp = url_encode(cp, ftp.pass,
ftp_user_encoded + sizeof ftp_user_encoded - 1,
NULL, 0);
*cp++ = '@';
*cp = 0;
}
cp = url_encode(ftp_dir_encoded, ftp.dir,
ftp_dir_encoded + sizeof ftp_dir_encoded - 1,
RFC1738_SAFE_LESS_SHELL_PLUS_SLASH, 1);
if (set_dir[0] != '/')
*cp++ = '/';
url_encode(cp, set_dir,
ftp_dir_encoded + sizeof ftp_dir_encoded,
RFC1738_SAFE_LESS_SHELL_PLUS_SLASH, 0);
rval = run_program(RUN_DISPLAY | RUN_PROGRESS | RUN_XFER_DIR,
"/usr/bin/ftp %s%s://%s%s/%s/%s%s",
ftp_opt, ftp.xfer_type, ftp_user_encoded, ftp.host,
ftp_dir_encoded, set_name, dist_postfix);
return rval ? SET_RETRY : SET_OK;
}
static int
do_config_network(void)
{
int ret;
while ((ret = config_network()) <= 0) {
if (ret < 0)
@ -884,145 +936,54 @@ get_via_ftp(const char *xfer_type)
msg_display(MSG_netnotup_continueanyway);
process_menu(MENU_yesno, NULL);
if (!yesno)
return 0;
return -1;
network_up = 1;
break;
}
}
return 0;
}
cwd = open(".", O_RDONLY);
cd_dist_dir("ftp");
int
get_via_ftp(const char *xfer_type)
{
if (do_config_network() != 0)
return SET_RETRY;
process_menu(MENU_ftpsource, deconst(xfer_type));
list = dist_list;
while (list->desc) {
if (list->name == NULL || (sets_selected & list->set) == 0) {
list++;
continue;
}
/*
* Invoke ftp to fetch the file.
*
* ftp_pass is quite likely to contain unsafe characters
* that need to be encoded in the URL (for example,
* "@", ":" and "/" need quoting). Let's be
* paranoid and also encode ftp_user and ftp_dir. (For
* example, ftp_dir could easily contain '~', which is
* unsafe by a strict reading of RFC 1738).
*/
if (strcmp("ftp", ftp_user) == 0 && ftp_pass[0] == 0) {
/* do anon ftp */
ftp_opt = "-a ";
ftp_user_encoded[0] = 0;
} else {
ftp_opt = "";
cp = url_encode(ftp_user_encoded, ftp_user,
ftp_user_encoded + sizeof ftp_user_encoded - 1,
RFC1738_SAFE_LESS_SHELL, 0);
*cp++ = ':';
cp = url_encode(cp, ftp_pass,
ftp_user_encoded + sizeof ftp_user_encoded - 1,
NULL, 0);
*cp++ = '@';
*cp = 0;
}
/* We'll fetch each file just before installing it */
fetch_fn = ftp_fetch;
ftp.xfer_type = xfer_type;
clean_xfer_dir = 1;
snprintf(ext_dir, sizeof ext_dir, "%s/%s", target_prefix(), xfer_dir);
cp = url_encode(ftp_dir_encoded, ftp_dir,
ftp_dir_encoded + sizeof ftp_dir_encoded - 1,
RFC1738_SAFE_LESS_SHELL_PLUS_SLASH, 1);
if (set_dir[0] != '/')
*cp++ = '/';
url_encode(cp, set_dir,
ftp_dir_encoded + sizeof ftp_dir_encoded,
RFC1738_SAFE_LESS_SHELL_PLUS_SLASH, 0);
ret = run_program(RUN_DISPLAY | RUN_PROGRESS,
"/usr/bin/ftp %s%s://%s%s/%s/%s%s",
ftp_opt, xfer_type, ftp_user_encoded, ftp_host,
ftp_dir_encoded, list->name, dist_postfix);
if (ret == 0) {
got_one = 1;
} else {
/* Error getting the file. Bad host name ... ? */
process_menu(MENU_yesno, deconst(MSG_ftperror));
if (yesno) {
process_menu(MENU_ftpsource, NULL);
continue;
}
if (got_one == 0) {
fchdir(cwd); /* back to current real root */
close(cwd);
return 0;
}
/* Continue without this set... */
}
list++;
}
wrefresh(curscr);
wmove(stdscr, 0, 0);
touchwin(stdscr);
wclear(stdscr);
wrefresh(stdscr);
fchdir(cwd); /* back to current real root */
close(cwd);
return (1);
return SET_OK;
}
int
get_via_nfs(void)
{
int ret;
while ((ret = config_network()) <= 0) {
if (ret < 0)
return (-1);
msg_display(MSG_netnotup);
process_menu(MENU_yesno, NULL);
if (!yesno) {
msg_display(MSG_netnotup_continueanyway);
process_menu(MENU_yesno, NULL);
if (!yesno)
return 0;
network_up = 1;
}
}
if (do_config_network() != 0)
return SET_RETRY;
again:
/* Get server and filepath */
process_menu(MENU_nfssource, NULL);
umount_mnt2();
/* Mount it */
if (run_program(0, "/sbin/mount -r -o -2,-i,-r=1024 -t nfs %s:%s /mnt2",
nfs_host, nfs_dir)) {
msg_display(MSG_nfsbadmount, nfs_host, nfs_dir);
process_menu(MENU_nfsbadmount, NULL);
if (!yesno)
return (0);
if (!ignorerror)
goto again;
}
nfs_host, nfs_dir))
return SET_RETRY;
mnt2_mounted = 1;
snprintf(ext_dir, sizeof ext_dir, "/mnt2/%s", set_dir);
/* Verify distribution files exist. */
if (distribution_sets_exist_p(ext_dir) == 0) {
msg_display(MSG_badsetdir, ext_dir);
process_menu (MENU_nfsbadmount, NULL);
if (!yesno)
return (0);
if (!ignorerror)
goto again;
}
/* return location, don't clean... */
clean_dist_dir = 0;
return 1;
clean_xfer_dir = 0;
return SET_OK;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: run.c,v 1.59 2005/02/26 17:40:49 dsl Exp $ */
/* $NetBSD: run.c,v 1.60 2006/01/12 22:02:44 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -174,7 +174,7 @@ collect(int kind, char **buffer, const char *name, ...)
char *cp;
va_start(ap, name);
vsnprintf(fileorcmd, STRSIZE, name, ap);
vsnprintf(fileorcmd, sizeof fileorcmd, name, ap);
va_end(ap);
if (kind == T_FILE) {
@ -446,18 +446,21 @@ launch_subwin(WINDOW **actionwin, char **args, struct winsize *win, int flags,
fprintf(script, "%s\n", scmd);
fclose(script);
}
if (flags & RUN_XFER_DIR)
target_chdir_or_die(xfer_dir);
/*
* If target_prefix == "", the chroot will fail, but
* that's ok, since we don't need it then.
*/
if ((flags & RUN_CHROOT) != 0 && chroot(target_prefix()) != 0)
if (flags & RUN_CHROOT && *target_prefix()
&& chroot(target_prefix()) != 0)
warn("chroot(%s) for %s", target_prefix(), *args);
else {
execvp(*args, args);
warn("execvp %s", *args);
}
_exit(EXIT_FAILURE);
break; /* end of child */
// break; /* end of child */
default:
/*
* parent: we've set up the subprocess.

View File

@ -1,4 +1,4 @@
/* $NetBSD: target.c,v 1.47 2004/06/06 06:06:59 christos Exp $ */
/* $NetBSD: target.c,v 1.48 2006/01/12 22:02:44 dsl Exp $ */
/*
* Copyright 1997 Jonathan Stone
@ -71,7 +71,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: target.c,v 1.47 2004/06/06 06:06:59 christos Exp $");
__RCSID("$NetBSD: target.c,v 1.48 2006/01/12 22:02:44 dsl Exp $");
#endif
/*
@ -303,6 +303,7 @@ do_target_chdir(const char *dir, int must_succeed)
target_prefix(), strerror(error));
exit(1);
}
errno = error;
return (error);
#else
printf("target_chdir (%s)\n", tgt_dir);
@ -362,8 +363,8 @@ mv_within_target_or_die(const char *frompath, const char *topath)
char realfrom[STRSIZE];
char realto[STRSIZE];
strncpy(realfrom, target_expand(frompath), STRSIZE);
strncpy(realto, target_expand(topath), STRSIZE);
strlcpy(realfrom, target_expand(frompath), sizeof realfrom);
strlcpy(realto, target_expand(topath), sizeof realto);
run_program(RUN_FATAL, "mv %s %s", realfrom, realto);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: txtwalk.c,v 1.11 2004/11/11 20:14:02 dsl Exp $ */
/* $NetBSD: txtwalk.c,v 1.12 2006/01/12 22:02:44 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -56,15 +56,15 @@
/* prototypes */
static int process(struct lookfor *, char *);
static int match(char *, struct lookfor *, size_t);
static int finddata(struct lookfor *, char *, struct data *, size_t *);
static int process(const struct lookfor *, char *);
static int match(char *, const struct lookfor *, size_t);
static int finddata(const struct lookfor *, char *, struct data *, size_t *);
/*
* Walk the buffer, call match for each line.
*/
int
walk(char *buffer, size_t size, struct lookfor *these, size_t numthese)
walk(char *buffer, size_t size, const struct lookfor *these, size_t numthese)
{
size_t i = 0;
size_t len;
@ -101,7 +101,7 @@ walk(char *buffer, size_t size, struct lookfor *these, size_t numthese)
* For each match in these, process the match.
*/
static int
match(char *line, struct lookfor *these, size_t numthese)
match(char *line, const struct lookfor *these, size_t numthese)
{
size_t linelen; /* Line length */
size_t patlen; /* Pattern length */
@ -126,7 +126,7 @@ match(char *line, struct lookfor *these, size_t numthese)
/* process the matched line. */
static int
process(struct lookfor *item, char *line)
process(const struct lookfor *item, char *line)
{
struct data found[MAXDATA];
size_t numfound = 0;
@ -202,7 +202,7 @@ process(struct lookfor *item, char *line)
* Side Effect -- sets numfound and found.
*/
static int
finddata(struct lookfor *item, char *line, struct data *found, size_t *numfound)
finddata(const struct lookfor *item, char *line, struct data *found, size_t *numfound)
{
const char *fmt;
size_t len;

View File

@ -1,4 +1,4 @@
/* $NetBSD: txtwalk.h,v 1.9 2003/11/30 14:36:44 dsl Exp $ */
/* $NetBSD: txtwalk.h,v 1.10 2006/01/12 22:02:44 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -79,7 +79,7 @@ struct lookfor {
/* prototypes */
int walk(char *, size_t, struct lookfor *, size_t);
int walk(char *, size_t, const struct lookfor *, size_t);
/* Maximum number of matched data elements per line! */

File diff suppressed because it is too large Load Diff