V1.79 (Running 4.3BSD-tahoe on a VAX)

Keith Bostic bostic at OKEEFFE.BERKELEY.EDU
Wed Apr 19 05:29:32 AEST 1989


BSD4.3-tahoe VAX Installation


     Installing 4.3BSD-tahoe on  VAXen  running  4.3BSD  has
turned  out  to be more complicated than we had anticipated.
The following is intended to be a simple guide  to  some  of
the  things  that  must  be done to upgrade the commands and
libraries on your 4.3BSD VAX system.  It is not intended  to
replace  a  careful reading of the document ``Installing and
Operating 4.3BSD-tahoe UNIX on the VAX'', nor should  it  be
followed  blindly.   For further information, clarification,
or help with related problems, please contact our  technical
office at +1-415-642-4948.

     The rest of this document assumes that your VAX is run-
ning  4.3BSD;  upgrading from 4.2BSD is similar, but will be
more difficult.  It is suggested that  you  upgrade  in  two
steps, i.e. to 4.3BSD and from there to 4.3BSD-tahoe.

     The suggested procedure is to bring up 4.3BSD-tahoe  on
a  separate  disk (or at the very least a separate file sys-
tem) from your regular system, minimizing the risk of catas-
trophic  failure.  You will need approximately 160 megabytes
for building the entire source tree;  for  the  purposes  of
this document we will assume that it's mounted on /tahoe.

     Once you have mounted /tahoe, extract  /usr,  /usr/src,
and /sys into it.  If you have a 6250 bpi distribution, they
are the fourth, fifth, and sixth files respectively.  If you
have  a  1600  bpi distribution, they are the fourth file on
the first tape and the first two files on the  second  tape,
respectively.   All  three  files  are tar(1) files, and are
blocked at 40, i.e. use the ``b'' option for  tar,  with  an
argument of 40, to extract them:

        cd /tahoe;
        mkdir /usr /usr/src /usr/src/sys
        ln -s /usr/src/sys /sys
        cd /usr
        # position the tape to the appropriate file for /usr
        tar xbf 40 whatever_device_you're_using
        # position the tape to the appropriate file for /usr/src/sys
        cd /usr/src/sys
        tar xbf 40 whatever_device_you're_using
        # position the tape to the appropriate file for /usr/src
        cd /usr/src
        tar xbf 40 whatever_device_you're_using


     Since any binaries you have just placed into /tahoe are
for  the  tahoe  processor,  you must replace them with your
4.3BSD VAX binaries.  You must also copy a few other of your
4.3BSD directories into /tahoe.  The directories /etc, /lib,
/bin, /usr/bin, /usr/lib, and /usr/ucb should all be  copied
into /tahoe.  DON'T replace /usr/include!

        cp -p -r /etc /tahoe/etc
        cp -p -r /lib /tahoe/lib
        cp -p -r /bin /tahoe/bin
        cp -p -r /usr/bin /tahoe/usr/bin
        cp -p -r /usr/lib /tahoe/usr/lib
        cp -p -r /usr/ucb /tahoe/usr/ucb


     You will also need the chroot program -- if  you  don't
already  have it, it's at the end of this document.  Compile
and install it in /etc on your system.  Chroot  changes  its
root  directory  (``/'')  to its first argument and forks an
interactive copy of your shell.

     Now, change root to the tahoe  system;  note  that  all
full  pathnames  will  now  be  relative to ``/tahoe''!  The
``setenv'' command is necessary, as the source tree now sup-
ports  two  architectures.   If  you're  using  Bourne shell
(``/bin/sh'') or ksh, use  ``MACHINE=vax;  export  MACHINE''
instead:

        chroot /tahoe
        setenv MACHINE vax


     Change directory to /usr/src/sys and relink ``machine''
to the vax directory:

        cd /usr/src/sys
        rm machine
        ln -s vax machine


     Change directory to vax/inline; build the  inline  pro-
