mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 19:34:43 +01:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2cbfdf51d8 |
No files matched your search
@@ -1,59 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1996 Peter Wemm <[email protected]>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_RCS) && !defined(lint)
|
||||
static char rcsid[] = "$Id$";
|
||||
#endif /* LIBC_RCS and not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
#if __STDC__
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
|
||||
#if __STDC__
|
||||
int
|
||||
asprintf(char **str, char const *fmt, ...)
|
||||
#else
|
||||
int
|
||||
asprintf(str, fmt, va_alist)
|
||||
char **str;
|
||||
char *fmt;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
int ret;
|
||||
va_list ap;
|
||||
|
||||
#if __STDC__
|
||||
va_start(ap, fmt);
|
||||
#else
|
||||
va_start(ap);
|
||||
#endif
|
||||
ret = vasprintf(str, fmt, ap);
|
||||
va_end(ap);
|
||||
return (ret);
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
# $Id: Makefile,v 1.214 1996/05/02 08:18:28 jkh Exp $
|
||||
SUBDIR= crunch mfs floppy
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
@@ -1,20 +0,0 @@
|
||||
# $Id: boot_crunch.conf,v 1.23 1996/02/08 18:02:51 phk Exp $
|
||||
|
||||
srcdirs /usr/src/bin
|
||||
srcdirs /usr/src/release
|
||||
srcdirs /usr/src/sbin/i386
|
||||
srcdirs /usr/src/sbin
|
||||
srcdirs /usr/src/usr.bin
|
||||
srcdirs /usr/src/gnu/usr.bin
|
||||
srcdirs /usr/src/usr.sbin
|
||||
|
||||
progs sh find
|
||||
progs pwd ft ppp
|
||||
progs sysinstall newfs gzip cpio bad144 fsck ifconfig route slattach
|
||||
progs mount_nfs
|
||||
ln gzip gunzip
|
||||
ln gzip zcat
|
||||
ln sh -sh
|
||||
|
||||
libs -ll -ledit -lutil -lkvm -lmd
|
||||
libs -ldialog -lncurses -lmytinfo -L/usr/src/release/libdisk/obj -ldisk -lipx
|
||||
@@ -1,4 +0,0 @@
|
||||
nameserver 42/tcp name
|
||||
ftp 21/tcp
|
||||
domain 53/tcp nameserver
|
||||
domain 53/udp nameserver
|
||||
@@ -1,120 +0,0 @@
|
||||
:
|
||||
#set -ex
|
||||
|
||||
VNDEVICE=vn0
|
||||
export BLOCKSIZE=512
|
||||
|
||||
LABELDIR=$1 ; shift
|
||||
MNT=$1 ; shift
|
||||
FSSIZE=$1 ; shift
|
||||
FSPROTO=$1 ; shift
|
||||
FSINODE=$1 ; shift
|
||||
FSLABEL=$1 ; shift
|
||||
OLDFSSIZE=${FSSIZE}
|
||||
OLDFSINODE=${FSINODE}
|
||||
|
||||
deadlock=40
|
||||
|
||||
while true
|
||||
do
|
||||
rm -f fs-image
|
||||
|
||||
if [ ! -b /dev/${VNDEVICE} -o ! -c /dev/r${VNDEVICE} ] ; then
|
||||
( cd /dev && sh MAKEDEV ${VNDEVICE} )
|
||||
fi
|
||||
|
||||
umount /dev/${VNDEVICE} 2>/dev/null || true
|
||||
|
||||
umount ${MNT} 2>/dev/null || true
|
||||
|
||||
vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true
|
||||
|
||||
dd of=fs-image if=/dev/zero count=${FSSIZE} bs=1k 2>/dev/null
|
||||
# this suppresses the `invalid primary partition table: no magic'
|
||||
awk 'BEGIN {printf "%c%c", 85, 170}' |\
|
||||
dd of=fs-image obs=1 seek=510 conv=notrunc 2>/dev/null
|
||||
|
||||
vnconfig -s labels -c /dev/r${VNDEVICE} fs-image
|
||||
|
||||
sed '/^minimum:/,$d' /etc/disktab > /etc/disktab.tmp
|
||||
cat /etc/disktab.tmp > /etc/disktab
|
||||
rm -f /etc/disktab.tmp
|
||||
(
|
||||
a=`expr ${FSSIZE} \* 2`
|
||||
echo
|
||||
echo "minimum:ty=mfs:se#512:nt#1:rm#300:\\"
|
||||
echo " :ns#$a:nc#1:\\"
|
||||
echo " :pa#$a:oa#0:ba#4096:fa#512:\\"
|
||||
echo " :pc#$a:oc#0:bc#4096:fc#512:"
|
||||
echo
|
||||
) >> /etc/disktab
|
||||
|
||||
disklabel -w -r -B \
|
||||
-b ${LABELDIR}/boot1 \
|
||||
-s ${LABELDIR}/boot2 \
|
||||
/dev/r${VNDEVICE} minimum
|
||||
|
||||
newfs -u 0 -t 0 -i ${FSINODE} -m 0 -T minimum /dev/r${VNDEVICE}a
|
||||
|
||||
mount /dev/${VNDEVICE}a ${MNT}
|
||||
|
||||
if ( set -e && cd ${FSPROTO} && find . -print | cpio -dump ${MNT} )
|
||||
then
|
||||
;
|
||||
else
|
||||
echo " $FSINODE and $FSSIZE failed, reverting.."
|
||||
FSSIZE=`expr ${FSSIZE} + 10`
|
||||
#FSSIZE=${OLDFSSIZE}
|
||||
FSINODE=${FSINODE}
|
||||
continue
|
||||
fi
|
||||
|
||||
set `df -i /mnt | tail -1`
|
||||
#/dev/vn0a 937 932 5 99% 342 328 51% /mnt
|
||||
|
||||
umount ${MNT}
|
||||
|
||||
fsck -p /dev/r${VNDEVICE}a < /dev/null
|
||||
|
||||
vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true
|
||||
|
||||
if [ $FSLABEL != "minimum" ] ; then
|
||||
echo ${FSSIZE} > fs-image.size
|
||||
break
|
||||
fi
|
||||
|
||||
OLDFSSIZE=${FSSIZE}
|
||||
OLDFSINODE=${FSINODE}
|
||||
echo ">>> Filesystem is ${FSSIZE} K, $4 left"
|
||||
echo ">>> ${FSINODE} bytes/inode, $7 left"
|
||||
echo ">>> `expr ${FSSIZE} \* 1024 / ${FSINODE}`"
|
||||
if [ $4 -gt 128 ] ; then
|
||||
echo "Reducing size"
|
||||
FSSIZE=`expr ${FSSIZE} - $4 / 2`
|
||||
continue
|
||||
fi
|
||||
if [ $7 -gt 128 ] ; then
|
||||
echo "Increasing bytes per inode"
|
||||
FSINODE=`expr ${FSINODE} + 8192`
|
||||
continue
|
||||
fi
|
||||
if [ $4 -gt 32 ] ; then
|
||||
echo "Reducing size"
|
||||
FSSIZE=`expr ${FSSIZE} - 4`
|
||||
FSINODE=`expr ${FSINODE} - 1024`
|
||||
continue
|
||||
fi
|
||||
if [ $7 -gt 64 ] ; then
|
||||
echo "Increasing bytes per inode"
|
||||
FSINODE=`expr ${FSINODE} + 8192`
|
||||
continue
|
||||
fi
|
||||
if [ $deadlock -eq 0 ] ; then
|
||||
echo "Avoiding deadlock, giving up"
|
||||
echo ${FSSIZE} > fs-image.size
|
||||
break
|
||||
fi
|
||||
deadlock=`expr $deadlock - 1`
|
||||
echo ${FSSIZE} > fs-image.size
|
||||
break;
|
||||
done
|
||||
@@ -1,6 +0,0 @@
|
||||
###
|
||||
# $Id: Makefile,v 1.214 1996/05/02 08:18:28 jkh Exp $
|
||||
#
|
||||
SUBDIR= crunch image
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
@@ -1,45 +0,0 @@
|
||||
# $Id: fixit_crunch.conf,v 1.6 1996/01/03 23:41:03 joerg Exp $
|
||||
|
||||
# first, we list the source dirs that our programs reside in. These are
|
||||
# searched in order listed to find the dir containing each program.
|
||||
|
||||
srcdirs /usr/src/bin
|
||||
srcdirs /usr/src/sbin/i386
|
||||
srcdirs /usr/src/sbin
|
||||
srcdirs /usr/src/gnu/usr.bin
|
||||
srcdirs /usr/src/usr.bin
|
||||
srcdirs /usr/src/usr.sbin
|
||||
srcdirs /usr/src/usr.bin/vi
|
||||
|
||||
# second, we list all the programs we want to include in our crunched binary.
|
||||
# The order doesn't matter. Any program that needs hard links to it gets an
|
||||
# `ln' directive.
|
||||
|
||||
# /bin stuff
|
||||
|
||||
progs cat chmod chroot cp date dd df echo ed expr hostname kill ln ls mkdir
|
||||
progs mt mv pwd rcp rm rmdir sleep stty sync test
|
||||
|
||||
ln test [
|
||||
|
||||
# /sbin stuff
|
||||
|
||||
progs badsect chown clri disklabel dump dmesg fdisk
|
||||
progs mknod mount newfs ping reboot restore scsi swapon umount
|
||||
|
||||
progs mount_msdos mount_cd9660 mount_nfs
|
||||
ln dump rdump
|
||||
ln restore rrestore
|
||||
ln newfs mount_mfs
|
||||
|
||||
# /usr/bin stuff
|
||||
|
||||
progs ftp rsh sed telnet rlogin common find grep
|
||||
ln common vi
|
||||
ln common view
|
||||
ln common ex
|
||||
|
||||
# finally, we specify the libraries to link in with our binary
|
||||
|
||||
libs -lcrypt -ltelnet -lutil -ll
|
||||
libs -lcurses -ltermcap -ledit -lgnuregex -lkvm -lscsi
|
||||
@@ -1,16 +0,0 @@
|
||||
###
|
||||
# $Id: Makefile,v 1.214 1996/05/02 08:18:28 jkh Exp $
|
||||
#
|
||||
# What are we if we weren't told..
|
||||
CRUNCH?= fixit
|
||||
CRUNCHDIRS= ../crunch
|
||||
TOP=${.CURDIR}/../../../..
|
||||
FS_BIN=${.CURDIR}/../..
|
||||
|
||||
# the directories you want on the fs
|
||||
FS_DIRS= dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp
|
||||
# a subdir that contains a verbatim image to be copied to the fs
|
||||
VERBATIM= ../verbatim
|
||||
|
||||
.include "../../crunch_fs.mk"
|
||||
all: fs_image
|
||||
@@ -1,15 +0,0 @@
|
||||
:
|
||||
# $Id: fixit.profile,v 1.1 1995/03/15 06:14:19 phk Exp $
|
||||
PATH=/stand
|
||||
BLOCKSIZE=K
|
||||
PS1="Fixit# "
|
||||
|
||||
echo '+---------------------------------------------------+'
|
||||
echo '| You are now running from a FreeBSD "fixit" floppy |'
|
||||
echo '+---------------------------------------------------+'
|
||||
echo
|
||||
echo 'Good Luck!'
|
||||
echo
|
||||
|
||||
export PATH BLOCKSIZE PS1
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* ----------------------------------------------------------------------------
|
||||
* "THE BEER-WARE LICENSE" (Revision 42):
|
||||
* <[email protected]> wrote this file. As long as you retain this notice you
|
||||
* can do whatever you want with this stuff. If we meet some day, and you think
|
||||
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
|
||||
* ----------------------------------------------------------------------------
|
||||
*
|
||||
* $Id: write_mfs_in_kernel.c,v 1.1 1995/04/25 03:45:18 phk Exp $
|
||||
*
|
||||
* This program patches a filesystem into a kernel made with MFS_ROOT
|
||||
* option.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <ufs/ffs/fs.h>
|
||||
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
unsigned char *buf_kernel, *buf_fs, *p,*q;
|
||||
int fd_kernel, fd_fs;
|
||||
struct stat st_kernel, st_fs;
|
||||
u_long l;
|
||||
|
||||
if (argc < 3) {
|
||||
fprintf(stderr,"Usage:\n\t%s kernel fs\n");
|
||||
exit(2);
|
||||
}
|
||||
fd_kernel = open(argv[1],O_RDWR);
|
||||
if (fd_kernel < 0) { perror(argv[1]); exit(2); }
|
||||
fstat(fd_kernel,&st_kernel);
|
||||
fd_fs = open(argv[2],O_RDONLY);
|
||||
if (fd_fs < 0) { perror(argv[2]); exit(2); }
|
||||
fstat(fd_fs,&st_fs);
|
||||
buf_kernel = malloc(st_kernel.st_size);
|
||||
if (!buf_kernel) { perror("malloc"); exit(2); }
|
||||
buf_fs = malloc(st_fs.st_size);
|
||||
if (!buf_fs) { perror("malloc"); exit(2); }
|
||||
if (st_kernel.st_size != read(fd_kernel,buf_kernel,st_kernel.st_size))
|
||||
{ perror(argv[1]); exit(2); }
|
||||
if (st_fs.st_size != read(fd_fs,buf_fs,st_fs.st_size))
|
||||
{ perror(argv[2]); exit(2); }
|
||||
for(l=0,p=buf_kernel; l < st_kernel.st_size - st_fs.st_size ; l++,p++ )
|
||||
if(*p == 'M' && !strcmp(p,"MFS Filesystem goes here"))
|
||||
goto found;
|
||||
fprintf(stderr,"MFS filesystem signature not found in %s\n",argv[1]);
|
||||
exit(1);
|
||||
found:
|
||||
for(l=0,q= p + SBOFF; l < st_fs.st_size - SBOFF ; l++,q++ )
|
||||
if (*q)
|
||||
goto fail;
|
||||
memcpy(p+SBOFF,buf_fs+SBOFF,st_fs.st_size-SBOFF);
|
||||
lseek(fd_kernel,0L,SEEK_SET);
|
||||
if (st_kernel.st_size != write(fd_kernel,buf_kernel,st_kernel.st_size))
|
||||
{ perror(argv[1]); exit(2); }
|
||||
exit(0);
|
||||
fail:
|
||||
l += SBOFF;
|
||||
fprintf(stderr,"Obstruction in kernel after %ld bytes (%ld Kbyte)\n",
|
||||
l, l/1024);
|
||||
fprintf(stderr,"Filesystem is %ld bytes (%ld Kbyte)\n",
|
||||
(u_long)st_fs.st_size, (u_long)st_fs.st_size/1024);
|
||||
exit(1);
|
||||
}
|
||||
@@ -0,0 +1,476 @@
|
||||
/*
|
||||
* The new sysinstall program.
|
||||
*
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: anonFTP.c,v 1.13 1996/04/28 01:07:19 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Coranth Gryphon. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer,
|
||||
* verbatim and that no modifications are made prior to this
|
||||
* point in the file.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY CORANTH GRYPHON ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL CORANTH GRYPHON OR HIS PETS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
#include <string.h>
|
||||
#include <dialog.h>
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include "ui_objects.h"
|
||||
#include "dir.h"
|
||||
#include "dialog.priv.h"
|
||||
#include "colors.h"
|
||||
#include "sysinstall.h"
|
||||
|
||||
/* This doesn't change until FTP itself changes */
|
||||
|
||||
#define FTP_NAME "ftp"
|
||||
#define MOTD_FILE "ftpmotd"
|
||||
|
||||
/* These change if we want to use different defaults */
|
||||
|
||||
#define FTP_UID 14
|
||||
#define FTP_GID 5
|
||||
#define FTP_GROUP "operator"
|
||||
#define FTP_UPLOAD "incoming"
|
||||
#define FTP_COMMENT "Anonymous FTP Admin"
|
||||
#define FTP_HOMEDIR "/var/ftp"
|
||||
|
||||
#define ANONFTP_HELPFILE "anonftp"
|
||||
|
||||
/* Set up the structure to hold configuration information */
|
||||
/* Note that this is only what we could fit onto the one screen */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char homedir[64]; /* Home Dir for Anon FTP */
|
||||
char group[32]; /* Group */
|
||||
char uid[8]; /* UID */
|
||||
char comment[64]; /* PWD Comment */
|
||||
char upload[32]; /* Upload Dir */
|
||||
} FTPConf;
|
||||
|
||||
static FTPConf tconf;
|
||||
|
||||
#define ANONFTP_HOMEDIR_LEN 64
|
||||
#define ANONFTP_COMMENT_LEN 64
|
||||
#define ANONFTP_UPLOAD_LEN 32
|
||||
#define ANONFTP_GROUP_LEN 32
|
||||
#define ANONFTP_UID_LEN 8
|
||||
|
||||
static int okbutton, cancelbutton;
|
||||
|
||||
/* What the screen size is meant to be */
|
||||
#define ANONFTP_DIALOG_Y 0
|
||||
#define ANONFTP_DIALOG_X 8
|
||||
#define ANONFTP_DIALOG_WIDTH COLS - 16
|
||||
#define ANONFTP_DIALOG_HEIGHT LINES - 2
|
||||
|
||||
/* The screen layout structure */
|
||||
typedef struct _layout {
|
||||
int y; /* x & Y co-ordinates */
|
||||
int x;
|
||||
int len; /* The size of the dialog on the screen */
|
||||
int maxlen; /* How much the user can type in ... */
|
||||
char *prompt; /* The string for the prompt */
|
||||
char *help; /* The display for the help line */
|
||||
void *var; /* The var to set when this changes */
|
||||
int type; /* The type of the dialog to create */
|
||||
void *obj; /* The obj pointer returned by libdialog */
|
||||
} Layout;
|
||||
|
||||
static Layout layout[] = {
|
||||
{ 2, 3, 8, ANONFTP_UID_LEN - 1,
|
||||
"UID:", "What user ID to assign to FTP Admin",
|
||||
tconf.uid, STRINGOBJ, NULL },
|
||||
#define LAYOUT_UID 1
|
||||
|
||||
{ 2, 15, 15, ANONFTP_GROUP_LEN - 1,
|
||||
"Group:", "Group name that ftp process belongs to",
|
||||
tconf.group, STRINGOBJ, NULL },
|
||||
#define LAYOUT_GROUP 2
|
||||
|
||||
{ 2, 35, 24, ANONFTP_COMMENT_LEN - 1,
|
||||
"Comment:", "Password file comment for FTP Admin",
|
||||
tconf.comment, STRINGOBJ, NULL },
|
||||
#define LAYOUT_COMMENT 3
|
||||
|
||||
{ 9, 10, 43, ANONFTP_HOMEDIR_LEN - 1,
|
||||
"FTP Root Directory:",
|
||||
"The top directory to chroot to when doing anonymous ftp",
|
||||
tconf.homedir, STRINGOBJ, NULL },
|
||||
#define LAYOUT_HOMEDIR 4
|
||||
|
||||
{ 14, 20, 22, ANONFTP_UPLOAD_LEN - 1,
|
||||
"Upload Subdirectory:", "Designated sub-directory that holds uploads",
|
||||
tconf.upload, STRINGOBJ, NULL },
|
||||
#define LAYOUT_UPLOAD 5
|
||||
|
||||
{ 19, 15, 0, 0,
|
||||
"OK", "Select this if you are happy with these settings",
|
||||
&okbutton, BUTTONOBJ, NULL },
|
||||
#define LAYOUT_OKBUTTON 6
|
||||
|
||||
{ 19, 35, 0, 0,
|
||||
"CANCEL", "Select this if you wish to cancel this screen",
|
||||
&cancelbutton, BUTTONOBJ, NULL },
|
||||
#define LAYOUT_CANCELBUTTON 7
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
int
|
||||
createFtpUser(void)
|
||||
{
|
||||
struct passwd *tpw;
|
||||
struct group *tgrp;
|
||||
char pwline[256];
|
||||
char *tptr;
|
||||
int gid;
|
||||
FILE *fptr;
|
||||
|
||||
if ((gid = atoi(tconf.group)) <= 0) {
|
||||
if (!(tgrp = getgrnam(tconf.group))) {
|
||||
/* group does not exist, create it by name */
|
||||
|
||||
tptr = msgGetInput("14", "What group ID to use for group %s ?", tconf.group);
|
||||
if (tptr && *tptr && ((gid = atoi(tptr)) > 0)) {
|
||||
if ((fptr = fopen(_PATH_GROUP,"a"))) {
|
||||
fprintf(fptr,"%s:*:%d:%s\n",tconf.group,gid,FTP_NAME);
|
||||
fclose(fptr);
|
||||
}
|
||||
}
|
||||
else
|
||||
gid = FTP_GID;
|
||||
}
|
||||
else
|
||||
gid = tgrp->gr_gid;
|
||||
}
|
||||
else if (!getgrgid(gid)) {
|
||||
/* group does not exist, create it by number */
|
||||
|
||||
tptr = msgGetInput("14", "What group name to use for gid %d ?", gid);
|
||||
if (tptr && *tptr) {
|
||||
strcpy(tconf.group, tptr);
|
||||
if ((tgrp = getgrnam(tconf.group))) {
|
||||
gid = tgrp->gr_gid;
|
||||
}
|
||||
else if ((fptr = fopen(_PATH_GROUP,"a"))) {
|
||||
fprintf(fptr,"%s:*:%d:%s\n",tconf.group,gid,FTP_NAME);
|
||||
fclose(fptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((tpw = getpwnam(FTP_NAME))) {
|
||||
if (tpw->pw_uid != FTP_UID)
|
||||
msgConfirm("FTP user already exists with a different uid.");
|
||||
|
||||
return (DITEM_SUCCESS); /* succeeds if already exists */
|
||||
}
|
||||
|
||||
sprintf(pwline, "%s::%s:%d::0:0:%s:%s:/bin/date\n", FTP_NAME, tconf.uid, gid, tconf.comment, tconf.homedir);
|
||||
|
||||
fptr = fopen(_PATH_MASTERPASSWD,"a");
|
||||
if (! fptr) {
|
||||
msgConfirm("Could not open master password file.");
|
||||
return (DITEM_FAILURE);
|
||||
}
|
||||
fprintf(fptr, pwline);
|
||||
fclose(fptr);
|
||||
msgNotify("Remaking password file: %s", _PATH_MASTERPASSWD);
|
||||
vsystem("pwd_mkdb -p %s", _PATH_MASTERPASSWD);
|
||||
return (DITEM_SUCCESS);
|
||||
}
|
||||
|
||||
/* This is it - how to get the setup values */
|
||||
static int
|
||||
anonftpOpenDialog(void)
|
||||
{
|
||||
WINDOW *ds_win;
|
||||
ComposeObj *obj = NULL;
|
||||
ComposeObj *first, *last;
|
||||
int n=0, quit=FALSE, cancel=FALSE, ret;
|
||||
int max;
|
||||
char help[FILENAME_MAX];
|
||||
char title[80];
|
||||
|
||||
/* We need a curses window */
|
||||
ds_win = newwin(LINES, COLS, 0, 0);
|
||||
if (ds_win == 0) {
|
||||
beep();
|
||||
msgConfirm("Cannot open anonymous ftp dialog window!!");
|
||||
return(DITEM_FAILURE);
|
||||
}
|
||||
|
||||
/* Say where our help comes from */
|
||||
systemHelpFile(ANONFTP_HELPFILE, help);
|
||||
use_helpfile(help);
|
||||
|
||||
/* Setup a nice screen for us to splat stuff onto */
|
||||
draw_box(ds_win, ANONFTP_DIALOG_Y, ANONFTP_DIALOG_X, ANONFTP_DIALOG_HEIGHT, ANONFTP_DIALOG_WIDTH, dialog_attr, border_attr);
|
||||
wattrset(ds_win, dialog_attr);
|
||||
mvwaddstr(ds_win, ANONFTP_DIALOG_Y, ANONFTP_DIALOG_X + 20, " Anonymous FTP Configuration ");
|
||||
|
||||
draw_box(ds_win, ANONFTP_DIALOG_Y + 7, ANONFTP_DIALOG_X + 8, ANONFTP_DIALOG_HEIGHT - 11, ANONFTP_DIALOG_WIDTH - 17,
|
||||
dialog_attr, border_attr);
|
||||
wattrset(ds_win, dialog_attr);
|
||||
sprintf(title, " Path Configuration ");
|
||||
mvwaddstr(ds_win, ANONFTP_DIALOG_Y + 7, ANONFTP_DIALOG_X + 22, title);
|
||||
|
||||
/** Initialize the config Data Structure **/
|
||||
|
||||
bzero(&tconf, sizeof(tconf));
|
||||
|
||||
strcpy(tconf.group, FTP_GROUP);
|
||||
strcpy(tconf.upload, FTP_UPLOAD);
|
||||
strcpy(tconf.comment, FTP_COMMENT);
|
||||
strcpy(tconf.homedir, FTP_HOMEDIR);
|
||||
sprintf(tconf.uid, "%d", FTP_UID);
|
||||
|
||||
/* Loop over the layout list, create the objects, and add them
|
||||
onto the chain of objects that dialog uses for traversal*/
|
||||
|
||||
n = 0;
|
||||
#define lt layout[n]
|
||||
|
||||
while (lt.help != NULL) {
|
||||
switch (lt.type) {
|
||||
case STRINGOBJ:
|
||||
lt.obj = NewStringObj(ds_win, lt.prompt, lt.var,
|
||||
lt.y + ANONFTP_DIALOG_Y, lt.x + ANONFTP_DIALOG_X,
|
||||
lt.len, lt.maxlen);
|
||||
break;
|
||||
|
||||
case BUTTONOBJ:
|
||||
lt.obj = NewButtonObj(ds_win, lt.prompt, lt.var,
|
||||
lt.y + ANONFTP_DIALOG_Y, lt.x + ANONFTP_DIALOG_X);
|
||||
break;
|
||||
|
||||
default:
|
||||
msgFatal("Don't support this object yet!");
|
||||
}
|
||||
AddObj(&obj, lt.type, (void *) lt.obj);
|
||||
n++;
|
||||
}
|
||||
max = n - 1;
|
||||
|
||||
/* Find the last object we can traverse to */
|
||||
last = obj;
|
||||
while (last->next)
|
||||
last = last->next;
|
||||
|
||||
/* Find the first object in the list */
|
||||
first = obj;
|
||||
while (first->prev)
|
||||
first = first->prev;
|
||||
|
||||
/* Some more initialisation before we go into the main input loop */
|
||||
n = 0;
|
||||
cancelbutton = 0;
|
||||
cancel = FALSE;
|
||||
okbutton = 0;
|
||||
|
||||
/* Incoming user data - DUCK! */
|
||||
while (!quit) {
|
||||
char help_line[80];
|
||||
int i, len = strlen(lt.help);
|
||||
|
||||
/* Display the help line at the bottom of the screen */
|
||||
for (i = 0; i < 79; i++)
|
||||
help_line[i] = (i < len) ? lt.help[i] : ' ';
|
||||
help_line[i] = '\0';
|
||||
use_helpline(help_line);
|
||||
display_helpline(ds_win, LINES - 1, COLS - 1);
|
||||
|
||||
/* Ask for libdialog to do its stuff */
|
||||
ret = PollObj(&obj);
|
||||
|
||||
/* Handle special case stuff that libdialog misses. Sigh */
|
||||
switch (ret) {
|
||||
/* Bail out */
|
||||
case SEL_ESC:
|
||||
quit = TRUE, cancel=TRUE;
|
||||
break;
|
||||
|
||||
/* This doesn't work for list dialogs. Oh well. Perhaps
|
||||
should special case the move from the OK button ``up''
|
||||
to make it go to the interface list, but then it gets
|
||||
awkward for the user to go back and correct screw up's
|
||||
in the per-interface section */
|
||||
|
||||
case KEY_UP:
|
||||
if (obj->prev !=NULL ) {
|
||||
obj = obj->prev;
|
||||
--n;
|
||||
} else {
|
||||
obj = last;
|
||||
n = max;
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_DOWN:
|
||||
if (obj->next != NULL) {
|
||||
obj = obj->next;
|
||||
++n;
|
||||
} else {
|
||||
obj = first;
|
||||
n = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case SEL_TAB:
|
||||
if (n < max)
|
||||
++n;
|
||||
else
|
||||
n = 0;
|
||||
break;
|
||||
|
||||
/* The user has pressed enter over a button object */
|
||||
case SEL_BUTTON:
|
||||
quit = TRUE;
|
||||
if (cancelbutton)
|
||||
cancel = TRUE;
|
||||
break;
|
||||
|
||||
/* Generic CR handler */
|
||||
case SEL_CR:
|
||||
if (n < max)
|
||||
++n;
|
||||
else
|
||||
n = 0;
|
||||
break;
|
||||
|
||||
case SEL_BACKTAB:
|
||||
if (n)
|
||||
--n;
|
||||
else
|
||||
n = max;
|
||||
break;
|
||||
|
||||
case KEY_F(1):
|
||||
display_helpfile();
|
||||
|
||||
/* They tried some key combination we don't support - tell them! */
|
||||
default:
|
||||
beep();
|
||||
}
|
||||
}
|
||||
|
||||
/* Clear this crap off the screen */
|
||||
dialog_clear();
|
||||
refresh();
|
||||
use_helpfile(NULL);
|
||||
|
||||
if (cancel)
|
||||
return DITEM_FAILURE;
|
||||
return DITEM_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
configAnonFTP(dialogMenuItem *self)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Be optimistic */
|
||||
i = DITEM_SUCCESS;
|
||||
|
||||
dialog_clear();
|
||||
i = anonftpOpenDialog();
|
||||
if (DITEM_STATUS(i) != DITEM_SUCCESS) {
|
||||
msgConfirm("Configuration of Anonymous FTP cancelled per user request.");
|
||||
return i | DITEM_RESTORE;
|
||||
}
|
||||
|
||||
/*** Use defaults for any invalid values ***/
|
||||
if (atoi(tconf.uid) <= 0)
|
||||
sprintf(tconf.uid, "%d", FTP_UID);
|
||||
|
||||
if (!tconf.group[0])
|
||||
strcpy(tconf.group, FTP_GROUP);
|
||||
|
||||
if (!tconf.upload[0])
|
||||
strcpy(tconf.upload, FTP_UPLOAD);
|
||||
|
||||
/*** If the user did not specify a directory, use default ***/
|
||||
|
||||
if (tconf.homedir[strlen(tconf.homedir) - 1] == '/')
|
||||
tconf.homedir[strlen(tconf.homedir) - 1] = '\0';
|
||||
|
||||
if (!tconf.homedir[0])
|
||||
strcpy(tconf.homedir, FTP_HOMEDIR);
|
||||
|
||||
/*** If HomeDir does not exist, create it ***/
|
||||
|
||||
if (!directory_exists(tconf.homedir))
|
||||
vsystem("mkdir -p %s", tconf.homedir);
|
||||
|
||||
if (directory_exists(tconf.homedir)) {
|
||||
msgNotify("Configuring %s for use by anon FTP.", tconf.homedir);
|
||||
vsystem("chmod 555 %s && chown root.%s %s", tconf.homedir, tconf.group, tconf.homedir);
|
||||
vsystem("mkdir %s/bin && chmod 555 %s/bin", tconf.homedir, tconf.homedir);
|
||||
vsystem("cp /bin/ls %s/bin && chmod 111 %s/bin/ls", tconf.homedir, tconf.homedir);
|
||||
vsystem("cp /bin/date %s/bin && chmod 111 %s/bin/date", tconf.homedir, tconf.homedir);
|
||||
vsystem("mkdir %s/etc && chmod 555 %s/etc", tconf.homedir, tconf.homedir);
|
||||
vsystem("mkdir -p %s/pub", tconf.homedir);
|
||||
vsystem("mkdir -p %s/%s", tconf.homedir, tconf.upload);
|
||||
vsystem("chmod 1777 %s/%s", tconf.homedir, tconf.upload);
|
||||
|
||||
if (DITEM_STATUS(createFtpUser()) == DITEM_SUCCESS) {
|
||||
msgNotify("Copying password information for anon FTP.");
|
||||
vsystem("cp /etc/pwd.db %s/etc && chmod 444 %s/etc/pwd.db", tconf.homedir, tconf.homedir);
|
||||
vsystem("cp /etc/passwd %s/etc && chmod 444 %s/etc/passwd", tconf.homedir, tconf.homedir);
|
||||
vsystem("cp /etc/group %s/etc && chmod 444 %s/etc/group", tconf.homedir, tconf.homedir);
|
||||
vsystem("chown -R %s.%s %s/pub", FTP_NAME, tconf.group, tconf.homedir);
|
||||
}
|
||||
else {
|
||||
msgConfirm("Unable to create FTP user! Anonymous FTP setup failed.");
|
||||
i = DITEM_FAILURE;
|
||||
}
|
||||
|
||||
if (!msgYesNo("Create a welcome message file for anonymous FTP users?")) {
|
||||
char cmd[256];
|
||||
dialog_clear();
|
||||
vsystem("echo Your welcome message here. > %s/etc/%s", tconf.homedir, MOTD_FILE);
|
||||
sprintf(cmd, "%s %s/etc/%s", variable_get(VAR_EDITOR), tconf.homedir, MOTD_FILE);
|
||||
if (!systemExecute(cmd))
|
||||
i = DITEM_SUCCESS;
|
||||
else
|
||||
i = DITEM_FAILURE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
msgConfirm("Invalid Directory: %s\n"
|
||||
"Anonymous FTP will not be set up.", tconf.homedir);
|
||||
i = DITEM_FAILURE;
|
||||
}
|
||||
if (DITEM_STATUS(i) == DITEM_SUCCESS)
|
||||
variable_set2("anon_ftp", "YES");
|
||||
return i | DITEM_RESTORE;
|
||||
}
|
||||
@@ -0,0 +1,611 @@
|
||||
/*
|
||||
* The new sysinstall program.
|
||||
*
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: apache.c,v 1.24 1996/06/15 17:58:49 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Coranth Gryphon. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer,
|
||||
* verbatim and that no modifications are made prior to this
|
||||
* point in the file.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY CORANTH GRYPHON ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL CORANTH GRYPHON OR HIS PETS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
#include <string.h>
|
||||
#include <dialog.h>
|
||||
#include "ui_objects.h"
|
||||
#include "dir.h"
|
||||
#include "dialog.priv.h"
|
||||
#include "colors.h"
|
||||
#include "sysinstall.h"
|
||||
|
||||
|
||||
#define APACHE_HELPFILE "apache"
|
||||
#define APACHE_PACKAGE "apache-1.1.1"
|
||||
#define FREEBSD_GIF "http://www.freebsd.org/gifs/powerlogo.gif"
|
||||
|
||||
/* These change if the package uses different defaults */
|
||||
|
||||
#define DEFAULT_USER "bin"
|
||||
#define DEFAULT_GROUP "bin"
|
||||
#define WELCOME_FILE "index.html"
|
||||
#define USER_HOMEDIR "public_html"
|
||||
|
||||
#define APACHE_BASE "/usr/local/www"
|
||||
#define DATA_SUBDIR "data"
|
||||
#define CONFIG_SUBDIR "server/conf"
|
||||
|
||||
#define LOGS_SUBDIR "/var/log"
|
||||
#define ACCESS_LOGNAME "httpd.access"
|
||||
#define ERROR_LOGNAME "httpd.error"
|
||||
|
||||
/* Set up the structure to hold configuration information */
|
||||
/* Note that this is only what we could fit onto the one screen */
|
||||
|
||||
typedef struct {
|
||||
char docroot[128]; /* DocumentRoot */
|
||||
char userdir[128]; /* UserDir */
|
||||
char welcome[32]; /* Welcome Doc */
|
||||
char email[64]; /* ServerAdmin */
|
||||
char hostname[64]; /* ServerName */
|
||||
char logdir[64]; /* Where to put Logs */
|
||||
char accesslog[32]; /* access_log */
|
||||
char errorlog[32]; /* error_log */
|
||||
char defuser[16]; /* default user id */
|
||||
char defgroup[16]; /* default group id */
|
||||
} ApacheConf;
|
||||
|
||||
static ApacheConf tconf;
|
||||
|
||||
#define APACHE_DOCROOT_LEN 128
|
||||
#define APACHE_USERDIR_LEN 128
|
||||
#define APACHE_WELCOME_LEN 32
|
||||
#define APACHE_EMAIL_LEN 64
|
||||
#define APACHE_HOSTNAME_LEN 64
|
||||
#define APACHE_LOGDIR_LEN 64
|
||||
#define APACHE_ACCESSLOG_LEN 32
|
||||
#define APACHE_ERRORLOG_LEN 32
|
||||
#define APACHE_DEFUSER_LEN 16
|
||||
#define APACHE_DEFGROUP_LEN 16
|
||||
|
||||
static int okbutton, cancelbutton;
|
||||
|
||||
/* What the screen size is meant to be */
|
||||
#define APACHE_DIALOG_Y 0
|
||||
#define APACHE_DIALOG_X 0
|
||||
#define APACHE_DIALOG_WIDTH COLS
|
||||
#define APACHE_DIALOG_HEIGHT LINES - 2
|
||||
|
||||
/* The screen layout structure */
|
||||
typedef struct _layout {
|
||||
int y; /* x & Y co-ordinates */
|
||||
int x;
|
||||
int len; /* The size of the dialog on the screen */
|
||||
int maxlen; /* How much the user can type in ... */
|
||||
char *prompt; /* The string for the prompt */
|
||||
char *help; /* The display for the help line */
|
||||
void *var; /* The var to set when this changes */
|
||||
int type; /* The type of the dialog to create */
|
||||
void *obj; /* The obj pointer returned by libdialog */
|
||||
} Layout;
|
||||
|
||||
static Layout layout[] = {
|
||||
{ 1, 2, 30, HOSTNAME_FIELD_LEN - 1,
|
||||
"Host Name:",
|
||||
"What name to report this host as to client browsers",
|
||||
tconf.hostname, STRINGOBJ, NULL },
|
||||
#define LAYOUT_HOSTNAME 0
|
||||
|
||||
{ 1, 40, 32, APACHE_EMAIL_LEN - 1,
|
||||
"Email Address:",
|
||||
"The email address of the site maintainer, e.g. [email protected]",
|
||||
tconf.email, STRINGOBJ, NULL },
|
||||
#define LAYOUT_EMAIL 1
|
||||
|
||||
{ 5, 5, 20, APACHE_WELCOME_LEN - 1,
|
||||
"Default Document:",
|
||||
"The name of the default document found in each directory",
|
||||
tconf.welcome, STRINGOBJ, NULL },
|
||||
#define LAYOUT_WELCOME 2
|
||||
|
||||
{ 5, 40, 14, APACHE_DEFUSER_LEN - 1,
|
||||
"Default UserID:", "Default UID for access to web pages",
|
||||
tconf.defuser, STRINGOBJ, NULL },
|
||||
#define LAYOUT_DEFUSER 3
|
||||
|
||||
{ 5, 60, 14, APACHE_DEFGROUP_LEN - 1,
|
||||
"Default Group ID:", "Default GID for access to web pages",
|
||||
tconf.defgroup, STRINGOBJ, NULL },
|
||||
#define LAYOUT_DEFGROUP 4
|
||||
|
||||
{ 10, 4, 36, APACHE_DOCROOT_LEN - 1,
|
||||
"Root Document Path:",
|
||||
"The top directory that holds the system web pages",
|
||||
tconf.docroot, STRINGOBJ, NULL },
|
||||
#define LAYOUT_DOCROOT 5
|
||||
|
||||
{ 10, 50, 14, APACHE_USERDIR_LEN - 1,
|
||||
"User Directory:",
|
||||
"Personal sub-directory that holds users' web pages (eg. ~/Web)",
|
||||
tconf.userdir, STRINGOBJ, NULL },
|
||||
#define LAYOUT_USERDIR 6
|
||||
|
||||
{ 14, 4, 28, APACHE_LOGDIR_LEN - 1,
|
||||
"Log Dir:", "Directory to put httpd log files",
|
||||
tconf.logdir, STRINGOBJ, NULL },
|
||||
#define LAYOUT_LOGDIR 7
|
||||
|
||||
{ 14, 38, 16, APACHE_ACCESSLOG_LEN - 1,
|
||||
"Access Log:", "Name of log file to report access",
|
||||
tconf.accesslog, STRINGOBJ, NULL },
|
||||
#define LAYOUT_ACCESSLOG 8
|
||||
|
||||
{ 14, 60, 16, APACHE_ERRORLOG_LEN - 1,
|
||||
"Error Log:", "Name of log file to report errors",
|
||||
tconf.errorlog, STRINGOBJ, NULL },
|
||||
#define LAYOUT_ERRORLOG 9
|
||||
|
||||
{ 19, 15, 0, 0,
|
||||
"OK", "Select this if you are happy with these settings",
|
||||
&okbutton, BUTTONOBJ, NULL },
|
||||
#define LAYOUT_OKBUTTON 10
|
||||
|
||||
{ 19, 45, 0, 0,
|
||||
"CANCEL", "Select this if you wish to cancel this screen",
|
||||
&cancelbutton, BUTTONOBJ, NULL },
|
||||
#define LAYOUT_CANCELBUTTON 11
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
/* This is it - how to get Apache setup values */
|
||||
static int
|
||||
apacheOpenDialog(void)
|
||||
{
|
||||
WINDOW *ds_win;
|
||||
ComposeObj *obj = NULL;
|
||||
ComposeObj *first, *last;
|
||||
int n=0, quit=FALSE, cancel=FALSE, ret;
|
||||
int max;
|
||||
char *tmp;
|
||||
char help[FILENAME_MAX];
|
||||
char title[80];
|
||||
|
||||
/* We need a curses window */
|
||||
ds_win = newwin(LINES, COLS, 0, 0);
|
||||
if (ds_win == 0)
|
||||
{
|
||||
beep();
|
||||
msgConfirm("Cannot open apache dialog window!!");
|
||||
return(DITEM_SUCCESS);
|
||||
}
|
||||
|
||||
/* Say where our help comes from */
|
||||
systemHelpFile(APACHE_HELPFILE, help);
|
||||
use_helpfile(help);
|
||||
|
||||
/* Setup a nice screen for us to splat stuff onto */
|
||||
draw_box(ds_win, APACHE_DIALOG_Y, APACHE_DIALOG_X, APACHE_DIALOG_HEIGHT, APACHE_DIALOG_WIDTH, dialog_attr, border_attr);
|
||||
wattrset(ds_win, dialog_attr);
|
||||
mvwaddstr(ds_win, APACHE_DIALOG_Y, APACHE_DIALOG_X + 20, " Apache HTTPD Configuration ");
|
||||
|
||||
draw_box(ds_win, APACHE_DIALOG_Y + 9, APACHE_DIALOG_X + 1, APACHE_DIALOG_HEIGHT - 13, APACHE_DIALOG_WIDTH - 2,
|
||||
dialog_attr, border_attr);
|
||||
wattrset(ds_win, dialog_attr);
|
||||
sprintf(title, " Path Configuration ");
|
||||
mvwaddstr(ds_win, APACHE_DIALOG_Y + 9, APACHE_DIALOG_X + 22, title);
|
||||
|
||||
/** Initialize the config Data Structure **/
|
||||
|
||||
bzero(&tconf, sizeof(tconf));
|
||||
|
||||
tmp = variable_get(VAR_DOMAINNAME);
|
||||
if (tmp) {
|
||||
sprintf(tconf.email, "webmaster@%s", tmp);
|
||||
sprintf(tconf.hostname, "www.%s", tmp);
|
||||
}
|
||||
|
||||
strcpy(tconf.defuser, DEFAULT_USER);
|
||||
strcpy(tconf.defgroup, DEFAULT_GROUP);
|
||||
|
||||
strcpy(tconf.userdir, USER_HOMEDIR);
|
||||
strcpy(tconf.welcome, WELCOME_FILE);
|
||||
|
||||
strcpy(tconf.logdir, LOGS_SUBDIR);
|
||||
strcpy(tconf.accesslog, ACCESS_LOGNAME);
|
||||
strcpy(tconf.errorlog, ERROR_LOGNAME);
|
||||
|
||||
sprintf(tconf.docroot, "%s/%s", APACHE_BASE,DATA_SUBDIR);
|
||||
|
||||
/* Loop over the layout list, create the objects, and add them
|
||||
onto the chain of objects that dialog uses for traversal*/
|
||||
|
||||
n = 0;
|
||||
|
||||
#define lt layout[n]
|
||||
|
||||
while (lt.help != NULL) {
|
||||
switch (lt.type) {
|
||||
case STRINGOBJ:
|
||||
lt.obj = NewStringObj(ds_win, lt.prompt, lt.var,
|
||||
lt.y + APACHE_DIALOG_Y, lt.x + APACHE_DIALOG_X,
|
||||
lt.len, lt.maxlen);
|
||||
break;
|
||||
|
||||
case BUTTONOBJ:
|
||||
lt.obj = NewButtonObj(ds_win, lt.prompt, lt.var,
|
||||
lt.y + APACHE_DIALOG_Y, lt.x + APACHE_DIALOG_X);
|
||||
break;
|
||||
|
||||
default:
|
||||
msgFatal("Don't support this object yet!");
|
||||
}
|
||||
AddObj(&obj, lt.type, (void *) lt.obj);
|
||||
n++;
|
||||
}
|
||||
max = n - 1;
|
||||
|
||||
/* Find the last object we can traverse to */
|
||||
last = obj;
|
||||
while (last->next)
|
||||
last = last->next;
|
||||
|
||||
/* Find the first object in the list */
|
||||
first = obj;
|
||||
while (first->prev)
|
||||
first = first->prev;
|
||||
|
||||
/* Some more initialisation before we go into the main input loop */
|
||||
n = 0;
|
||||
cancelbutton = 0;
|
||||
cancel = FALSE;
|
||||
okbutton = 0;
|
||||
|
||||
/* Incoming user data - DUCK! */
|
||||
while (!quit) {
|
||||
char help_line[80];
|
||||
int i, len = strlen(lt.help);
|
||||
|
||||
/* Display the help line at the bottom of the screen */
|
||||
for (i = 0; i < 79; i++)
|
||||
help_line[i] = (i < len) ? lt.help[i] : ' ';
|
||||
help_line[i] = '\0';
|
||||
use_helpline(help_line);
|
||||
display_helpline(ds_win, LINES - 1, COLS - 1);
|
||||
|
||||
/* Ask for libdialog to do its stuff */
|
||||
ret = PollObj(&obj);
|
||||
|
||||
/* We are in the Hostname field - calculate the e-mail addr */
|
||||
if (n == LAYOUT_HOSTNAME) {
|
||||
if ((tmp = index(tconf.hostname, '.')) != NULL) {
|
||||
sprintf(tconf.email,"webmaster@%s",tmp+1);
|
||||
RefreshStringObj(layout[LAYOUT_EMAIL].obj);
|
||||
}
|
||||
}
|
||||
|
||||
/* Handle special case stuff that libdialog misses. Sigh */
|
||||
switch (ret) {
|
||||
/* Bail out */
|
||||
case SEL_ESC:
|
||||
quit = TRUE, cancel=TRUE;
|
||||
break;
|
||||
|
||||
/* This doesn't work for list dialogs. Oh well. Perhaps
|
||||
should special case the move from the OK button ``up''
|
||||
to make it go to the interface list, but then it gets
|
||||
awkward for the user to go back and correct screw up's
|
||||
in the per-interface section */
|
||||
|
||||
case KEY_UP:
|
||||
if (obj->prev !=NULL ) {
|
||||
obj = obj->prev;
|
||||
--n;
|
||||
} else {
|
||||
obj = last;
|
||||
n = max;
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_DOWN:
|
||||
if (obj->next != NULL) {
|
||||
obj = obj->next;
|
||||
++n;
|
||||
} else {
|
||||
obj = first;
|
||||
n = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case SEL_TAB:
|
||||
if (n < max)
|
||||
++n;
|
||||
else
|
||||
n = 0;
|
||||
break;
|
||||
|
||||
/* The user has pressed enter over a button object */
|
||||
case SEL_BUTTON:
|
||||
quit = TRUE;
|
||||
if (cancelbutton)
|
||||
cancel = TRUE;
|
||||
break;
|
||||
|
||||
/* Generic CR handler */
|
||||
case SEL_CR:
|
||||
if (n < max)
|
||||
++n;
|
||||
else
|
||||
n = 0;
|
||||
break;
|
||||
|
||||
case SEL_BACKTAB:
|
||||
if (n)
|
||||
--n;
|
||||
else
|
||||
n = max;
|
||||
break;
|
||||
|
||||
case KEY_F(1):
|
||||
display_helpfile();
|
||||
|
||||
/* They tried some key combination we don't support - tell them! */
|
||||
default:
|
||||
beep();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Clear this crap off the screen */
|
||||
dialog_clear();
|
||||
refresh();
|
||||
use_helpfile(NULL);
|
||||
|
||||
if (cancel)
|
||||
return DITEM_FAILURE | DITEM_RESTORE;
|
||||
return DITEM_SUCCESS | DITEM_RESTORE;
|
||||
}
|
||||
|
||||
int
|
||||
configApache(dialogMenuItem *self)
|
||||
{
|
||||
int i;
|
||||
char company[64], file[128];
|
||||
char *tptr;
|
||||
FILE *fptr;
|
||||
|
||||
/* Be optimistic */
|
||||
i = DITEM_SUCCESS;
|
||||
|
||||
dialog_clear();
|
||||
msgConfirm("Since you elected to install the WEB server, we'll now add the\n"
|
||||
"Apache HTTPD package and set up a few configuration files.");
|
||||
i = package_add(APACHE_PACKAGE);
|
||||
if (DITEM_STATUS(i) != DITEM_SUCCESS) {
|
||||
msgConfirm("Hmmmmm. Looks like we weren't able to fetch the Apache WEB server\n"
|
||||
"package. You may wish to fetch and configure it by hand by looking\n"
|
||||
"in /usr/ports/net/apache (in the ports collection) or looking for the\n"
|
||||
"precompiled apache package in packages/networking/%s.", APACHE_PACKAGE);
|
||||
return i | DITEM_RESTORE;
|
||||
}
|
||||
|
||||
dialog_clear();
|
||||
i = apacheOpenDialog();
|
||||
if (DITEM_STATUS(i) != DITEM_SUCCESS) {
|
||||
msgConfirm("Configuration of the Apache WEB server was cancelled per\n"
|
||||
"user request.");
|
||||
return i;
|
||||
}
|
||||
/*** Fix defaults for invalid value ***/
|
||||
if (!tconf.logdir[0])
|
||||
strcpy(tconf.logdir, LOGS_SUBDIR);
|
||||
if (!tconf.accesslog[0])
|
||||
strcpy(tconf.accesslog, ACCESS_LOGNAME);
|
||||
if (!tconf.errorlog[0])
|
||||
strcpy(tconf.errorlog, ERROR_LOGNAME);
|
||||
|
||||
if (!tconf.welcome[0])
|
||||
strcpy(tconf.welcome, WELCOME_FILE);
|
||||
if (!tconf.userdir[0])
|
||||
strcpy(tconf.userdir, USER_HOMEDIR);
|
||||
|
||||
if (!tconf.defuser[0])
|
||||
strcpy(tconf.defuser, DEFAULT_USER);
|
||||
if (!tconf.defgroup[0])
|
||||
strcpy(tconf.defgroup, DEFAULT_GROUP);
|
||||
|
||||
/*** If the user did not specify a directory, use default ***/
|
||||
|
||||
if (tconf.docroot[strlen(tconf.docroot) - 1] == '/')
|
||||
tconf.docroot[strlen(tconf.docroot) - 1] = '\0';
|
||||
|
||||
if (!tconf.docroot[0])
|
||||
sprintf(tconf.docroot, "%s/%s", APACHE_BASE, DATA_SUBDIR);
|
||||
|
||||
/*** If DocRoot does not exist, create it ***/
|
||||
|
||||
if (!directory_exists(tconf.docroot))
|
||||
vsystem("mkdir -p %s", tconf.docroot);
|
||||
|
||||
if (directory_exists(tconf.docroot)) {
|
||||
sprintf(file, "%s/%s", tconf.docroot, tconf.welcome);
|
||||
if (!file_readable(file)) {
|
||||
tptr = msgGetInput(NULL, "What is your company name?");
|
||||
if (tptr && tptr[0])
|
||||
strcpy(company, tptr);
|
||||
else
|
||||
strcpy(company, "our Web Page");
|
||||
|
||||
msgNotify("Creating sample web page...");
|
||||
fptr = fopen(file,"w");
|
||||
if (fptr) {
|
||||
fprintf(fptr, "<CENTER>\n<TITLE>Welcome Page</TITLE>\n");
|
||||
fprintf(fptr, "<H1>Welcome to %s </H1>\n</CENTER>\n",company);
|
||||
fprintf(fptr, "<P><HR SIZE=4>\n<CENTER>\n");
|
||||
fprintf(fptr, "<A HREF=\"http://www.FreeBSD.org/What\">\n");
|
||||
fprintf(fptr, "<IMG SRC=\"%s\" ALIGN=CENTER BORDER=0 ", FREEBSD_GIF);
|
||||
fprintf(fptr, " ALT=\"Powered by FreeBSD\"></A>\n");
|
||||
if (!tconf.email[0]) {
|
||||
if ((tptr = variable_get(VAR_DOMAINNAME)))
|
||||
sprintf(tconf.email, "root@%s", tptr);
|
||||
}
|
||||
if (tconf.email[0]) {
|
||||
fprintf(fptr, "<ADDRESS><H4>\n");
|
||||
fprintf(fptr, " For questions or comments, please send mail to:\n");
|
||||
fprintf(fptr, " <A HREF=\"mailto:%s\">%s</A>\n",
|
||||
tconf.email, tconf.email);
|
||||
fprintf(fptr, "</H4></ADDRESS>\n");
|
||||
}
|
||||
fprintf(fptr, "</CENTER>\n\n");
|
||||
fclose(fptr);
|
||||
}
|
||||
else {
|
||||
msgConfirm("Unable to create sample Web Page.");
|
||||
i = DITEM_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
msgConfirm("Unable to create Document Root Directory.");
|
||||
i = DITEM_FAILURE;
|
||||
}
|
||||
|
||||
msgNotify("Writing configuration files....");
|
||||
|
||||
(void)vsystem("mkdir -p %s/%s", APACHE_BASE, CONFIG_SUBDIR);
|
||||
sprintf(file, "%s/%s/access.conf", APACHE_BASE, CONFIG_SUBDIR);
|
||||
if (file_readable(file))
|
||||
vsystem("mv -f %s %s.ORIG", file, file);
|
||||
|
||||
fptr = fopen(file,"w");
|
||||
if (fptr) {
|
||||
fprintf(fptr, "<Directory %s/cgi-bin>\n", APACHE_BASE);
|
||||
fprintf(fptr, "Options Indexes FollowSymLinks\n");
|
||||
fprintf(fptr, "</Directory>\n");
|
||||
fprintf(fptr, "\n");
|
||||
fprintf(fptr, "<Directory %s>\n", tconf.docroot);
|
||||
fprintf(fptr, "Options Indexes FollowSymLinks\n");
|
||||
fprintf(fptr, "AllowOverride All\n");
|
||||
fprintf(fptr, "</Directory>\n");
|
||||
fprintf(fptr, "\n");
|
||||
fclose(fptr);
|
||||
}
|
||||
else {
|
||||
msgConfirm("Could not create %s",file);
|
||||
i = DITEM_FAILURE;
|
||||
}
|
||||
|
||||
sprintf(file, "%s/%s/httpd.conf", APACHE_BASE, CONFIG_SUBDIR);
|
||||
if (file_readable(file))
|
||||
vsystem("mv -f %s %s.ORIG", file, file);
|
||||
|
||||
fptr = fopen(file,"w");
|
||||
if (fptr) {
|
||||
fprintf(fptr, "ServerType standalone\n");
|
||||
fprintf(fptr, "Port 80\n");
|
||||
fprintf(fptr, "TimeOut 400\n");
|
||||
fprintf(fptr, "\n");
|
||||
fprintf(fptr, "ErrorLog %s/%s\n", LOGS_SUBDIR, ERROR_LOGNAME);
|
||||
fprintf(fptr, "TransferLog %s/%s\n", LOGS_SUBDIR, ACCESS_LOGNAME);
|
||||
fprintf(fptr, "PidFile /var/run/httpd.pid\n");
|
||||
fprintf(fptr, "\n");
|
||||
fprintf(fptr, "StartServers 5\n");
|
||||
fprintf(fptr, "MinSpareServers 5\n");
|
||||
fprintf(fptr, "MaxSpareServers 10\n");
|
||||
fprintf(fptr, "MaxRequestsPerChild 30\n");
|
||||
fprintf(fptr, "MaxClients 150\n");
|
||||
fprintf(fptr, "\n");
|
||||
fprintf(fptr, "User %s\n",tconf.defuser);
|
||||
fprintf(fptr, "Group %s\n",tconf.defgroup);
|
||||
fprintf(fptr, "\n");
|
||||
|
||||
if (tconf.email[0])
|
||||
fprintf(fptr, "ServerAdmin %s\n", tconf.email);
|
||||
if (tconf.hostname[0])
|
||||
fprintf(fptr, "ServerName %s\n", tconf.hostname);
|
||||
|
||||
fclose(fptr);
|
||||
}
|
||||
else {
|
||||
msgConfirm("Could not create %s",file);
|
||||
i = DITEM_FAILURE;
|
||||
}
|
||||
|
||||
sprintf(file, "%s/%s/srm.conf", APACHE_BASE, CONFIG_SUBDIR);
|
||||
if (file_readable(file))
|
||||
vsystem("mv -f %s %s.ORIG", file, file);
|
||||
fptr = fopen(file,"w");
|
||||
if (fptr) {
|
||||
fprintf(fptr, "FancyIndexing on\n");
|
||||
fprintf(fptr, "DefaultType text/plain\n");
|
||||
fprintf(fptr, "IndexIgnore */.??* *~ *# */HEADER* */README* */RCS\n");
|
||||
fprintf(fptr, "HeaderName HEADER\n");
|
||||
fprintf(fptr, "ReadmeName README\n");
|
||||
fprintf(fptr, "AccessFileName .htaccess\n");
|
||||
fprintf(fptr, "\n");
|
||||
fprintf(fptr, "AddEncoding x-compress Z\n");
|
||||
fprintf(fptr, "AddEncoding x-gzip gz\n");
|
||||
fprintf(fptr, "DefaultIcon /icons/unknown.gif\n");
|
||||
fprintf(fptr, "\n");
|
||||
fprintf(fptr, "AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip\n");
|
||||
fprintf(fptr, "AddIconByType (TXT,/icons/text.gif) text/*\n");
|
||||
fprintf(fptr, "AddIconByType (IMG,/icons/image2.gif) image/*\n");
|
||||
fprintf(fptr, "AddIconByType (SND,/icons/sound2.gif) audio/*\n");
|
||||
fprintf(fptr, "AddIconByType (VID,/icons/movie.gif) video/*\n");
|
||||
fprintf(fptr, "\n");
|
||||
|
||||
fprintf(fptr, "AddIcon /icons/text.gif .ps .shtml\n");
|
||||
fprintf(fptr, "AddIcon /icons/movie.gif .mpg .qt\n");
|
||||
fprintf(fptr, "AddIcon /icons/binary.gif .bin\n");
|
||||
fprintf(fptr, "AddIcon /icons/burst.gif .wrl\n");
|
||||
fprintf(fptr, "AddIcon /icons/binhex.gif .hqx .sit\n");
|
||||
fprintf(fptr, "AddIcon /icons/uu.gif .uu\n");
|
||||
fprintf(fptr, "AddIcon /icons/tar.gif .tar\n");
|
||||
fprintf(fptr, "AddIcon /icons/back.gif ..\n");
|
||||
fprintf(fptr, "AddIcon /icons/dir.gif ^^DIRECTORY^^\n");
|
||||
fprintf(fptr, "AddIcon /icons/blank.gif ^^BLANKICON^^\n");
|
||||
fprintf(fptr, "\n");
|
||||
|
||||
fprintf(fptr, "ScriptAlias /cgi_bin/ %s/cgi_bin/\n",APACHE_BASE);
|
||||
fprintf(fptr, "Alias /icons/ %s/icons/\n",APACHE_BASE);
|
||||
fprintf(fptr, "DocumentRoot %s\n",tconf.docroot);
|
||||
fprintf(fptr, "UserDir %s\n", tconf.userdir);
|
||||
fprintf(fptr, "DirectoryIndex %s\n", tconf.welcome);
|
||||
fprintf(fptr, "\n");
|
||||
|
||||
fclose(fptr);
|
||||
}
|
||||
else {
|
||||
msgConfirm("Could not create %s",file);
|
||||
i = DITEM_FAILURE;
|
||||
}
|
||||
if (DITEM_STATUS(i) == DITEM_SUCCESS)
|
||||
variable_set2("apache_httpd", "YES");
|
||||
return i | DITEM_RESTORE;
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* The new sysinstall program.
|
||||
*
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated for what's essentially a complete rewrite.
|
||||
*
|
||||
* $Id: doc.c,v 1.17 1996/07/02 01:03:40 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer,
|
||||
* verbatim and that no modifications are made prior to this
|
||||
* point in the file.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
|
||||
*
|
||||
*/
|
||||
|
||||
#include "sysinstall.h"
|
||||
|
||||
/*
|
||||
* This is called from the main menu. Try to find a copy of Lynx from somewhere
|
||||
* and fire it up on the first copy of the handbook we can find.
|
||||
*/
|
||||
int
|
||||
docBrowser(dialogMenuItem *self)
|
||||
{
|
||||
int ret;
|
||||
char *browser = variable_get(VAR_BROWSER_PACKAGE);
|
||||
|
||||
if (RunningAsInit && !strstr(variable_get(SYSTEM_STATE), "install")) {
|
||||
msgConfirm("This option may only be used after the system is installed, sorry!");
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
|
||||
/* First, make sure we have whatever browser we've chosen is here */
|
||||
if (!package_exists(browser)) {
|
||||
ret = package_add(browser);
|
||||
if (DITEM_STATUS(ret) != DITEM_SUCCESS) {
|
||||
msgConfirm("Unable to install the %s HTML browser package. You may\n"
|
||||
"wish to verify that your media is configured correctly and\n"
|
||||
"try again.", browser);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (!file_executable(variable_get(VAR_BROWSER_BINARY))) {
|
||||
if (!msgYesNo("Hmmm. The %s package claims to have installed, but I can't\n"
|
||||
"find its binary in %s! You may wish to try a different\n"
|
||||
"location to load the package from (go to Media menu) and see if that\n"
|
||||
"makes a difference.\n\n"
|
||||
"I suggest that we remove the version that was extracted since it does\n"
|
||||
"not appear to be correct. Would you like me to do that now?"))
|
||||
vsystem("pkg_delete %s %s", !strcmp(variable_get(VAR_CPIO_VERBOSITY), "high") ? "-v" : "", browser);
|
||||
return DITEM_FAILURE | DITEM_RESTORE;
|
||||
}
|
||||
|
||||
/* Run browser on the appropriate doc */
|
||||
if (dmenuOpenSimple(&MenuHTMLDoc, FALSE))
|
||||
return DITEM_SUCCESS | DITEM_RECREATE;
|
||||
else
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
}
|
||||
|
||||
/* Try to show one of the documents requested from the HTML doc menu */
|
||||
int
|
||||
docShowDocument(dialogMenuItem *self)
|
||||
{
|
||||
char tmp[512], target[512];
|
||||
char *where = NULL;
|
||||
char *browser = variable_get(VAR_BROWSER_BINARY);
|
||||
char *str = self->prompt;
|
||||
|
||||
if (!file_executable(browser)) {
|
||||
msgConfirm("Can't find the browser in %s! Please ensure that it's\n"
|
||||
"properly set in the Options editor.", browser);
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
if (!strcmp(str, "Home"))
|
||||
where = "http://www.freebsd.org";
|
||||
else if (!strcmp(str, "Other"))
|
||||
where = msgGetInput("http://www.freebsd.org", "Please enter the URL of the location you wish to visit.");
|
||||
else if (!strcmp(str, "FAQ")) {
|
||||
strcpy(target, "/usr/share/doc/FAQ/freebsd-faq.html");
|
||||
if (!file_readable(target))
|
||||
strcpy(target, "http://www.freebsd.org/FAQ");
|
||||
where = target;
|
||||
}
|
||||
else if (!strcmp(str, "Handbook")) {
|
||||
strcpy(target, "/usr/share/doc/handbook/handbook.html");
|
||||
if (!file_readable(target))
|
||||
strcpy(target, "http://www.freebsd.org/handbook");
|
||||
where = target;
|
||||
}
|
||||
if (where) {
|
||||
sprintf(tmp, "%s %s", browser, where);
|
||||
dialog_clear();
|
||||
systemExecute(tmp);
|
||||
return DITEM_SUCCESS | DITEM_RESTORE;
|
||||
}
|
||||
else {
|
||||
msgConfirm("Hmmmmm! I can't seem to access the documentation you selected!\n"
|
||||
"Have you loaded the bin distribution? Is your network connected?");
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
This screen allows you to configure the anonymous FTP user.
|
||||
|
||||
The following configuration values are editable:
|
||||
|
||||
UID: The user ID you wish to assign to the anonymous FTP user.
|
||||
All files uploaded will be owned by this ID.
|
||||
|
||||
Group: Which group you wish the anonymous FTP user to be in.
|
||||
|
||||
Comment: String describing this user in /etc/passwd
|
||||
|
||||
|
||||
FTP Root Directory:
|
||||
|
||||
Where files available for anonymous FTP will be kept.
|
||||
|
||||
Upload subdirectory:
|
||||
|
||||
Where files uploaded by anonymous FTP users will go.
|
||||
@@ -0,0 +1,51 @@
|
||||
There are two sets of options that the Apache HTTP Server needs.
|
||||
|
||||
The first set covers how it operates. These are as follows:
|
||||
|
||||
The "HostName" field is the name of this host, as it is
|
||||
reported to each client connection. Normally, the fully
|
||||
qualified domain name of the host running the server is
|
||||
returned. If you want this set to something else, however,
|
||||
(usually "www.my.domain") then this can be entered here.
|
||||
|
||||
Additionally, the server needs to know how many connections
|
||||
are allowed at one time - this is the "Max Connections"
|
||||
field. If more than this number of clients attempt to connect
|
||||
at once, the additional connections will be refused. This is
|
||||
used to limit how much system load will be imposed by the HTTP
|
||||
server.
|
||||
|
||||
The "Email Address" field is the address of the person (or
|
||||
system alias) who is the administrator for this web site. In
|
||||
addition to being used by the Apache Server itself, it is also
|
||||
put at the bottom of the sample web page that is created.
|
||||
|
||||
Finally, the "Default User" and "Default Group" fields specify
|
||||
what user id and group id should be used by the server for
|
||||
remote connections. Local connections are kept as the UID and
|
||||
GID of the local process.
|
||||
|
||||
The second set of options determine what information is made available
|
||||
to each client:
|
||||
|
||||
The "Document Root Path" is the top of the tree of documents
|
||||
that are made avaliable. For example, if the value is
|
||||
"/usr/web", then the URL "http://www.foo.com/doc.html" would
|
||||
translate as "/usr/web/doc.html".
|
||||
|
||||
Similarly, the "User Directory" is the location in each user's
|
||||
home directory where their public web documents are
|
||||
stored. Thus if the value if this is "Public", then the URL
|
||||
"http://www.foo.com/~joe/doc" would translate to the path
|
||||
"~joe/Public/doc".
|
||||
|
||||
Finally, if the URL points to a directory, there is always a
|
||||
"Default Document" that Apache will use. This field holds the
|
||||
name (not the path) of this document. By default, Apache uses
|
||||
the file "index.html". However, some sites may be more used to
|
||||
using the file "welcome.html".
|
||||
|
||||
There are a number of other options that can be configured with
|
||||
Apache, such as path aliases, masquerading as multiple hosts, server
|
||||
child process parameters, and so forth. For more information on these,
|
||||
consult the Apache man pages at http://www.apache.org.
|
||||
@@ -0,0 +1,38 @@
|
||||
Welcome to the 2.1 (or 2.0.5) -> 2.1.5 upgrade procedure!
|
||||
|
||||
It must first be said that this upgrade DOES NOT take a particularly
|
||||
sophisticated approach to the upgrade problem, it being more a question
|
||||
of providing what seemed "good enough" at the time. A truly polished
|
||||
upgrade that deals properly with the broad spectrum of installed 2.0.5 / 2.1
|
||||
systems would be nice to have, but until that gets written what you get is
|
||||
this - the brute-force approach!
|
||||
|
||||
What this upgrade will attempt to do is best summarized thusly:
|
||||
|
||||
1. fsck and mount all file systems chosen in the label editor.
|
||||
2. Ask for a location to preserve your /etc directory into and do so.
|
||||
3. Extract all selected distributions on top of your existing system.
|
||||
4. Copy certain obvious files back from the preserved /etc, leaving the
|
||||
rest of the /etc file merge up to the user.
|
||||
5. Drop user in a shell so that they may perform that merge before
|
||||
rebooting into the new system.
|
||||
|
||||
And that's it! This "upgrade" is not going to hold your hand in all
|
||||
major respects, it's simply provided to make one PART of the upgrade
|
||||
easier.
|
||||
|
||||
IMPORTANT NOTE: What this upgrade procedure may also do, in fact, is
|
||||
completely destroy your system (though much more quickly than you
|
||||
would have been able to destroy it yourself). It is simply impossible
|
||||
to guarantee that this procedure's crude form of upgrade automation
|
||||
will work in all cases and if you do this upgrade without proper
|
||||
BACKUPS for any important data then you really must like living life
|
||||
close to the edge, that's all we can say!
|
||||
|
||||
NOTE to 2.0 users: We're sorry, but the "slice" changes that were
|
||||
added in FreeBSD 2.0.5 made automated upgrades pretty difficult due to
|
||||
the fact that a complete reinstall is pretty much called for. Things
|
||||
may still *work* after a 2.1 upgrade, but you will also no doubt
|
||||
receive many warnings at boot time about non-aligned slices and such;
|
||||
we really do recommend a fresh installation for 2.0 systems! (But
|
||||
back up your user data first :-).
|
||||
@@ -0,0 +1,582 @@
|
||||
/*
|
||||
* The new sysinstall program.
|
||||
*
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: index.c,v 1.35 1996/06/14 14:33:53 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer,
|
||||
* verbatim and that no modifications are made prior to this
|
||||
* point in the file.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <ncurses.h>
|
||||
#include <dialog.h>
|
||||
#include "sysinstall.h"
|
||||
|
||||
/* Macros and magic values */
|
||||
#define MAX_MENU 12
|
||||
#define _MAX_DESC 60
|
||||
|
||||
static int index_extract_one(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended);
|
||||
|
||||
/* Smarter strdup */
|
||||
inline char *
|
||||
_strdup(char *ptr)
|
||||
{
|
||||
return ptr ? strdup(ptr) : NULL;
|
||||
}
|
||||
|
||||
static char *descrs[] = {
|
||||
"Package Selection", "To mark a package or select a category, move to it and press SPACE.\n"
|
||||
"To unmark a package, press SPACE again. To go to a previous menu,\n"
|
||||
"select the Cancel button. To search for a package by name, press ESC.\n"
|
||||
"To finally extract packages, you should Cancel all the way out of any\n"
|
||||
"submenus and then this top menu. NOTE: The All category selection\n"
|
||||
"creates a very large submenu. If you select it, please be patient.",
|
||||
"Package Targets", "These are the packages you've selected for extraction.\n\n"
|
||||
"If you're sure of these choices, select OK.\n"
|
||||
"If not, select Cancel to go back to the package selection menu.\n",
|
||||
"All", "All available packages in all categories.",
|
||||
"applications", "User application software.",
|
||||
"archivers", "Utilities for archiving and unarchiving data.",
|
||||
"audio", "Audio utilities - most require a supported sound card.",
|
||||
"benchmarks", "Utilities for measuring system performance.",
|
||||
"benchmarking", "Utilities for measuring system performance.",
|
||||
"cad", "Computer Aided Design utilities.",
|
||||
"comms", "Communications utilities.",
|
||||
"databases", "Database software.",
|
||||
"devel", "Software development utilities and libraries.",
|
||||
"development", "Software development utilities and libraries.",
|
||||
"documentation", "Document preparation utilities.",
|
||||
"editors", "Common text editors.",
|
||||
"emulation", "Utilities for emulating other OS types.",
|
||||
"emulators", "Utilities for emulating other OS types.",
|
||||
"games", "Various and sundry amusements.",
|
||||
"graphics", "Graphics libraries and utilities.",
|
||||
"japanese", "Ported software for the Japanese market.",
|
||||
"lang", "Computer languages.",
|
||||
"languages", "Computer languages.",
|
||||
"libraries", "Software development libraries.",
|
||||
"mail", "Electronic mail packages and utilities.",
|
||||
"math", "Mathematical computation software.",
|
||||
"misc", "Miscellaneous utilities.",
|
||||
"net", "Networking utilities.",
|
||||
"networking", "Networking utilities.",
|
||||
"news", "USENET News support software.",
|
||||
"numeric", "Mathematical computation software.",
|
||||
"orphans", "Packages without a home elsewhere.",
|
||||
"plan9", "Software from the plan9 Operating System.",
|
||||
"print", "Utilities for dealing with printing.",
|
||||
"printing", "Utilities for dealing with printing.",
|
||||
"programming", "Software development utilities and libraries.",
|
||||
"russian", "Ported software for the Russian market.",
|
||||
"security", "System security software.",
|
||||
"shells", "Various shells (tcsh, bash, etc).",
|
||||
"sysutils", "Various system utilities.",
|
||||
"www", "WEB utilities (browers, HTTP servers, etc).",
|
||||
"troff", "TROFF Text formatting utilities.",
|
||||
"utils", "Various user utilities.",
|
||||
"utilities", "Various user utilities.",
|
||||
"x11", "X Window System based utilities.",
|
||||
NULL, NULL,
|
||||
};
|
||||
|
||||
static char *
|
||||
fetch_desc(char *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; descrs[i]; i += 2) {
|
||||
if (!strcmp(descrs[i], name))
|
||||
return descrs[i + 1];
|
||||
}
|
||||
return "No description provided";
|
||||
}
|
||||
|
||||
static PkgNodePtr
|
||||
new_pkg_node(char *name, node_type type)
|
||||
{
|
||||
PkgNodePtr tmp = safe_malloc(sizeof(PkgNode));
|
||||
|
||||
tmp->name = _strdup(name);
|
||||
tmp->type = type;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static char *
|
||||
strip(char *buf)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; buf[i]; i++)
|
||||
if (buf[i] == '\t' || buf[i] == '\n')
|
||||
buf[i] = ' ';
|
||||
return buf;
|
||||
}
|
||||
|
||||
static IndexEntryPtr
|
||||
new_index(char *name, char *pathto, char *prefix, char *comment, char *descr, char *maint, char *deps)
|
||||
{
|
||||
IndexEntryPtr tmp = safe_malloc(sizeof(IndexEntry));
|
||||
|
||||
tmp->name = _strdup(name);
|
||||
tmp->path = _strdup(pathto);
|
||||
tmp->prefix = _strdup(prefix);
|
||||
tmp->comment = _strdup(comment);
|
||||
tmp->descrfile = strip(_strdup(descr));
|
||||
tmp->maintainer = _strdup(maint);
|
||||
tmp->deps = _strdup(deps);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static void
|
||||
index_register(PkgNodePtr top, char *where, IndexEntryPtr ptr)
|
||||
{
|
||||
PkgNodePtr p, q;
|
||||
|
||||
for (q = NULL, p = top->kids; p; p = p->next) {
|
||||
if (!strcmp(p->name, where)) {
|
||||
q = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!p) {
|
||||
/* Add new category */
|
||||
q = new_pkg_node(where, PLACE);
|
||||
q->desc = fetch_desc(where);
|
||||
q->next = top->kids;
|
||||
top->kids = q;
|
||||
}
|
||||
p = new_pkg_node(ptr->name, PACKAGE);
|
||||
p->desc = ptr->comment;
|
||||
p->data = ptr;
|
||||
p->next = q->kids;
|
||||
q->kids = p;
|
||||
}
|
||||
|
||||
static int
|
||||
copy_to_sep(char *to, char *from, int sep)
|
||||
{
|
||||
char *tok;
|
||||
|
||||
tok = strchr(from, sep);
|
||||
if (!tok) {
|
||||
*to = '\0';
|
||||
return 0;
|
||||
}
|
||||
*tok = '\0';
|
||||
strcpy(to, from);
|
||||
return tok + 1 - from;
|
||||
}
|
||||
|
||||
static int
|
||||
readline(int fd, char *buf, int max)
|
||||
{
|
||||
int rv, i = 0;
|
||||
char ch;
|
||||
|
||||
while ((rv = read(fd, &ch, 1)) == 1 && ch != '\n' && i < max)
|
||||
buf[i++] = ch;
|
||||
if (i < max)
|
||||
buf[i] = '\0';
|
||||
return rv;
|
||||
}
|
||||
|
||||
int
|
||||
index_parse(int fd, char *name, char *pathto, char *prefix, char *comment, char *descr, char *maint, char *cats, char *deps)
|
||||
{
|
||||
char line[1024];
|
||||
char *cp;
|
||||
int i;
|
||||
|
||||
i = readline(fd, line, 1024);
|
||||
if (i <= 0)
|
||||
return EOF;
|
||||
cp = line;
|
||||
cp += copy_to_sep(name, cp, '|');
|
||||
cp += copy_to_sep(pathto, cp, '|');
|
||||
cp += copy_to_sep(prefix, cp, '|');
|
||||
cp += copy_to_sep(comment, cp, '|');
|
||||
cp += copy_to_sep(descr, cp, '|');
|
||||
cp += copy_to_sep(maint, cp, '|');
|
||||
cp += copy_to_sep(cats, cp, '|');
|
||||
(void)copy_to_sep(deps, cp, '|');
|
||||
/* We're not actually interested in any of the other fields */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
index_get(char *fname, PkgNodePtr papa)
|
||||
{
|
||||
int i, fd;
|
||||
|
||||
fd = open(fname, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "Unable to open index file `%s' for reading.\n", fname);
|
||||
i = -1;
|
||||
}
|
||||
else
|
||||
i = index_read(fd, papa);
|
||||
close(fd);
|
||||
return i;
|
||||
}
|
||||
|
||||
int
|
||||
index_read(int fd, PkgNodePtr papa)
|
||||
{
|
||||
char name[127], pathto[255], prefix[255], comment[255], descr[127], maint[127], cats[511], deps[511];
|
||||
|
||||
while (index_parse(fd, name, pathto, prefix, comment, descr, maint, cats, deps) != EOF) {
|
||||
char *cp, *cp2, tmp[511];
|
||||
IndexEntryPtr idx;
|
||||
|
||||
idx = new_index(name, pathto, prefix, comment, descr, maint, deps);
|
||||
/* For now, we only add things to menus if they're in categories. Keywords are ignored */
|
||||
for (cp = strcpy(tmp, cats); (cp2 = strchr(cp, ' ')) != NULL; cp = cp2 + 1) {
|
||||
*cp2 = '\0';
|
||||
index_register(papa, cp, idx);
|
||||
}
|
||||
index_register(papa, cp, idx);
|
||||
|
||||
/* Add to special "All" category */
|
||||
index_register(papa, "All", idx);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
index_init(PkgNodePtr top, PkgNodePtr plist)
|
||||
{
|
||||
if (top) {
|
||||
top->next = top->kids = NULL;
|
||||
top->name = "Package Selection";
|
||||
top->type = PLACE;
|
||||
top->desc = fetch_desc(top->name);
|
||||
top->data = NULL;
|
||||
}
|
||||
if (plist) {
|
||||
plist->next = plist->kids = NULL;
|
||||
plist->name = "Package Targets";
|
||||
plist->type = PLACE;
|
||||
plist->desc = fetch_desc(plist->name);
|
||||
plist->data = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
index_print(PkgNodePtr top, int level)
|
||||
{
|
||||
int i;
|
||||
|
||||
while (top) {
|
||||
for (i = 0; i < level; i++) putchar('\t');
|
||||
printf("name [%s]: %s\n", top->type == PLACE ? "place" : "package", top->name);
|
||||
for (i = 0; i < level; i++) putchar('\t');
|
||||
printf("desc: %s\n", top->desc);
|
||||
if (top->kids)
|
||||
index_print(top->kids, level + 1);
|
||||
top = top->next;
|
||||
}
|
||||
}
|
||||
|
||||
/* Swap one node for another */
|
||||
static void
|
||||
swap_nodes(PkgNodePtr a, PkgNodePtr b)
|
||||
{
|
||||
PkgNode tmp;
|
||||
|
||||
tmp = *a;
|
||||
*a = *b;
|
||||
a->next = tmp.next;
|
||||
tmp.next = b->next;
|
||||
*b = tmp;
|
||||
}
|
||||
|
||||
/* Use a disgustingly simplistic bubble sort to put our lists in order */
|
||||
void
|
||||
index_sort(PkgNodePtr top)
|
||||
{
|
||||
PkgNodePtr p, q;
|
||||
|
||||
/* Sort everything at the top level */
|
||||
for (p = top->kids; p; p = p->next) {
|
||||
for (q = top->kids; q; q = q->next) {
|
||||
if (q->next && strcmp(q->name, q->next->name) > 0)
|
||||
swap_nodes(q, q->next);
|
||||
}
|
||||
}
|
||||
|
||||
/* Now sub-sort everything n levels down */
|
||||
|
||||
for (p = top->kids; p; p = p->next) {
|
||||
if (p->kids)
|
||||
index_sort(p);
|
||||
}
|
||||
}
|
||||
|
||||
/* Delete an entry out of the list it's in (only the plist, at present) */
|
||||
void
|
||||
index_delete(PkgNodePtr n)
|
||||
{
|
||||
if (n->next) {
|
||||
PkgNodePtr p = n->next;
|
||||
|
||||
*n = *(n->next);
|
||||
safe_free(p);
|
||||
}
|
||||
else /* Kludgy end sentinal */
|
||||
n->name = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Search for a given node by name, returning the category in if
|
||||
* tp is non-NULL.
|
||||
*/
|
||||
PkgNodePtr
|
||||
index_search(PkgNodePtr top, char *str, PkgNodePtr *tp)
|
||||
{
|
||||
PkgNodePtr p, sp;
|
||||
|
||||
for (p = top->kids; p && p->name; p = p->next) {
|
||||
/* Subtract out the All category from searches */
|
||||
if (!strcmp(p->name, "All"))
|
||||
continue;
|
||||
|
||||
/* If tp == NULL, we're looking for an exact package match */
|
||||
if (!tp && !strncmp(p->name, str, strlen(str)))
|
||||
return p;
|
||||
|
||||
/* If tp, we're looking for both a package and a pointer to the place it's in */
|
||||
if (tp && !strncmp(p->name, str, strlen(str))) {
|
||||
*tp = top;
|
||||
return p;
|
||||
}
|
||||
|
||||
/* The usual recursion-out-of-laziness ploy */
|
||||
if (p->kids)
|
||||
if ((sp = index_search(p, str, tp)) != NULL)
|
||||
return sp;
|
||||
}
|
||||
if (p && !p->name)
|
||||
p = NULL;
|
||||
return p;
|
||||
}
|
||||
|
||||
int
|
||||
pkg_checked(dialogMenuItem *self)
|
||||
{
|
||||
PkgNodePtr kp = self->data, plist = (PkgNodePtr)self->aux;
|
||||
int i;
|
||||
|
||||
i = index_search(plist, kp->name, NULL) ? TRUE : FALSE;
|
||||
if (kp->type == PACKAGE && plist)
|
||||
return i || package_exists(kp->name);
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
pkg_fire(dialogMenuItem *self)
|
||||
{
|
||||
int ret;
|
||||
PkgNodePtr sp, kp = self->data, plist = (PkgNodePtr)self->aux;
|
||||
|
||||
if (!plist)
|
||||
ret = DITEM_FAILURE;
|
||||
else if (kp->type == PACKAGE) {
|
||||
sp = index_search(plist, kp->name, NULL);
|
||||
/* Not already selected? */
|
||||
if (!sp) {
|
||||
if (!package_exists(kp->name)) {
|
||||
PkgNodePtr np = (PkgNodePtr)safe_malloc(sizeof(PkgNode));
|
||||
|
||||
*np = *kp;
|
||||
np->next = plist->kids;
|
||||
plist->kids = np;
|
||||
msgInfo("Added %s to selection list", kp->name);
|
||||
}
|
||||
}
|
||||
else if (sp) {
|
||||
msgInfo("Removed %s from selection list", kp->name);
|
||||
index_delete(sp);
|
||||
}
|
||||
ret = DITEM_SUCCESS;
|
||||
}
|
||||
else { /* Not a package, must be a directory */
|
||||
int p, s;
|
||||
|
||||
p = s = 0;
|
||||
index_menu(kp, plist, &p, &s);
|
||||
ret = DITEM_SUCCESS | DITEM_CONTINUE;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
pkg_selected(dialogMenuItem *self, int is_selected)
|
||||
{
|
||||
PkgNodePtr kp = self->data;
|
||||
|
||||
if (!is_selected || kp->type != PACKAGE)
|
||||
return;
|
||||
msgInfo(kp->desc);
|
||||
}
|
||||
|
||||
int
|
||||
index_menu(PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll)
|
||||
{
|
||||
int n, rval, maxname;
|
||||
int curr, max;
|
||||
PkgNodePtr kp;
|
||||
dialogMenuItem *nitems;
|
||||
Boolean hasPackages;
|
||||
WINDOW *w;
|
||||
|
||||
hasPackages = FALSE;
|
||||
nitems = NULL;
|
||||
|
||||
w = savescr();
|
||||
n = maxname = 0;
|
||||
/* Figure out if this menu is full of "leaves" or "branches" */
|
||||
for (kp = top->kids; kp && kp->name; kp = kp->next) {
|
||||
int len;
|
||||
|
||||
++n;
|
||||
if (kp->type == PACKAGE && plist) {
|
||||
hasPackages = TRUE;
|
||||
if ((len = strlen(kp->name)) > maxname)
|
||||
maxname = len;
|
||||
}
|
||||
}
|
||||
if (!n && plist) {
|
||||
msgConfirm("The %s menu is empty.", top->name);
|
||||
restorescr(w);
|
||||
return DITEM_LEAVE_MENU;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
n = 0;
|
||||
curr = max = 0;
|
||||
kp = top->kids;
|
||||
while (kp && kp->name) {
|
||||
char buf[256];
|
||||
|
||||
/* Brutally adjust description to fit in menu */
|
||||
strcpy(buf, kp->desc);
|
||||
if (strlen(buf) > (_MAX_DESC - maxname))
|
||||
buf[_MAX_DESC - maxname] = '\0';
|
||||
nitems = item_add(nitems, kp->name, buf, pkg_checked, pkg_fire, pkg_selected, kp, (int)plist, &curr, &max);
|
||||
++n;
|
||||
kp = kp->next;
|
||||
}
|
||||
/* NULL delimiter so item_free() knows when to stop later */
|
||||
nitems = item_add(nitems, NULL, NULL, NULL, NULL, NULL, NULL, 0, &curr, &max);
|
||||
|
||||
recycle:
|
||||
dialog_clear();
|
||||
if (hasPackages)
|
||||
rval = dialog_checklist(top->name, top->desc, -1, -1, n > MAX_MENU ? MAX_MENU : n, -n, nitems, NULL);
|
||||
else /* It's a categories menu */
|
||||
rval = dialog_menu(top->name, top->desc, -1, -1, n > MAX_MENU ? MAX_MENU : n, -n,
|
||||
nitems, NULL, pos, scroll);
|
||||
if (rval == -1 && plist) {
|
||||
static char *cp;
|
||||
PkgNodePtr menu;
|
||||
|
||||
/* Search */
|
||||
if ((cp = msgGetInput(cp, "Search by package name. Please enter search string:")) != NULL) {
|
||||
PkgNodePtr p = index_search(top, cp, &menu);
|
||||
|
||||
if (p) {
|
||||
int pos, scroll;
|
||||
|
||||
/* These need to be set to point at the found item, actually. Hmmm! */
|
||||
pos = scroll = 0;
|
||||
index_menu(menu, plist, &pos, &scroll);
|
||||
}
|
||||
else
|
||||
msgConfirm("Search string: %s yielded no hits.", cp);
|
||||
}
|
||||
goto recycle;
|
||||
}
|
||||
items_free(nitems, &curr, &max);
|
||||
restorescr(w);
|
||||
return rval ? DITEM_FAILURE : DITEM_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
index_extract(Device *dev, PkgNodePtr top, PkgNodePtr plist)
|
||||
{
|
||||
PkgNodePtr tmp;
|
||||
int status = DITEM_SUCCESS;
|
||||
|
||||
for (tmp = plist->kids; tmp && tmp->name; tmp = tmp->next)
|
||||
status = index_extract_one(dev, top, tmp, FALSE);
|
||||
return status;
|
||||
}
|
||||
|
||||
static int
|
||||
index_extract_one(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended)
|
||||
{
|
||||
int status = DITEM_SUCCESS;
|
||||
PkgNodePtr tmp2;
|
||||
IndexEntryPtr id = who->data;
|
||||
|
||||
if (id && id->deps && strlen(id->deps)) {
|
||||
char t[1024], *cp, *cp2;
|
||||
|
||||
strcpy(t, id->deps);
|
||||
cp = t;
|
||||
while (cp && DITEM_STATUS(status) == DITEM_SUCCESS) {
|
||||
if ((cp2 = index(cp, ' ')) != NULL)
|
||||
*cp2 = '\0';
|
||||
if ((tmp2 = index_search(top, cp, NULL)) != NULL) {
|
||||
status = index_extract_one(dev, top, tmp2, TRUE);
|
||||
if (DITEM_STATUS(status) != DITEM_SUCCESS) {
|
||||
if (variable_get(VAR_NO_CONFIRM))
|
||||
msgNotify("Loading of dependant package %s failed", cp);
|
||||
else
|
||||
msgConfirm("Loading of dependant package %s failed", cp);
|
||||
}
|
||||
if (cp2)
|
||||
cp = cp2 + 1;
|
||||
else
|
||||
cp = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Done with the deps? Load the real m'coy */
|
||||
if (DITEM_STATUS(status) == DITEM_SUCCESS)
|
||||
status = package_extract(dev, who->name, depended);
|
||||
return status;
|
||||
}
|
||||
@@ -0,0 +1,387 @@
|
||||
/*
|
||||
* The new sysinstall program.
|
||||
*
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: installUpgrade.c,v 1.29 1996/07/08 08:54:28 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer,
|
||||
* verbatim and that no modifications are made prior to this
|
||||
* point in the file.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "sysinstall.h"
|
||||
#include <sys/disklabel.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
typedef struct _hitList {
|
||||
enum { JUST_COPY, CALL_HANDLER } action ;
|
||||
char *name;
|
||||
Boolean optional;
|
||||
void (*handler)(struct _hitList *self);
|
||||
} HitList;
|
||||
|
||||
/* cop-out function for files we can't handle */
|
||||
static void
|
||||
doByHand(HitList *h)
|
||||
{
|
||||
msgConfirm("/etc/%s is one of those files that this upgrade procedure just isn't\n"
|
||||
"smart enough to deal with right now. You'll need to merge the old and\n"
|
||||
"new versions by hand when the option to do so manually is later\n"
|
||||
"presented (in the meantime, you might want to write the name of\n"
|
||||
"this file down! - the holographic shell on VTY4 is a good place for\n"
|
||||
"this).", h->name);
|
||||
}
|
||||
|
||||
static void
|
||||
yellSysconfig(HitList *h)
|
||||
{
|
||||
msgConfirm("/etc/sysconfig is one of those files that this upgrade procedure just isn't\n"
|
||||
"smart enough to deal with right now. Unfortunately, your system\n"
|
||||
"will also come up with a very different \"personality\" than it had\n"
|
||||
"before if you do not merge at LEAST the hostname and ifconfig lines\n"
|
||||
"from the old one! This is very important, so please do this merge\n"
|
||||
"even if you do no others before the system is allowed to reboot.");
|
||||
}
|
||||
|
||||
/* These are the only meaningful files I know about */
|
||||
static HitList etc_files [] = {
|
||||
{ JUST_COPY, "Xaccel.ini", TRUE, NULL },
|
||||
{ JUST_COPY, "adduser.conf", TRUE, NULL },
|
||||
{ JUST_COPY, "aliases", TRUE, NULL },
|
||||
{ JUST_COPY, "aliases.db", TRUE, NULL },
|
||||
{ JUST_COPY, "amd.map", TRUE, NULL },
|
||||
{ JUST_COPY, "crontab", TRUE, NULL },
|
||||
{ JUST_COPY, "csh.cshrc", TRUE, NULL },
|
||||
{ JUST_COPY, "csh.login", TRUE, NULL },
|
||||
{ JUST_COPY, "csh.logout", TRUE, NULL },
|
||||
{ JUST_COPY, "daily", TRUE, NULL },
|
||||
{ JUST_COPY, "disktab", TRUE, NULL },
|
||||
{ JUST_COPY, "dm.conf", TRUE, NULL },
|
||||
{ JUST_COPY, "exports", TRUE, NULL },
|
||||
{ JUST_COPY, "fbtab", TRUE, NULL },
|
||||
{ CALL_HANDLER, "fstab", FALSE, doByHand },
|
||||
{ JUST_COPY, "ftpusers", TRUE, NULL },
|
||||
{ JUST_COPY, "gnats", TRUE, NULL },
|
||||
{ JUST_COPY, "group", FALSE, NULL },
|
||||
{ JUST_COPY, "host.conf", TRUE, NULL },
|
||||
{ JUST_COPY, "hosts", TRUE, NULL },
|
||||
{ JUST_COPY, "hosts.equiv", TRUE, NULL },
|
||||
{ JUST_COPY, "hosts.lpd", TRUE, NULL },
|
||||
{ CALL_HANDLER, "inetd.conf", FALSE, doByHand },
|
||||
{ CALL_HANDLER, "kerberosIV", TRUE, doByHand },
|
||||
{ JUST_COPY, "localtime", TRUE, NULL },
|
||||
{ JUST_COPY, "login.access", TRUE, NULL },
|
||||
{ JUST_COPY, "mail.rc", TRUE, NULL },
|
||||
{ JUST_COPY, "make.conf", TRUE, NULL },
|
||||
{ JUST_COPY, "manpath.config", TRUE, NULL },
|
||||
{ JUST_COPY, "master.passwd", TRUE, NULL },
|
||||
{ JUST_COPY, "mib.txt", TRUE, NULL },
|
||||
{ JUST_COPY, "modems", TRUE, NULL },
|
||||
{ JUST_COPY, "monthly", TRUE, NULL },
|
||||
{ JUST_COPY, "motd", TRUE, NULL },
|
||||
{ JUST_COPY, "namedb", TRUE, NULL },
|
||||
{ CALL_HANDLER, "netstart", FALSE, doByHand },
|
||||
{ JUST_COPY, "networks", TRUE, NULL },
|
||||
{ JUST_COPY, "passwd", FALSE, NULL },
|
||||
{ JUST_COPY, "phones", TRUE, NULL },
|
||||
{ JUST_COPY, "ppp", TRUE, NULL },
|
||||
{ JUST_COPY, "printcap", TRUE, NULL },
|
||||
{ JUST_COPY, "profile", TRUE, NULL },
|
||||
{ JUST_COPY, "protocols", TRUE, NULL },
|
||||
{ JUST_COPY, "pwd.db", TRUE, NULL },
|
||||
{ CALL_HANDLER, "rc", FALSE, doByHand },
|
||||
{ CALL_HANDLER, "rc.i386", TRUE, doByHand },
|
||||
{ JUST_COPY, "rc.local", TRUE, NULL },
|
||||
{ CALL_HANDLER, "rc.serial", TRUE, doByHand },
|
||||
{ JUST_COPY, "remote", TRUE, NULL },
|
||||
{ JUST_COPY, "resolv.conf", TRUE, NULL },
|
||||
{ JUST_COPY, "rmt", TRUE, NULL },
|
||||
{ JUST_COPY, "security", TRUE, NULL },
|
||||
{ JUST_COPY, "sendmail.cf", TRUE, NULL },
|
||||
{ CALL_HANDLER, "services", TRUE, doByHand },
|
||||
{ JUST_COPY, "shells", TRUE, NULL },
|
||||
{ JUST_COPY, "skeykeys", TRUE, NULL },
|
||||
{ JUST_COPY, "spwd.db", TRUE, NULL },
|
||||
{ JUST_COPY, "supfile", TRUE, NULL },
|
||||
{ CALL_HANDLER, "sysconfig", FALSE, yellSysconfig },
|
||||
{ JUST_COPY, "syslog.conf", TRUE, NULL },
|
||||
{ JUST_COPY, "termcap", TRUE, NULL },
|
||||
{ JUST_COPY, "ttys", TRUE, NULL },
|
||||
{ JUST_COPY, "uucp", TRUE, NULL },
|
||||
{ JUST_COPY, "weekly", TRUE, NULL },
|
||||
{ 0 },
|
||||
};
|
||||
|
||||
void
|
||||
traverseHitlist(HitList *h)
|
||||
{
|
||||
while (h->name) {
|
||||
if (!file_readable(h->name)) {
|
||||
if (!h->optional)
|
||||
msgConfirm("Unable to find an old /etc/%s file! That is decidedly non-standard and\n"
|
||||
"your upgraded system may function a little strangely as a result.");
|
||||
}
|
||||
else {
|
||||
if (h->action == JUST_COPY) {
|
||||
/* Nuke the just-loaded copy thoroughly */
|
||||
vsystem("rm -rf /etc/%s", h->name);
|
||||
|
||||
/* Copy the old one into its place */
|
||||
msgNotify("Resurrecting %s..", h->name);
|
||||
/* Do this with tar so that symlinks and such are preserved */
|
||||
if (vsystem("tar cf - %s | tar xpf - -C /etc", h->name))
|
||||
msgConfirm("Unable to resurrect your old /etc/%s! Hmmmm.", h->name);
|
||||
}
|
||||
else /* call handler */
|
||||
h->handler(h);
|
||||
}
|
||||
++h;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
installUpgrade(dialogMenuItem *self)
|
||||
{
|
||||
char *saved_etc;
|
||||
Boolean extractingBin = TRUE;
|
||||
struct termios foo;
|
||||
|
||||
variable_set2(SYSTEM_STATE, "upgrade");
|
||||
systemDisplayHelp("upgrade");
|
||||
|
||||
dialog_clear();
|
||||
if (msgYesNo("Given all that scary stuff you just read, are you sure you want to\n"
|
||||
"risk it all and proceed with this upgrade?"))
|
||||
return DITEM_FAILURE | DITEM_RESTORE;
|
||||
|
||||
if (!Dists) {
|
||||
msgConfirm("You haven't specified any distributions yet. The upgrade procedure will\n"
|
||||
"only upgrade those portions of the system for which a distribution has\n"
|
||||
"been selected. In the next screen, we'll go to the Distributions menu\n"
|
||||
"to select those portions of 2.1 you wish to install on top of your 2.0.5\n"
|
||||
"system.");
|
||||
if (!dmenuOpenSimple(&MenuDistributions, FALSE))
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
dialog_clear();
|
||||
}
|
||||
|
||||
/* No bin selected? Not much of an upgrade.. */
|
||||
if (!(Dists & DIST_BIN)) {
|
||||
if (msgYesNo("You didn't select the bin distribution as one of the distributons to load.\n"
|
||||
"This one is pretty vital to a successful 2.1 upgrade. Are you SURE you don't\n"
|
||||
"want to select the bin distribution? Chose _No_ to bring up the Distributions\n"
|
||||
"menu.")) {
|
||||
if (!dmenuOpenSimple(&MenuDistributions, FALSE))
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
dialog_clear();
|
||||
}
|
||||
}
|
||||
|
||||
/* Still?! OK! They must know what they're doing.. */
|
||||
if (!(Dists & DIST_BIN))
|
||||
extractingBin = FALSE;
|
||||
|
||||
if (!mediaDevice) {
|
||||
msgConfirm("Now you must specify an installation medium for the upgrade.");
|
||||
if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice)
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
}
|
||||
|
||||
if (RunningAsInit) {
|
||||
Device **devs;
|
||||
int i, cnt;
|
||||
char *cp;
|
||||
|
||||
cp = variable_get(VAR_DISK);
|
||||
devs = deviceFind(cp, DEVICE_TYPE_DISK);
|
||||
cnt = deviceCount(devs);
|
||||
if (!cnt) {
|
||||
msgConfirm("No disks found! Please verify that your disk controller is being\n"
|
||||
"properly probed at boot time. See the Hardware Guide on the\n"
|
||||
"Documentation menu for clues on diagnosing this type of problem.");
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
else {
|
||||
/* Enable all the drives befor we start */
|
||||
for (i = 0; i < cnt; i++)
|
||||
devs[i]->enabled = TRUE;
|
||||
}
|
||||
|
||||
msgConfirm("OK. First, we're going to go to the disk label editor. In this editor\n"
|
||||
"you will be expected to *Mount* any partitions you're interested in\n"
|
||||
"upgrading. DO NOT set the Newfs flag to Y on anything in the label editor\n"
|
||||
"unless you're absolutely sure you know what you're doing! In this\n"
|
||||
"instance, you'll be using the label editor as little more than a fancy\n"
|
||||
"screen-oriented way of labeling existing partitions.\n\n"
|
||||
"Once you're done in the label editor, press Q to return here for the next\n"
|
||||
"step.");
|
||||
|
||||
if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE) {
|
||||
msgConfirm("The disk label editor failed to work properly! Upgrade operation\n"
|
||||
"aborted.");
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
}
|
||||
|
||||
/* Don't write out MBR info */
|
||||
variable_set2(DISK_PARTITIONED, "written");
|
||||
if (DITEM_STATUS(diskLabelCommit(self)) == DITEM_FAILURE) {
|
||||
msgConfirm("Not all file systems were properly mounted. Upgrade operation\n"
|
||||
"aborted.");
|
||||
variable_unset(DISK_PARTITIONED);
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!copySelf()) {
|
||||
msgConfirm("Couldn't clone the boot floppy onto the root file system.\n"
|
||||
"Aborting.");
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
}
|
||||
|
||||
if (DITEM_STATUS(chroot("/mnt")) == DITEM_FAILURE) {
|
||||
msgConfirm("Unable to chroot to /mnt - something is wrong with the\n"
|
||||
"root partition or the way it's mounted if this doesn't work.");
|
||||
variable_unset(DISK_PARTITIONED);
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
}
|
||||
|
||||
chdir("/");
|
||||
systemCreateHoloshell();
|
||||
|
||||
saved_etc = NULL;
|
||||
if (extractingBin) {
|
||||
while (!saved_etc) {
|
||||
saved_etc = msgGetInput("/usr/tmp/etc", "Under which directory do you wish to save your current /etc?");
|
||||
if (!saved_etc || !*saved_etc || Mkdir(saved_etc)) {
|
||||
saved_etc = NULL;
|
||||
if (msgYesNo("Directory was not specified, was invalid or user selected Cancel.\n\n"
|
||||
"Doing an upgrade without first backing up your /etc directory is a very\n"
|
||||
"bad idea! Do you want to go back and specify the save directory again?"))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (saved_etc) {
|
||||
msgNotify("Preserving /etc directory..");
|
||||
if (vsystem("tar -cf - -C /etc . | tar -xpf - -C %s", saved_etc))
|
||||
if (msgYesNo("Unable to backup your /etc into %s.\n"
|
||||
"Do you want to continue anyway?"))
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
}
|
||||
if (file_readable("/kernel")) {
|
||||
msgNotify("Moving old kernel to /kernel.prev");
|
||||
if (system("chflags noschg /kernel && mv /kernel /kernel.prev")) {
|
||||
if (!msgYesNo("Hmmm! I couldn't move the old kernel over! Do you want to\n"
|
||||
"treat this as a big problem and abort the upgrade? Due to the\n"
|
||||
"way that this upgrade process works, you will have to reboot\n"
|
||||
"and start over from the beginning. Select Yes to reboot now"))
|
||||
systemShutdown(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
msgNotify("Beginning extraction of distributions..");
|
||||
if (DITEM_STATUS(distExtractAll(self)) == DITEM_FAILURE) {
|
||||
if (extractingBin && (Dists & DIST_BIN)) {
|
||||
msgConfirm("Hmmmm. We couldn't even extract the bin distribution. This upgrade\n"
|
||||
"should be considered a failure and started from the beginning, sorry!\n"
|
||||
"The system will reboot now.");
|
||||
dialog_clear();
|
||||
systemShutdown(1);
|
||||
}
|
||||
msgConfirm("The extraction process seems to have had some problems, but we got most\n"
|
||||
"of the essentials. We'll treat this as a warning since it may have been\n"
|
||||
"only non-essential distributions which failed to load.");
|
||||
}
|
||||
|
||||
if (extractingBin) {
|
||||
msgNotify("OK, now it's time to go pound on your root a little bit to create all the\n"
|
||||
"/dev entries and such that a 2.1 system expects to see. I'll also perform a\n"
|
||||
"few \"fixup\" operations to repair the effects of splatting a bin distribution\n"
|
||||
"on top of an existing system..");
|
||||
if (DITEM_STATUS(installFixup(self)) == DITEM_FAILURE) {
|
||||
msgConfirm("Hmmmmm. The fixups don't seem to have been very happy.\n"
|
||||
"You may wish to examine the system a little more closely when\n"
|
||||
"it comes time to merge your /etc customizations back.");
|
||||
}
|
||||
}
|
||||
|
||||
msgConfirm("First stage of upgrade completed successfully!\n\n"
|
||||
"Next comes stage 2, where we attempt to resurrect your /etc\n"
|
||||
"directory!");
|
||||
|
||||
if (saved_etc && chdir(saved_etc)) {
|
||||
msgConfirm("Unable to go to your saved /etc directory in %s?! Argh!\n"
|
||||
"Something went seriously wrong! It's quite possible that\n"
|
||||
"your former /etc is toast. I hope you didn't have any\n"
|
||||
"important customizations you wanted to keep in there.. :(");
|
||||
}
|
||||
else {
|
||||
/* Now try to resurrect the /etc files */
|
||||
traverseHitlist(etc_files);
|
||||
}
|
||||
|
||||
msgConfirm("OK! At this stage, we've resurrected all the /etc files we could\n"
|
||||
"(and you may have been warned about some that you'll have to merge\n"
|
||||
"yourself by hand) and we're going to drop you into a shell to do\n"
|
||||
"the rest yourself (sorry about this!). Once the system looks good\n"
|
||||
"to you, exit the shell to reboot the system.");
|
||||
|
||||
chdir("/");
|
||||
dialog_clear();
|
||||
dialog_update();
|
||||
end_dialog();
|
||||
DialogActive = FALSE;
|
||||
endwin();
|
||||
|
||||
signal(SIGTTOU, SIG_IGN);
|
||||
if (tcgetattr(0, &foo) != -1) {
|
||||
foo.c_cc[VERASE] = '\010';
|
||||
if (tcsetattr(0, TCSANOW, &foo) == -1)
|
||||
msgDebug("Unable to set the erase character.\n");
|
||||
}
|
||||
else
|
||||
msgDebug("Unable to get the terminal attributes!\n");
|
||||
printf("Well, good luck! When you're done, please type \"reboot\" or exit\n"
|
||||
"the shell to reboot the new system.\n");
|
||||
if (!Fake)
|
||||
system("/bin/sh");
|
||||
else
|
||||
exit(0);
|
||||
if (RunningAsInit)
|
||||
reboot(0);
|
||||
/* NOTREACHED */
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
/* $XConsortium: lndir.c,v 1.14 95/01/09 20:08:20 kaleb Exp $ */
|
||||
/* $XFree86: xc/config/util/lndir.c,v 3.3 1995/01/28 15:41:09 dawes Exp $ */
|
||||
/* Create shadow link tree (after X11R4 script of the same name)
|
||||
Mark Reinhold ([email protected])/3 January 1990 */
|
||||
|
||||
/* Hacked somewhat by Jordan Hubbard, The FreeBSD Project, to make it */
|
||||
/* an invokable function from sysinstall rather than a stand-alone binary */
|
||||
|
||||
/*
|
||||
Copyright (c) 1990, X Consortium
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of the X Consortium shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from the X Consortium.
|
||||
|
||||
*/
|
||||
|
||||
/* From the original /bin/sh script:
|
||||
|
||||
Used to create a copy of the a directory tree that has links for all
|
||||
non-directories (except those named RCS, SCCS or CVS.adm). If you are
|
||||
building the distribution on more than one machine, you should use
|
||||
this technique.
|
||||
|
||||
If your master sources are located in /usr/local/src/X and you would like
|
||||
your link tree to be in /usr/local/src/new-X, do the following:
|
||||
|
||||
% mkdir /usr/local/src/new-X
|
||||
% cd /usr/local/src/new-X
|
||||
% lndir ../X
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "sysinstall.h"
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
#define MAXPATHLEN 2048
|
||||
#endif
|
||||
|
||||
static char *rcurdir;
|
||||
static char *curdir;
|
||||
|
||||
static int
|
||||
equivalent(char *lname, char *rname)
|
||||
{
|
||||
char *s;
|
||||
|
||||
if (!strcmp(lname, rname))
|
||||
return 1;
|
||||
for (s = lname; *s && (s = strchr(s, '/')); s++) {
|
||||
while (s[1] == '/')
|
||||
strcpy(s+1, s+2);
|
||||
}
|
||||
return !strcmp(lname, rname);
|
||||
}
|
||||
|
||||
|
||||
/* Recursively create symbolic links from the current directory to the "from"
|
||||
directory. Assumes that files described by fs and ts are directories. */
|
||||
|
||||
static int
|
||||
dodir(char *fn, struct stat *fs, struct stat *ts, int rel)
|
||||
{
|
||||
DIR *df;
|
||||
struct dirent *dp;
|
||||
char buf[MAXPATHLEN + 1], *p;
|
||||
char symbuf[MAXPATHLEN + 1];
|
||||
struct stat sb, sc;
|
||||
int n_dirs;
|
||||
int symlen;
|
||||
char *ocurdir;
|
||||
|
||||
if ((fs->st_dev == ts->st_dev) && (fs->st_ino == ts->st_ino))
|
||||
return 1;
|
||||
|
||||
if (rel)
|
||||
strcpy (buf, "../");
|
||||
else
|
||||
buf[0] = '\0';
|
||||
strcat (buf, fn);
|
||||
|
||||
if (!(df = opendir (buf))) {
|
||||
msgDebug("%s: Cannot opendir\n", buf);
|
||||
return 1;
|
||||
}
|
||||
|
||||
p = buf + strlen (buf);
|
||||
*p++ = '/';
|
||||
n_dirs = fs->st_nlink;
|
||||
while ((dp = readdir (df)) != NULL) {
|
||||
if (dp->d_name[strlen(dp->d_name) - 1] == '~')
|
||||
continue;
|
||||
strcpy (p, dp->d_name);
|
||||
|
||||
if (n_dirs > 0) {
|
||||
if (stat (buf, &sb) < 0) {
|
||||
msgDebug("Can't stat: %s\n", buf);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (S_ISDIR(sb.st_mode)) {
|
||||
/* directory */
|
||||
n_dirs--;
|
||||
if (dp->d_name[0] == '.' &&
|
||||
(dp->d_name[1] == '\0' || (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
|
||||
continue;
|
||||
if (!strcmp (dp->d_name, "RCS"))
|
||||
continue;
|
||||
if (!strcmp (dp->d_name, "SCCS"))
|
||||
continue;
|
||||
if (!strcmp (dp->d_name, "CVS"))
|
||||
continue;
|
||||
if (!strcmp (dp->d_name, "CVS.adm"))
|
||||
continue;
|
||||
ocurdir = rcurdir;
|
||||
rcurdir = buf;
|
||||
curdir = isDebug() ? buf : (char *)0;
|
||||
if (isDebug())
|
||||
msgDebug("%s:\n", buf);
|
||||
if ((stat(dp->d_name, &sc) < 0) && (errno == ENOENT)) {
|
||||
if (mkdir(dp->d_name, 0777) < 0 ||
|
||||
stat (dp->d_name, &sc) < 0) {
|
||||
msgDebug("Unable to make or stat: %s\n", dp->d_name);
|
||||
curdir = rcurdir = ocurdir;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (readlink (dp->d_name, symbuf, sizeof(symbuf) - 1) >= 0) {
|
||||
msgDebug("%s: is a link instead of a directory\n", dp->d_name);
|
||||
curdir = rcurdir = ocurdir;
|
||||
continue;
|
||||
}
|
||||
if (chdir (dp->d_name) < 0) {
|
||||
msgDebug("Unable to chdir to: %s\n", dp->d_name);
|
||||
curdir = rcurdir = ocurdir;
|
||||
continue;
|
||||
}
|
||||
(void)dodir(buf, &sb, &sc, (buf[0] != '/'));
|
||||
if (chdir ("..") < 0) {
|
||||
msgDebug("Unable to get back to ..\n");
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
curdir = rcurdir = ocurdir;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* non-directory */
|
||||
symlen = readlink (dp->d_name, symbuf, sizeof(symbuf) - 1);
|
||||
if (symlen >= 0) {
|
||||
symbuf[symlen] = '\0';
|
||||
if (!equivalent (symbuf, buf))
|
||||
msgDebug("%s: %s\n", dp->d_name, symbuf);
|
||||
} else if (symlink (buf, dp->d_name) < 0)
|
||||
msgDebug("Unable to create symlink: %s\n", dp->d_name);
|
||||
}
|
||||
|
||||
closedir (df);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
lndir(char *from, char *to)
|
||||
{
|
||||
struct stat fs, ts;
|
||||
|
||||
if (!to)
|
||||
to = ".";
|
||||
|
||||
/* to directory */
|
||||
if (stat(to, &ts) < 0) {
|
||||
msgDebug("Destination directory doesn't exist: %s\n", to);
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
if (!(S_ISDIR(ts.st_mode))) {
|
||||
msgDebug ("%s: Not a directory\n", to);
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
if (chdir(to) < 0) {
|
||||
msgDebug("Unable to chdir to %s\n", to);
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
/* from directory */
|
||||
if (stat(from, &fs) < 0) {
|
||||
msgDebug("From directory doesn't exist: %s\n", from);
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
if (!(S_ISDIR(fs.st_mode))) {
|
||||
msgDebug ("%s: Not a directory\n", from);
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
return dodir(from, &fs, &ts, 0);
|
||||
}
|
||||
@@ -0,0 +1,285 @@
|
||||
/*
|
||||
* The new sysinstall program.
|
||||
*
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated for what's essentially a complete rewrite.
|
||||
*
|
||||
* $Id: options.c,v 1.40 1996/07/08 10:08:18 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer,
|
||||
* verbatim and that no modifications are made prior to this
|
||||
* point in the file.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "sysinstall.h"
|
||||
#include <ctype.h>
|
||||
|
||||
static char *
|
||||
varCheck(Option opt)
|
||||
{
|
||||
char *cp = NULL;
|
||||
|
||||
if (opt.aux)
|
||||
cp = variable_get((char *)opt.aux);
|
||||
if (!cp)
|
||||
return "NO";
|
||||
return cp;
|
||||
}
|
||||
|
||||
/* Show our little logo */
|
||||
static char *
|
||||
resetLogo(char *str)
|
||||
{
|
||||
return "[RESET!]";
|
||||
}
|
||||
|
||||
static char *
|
||||
mediaCheck(Option opt)
|
||||
{
|
||||
if (mediaDevice) {
|
||||
switch(mediaDevice->type) {
|
||||
case DEVICE_TYPE_UFS:
|
||||
case DEVICE_TYPE_DISK:
|
||||
return "File system";
|
||||
|
||||
case DEVICE_TYPE_FLOPPY:
|
||||
return "Floppy";
|
||||
|
||||
case DEVICE_TYPE_FTP:
|
||||
return "FTP";
|
||||
|
||||
case DEVICE_TYPE_CDROM:
|
||||
return "CDROM";
|
||||
|
||||
case DEVICE_TYPE_TAPE:
|
||||
return "Tape";
|
||||
|
||||
case DEVICE_TYPE_DOS:
|
||||
return "DOS";
|
||||
|
||||
case DEVICE_TYPE_NFS:
|
||||
return "NFS";
|
||||
|
||||
case DEVICE_TYPE_NONE:
|
||||
case DEVICE_TYPE_NETWORK:
|
||||
case DEVICE_TYPE_ANY:
|
||||
default:
|
||||
return "<unknown>";
|
||||
}
|
||||
}
|
||||
return "<not yet set>";
|
||||
}
|
||||
|
||||
#define TAPE_PROMPT "Please enter the tape block size in 512 byte blocks:"
|
||||
#define RELNAME_PROMPT "Please specify the release you wish to load:"
|
||||
#define BPKG_PROMPT "Please specify the name of the HTML browser package:"
|
||||
#define BBIN_PROMPT "Please specify a full pathname to the HTML browser binary:"
|
||||
#define EDITOR_PROMPT "Please specify the name of the text editor you wish to use:"
|
||||
#define PKG_PROMPT "Please specify a temporary directory with lots of free space:"
|
||||
#define INSTROOT_PROMPT "Please specify a root directory if installing somewhere other than /"
|
||||
|
||||
static Option Options[] = {
|
||||
{ "NFS Secure", "NFS server talks only on a secure port",
|
||||
OPT_IS_VAR, NULL, VAR_NFS_SECURE, varCheck },
|
||||
{ "NFS Slow", "User is using a slow PC or ethernet card",
|
||||
OPT_IS_VAR, NULL, VAR_SLOW_ETHER, varCheck },
|
||||
{ "Debugging", "Emit extra debugging output on VTY2 (ALT-F2)",
|
||||
OPT_IS_VAR, NULL, VAR_DEBUG, varCheck },
|
||||
{ "Yes to All", "Assume \"Yes\" answers to all non-critical dialogs",
|
||||
OPT_IS_VAR, NULL, VAR_NO_CONFIRM, varCheck },
|
||||
{ "FTP username", "Username and password to use instead of anonymous",
|
||||
OPT_IS_FUNC, mediaSetFtpUserPass, VAR_FTP_USER, varCheck },
|
||||
{ "Editor", "Which text editor to use during installation",
|
||||
OPT_IS_VAR, EDITOR_PROMPT, VAR_EDITOR, varCheck },
|
||||
{ "Tape Blocksize", "Tape media block size in 512 byte blocks",
|
||||
OPT_IS_VAR, TAPE_PROMPT, VAR_TAPE_BLOCKSIZE, varCheck },
|
||||
{ "Extract Detail", "How verbosely to display file name information during extractions",
|
||||
OPT_IS_FUNC, mediaSetCPIOVerbosity, VAR_CPIO_VERBOSITY, varCheck },
|
||||
{ "Release Name", "Which release to attempt to load from installation media",
|
||||
OPT_IS_VAR, RELNAME_PROMPT, VAR_RELNAME, varCheck },
|
||||
{ "Install Root", "Which directory to unpack distributions or packages relative to",
|
||||
OPT_IS_VAR, INSTROOT_PROMPT, VAR_INSTALL_ROOT, varCheck },
|
||||
{ "Browser Pkg", "This is the browser package that will be used for viewing HTML docs",
|
||||
OPT_IS_VAR, BPKG_PROMPT, VAR_BROWSER_PACKAGE, varCheck },
|
||||
{ "Browser Exec", "This is the path to the main binary of the browser package",
|
||||
OPT_IS_VAR, BBIN_PROMPT, VAR_BROWSER_BINARY, varCheck },
|
||||
{ "Media Type", "The current installation media type.",
|
||||
OPT_IS_FUNC, mediaGetType, VAR_MEDIA_TYPE, mediaCheck },
|
||||
{ "Package Temp", "The directory where package temporary files should go",
|
||||
OPT_IS_VAR, PKG_PROMPT, VAR_PKG_TMPDIR, varCheck },
|
||||
{ "Use Defaults", "Reset all values to startup defaults",
|
||||
OPT_IS_FUNC, installVarDefaults, 0, resetLogo },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
#define OPT_START_ROW 4
|
||||
#define OPT_END_ROW 19
|
||||
#define OPT_NAME_COL 0
|
||||
#define OPT_VALUE_COL 16
|
||||
#define GROUP_OFFSET 40
|
||||
|
||||
static char *
|
||||
value_of(Option opt)
|
||||
{
|
||||
static char ival[40];
|
||||
|
||||
switch (opt.type) {
|
||||
case OPT_IS_STRING:
|
||||
return (char *)opt.data;
|
||||
|
||||
case OPT_IS_INT:
|
||||
sprintf(ival, "%d", (int)opt.data);
|
||||
return ival;
|
||||
|
||||
case OPT_IS_FUNC:
|
||||
case OPT_IS_VAR:
|
||||
if (opt.check)
|
||||
return opt.check(opt);
|
||||
else
|
||||
return "<*>";
|
||||
}
|
||||
return "<unknown>";
|
||||
}
|
||||
|
||||
static void
|
||||
fire(Option opt)
|
||||
{
|
||||
if (opt.type == OPT_IS_FUNC) {
|
||||
int (*cp)(char *) = opt.data;
|
||||
|
||||
cp(NULL);
|
||||
}
|
||||
else if (opt.type == OPT_IS_VAR) {
|
||||
if (opt.data) {
|
||||
(void)variable_get_value(opt.aux, opt.data);
|
||||
}
|
||||
else if (variable_get(opt.aux))
|
||||
variable_unset(opt.aux);
|
||||
else
|
||||
variable_set2(opt.aux, "YES");
|
||||
}
|
||||
if (opt.check)
|
||||
opt.check(opt);
|
||||
clear();
|
||||
refresh();
|
||||
}
|
||||
|
||||
int
|
||||
optionsEditor(dialogMenuItem *self)
|
||||
{
|
||||
int i, optcol, optrow, key;
|
||||
static int currOpt = 0;
|
||||
|
||||
dialog_clear();
|
||||
clear();
|
||||
|
||||
while (1) {
|
||||
/* Whap up the header */
|
||||
attrset(A_REVERSE); mvaddstr(0, 0, "Options Editor"); attrset(A_NORMAL);
|
||||
for (i = 0; i < 2; i++) {
|
||||
mvaddstr(OPT_START_ROW - 2, OPT_NAME_COL + (i * GROUP_OFFSET), "Name");
|
||||
mvaddstr(OPT_START_ROW - 1, OPT_NAME_COL + (i * GROUP_OFFSET), "----");
|
||||
|
||||
mvaddstr(OPT_START_ROW - 2, OPT_VALUE_COL + (i * GROUP_OFFSET), "Value");
|
||||
mvaddstr(OPT_START_ROW - 1, OPT_VALUE_COL + (i * GROUP_OFFSET), "-----");
|
||||
}
|
||||
/* And the footer */
|
||||
mvprintw(OPT_END_ROW + 1, 0, "Use SPACE to select/toggle an option, arrow keys to move,");
|
||||
mvprintw(OPT_END_ROW + 2, 0, "? or F1 for more help. When you're done, type Q to Quit.");
|
||||
|
||||
optrow = OPT_START_ROW;
|
||||
optcol = OPT_NAME_COL;
|
||||
for (i = 0; Options[i].name; i++) {
|
||||
/* Names are painted somewhat gratuitously each time, but it's easier this way */
|
||||
mvprintw(optrow, OPT_NAME_COL + optcol, Options[i].name);
|
||||
if (currOpt == i)
|
||||
attrset(ATTR_SELECTED);
|
||||
mvprintw(optrow++, OPT_VALUE_COL + optcol, value_of(Options[i]));
|
||||
if (currOpt == i)
|
||||
attrset(A_NORMAL);
|
||||
if (optrow == OPT_END_ROW) {
|
||||
optrow = OPT_START_ROW;
|
||||
optcol += GROUP_OFFSET;
|
||||
}
|
||||
clrtoeol();
|
||||
}
|
||||
attrset(ATTR_TITLE);
|
||||
mvaddstr(OPT_END_ROW + 4, 0, Options[currOpt].desc);
|
||||
attrset(A_NORMAL);
|
||||
clrtoeol();
|
||||
move(0, 14);
|
||||
refresh();
|
||||
|
||||
/* Start the edit loop */
|
||||
key = toupper(getch());
|
||||
switch (key) {
|
||||
case KEY_F(1):
|
||||
case '?':
|
||||
systemDisplayHelp("options");
|
||||
break;
|
||||
|
||||
case KEY_UP:
|
||||
if (currOpt)
|
||||
--currOpt;
|
||||
else
|
||||
for (currOpt = 0; Options[currOpt + 1].name; currOpt++);
|
||||
continue;
|
||||
|
||||
case KEY_DOWN:
|
||||
if (Options[currOpt + 1].name)
|
||||
++currOpt;
|
||||
else
|
||||
currOpt = 0;
|
||||
continue;
|
||||
|
||||
case KEY_HOME:
|
||||
currOpt = 0;
|
||||
continue;
|
||||
|
||||
case KEY_END:
|
||||
while (Options[currOpt + 1].name)
|
||||
++currOpt;
|
||||
continue;
|
||||
|
||||
case ' ':
|
||||
clear();
|
||||
fire(Options[currOpt]);
|
||||
clear();
|
||||
continue;
|
||||
|
||||
case 'Q':
|
||||
clear();
|
||||
dialog_clear();
|
||||
return DITEM_SUCCESS | DITEM_RESTORE;
|
||||
|
||||
default:
|
||||
beep();
|
||||
}
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return DITEM_SUCCESS | DITEM_RESTORE;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
* The new sysinstall program.
|
||||
*
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: package.c,v 1.42 1996/07/09 14:28:20 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer,
|
||||
* verbatim and that no modifications are made prior to this
|
||||
* point in the file.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/stat.h>
|
||||
#include "sysinstall.h"
|
||||
|
||||
/* Like package_extract, but assumes current media device */
|
||||
int
|
||||
package_add(char *name)
|
||||
{
|
||||
if (!mediaVerify())
|
||||
return DITEM_FAILURE;
|
||||
return package_extract(mediaDevice, name, FALSE);
|
||||
}
|
||||
|
||||
Boolean
|
||||
package_exists(char *name)
|
||||
{
|
||||
char fname[FILENAME_MAX];
|
||||
int status /* = vsystem("pkg_info -e %s", name) */;
|
||||
|
||||
/* XXX KLUDGE ALERT! This makes evil assumptions about how XXX
|
||||
* packages register themselves and should *really be done with
|
||||
* `pkg_info -e <name>' except that this it's too slow for an
|
||||
* item check routine.. :-(
|
||||
*/
|
||||
snprintf(fname, FILENAME_MAX, "/var/db/pkg/%s", name);
|
||||
status = access(fname, R_OK);
|
||||
msgDebug("package check for %s returns %s.\n", name,
|
||||
status ? "failure" : "success");
|
||||
return !status;
|
||||
}
|
||||
|
||||
/* SIGPIPE handler */
|
||||
static Boolean sigpipe_caught = FALSE;
|
||||
|
||||
static void
|
||||
catch_pipe(int sig)
|
||||
{
|
||||
sigpipe_caught = TRUE;
|
||||
}
|
||||
|
||||
/* Extract a package based on a namespec and a media device */
|
||||
int
|
||||
package_extract(Device *dev, char *name, Boolean depended)
|
||||
{
|
||||
char path[511];
|
||||
int fd, ret;
|
||||
|
||||
/* If necessary, initialize the ldconfig hints */
|
||||
if (!file_readable("/var/run/ld.so.hints"))
|
||||
vsystem("ldconfig /usr/lib /usr/local/lib /usr/X11R6/lib");
|
||||
|
||||
/* Check to make sure it's not already there */
|
||||
if (package_exists(name))
|
||||
return DITEM_SUCCESS;
|
||||
|
||||
if (!dev->init(dev)) {
|
||||
msgConfirm("Unable to initialize media type for package extract.");
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
|
||||
/* Be initially optimistic */
|
||||
ret = DITEM_SUCCESS | DITEM_RESTORE;
|
||||
/* Make a couple of paranoid locations for temp files to live if user specified none */
|
||||
if (!variable_get("PKG_TMPDIR")) {
|
||||
Mkdir("/usr/tmp");
|
||||
Mkdir("/var/tmp");
|
||||
/* Set it to a location with as much space as possible */
|
||||
variable_set2("PKG_TMPDIR", "/usr/tmp");
|
||||
}
|
||||
|
||||
if (!index(name, '/'))
|
||||
sprintf(path, "packages/All/%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
|
||||
else
|
||||
sprintf(path, "%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
|
||||
fd = dev->get(dev, path, TRUE);
|
||||
if (fd >= 0) {
|
||||
int i, tot, pfd[2];
|
||||
pid_t pid;
|
||||
|
||||
msgNotify("Adding %s%s\nfrom %s", path, depended ? " (as a dependency)" : "", dev->name);
|
||||
signal(SIGPIPE, catch_pipe);
|
||||
pipe(pfd);
|
||||
pid = fork();
|
||||
if (!pid) {
|
||||
dup2(pfd[0], 0); close(pfd[0]);
|
||||
dup2(DebugFD, 1);
|
||||
close(2);
|
||||
close(pfd[1]);
|
||||
chroot(variable_get(VAR_INSTALL_ROOT));
|
||||
i = execl("/usr/sbin/pkg_add", "/usr/sbin/pkg_add", "-", 0);
|
||||
if (isDebug())
|
||||
msgDebug("pkg_add returns %d status\n", i);
|
||||
}
|
||||
else {
|
||||
char buf[BUFSIZ];
|
||||
WINDOW *w = savescr();
|
||||
struct timeval start, stop;
|
||||
|
||||
close(pfd[0]);
|
||||
tot = 0;
|
||||
(void)gettimeofday(&start, (struct timezone *)0);
|
||||
|
||||
while (!sigpipe_caught && (i = read(fd, buf, BUFSIZ)) > 0) {
|
||||
int seconds;
|
||||
|
||||
tot += i;
|
||||
/* Print statistics about how we're doing */
|
||||
(void) gettimeofday(&stop, (struct timezone *)0);
|
||||
stop.tv_sec = stop.tv_sec - start.tv_sec;
|
||||
stop.tv_usec = stop.tv_usec - start.tv_usec;
|
||||
if (stop.tv_usec < 0)
|
||||
stop.tv_sec--, stop.tv_usec += 1000000;
|
||||
seconds = stop.tv_sec + (stop.tv_usec / 1000000.0);
|
||||
if (!seconds)
|
||||
seconds = 1;
|
||||
msgInfo("%10d bytes read from package %s @ %4.1f KBytes/second", tot, name, (tot / seconds) / 1024.0);
|
||||
/* Write it out */
|
||||
if (write(pfd[1], buf, i) != i) {
|
||||
msgInfo("Write failure to pkg_add! Package may be corrupt.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
close(pfd[1]);
|
||||
dev->close(dev, fd);
|
||||
if (sigpipe_caught)
|
||||
msgDebug("Caught SIGPIPE while trying to install the %s package.\n", name);
|
||||
else
|
||||
msgInfo("Package %s read successfully - waiting for pkg_add", name);
|
||||
refresh();
|
||||
i = waitpid(pid, &tot, 0);
|
||||
if (sigpipe_caught || i < 0 || WEXITSTATUS(tot)) {
|
||||
if (variable_get(VAR_NO_CONFIRM))
|
||||
msgNotify("Add of package %s aborted due to some error -\n"
|
||||
"Please check the debug screen for more info.", name);
|
||||
else
|
||||
msgConfirm("Add of package %s aborted due to some error -\n"
|
||||
"Please check the debug screen for more info.", name);
|
||||
}
|
||||
else
|
||||
msgNotify("Package %s was added successfully", name);
|
||||
sleep(1);
|
||||
restorescr(w);
|
||||
sigpipe_caught = FALSE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
msgDebug("pkg_extract: get operation returned %d\n", fd);
|
||||
dialog_clear();
|
||||
if (variable_get(VAR_NO_CONFIRM))
|
||||
msgNotify("Unable to fetch package %s from selected media.\n"
|
||||
"No package add will be done.", name);
|
||||
else {
|
||||
msgConfirm("Unable to fetch package %s from selected media.\n"
|
||||
"No package add will be done.", name);
|
||||
}
|
||||
ret = DITEM_FAILURE | DITEM_RESTORE;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
#define RELEASE_NAME "__RELEASE"
|
||||
@@ -0,0 +1,47 @@
|
||||
.\"
|
||||
.\" Copyright (c) 1994 James A. Jegers
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. The name of the author may not be used to endorse or promote products
|
||||
.\" derived from this software without specific prior written permission
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\"
|
||||
.Dd November 29, 1994
|
||||
.Dt AIC 4 i386
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm aic
|
||||
.Nd Adaptec AIC-6260 and AIC-6360 SCSI driver
|
||||
.Sh SYNOPSIS
|
||||
.Cd "device aic0 at isa? port 0x340 bio irq 11"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm aic
|
||||
driver provides support for the Adaptec AIC-6260 and AIC-6360 SCSI
|
||||
controller chips. This includes the Adaptec 152x and the Creative
|
||||
Labs SoundBlaster SCSI host adapter.
|
||||
.Pp
|
||||
Many systems that use these controller chips do not have a boot ROM
|
||||
and therefore cannot be booted from.
|
||||
.Sh SEE ALSO
|
||||
.Xr intro 4 ,
|
||||
.Xr sd 4 ,
|
||||
.Xr st 4 ,
|
||||
.Xr cd 4 ,
|
||||
.Xr ch 4
|
||||
@@ -0,0 +1,44 @@
|
||||
.\"
|
||||
.\" Copyright (c) 1994 James A. Jegers
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. The name of the author may not be used to endorse or promote products
|
||||
.\" derived from this software without specific prior written permission
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd July 10, 1995
|
||||
.Dt EG 4 i386
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm eg
|
||||
.Nd Ethernet driver for 3Com 3c505 Ethernet boards
|
||||
.Sh SYNOPSIS
|
||||
.Cd "device eg0 at isa? port 0x310 net irq 5 vector egintr"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
interface provides access to a 10 Mb/s Ethernet network via the
|
||||
3Com 3c505 Ethernet board.
|
||||
.Sh SEE ALSO
|
||||
.Xr ifconfig 8 ,
|
||||
.Xr intro 4 ,
|
||||
.Xr ed 4 ,
|
||||
.Xr el 4 ,
|
||||
.Xr ep 4 ,
|
||||
.Xr ie 4 ,
|
||||
.Xr le 4
|
||||
@@ -0,0 +1,44 @@
|
||||
.\"
|
||||
.\" Copyright (c) 1994 James A. Jegers
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. The name of the author may not be used to endorse or promote products
|
||||
.\" derived from this software without specific prior written permission
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd July 10, 1995
|
||||
.Dt EL 4 i386
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm el
|
||||
.Nd Ethernet driver for 3Com Etherlink 3C501 device driver
|
||||
.Sh SYNOPSIS
|
||||
.Cd "device el0 at isa? port 0x300 net irq 9 vector elintr"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
interface provides access to a 10 Mb/s Ethernet network via the
|
||||
3Com 3c501 Ethernet cards.
|
||||
.Sh SEE ALSO
|
||||
.Xr ifconfig 8 ,
|
||||
.Xr intro 4 ,
|
||||
.Xr ed 4 ,
|
||||
.Xr eg 4 ,
|
||||
.Xr ep 4 ,
|
||||
.Xr ie 4 ,
|
||||
.Xr le 4
|
||||
@@ -0,0 +1,123 @@
|
||||
.\"
|
||||
.\" Copyright (c) 1994 Herb Peyerl
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. All advertising materials mentioning features or use of this software
|
||||
.\" must display the following acknowledgement:
|
||||
.\" This product includes software developed by Herb Peyerl
|
||||
.\" 3. The name of the author may not be used to endorse or promote products
|
||||
.\" derived from this software without specific prior written permission
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: ep.4,v 1.1 1996/07/11 00:22:46 mpp Exp $
|
||||
.\"
|
||||
.Dd February 04, 1993
|
||||
.Dt EP 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm ep
|
||||
.Nd Ethernet driver for 3Com Etherlink III (3c5x9)
|
||||
.Sh SYNOPSIS
|
||||
.Cd "device ep0 at isa? port 0x300 net irq 10 vector epintr"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm ep
|
||||
device driver supports the 3c509 (ISA) and 3c579 (EISA) cards.
|
||||
Various models of these cards come with a different assortment of
|
||||
connectors:
|
||||
.Pp
|
||||
.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
|
||||
.It AUI/DIX
|
||||
Standard 15 pin connector
|
||||
.It 10Base2
|
||||
BNC, also known as thin-net
|
||||
.It 10BaseT
|
||||
UTP, also known as twisted pair
|
||||
.El
|
||||
.Pp
|
||||
The default port to use is the BNC. To choose an alternate port,
|
||||
use the following flag combinations with
|
||||
.Xr ifconfig 8
|
||||
or in your /etc/hostname.ep? file.
|
||||
.Pp
|
||||
.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
|
||||
.It -link0
|
||||
Use the BNC port (default).
|
||||
.It \ link0 -link1
|
||||
Use the AUI port.
|
||||
.It \ link0 \ link1
|
||||
Use the UTP port.
|
||||
.El
|
||||
.Pp
|
||||
If there are multiple cards in the computer, they are searched for
|
||||
in the following order:
|
||||
The 3c579 EISA cards are searched for first -- they will be found
|
||||
in EISA slot# order.
|
||||
Next, the 3c509 ISA cards are searched -- they are found in increasing
|
||||
ethernet address order.
|
||||
This is an example of how they will probe:
|
||||
.Pp
|
||||
ep0 at isa0 port 0x6000-0x600f irq 10: aui/bnc address 00:60:8c:70:e5:c5
|
||||
ep1 at isa0 port 0x300-0x30f irq 3: aui/bnc/utp address 00:20:af:10:62:ab
|
||||
.Pp
|
||||
You may specify the port and irq numbers that the cards are expected
|
||||
to be found at, but it is not necessary.
|
||||
The cards are sufficiently intelligent to tell us where they
|
||||
actually live on the ISA bus.
|
||||
.Pp
|
||||
.Sh NOTES
|
||||
The 3c509 card has no jumpers to set the address.
|
||||
3Com supplies software to set the address of the card in software.
|
||||
To find the card on the ISA bus, the kernel performs a complex
|
||||
scan operation at IO address 0x100.
|
||||
Beware!
|
||||
Avoid placing other cards at that address!
|
||||
.Pp
|
||||
Some models of 3c5x9 have all three connectors on them.
|
||||
In the case of these cards; you must configure the transceiver type
|
||||
with the 3Com supplied DOS configuration disk before the link0/link1
|
||||
flags will operate correctly.
|
||||
.Pp
|
||||
.Sh DIAGNOSTICS
|
||||
ep0: reset (status: %x)
|
||||
.in +4
|
||||
the driver has encountered a FIFO underrun or overrun. The driver will reset
|
||||
the card and the packet will be lost. This is not fatal.
|
||||
.in -4
|
||||
ep0: eeprom failed to come ready
|
||||
.in +4
|
||||
The eeprom failed to come ready. This probably means the card is wedged.
|
||||
.in -4
|
||||
ep0: 3c509 in test mode. Erase pencil mark!
|
||||
.in +4
|
||||
This means that someone has scribbled with pencil in the test area on the
|
||||
card. Erase the pencil mark and reboot. (This is not a joke).
|
||||
.in -4
|
||||
.Sh SEE ALSO
|
||||
.Xr ifconfig 8 ,
|
||||
.Xr intro 4 ,
|
||||
.Xr ed 4 ,
|
||||
.Xr eg 4 ,
|
||||
.Xr el 4 ,
|
||||
.Xr ie 4 ,
|
||||
.Xr le 4
|
||||
.Sh STANDARDS
|
||||
are great. There's so many to choose from.
|
||||
@@ -0,0 +1,43 @@
|
||||
.\"
|
||||
.\" Copyright (c) 1994 James A. Jegers
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. The name of the author may not be used to endorse or promote products
|
||||
.\" derived from this software without specific prior written permission
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\"
|
||||
.Dd July 10, 1996
|
||||
.Dt NCR 4 i386
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm ncr
|
||||
.Nd NCR 53C810 SCSI driver
|
||||
.Sh SYNOPSIS
|
||||
.Cd "device ncr0"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm ncr
|
||||
driver provides support for the NCR 53C810 and NCR 53C825
|
||||
SCSI controller chips.
|
||||
.Sh SEE ALSO
|
||||
.Xr intro 4 ,
|
||||
.Xr sd 4 ,
|
||||
.Xr st 4 ,
|
||||
.Xr cd 4 ,
|
||||
.Xr ch 4
|
||||
@@ -0,0 +1,44 @@
|
||||
.\"
|
||||
.\" Copyright (c) 1994 James A. Jegers
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. The name of the author may not be used to endorse or promote products
|
||||
.\" derived from this software without specific prior written permission
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd July 10, 1995
|
||||
.Dt WT 4 i386
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm wt
|
||||
.Nd
|
||||
Archive/Wangtek cartridge tape driver
|
||||
.Sh SYNOPSIS
|
||||
.Cd "device wt0 at isa? port 0x300 bio irq 5 drq 1 vector wtintr"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm wt
|
||||
driver provides support for the following Archive and Wangtek boards:
|
||||
.Pp
|
||||
.Bl -tag -width -offset indent -compact
|
||||
.It QIC-02
|
||||
.It QIC-36
|
||||
.El
|
||||
.Pp
|
||||
.Sh SEE ALSO
|
||||
.Xr intro 4
|
||||
@@ -1,685 +0,0 @@
|
||||
/*+M*************************************************************************
|
||||
* Adaptec AIC7770/AIC7870 sequencer code assembler.
|
||||
*
|
||||
* Copyright (c) 1994 John Aycock
|
||||
* The University of Calgary Department of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of Calgary
|
||||
* Department of Computer Science and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* Comments are started by `#' and continue to the end of the line; lines
|
||||
* may be of the form:
|
||||
* <label>*
|
||||
* <label>* <undef-sym> = <value>
|
||||
* <label>* <opcode> <operand>*
|
||||
*
|
||||
* A <label> is an <undef-sym> ending in a colon. Spaces, tabs, and commas
|
||||
* are token separators.
|
||||
*
|
||||
*-M*************************************************************************/
|
||||
static char id[] = "$Id: aic7xxx_asm.c,v 1.12 1996/03/31 03:02:35 gibbs Exp $";
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#define MEMORY 448
|
||||
#define MAXLINE 1024
|
||||
#define MAXTOKEN 32
|
||||
#define ADOTOUT "a.out"
|
||||
#define NOVALUE -1
|
||||
|
||||
/*
|
||||
* AIC-7770/AIC-7870 register definitions
|
||||
*/
|
||||
#define R_SINDEX 0x65
|
||||
#define R_ALLONES 0x69
|
||||
#define R_ALLZEROS 0x6a
|
||||
#define R_NONE 0x6a
|
||||
|
||||
int debug;
|
||||
int lineno, LC;
|
||||
char *filename;
|
||||
unsigned char M[MEMORY][4];
|
||||
|
||||
void
|
||||
error(char *s)
|
||||
{
|
||||
fprintf(stderr, "%s: %s at line %d\n", filename, s, lineno);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
void *
|
||||
Malloc(size_t size)
|
||||
{
|
||||
void *p = malloc(size);
|
||||
if (!p)
|
||||
error("out of memory");
|
||||
return(p);
|
||||
}
|
||||
|
||||
void *
|
||||
Realloc(void *ptr, size_t size)
|
||||
{
|
||||
void *p = realloc(ptr, size);
|
||||
if (!p)
|
||||
error("out of memory");
|
||||
return(p);
|
||||
}
|
||||
|
||||
char *
|
||||
Strdup(char *s)
|
||||
{
|
||||
char *p = (char *)Malloc(strlen(s) + 1);
|
||||
strcpy(p, s);
|
||||
return(p);
|
||||
}
|
||||
|
||||
typedef struct sym_t {
|
||||
struct sym_t *next; /* MUST BE FIRST */
|
||||
char *name;
|
||||
int value;
|
||||
int npatch;
|
||||
int *patch;
|
||||
} sym_t;
|
||||
|
||||
sym_t *head;
|
||||
|
||||
void
|
||||
define(char *name, int value)
|
||||
{
|
||||
sym_t *p, *q;
|
||||
|
||||
for (p = head, q = (sym_t *)&head; p; p = p->next) {
|
||||
if (!strcmp(p->name, name))
|
||||
error("redefined symbol");
|
||||
q = p;
|
||||
}
|
||||
|
||||
p = q->next = (sym_t *)Malloc(sizeof(sym_t));
|
||||
p->next = NULL;
|
||||
p->name = Strdup(name);
|
||||
p->value = value;
|
||||
p->npatch = 0;
|
||||
p->patch = NULL;
|
||||
|
||||
if (debug) {
|
||||
fprintf(stderr, "\"%s\" ", p->name);
|
||||
if (p->value != NOVALUE)
|
||||
fprintf(stderr, "defined as 0x%x\n", p->value);
|
||||
else
|
||||
fprintf(stderr, "undefined\n");
|
||||
}
|
||||
}
|
||||
|
||||
sym_t *
|
||||
lookup(char *name)
|
||||
{
|
||||
sym_t *p;
|
||||
|
||||
for (p = head; p; p = p->next)
|
||||
if (!strcmp(p->name, name))
|
||||
return(p);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void
|
||||
patch(sym_t *p, int location)
|
||||
{
|
||||
p->npatch += 1;
|
||||
p->patch = (int *)Realloc(p->patch, p->npatch * sizeof(int *));
|
||||
|
||||
p->patch[p->npatch - 1] = location;
|
||||
}
|
||||
|
||||
void backpatch(void)
|
||||
{
|
||||
int i;
|
||||
sym_t *p;
|
||||
|
||||
for (p = head; p; p = p->next) {
|
||||
|
||||
if (p->value == NOVALUE) {
|
||||
fprintf(stderr,
|
||||
"%s: undefined symbol \"%s\"\n",
|
||||
filename, p->name);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (p->npatch) {
|
||||
if (debug)
|
||||
fprintf(stderr,
|
||||
"\"%s\" (0x%x) patched at",
|
||||
p->name, p->value);
|
||||
|
||||
for (i = 0; i < p->npatch; i++) {
|
||||
M[p->patch[i]][0] &= ~1;
|
||||
M[p->patch[i]][0] |= ((p->value >> 8) & 1);
|
||||
M[p->patch[i]][1] = p->value & 0xff;
|
||||
|
||||
if (debug)
|
||||
fprintf(stderr, " 0x%x", p->patch[i]);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
fputc('\n', stderr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Output words in byte-reversed order (least significant first)
|
||||
* since the sequencer RAM is loaded that way.
|
||||
*/
|
||||
void
|
||||
output(FILE *fp)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < LC; i++)
|
||||
fprintf(fp, "\t0x%02x, 0x%02x, 0x%02x, 0x%02x,\n",
|
||||
M[i][3],
|
||||
M[i][2],
|
||||
M[i][1],
|
||||
M[i][0]);
|
||||
printf("%d out of %d instructions used.\n", LC, MEMORY);
|
||||
}
|
||||
|
||||
char **
|
||||
getl(int *n)
|
||||
{
|
||||
int i;
|
||||
char *p, *quote;
|
||||
static char buf[MAXLINE];
|
||||
static char *a[MAXTOKEN];
|
||||
|
||||
i = 0;
|
||||
|
||||
while (fgets(buf, sizeof(buf), stdin)) {
|
||||
|
||||
lineno += 1;
|
||||
|
||||
if (buf[strlen(buf)-1] != '\n')
|
||||
error("line too long");
|
||||
|
||||
p = strchr(buf, '#');
|
||||
if (p)
|
||||
*p = '\0';
|
||||
p = buf;
|
||||
rescan:
|
||||
quote = strchr(p, '\"');
|
||||
if (quote)
|
||||
*quote = '\0';
|
||||
for (p = strtok(p, ", \t\n"); p; p = strtok(NULL, ", \t\n"))
|
||||
if (i < MAXTOKEN-1)
|
||||
a[i++] = p;
|
||||
else
|
||||
error("too many tokens");
|
||||
if (quote) {
|
||||
quote++;
|
||||
p = strchr(quote, '\"');
|
||||
if (!p)
|
||||
error("unterminated string constant");
|
||||
else if (i < MAXTOKEN-1) {
|
||||
a[i++] = quote;
|
||||
*p = '\0';
|
||||
p++;
|
||||
}
|
||||
else
|
||||
error("too many tokens");
|
||||
goto rescan;
|
||||
}
|
||||
if (i) {
|
||||
*n = i;
|
||||
return(a);
|
||||
}
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
#define A 0x8000 /* `A'ccumulator ok */
|
||||
#define I 0x4000 /* use as immediate value */
|
||||
#define SL 0x2000 /* shift left */
|
||||
#define SR 0x1000 /* shift right */
|
||||
#define RL 0x0800 /* rotate left */
|
||||
#define RR 0x0400 /* rotate right */
|
||||
#define LO 0x8000 /* lookup: ori-{jmp,jc,jnc,call} */
|
||||
#define LA 0x4000 /* lookup: and-{jz,jnz} */
|
||||
#define LX 0x2000 /* lookup: xor-{je,jne} */
|
||||
#define NA -1 /* not applicable */
|
||||
|
||||
struct {
|
||||
char *name;
|
||||
int n; /* number of operands, including opcode */
|
||||
unsigned int op; /* immediate or L?|pos_from_0 */
|
||||
unsigned int dest; /* NA, pos_from_0, or I|immediate */
|
||||
unsigned int src; /* NA, pos_from_0, or I|immediate */
|
||||
unsigned int imm; /* pos_from_0, A|pos_from_0, or I|immediate */
|
||||
unsigned int addr; /* NA or pos_from_0 */
|
||||
int fmt; /* instruction format - 1, 2, or 3 */
|
||||
} instr[] = {
|
||||
/*
|
||||
* N OP DEST SRC IMM ADDR FMT
|
||||
*/
|
||||
{ "mov", 3, 1, 1, 2, I|0xff, NA, 1 },
|
||||
{ "mov", 4, LO|2, NA, 1, I|0, 3, 3 },
|
||||
{ "mvi", 3, 0, 1, I|R_ALLZEROS, A|2, NA, 1 },
|
||||
{ "mvi", 4, LO|2, NA, I|R_ALLZEROS, 1, 3, 3 },
|
||||
{ "not", 2, 2, 1, 1, I|0xff, NA, 1 },
|
||||
{ "and", 3, 1, 1, 1, A|2, NA, 1 },
|
||||
{ "and", 4, 1, 1, 3, A|2, NA, 1 },
|
||||
{ "or", 3, 0, 1, 1, A|2, NA, 1 },
|
||||
{ "or", 4, 0, 1, 3, A|2, NA, 1 },
|
||||
{ "or", 5, LO|3, NA, 1, 2, 4, 3 },
|
||||
{ "xor", 3, 2, 1, 1, A|2, NA, 1 },
|
||||
{ "xor", 4, 2, 1, 3, A|2, NA, 1 },
|
||||
{ "nop", 1, 1, I|R_NONE, I|R_ALLZEROS, I|0xff, NA, 1 },
|
||||
{ "inc", 2, 3, 1, 1, I|1, NA, 1 },
|
||||
{ "inc", 3, 3, 1, 2, I|1, NA, 1 },
|
||||
{ "dec", 2, 3, 1, 1, I|0xff, NA, 1 },
|
||||
{ "dec", 3, 3, 1, 2, I|0xff, NA, 1 },
|
||||
{ "jmp", 2, LO|0, NA, I|R_SINDEX, I|0, 1, 3 },
|
||||
{ "jc", 2, LO|0, NA, I|R_SINDEX, I|0, 1, 3 },
|
||||
{ "jnc", 2, LO|0, NA, I|R_SINDEX, I|0, 1, 3 },
|
||||
{ "call", 2, LO|0, NA, I|R_SINDEX, I|0, 1, 3 },
|
||||
{ "test", 5, LA|3, NA, 1, A|2, 4, 3 },
|
||||
{ "cmp", 5, LX|3, NA, 1, A|2, 4, 3 },
|
||||
{ "ret", 1, 1, I|R_NONE, I|R_ALLZEROS, I|0xff, NA, 1 },
|
||||
{ "ret", 1, 1, I|R_NONE, I|R_ALLZEROS, I|0xff, NA, 1 },
|
||||
{ "clc", 1, 3, I|R_NONE, I|R_ALLZEROS, I|1, NA, 1 },
|
||||
{ "clc", 4, 3, 2, I|R_ALLZEROS, A|3, NA, 1 },
|
||||
{ "stc", 2, 3, 1, I|R_ALLONES, I|1, NA, 1 },
|
||||
{ "add", 3, 3, 1, 1, A|2, NA, 1 },
|
||||
{ "add", 4, 3, 1, 3, A|2, NA, 1 },
|
||||
{ "adc", 3, 4, 1, 1, A|2, NA, 1 },
|
||||
{ "adc", 4, 4, 1, 3, A|2, NA, 1 },
|
||||
{ "shl", 3, 5, 1, 1, SL|2, NA, 2 },
|
||||
{ "shl", 4, 5, 1, 2, SL|3, NA, 2 },
|
||||
{ "shr", 3, 5, 1, 1, SR|2, NA, 2 },
|
||||
{ "shr", 4, 5, 1, 2, SR|3, NA, 2 },
|
||||
{ "rol", 3, 5, 1, 1, RL|2, NA, 2 },
|
||||
{ "rol", 4, 5, 1, 2, RL|3, NA, 2 },
|
||||
{ "ror", 3, 5, 1, 1, RR|2, NA, 2 },
|
||||
{ "ror", 4, 5, 1, 2, RR|3, NA, 2 },
|
||||
/*
|
||||
* Extensions (note also that mvi allows A)
|
||||
*/
|
||||
{ "clr", 2, 1, 1, I|R_ALLZEROS, I|0xff, NA, 1 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
int
|
||||
eval_operand(char **a, int spec)
|
||||
{
|
||||
int i;
|
||||
unsigned int want = spec & (LO|LA|LX);
|
||||
|
||||
static struct {
|
||||
unsigned int what;
|
||||
char *name;
|
||||
int value;
|
||||
} jmptab[] = {
|
||||
{ LO, "jmp", 8 },
|
||||
{ LO, "jc", 9 },
|
||||
{ LO, "jnc", 10 },
|
||||
{ LO, "call", 11 },
|
||||
{ LA, "jz", 15 },
|
||||
{ LA, "jnz", 13 },
|
||||
{ LX, "je", 14 },
|
||||
{ LX, "jne", 12 },
|
||||
};
|
||||
|
||||
spec &= ~(LO|LA|LX);
|
||||
|
||||
for (i = 0; i < sizeof(jmptab)/sizeof(jmptab[0]); i++)
|
||||
if (jmptab[i].what == want &&
|
||||
!strcmp(jmptab[i].name, a[spec]))
|
||||
{
|
||||
return(jmptab[i].value);
|
||||
}
|
||||
|
||||
if (want)
|
||||
error("invalid jump");
|
||||
|
||||
return(spec); /* "case 0" - no flags set */
|
||||
}
|
||||
|
||||
int
|
||||
eval_sdi(char **a, int spec)
|
||||
{
|
||||
sym_t *p;
|
||||
unsigned val;
|
||||
|
||||
if (spec == NA)
|
||||
return(NA);
|
||||
|
||||
switch (spec & (A|I|SL|SR|RL|RR)) {
|
||||
case SL:
|
||||
case SR:
|
||||
case RL:
|
||||
case RR:
|
||||
if (isdigit(*a[spec &~ (SL|SR|RL|RR)]))
|
||||
val = strtol(a[spec &~ (SL|SR|RL|RR)], NULL, 0);
|
||||
else {
|
||||
p = lookup(a[spec &~ (SL|SR|RL|RR)]);
|
||||
if (!p)
|
||||
error("undefined symbol used");
|
||||
val = p->value;
|
||||
}
|
||||
|
||||
switch (spec & (SL|SR|RL|RR)) { /* blech */
|
||||
case SL:
|
||||
if (val > 7)
|
||||
return(0xf0);
|
||||
return(((val % 8) << 4) |
|
||||
(val % 8));
|
||||
case SR:
|
||||
if (val > 7)
|
||||
return(0xf0);
|
||||
return(((val % 8) << 4) |
|
||||
(1 << 3) |
|
||||
((8 - (val % 8)) % 8));
|
||||
case RL:
|
||||
return(val % 8);
|
||||
case RR:
|
||||
return((8 - (val % 8)) % 8);
|
||||
}
|
||||
case I:
|
||||
return(spec &~ I);
|
||||
case A:
|
||||
/*
|
||||
* An immediate field of zero selects
|
||||
* the accumulator. Vigorously object
|
||||
* if zero is given otherwise - it's
|
||||
* most likely an error.
|
||||
*/
|
||||
spec &= ~A;
|
||||
if (!strcmp("A", a[spec]))
|
||||
return(0);
|
||||
if (isdigit(*a[spec]) &&
|
||||
strtol(a[spec], NULL, 0) == 0)
|
||||
{
|
||||
error("immediate value of zero selects accumulator");
|
||||
}
|
||||
/* falls through */
|
||||
case 0:
|
||||
if (isdigit(*a[spec]))
|
||||
return(strtol(a[spec], NULL, 0));
|
||||
p = lookup(a[spec]);
|
||||
if (p)
|
||||
return(p->value);
|
||||
error("undefined symbol used");
|
||||
}
|
||||
|
||||
return(NA); /* shut the compiler up */
|
||||
}
|
||||
|
||||
int
|
||||
eval_addr(char **a, int spec)
|
||||
{
|
||||
sym_t *p;
|
||||
|
||||
if (spec == NA)
|
||||
return(NA);
|
||||
if (isdigit(*a[spec]))
|
||||
return(strtol(a[spec], NULL, 0));
|
||||
|
||||
p = lookup(a[spec]);
|
||||
|
||||
if (p) {
|
||||
if (p->value != NOVALUE)
|
||||
return(p->value);
|
||||
patch(p, LC);
|
||||
} else {
|
||||
define(a[spec], NOVALUE);
|
||||
p = lookup(a[spec]);
|
||||
patch(p, LC);
|
||||
}
|
||||
|
||||
return(NA); /* will be patched in later */
|
||||
}
|
||||
|
||||
int
|
||||
crack(char **a, int n)
|
||||
{
|
||||
int i;
|
||||
int I_imm, I_addr;
|
||||
int I_op, I_dest, I_src, I_ret;
|
||||
|
||||
/*
|
||||
* Check for "ret" at the end of the line; remove
|
||||
* it unless it's "ret" alone - we still want to
|
||||
* look it up in the table.
|
||||
*/
|
||||
I_ret = (strcmp(a[n-1], "ret") ? 0 : !0);
|
||||
if (I_ret && n > 1)
|
||||
n -= 1;
|
||||
|
||||
for (i = 0; instr[i].name; i++) {
|
||||
/*
|
||||
* Look for match in table given constraints,
|
||||
* currently just the name and the number of
|
||||
* operands.
|
||||
*/
|
||||
if (!strcmp(instr[i].name, *a) && instr[i].n == n)
|
||||
break;
|
||||
}
|
||||
if (!instr[i].name)
|
||||
error("unknown opcode or wrong number of operands");
|
||||
|
||||
I_op = eval_operand(a, instr[i].op);
|
||||
I_src = eval_sdi(a, instr[i].src);
|
||||
I_imm = eval_sdi(a, instr[i].imm);
|
||||
I_dest = eval_sdi(a, instr[i].dest);
|
||||
I_addr = eval_addr(a, instr[i].addr);
|
||||
|
||||
if( LC >= MEMORY )
|
||||
error("Memory exhausted!\n");
|
||||
|
||||
switch (instr[i].fmt) {
|
||||
case 1:
|
||||
case 2:
|
||||
M[LC][0] = (I_op << 1) | I_ret;
|
||||
M[LC][1] = I_dest;
|
||||
M[LC][2] = I_src;
|
||||
M[LC][3] = I_imm;
|
||||
break;
|
||||
case 3:
|
||||
if (I_ret)
|
||||
error("illegal use of \"ret\"");
|
||||
M[LC][0] = (I_op << 1) | ((I_addr >> 8) & 1);
|
||||
M[LC][1] = I_addr & 0xff;
|
||||
M[LC][2] = I_src;
|
||||
M[LC][3] = I_imm;
|
||||
break;
|
||||
}
|
||||
|
||||
return (1); /* no two-byte instructions yet */
|
||||
}
|
||||
|
||||
#undef SL
|
||||
#undef SR
|
||||
#undef RL
|
||||
#undef RR
|
||||
#undef LX
|
||||
#undef LA
|
||||
#undef LO
|
||||
#undef I
|
||||
#undef A
|
||||
|
||||
void
|
||||
assemble(FILE *ofile)
|
||||
{
|
||||
int n;
|
||||
char **a;
|
||||
sym_t *p;
|
||||
|
||||
while ((a = getl(&n))) {
|
||||
|
||||
while (a[0][strlen(*a)-1] == ':') {
|
||||
a[0][strlen(*a)-1] = '\0';
|
||||
p = lookup(*a);
|
||||
if (p)
|
||||
p->value = LC;
|
||||
else
|
||||
define(*a, LC);
|
||||
a += 1;
|
||||
n -= 1;
|
||||
}
|
||||
|
||||
if (!n) /* line was all labels */
|
||||
continue;
|
||||
|
||||
if (n == 3 && !strcmp("VERSION", *a))
|
||||
fprintf(ofile, "#define %s \"%s\"\n", a[1], a[2]);
|
||||
else {
|
||||
if (n == 3 && !strcmp("=", a[1]))
|
||||
define(*a, strtol(a[2], NULL, 0));
|
||||
else
|
||||
LC += crack(a, n);
|
||||
}
|
||||
}
|
||||
|
||||
backpatch();
|
||||
output(ofile);
|
||||
|
||||
if (debug)
|
||||
output(stderr);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int c;
|
||||
int pid;
|
||||
int ifile;
|
||||
FILE *ofile;
|
||||
int fd[2];
|
||||
|
||||
ofile = NULL;
|
||||
while ((c = getopt(argc, argv, "dho:vD:")) != EOF) {
|
||||
switch (c) {
|
||||
case 'd':
|
||||
debug = !0;
|
||||
break;
|
||||
case 'D':
|
||||
{
|
||||
char *p;
|
||||
if ((p = strchr(optarg, '=')) != NULL) {
|
||||
*p = '\0';
|
||||
define(optarg, strtol(p + 1, NULL, 0));
|
||||
}
|
||||
else
|
||||
define(optarg, 1);
|
||||
break;
|
||||
}
|
||||
case 'o':
|
||||
|
||||
if ((ofile = fopen(optarg, "w")) == NULL) {
|
||||
perror(optarg);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
case 'h':
|
||||
printf("usage: %s [-d] [-Dname] [-ooutput] input\n",
|
||||
*argv);
|
||||
exit(EXIT_SUCCESS);
|
||||
break;
|
||||
case 'v':
|
||||
printf("%s\n", id);
|
||||
exit(EXIT_SUCCESS);
|
||||
break;
|
||||
default:
|
||||
exit(EXIT_FAILURE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (argc - optind != 1) {
|
||||
fprintf(stderr, "%s: must have one input file\n", *argv);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
filename = argv[optind];
|
||||
|
||||
|
||||
if ((ifile = open(filename, O_RDONLY)) < 0) {
|
||||
perror(filename);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (!ofile) {
|
||||
if ((ofile = fopen(ADOTOUT, "w")) == NULL) {
|
||||
perror(ADOTOUT);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
if (pipe(fd) < 0) {
|
||||
perror("pipe failed");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ((pid = fork()) < 0 ) {
|
||||
perror("fork failed");
|
||||
exit(1);
|
||||
}
|
||||
else if (pid > 0) { /* Parent */
|
||||
close(fd[1]); /* Close write end */
|
||||
if (fd[0] != STDIN_FILENO) {
|
||||
if (dup2(fd[0], STDIN_FILENO) != STDIN_FILENO) {
|
||||
perror("dup2 error on stdin");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
close(fd[0]);
|
||||
}
|
||||
assemble(ofile);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
else { /* Child */
|
||||
close(fd[0]); /* Close Read end */
|
||||
if (fd[1] != STDOUT_FILENO) {
|
||||
if (dup2(fd[1], STDOUT_FILENO) != STDOUT_FILENO) {
|
||||
perror("dup2 error on stdout");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
close(fd[1]);
|
||||
}
|
||||
if (ifile != STDIN_FILENO) {
|
||||
if (dup2(ifile, STDIN_FILENO) != STDIN_FILENO) {
|
||||
perror("dup2 error on stdin");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
close(ifile);
|
||||
}
|
||||
execl("/usr/bin/cpp", "/usr/bin/cpp", "-P", "-", "-", NULL);
|
||||
}
|
||||
return(EXIT_SUCCESS);
|
||||
}
|
||||
@@ -1,326 +0,0 @@
|
||||
Id: README-3.8.mrouted,v 3.8 1995/11/29 22:23:02 fenner Rel
|
||||
|
||||
IP Multicast Extensions for BSD-Derived Unix Systems
|
||||
|
||||
Release 3.8
|
||||
November 29, 1995
|
||||
|
||||
available from parcftp.xerox.com,
|
||||
file pub/net-research/ipmulti/mrouted3.8.tar.Z
|
||||
binaries pub/net-research/ipmulti/mrouted3.8-sparc-sunos41x.tar.Z
|
||||
pub/net-research/ipmulti/mrouted3.8-sparc-solaris2.tar.Z
|
||||
pub/net-research/ipmulti/mrouted3.8-i386-bsd.tar.Z
|
||||
pub/net-research/ipmulti/mrouted3.8-alpha-osf1.tar.Z
|
||||
pub/net-research/ipmulti/mrouted3.8-sgi-irix.tar.Z
|
||||
pub/net-research/ipmulti/mrouted3.8-hp-hpux.tar.Z
|
||||
|
||||
Note: The 3.8 release is mrouted-only, and will run on top of a 3.5 kernel.
|
||||
It is a drop-in replacement for mrouted 3.5, 3.6 or 3.7 .
|
||||
|
||||
The 3.8 release fixes the following bugs:
|
||||
|
||||
o mrouted would fail to forget prunes when a neighbor went away,
|
||||
thus potentially sending traffic down a tunnel after the tunnel
|
||||
endpoint has gone down. This was due to some research code making
|
||||
it into the "emergency" 3.7 release, sigh.
|
||||
|
||||
o mrouted could send prunes with negative lifetimes. This causes
|
||||
slightly higher prune traffic but shouldn't be any major problem.
|
||||
|
||||
===========
|
||||
Release 3.7
|
||||
November 28, 1995
|
||||
|
||||
The 3.7 release fixes the following bugs:
|
||||
|
||||
o mrouted now ignores route reports that include bogus netmasks.
|
||||
There was a bug in 3.5 that would mangle default routes into
|
||||
tens of bogus routes; this should prevent that bug from killing
|
||||
the MBONE.
|
||||
|
||||
This solution can cause route flaps and black holes until the
|
||||
3.5's are gone or all of the 3.5's neighbors are 3.7 .
|
||||
|
||||
o mrouted now ignores duplicate routes. Ciscos and the above 3.5
|
||||
bug could cause two copies of the same route to appear in a single
|
||||
routing update; mrouted would insert two copies of the same route
|
||||
into its routing table and wreak all sorts of havoc.
|
||||
|
||||
o mrouted now sends a group-specific query for both retransmissions
|
||||
of a g-s query; previous versions sent a general query the second
|
||||
time.
|
||||
|
||||
o mrouted now loops back multicasted mtrace responses and
|
||||
group-specific membership queries
|
||||
|
||||
o mrouted now performs deterministic tiebreaking between two
|
||||
neighbors on the same vif.
|
||||
|
||||
o mrouted now only does duplicate suppression on traceroute requests,
|
||||
not all traceroute packets, so that a loop can be nicely detected
|
||||
via a duplicate router instead of just a timeout.
|
||||
|
||||
o the buffer size that mrouted uses has been increased to allow
|
||||
more than 16 hops in mtrace messages.
|
||||
|
||||
o mtrace's hop-by-hop termination is now more likely to be correct.
|
||||
|
||||
o mrinfo now waits for the responses to its retransmitted queries.
|
||||
|
||||
The 3.7 release has the following new features:
|
||||
|
||||
o The configuration file can accept a hostname as the other end
|
||||
of a tunnel. There must be a single name->ip mapping for the
|
||||
given name, however, or mrouted will fail to start up.
|
||||
|
||||
o mrinfo now sends requests to all interfaces of a multihomed host.
|
||||
|
||||
o mtrace's passive mode has been implemented.
|
||||
|
||||
o The first screen of mtrace statistics is shorter and more likely
|
||||
to fit on one screen.
|
||||
|
||||
===========
|
||||
Release 3.6
|
||||
June 26, 1995
|
||||
|
||||
The 3.6 release fixes the following bugs:
|
||||
|
||||
o mrouted would dump core when attempting to report no routes (i.e. upon
|
||||
startup, if you have no enabled phyint's)
|
||||
|
||||
o mrouted would dump core if requested to traceroute a source for which it
|
||||
had no route
|
||||
|
||||
o neighbor flags were not always properly updated on probe or report
|
||||
|
||||
o mrouted would sometimes reply to a multicast traceroute on a disabled
|
||||
phyint; now it uses the first configured phyint to reply to traceroutes.
|
||||
|
||||
o host routes (i.e. netmask 0xffffffff) works now; it was discarding
|
||||
IGMP from the host because it was coming from the "broadcast address"
|
||||
of the subnet.
|
||||
|
||||
o send_igmp() now treats the failure to send an mtrace or a neighbor
|
||||
reply as informational, as opposed to warning.
|
||||
|
||||
o mrouted would go into an infinite loop trying to respond to a traceroute
|
||||
for a source with a netmask of 0xffffffff.
|
||||
|
||||
o vifs_with_neighbors was not being reset if the mrouted was restarted
|
||||
with SIGHUP
|
||||
|
||||
o the default route was not being properly advertised to neighbors (although
|
||||
it was accepted if it was advertised to it)
|
||||
|
||||
o ANSI-fication for those who it helps, still-K&R-ish for those it doesn't.
|
||||
|
||||
o mtrace now attempts to trace three hops past a non-responding router,
|
||||
in the hopes that it does support traceroute but just couldn't respond
|
||||
(i.e. unicast didn't work and it can't source multicast because all its
|
||||
phyints are disabled).
|
||||
|
||||
o mrinfo now times out even on a multicast router.
|
||||
|
||||
|
||||
===========
|
||||
Release 3.5
|
||||
May 8, 1995
|
||||
|
||||
The 3.5 release has the following new features:
|
||||
|
||||
o The kernel and mrouted make sure that each is the correct version, to
|
||||
prevent problems with mismatched kernel/mrouted versions. A too-old
|
||||
mrouted will die with the error:
|
||||
|
||||
can't enable DVMRP routing in kernel: Option not supported by protocol
|
||||
|
||||
o mrouted can accept and propogate a default route (essential for
|
||||
heirarchical multicast routing)
|
||||
|
||||
o Kernel route cache keeps source-specific routes instead of subnet routes,
|
||||
eliminating hashing and longest-match problems.
|
||||
(allows classless routing, longest-match and default routing)
|
||||
|
||||
o Cached kernel routes only get deleted if no traffic is flowing, to
|
||||
facilitate multicast traceroute
|
||||
|
||||
o mrouted has a new configuration file parser, which provides better error
|
||||
messages than before, and allows named boundaries (see man page)
|
||||
|
||||
o added "netmask" to phyint configuration, at the suggestion of
|
||||
Anders Klemets
|
||||
|
||||
o System V and FreeBSD compatibility from John Brezak <[email protected]>
|
||||
|
||||
o phyint's can have additional subnets configured, for people with
|
||||
multiple subnets on one physical network. mrouted.conf syntax is
|
||||
altnet 1.2.3.0, or altnet 1.2.3.0/24 if you need to specify
|
||||
a different netmask. There can be as many altnet statements
|
||||
as you need.
|
||||
|
||||
o both mrouted and the kernel now support classless addresses.
|
||||
|
||||
o the kernel supports PIM assert processing by notifying the router
|
||||
when a packet arrives on the wrong interface
|
||||
|
||||
o the kernel keeps additional counters, and mrouted can be compiled to
|
||||
support SNMP and the Multicast MIB
|
||||
|
||||
o the packet classifier in the kernel now uses the following udp port
|
||||
ranges:
|
||||
[0, 16384) - lowest priority, unclassified
|
||||
[16384, 32768) - highest priority, i.e. audio
|
||||
[32768, 49152) - medium priority, i.e. whiteboard
|
||||
[49152, 65536) - low priority, i.e. video
|
||||
A future release of a session directory will allocate ports in these
|
||||
ranges.
|
||||
|
||||
o the configuration code has been modified to default tunnels' rate_limit
|
||||
parameters to 500kbps. This is easily modified with a rate_limit keyword
|
||||
in mrouted.conf, but should be a good default for the MBONE in general.
|
||||
|
||||
o The tunnel sending code now caches a route for ip_output(), this should
|
||||
help performance on machines with lots of tunnels.
|
||||
|
||||
o Dispatching for de-capsulating packets is now via protosw[], making
|
||||
reception of other raw protocols more efficient
|
||||
|
||||
o Neighbor capabilities are discovered via a bitmask as opposed to
|
||||
version number.
|
||||
|
||||
o Multicast traceroute code improved
|
||||
|
||||
o mrouted can be compiled with Routing Support for Resource Reservation
|
||||
(RSRR), required for RSVP.
|
||||
|
||||
|
||||
The 3.5 release fixes the following bugs:
|
||||
|
||||
o The IGMPv2 query timeout field was interpreted as being in units of
|
||||
200ms as opposed to 100ms, thus the maximum timeout was set to twice
|
||||
the expected value. This is not fatal, as mrouted always queries
|
||||
twice in the expectation that a packet could get loss, but it does
|
||||
make it less robust in the face of packet loss.
|
||||
|
||||
o IGMP could report membership in local-only groups (i.e. 224.0.0.X)
|
||||
|
||||
o IGMP could get confused by hearing its own new membership reports, thus
|
||||
a router would never perform fast leave.
|
||||
|
||||
o IGMP could reset timers for the wrong interface.
|
||||
|
||||
o mrouted put a bogus value in the maximum timeout field of IGMPv2 query
|
||||
packets.
|
||||
|
||||
o Non-querier mrouters would respond to IGMP leave messages
|
||||
|
||||
o mrouted was not performing fast leave properly
|
||||
|
||||
o If the last member goes away on a transit network, the upstream router
|
||||
would stop forwarding even if there are downstream members.
|
||||
|
||||
o Kernel hash function improved
|
||||
|
||||
o Eliminated possibility of panic(): timeout in cache maintenance
|
||||
|
||||
o Reordered resource allocation when sending upcall to handle failure properly
|
||||
|
||||
o some endian-ness bugs squashed in mrouted, probably more to go.
|
||||
|
||||
o Multicast traceroute could send a reply on a disabled interface.
|
||||
|
||||
|
||||
This release consists of the following files:
|
||||
|
||||
|
||||
README-3.8.mrouted - this file
|
||||
|
||||
mrouted/* - version 3.8 of mrouted,
|
||||
mrinfo, map-mbone and
|
||||
mtrace.
|
||||
|
||||
ifconfig/* - Changes to ifconfig to
|
||||
show multicast interfaces
|
||||
|
||||
netstat/* - Diffs to netstat
|
||||
|
||||
ping/* - sources for ping
|
||||
which support
|
||||
multicasting
|
||||
|
||||
mtest/* - utility for testing
|
||||
multicast group
|
||||
membership
|
||||
|
||||
|
||||
MROUTED 3.8
|
||||
|
||||
Mrouted 3.8 has two optional features: SNMP and RSRR. RSRR support
|
||||
is required for running RSVP; the SNMP code, with the help of the
|
||||
ISODE snmpd, implements both the Multicast MIB and the DVMRP MIB.
|
||||
|
||||
RSRR
|
||||
----
|
||||
Routing Support for Resource Reservations (RSRR) was contributed by
|
||||
Daniel Zappala <[email protected]>.
|
||||
|
||||
To enable RSRR support, uncomment the three lines starting with
|
||||
RSRR near the top of the Makefile and "make clean; make". Or use
|
||||
the prebuilt binary, mrouted.rsrr .
|
||||
|
||||
RSRR allows RSVP to query mrouted for its routing entry for a particular
|
||||
source-group pair. Using the routing entry and the IP_MULTICAST_VIF
|
||||
socket call, RSVP can forward distinct control messages out each
|
||||
outgoing interface. This version of mrouted supports RSRR messages
|
||||
using a Unix datagram socket.
|
||||
|
||||
RSRR currently includes two pairs of query-reply messages. RSVP sends
|
||||
an Initial Query when it starts. Mrouted responds with an Initial Reply
|
||||
that includes the set of vifs it is using, flagging those that are
|
||||
administratively disabled. When RSVP needs the routing entry for a
|
||||
source-group pair, it sends a Route Query. Mrouted responds with a
|
||||
Route Reply that includes the incoming vif and outgoing vifs for the
|
||||
source-group pair.
|
||||
|
||||
RSVP may request route change notification by setting the notification
|
||||
bit in the Route Query. If mrouted can provide route change
|
||||
notification for the source-group pair, it sets the notification bit in
|
||||
its Route Reply. When the routing entry for the source-group pair
|
||||
changes, mrouted sends an unsolicited Route Reply containing the new
|
||||
routing information. The initial release of mrouted 3.5 did not support
|
||||
route change notification and always returned a Route Reply with the
|
||||
notification bit cleared. This release of mrouted provides route change
|
||||
notification when possible.
|
||||
|
||||
SNMP
|
||||
----
|
||||
SNMP support was contributed by David Thaler <[email protected]>.
|
||||
|
||||
To enable SNMP support, uncomment the six lines near the top of
|
||||
the Makefile below the description of SNMP support, or use the
|
||||
prebuilt binary, mrouted.snmp or mrouted.rsrr.snmp .
|
||||
|
||||
To link the SNMP-capable mrouted, you need the CMU libraries.
|
||||
See http://nic.merit.edu/~mbone/ for a full mrouted-snmp distribution.
|
||||
|
||||
Make sure to add the "sysName", "sysContact", "sysVersion" and
|
||||
"sysLocation" variables to your /etc/mrouted.conf if you want them
|
||||
to provide anything other than default values.
|
||||
|
||||
Example:
|
||||
|
||||
sysName "tibia"
|
||||
sysContact "Bill Fenner <[email protected]> +1 415 812-4816"
|
||||
sysVersion "SunOS 4.1.3 and mrouted 3.8"
|
||||
sysLocation "MAXC room, PARC building 35"
|
||||
|
||||
The SNMP version of mrouted has an additional command line flag:
|
||||
|
||||
-P snmp_port
|
||||
|
||||
Specifies a port for SNMP communication (default 161). This option
|
||||
should be used when another SNMP daemon already exists. The
|
||||
preferred alternate port in this case is port 9161.
|
||||
|
||||
The mstat(8) program allows querying of statistics using SNMP.
|
||||
Reference in new issue
Block a user