gram:

        cd /usr/src/sys/vax/inline
        make


     Make and install the install program:

        cd /usr/src/ucb/xinstall
        make
        mv xinstall /usr/ucb/install
        strip /usr/ucb/install
        chmod 775 /usr/ucb/install


     Make and install make(1):

        cd /usr/src/bin/make
        make
        make install


     Install the include files:

        cd /usr/src/include
        make install


     Remake and re-install the make program:

        cd /usr/src/bin/make
        make clean
        make
        make install


     Make and install  the  dependency  generating  program,
mkdep(1):

        cd /usr/src/ucb/mkdep
        make
        make install


     Make and install egrep:

        cd /usr/src/ucb/grep
        make
        make install


     Make and install the world (this takes quite awhile):

        cd /usr/src
        make clean
        make depend
        make build
        make install


     At this point you should have the libraries and  utili-
ties  installed for 4.3BSD-tahoe.  Of course, they are some-
what intermixed with your old libraries and  binaries,  how-
ever, using the modification times, it should be fairly easy
to determine which is which and clean up.


# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	Makefile
#	chroot.8
#	chroot.c
#	pathnames.h
#	strerror.c
#
echo x - Makefile
sed 's/^X//' >Makefile << 'END-of-Makefile'
X#
X# Copyright (c) 1989 The Regents of the University of California.
X# All rights reserved.
X#
X# Redistribution and use in source and binary forms are permitted
X# provided that the above copyright notice and this paragraph are
X# duplicated in all such forms and that any documentation,
X# advertising materials, and other materials related to such
X# distribution and use acknowledge that the software was developed
X# by the University of California, Berkeley.  The name of the
X# University may not be used to endorse or promote products derived
X# from this software without specific prior written permission.
X# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
X# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X#
X#	@(#)Makefile	5.2 (Berkeley) 4/18/89
X#
X
XCFLAGS=	-O
XLIBC=	/lib/libc.a
XSRCS=	chroot.c
XOBJS=
XMAN=	chroot.0
X
Xall: chroot
X
Xchroot: ${LIBC}
X	${CC} -o $@ ${CFLAGS} $@.c
X
Xclean:
X	rm -f ${OBJS} core chroot
X
Xcleandir: clean
X	rm -f ${MAN} tags .depend
X
Xdepend: ${SRCS}
X	mkdep -p ${CFLAGS} ${SRCS}
X
Xinstall: ${MAN}
X	install -s -o bin -g bin -m 755 chroot ${DESTDIR}/usr/bin
X	install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat8
X
Xlint: ${SRCS}
X	lint ${CFLAGS} ${SRCS}
X
Xtags: ${SRCS}
X	ctags ${SRCS}
END-of-Makefile
echo x - chroot.8
sed 's/^X//' >chroot.8 << 'END-of-chroot.8'
X.\" Copyright (c) 1988 The Regents of the University of California.
X.\" All rights reserved.
X.\"
X.\" Redistribution and use in source and binary forms are permitted
X.\" provided that the above copyright notice and this paragraph are
X.\" duplicated in all such forms and that any documentation,
X.\" advertising materials, and other materials related to such
X.\" distribution and use acknowledge that the software was developed
X.\" by the University of California, Berkeley.  The name of the
X.\" University may not be used to endorse or promote products derived
X.\" from this software without specific prior written permission.
X.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
X.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X.\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X.\"
X.\"	@(#)chroot.8	5.1 (Berkeley) 12/5/88
X.\"
X.TH CHROOT 8 "December 5, 1988"
X.UC 6
X.SH NAME
Xchroot \- change root directory
X.SH SYNOPSIS
X.B chroot newroot [ command ]
X.SH DESCRIPTION
XThe
X.I chroot
Xcommand changes its root directory to the supplied directory
X.I newroot
Xand exec's
X.IR command ,
Xif supplied, or an interactive copy of your shell (as specified
Xby the environmental variable
X.IR SHELL )
Xif not.
X.I /bin/sh
Xis used if
X.I SHELL
Xis not specified.
X.PP
XNote,
X.I command
Xor the shell are run as your real-user-id.
X.SH "SEE ALSO"
Xchdir(2), chroot(2), environ(7)
END-of-chroot.8
echo x - chroot.c
sed 's/^X//' >chroot.c << 'END-of-chroot.c'
X/*
X * Copyright (c) 1988 The Regents of the University of California.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms are permitted
X * provided that the above copyright notice and this paragraph are
X * duplicated in all such forms and that any documentation,
X * advertising materials, and other materials related to such
X * distribution and use acknowledge that the software was developed
X * by the University of California, Berkeley.  The name of the
X * University may not be used to endorse or promote products derived
X * from this software without specific prior written permission.
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X */
X
X#ifndef lint
Xchar copyright[] =
X"@(#) Copyright (c) 1988 The Regents of the University of California.\n\
X All rights reserved.\n";
X#endif /* not lint */
X
X#ifndef lint
Xstatic char sccsid[] = "@(#)chroot.c	5.4 (Berkeley) 3/5/89";
X#endif /* not lint */
X
X#include <stdio.h>
X#include "pathnames.h"
X
Xmain(argc, argv)
X	int argc;
X	char **argv;
X{
X	extern int errno;
X	char *shell, *getenv(), *strerror();
X
X	if (argc < 2) {
X		fprintf(stderr, "usage: chroot newroot [command]\n");
X		exit(1);
X	}
X	if (chdir(argv[1]) || chroot(argv[1]))
X		fatal(argv[1]);
X	setuid(getuid());
X	if (argv[2]) {
X		execvp(argv[2], &argv[2]);
X		fatal(argv[2]);
X	} else {
X		if (!(shell = getenv("SHELL")))
X			shell = _PATH_BSHELL;
X		execlp(shell, shell, "-i", (char *)NULL);
X		fatal(shell);
X	}
X	/* NOTREACHED */
X}
X
Xfatal(msg)
X	char *msg;
X{
X	extern int errno;
X
X	fprintf(stderr, "chroot: %s: %s\n", msg, strerror(errno));
X	exit(1);
X}
END-of-chroot.c
echo x - pathnames.h
sed 's/^X//' >pathnames.h << 'END-of-pathnames.h'
X/*
X * Copyright (c) 1989 The Regents of the University of California.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms are permitted
X * provided that the above copyright notice and this paragraph are
X * duplicated in all such forms and that any documentation,
X * advertising materials, and other materials related to such
X * distribution and use acknowledge that the software was developed
X * by the University of California, Berkeley.  The name of the
X * University may not be used to endorse or promote products derived
X * from this software without specific prior written permission.
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X *
X *	@(#)pathnames.h	5.1 (Berkeley) 3/5/89
X */
X
X#define	_PATH_BSHELL	"/bin/sh"
END-of-pathnames.h
echo x - strerror.c
sed 's/^X//' >strerror.c << 'END-of-strerror.c'
X/*
X * Copyright (c) 1988 Regents of the University of California.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms are permitted
X * provided that the above copyright notice and this paragraph are
X * duplicated in all such forms and that any documentation,
X * advertising materials, and other materials related to such
X * distribution and use acknowledge that the software was developed
X * by the University of California, Berkeley.  The name of the
X * University may not be used to endorse or promote products derived
X * from this software without specific prior written permission.
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X */
X
X#if defined(LIBC_SCCS) && !defined(lint)
Xstatic char sccsid[] = "@(#)strerror.c	5.1 (Berkeley) 4/9/89";
X#endif /* LIBC_SCCS and not lint */
X
Xchar *
Xstrerror(errnum)
X	int errnum;
X{
X	extern int sys_nerr;
X	extern char *sys_errlist[];
X	static char ebuf[20];
X
X	if ((unsigned int)errnum < sys_nerr)
X		return(sys_errlist[errnum]);
X	(void)sprintf(ebuf, "Unknown error: %d", errnum);
X	return(ebuf);
X}
END-of-strerror.c
exit



More information about the Comp.bugs.4bsd.ucb-fixes mailing list