summaryrefslogtreecommitdiff
path: root/distrib/arc/common
diff options
context:
space:
mode:
Diffstat (limited to 'distrib/arc/common')
-rw-r--r--distrib/arc/common/Makefile.inc73
-rw-r--r--distrib/arc/common/dot.commonutils131
-rw-r--r--distrib/arc/common/instbin-krb.conf26
-rw-r--r--distrib/arc/common/instbin.conf26
-rw-r--r--distrib/arc/common/list93
-rw-r--r--distrib/arc/common/mtree.conf83
-rw-r--r--distrib/arc/common/rdsetroot.c216
-rw-r--r--distrib/arc/common/termcap.pc344
8 files changed, 692 insertions, 0 deletions
diff --git a/distrib/arc/common/Makefile.inc b/distrib/arc/common/Makefile.inc
new file mode 100644
index 00000000000..3c411b5a96c
--- /dev/null
+++ b/distrib/arc/common/Makefile.inc
@@ -0,0 +1,73 @@
+# $OpenBSD: Makefile.inc,v 1.1 1997/05/14 21:13:30 pefo Exp $
+
+# TOP is assumed to be defined by Makefile including this one.
+
+CBIN= instbin
+COMMONDIR= ${TOP}/inst-common
+
+MOUNT_POINT?= /mnt
+VND?= vnd0
+VND_DEV= /dev/${VND}a
+VND_RDEV= /dev/r${VND}a
+IMAGE?= xxx${REV}.fs
+PID!= echo $$$$
+REALIMAGE= /tmp/image.${PID}
+MDEC= ${DESTDIR}/usr/mdec
+
+LISTS= ${COMMONDIR}/list ${.CURDIR}/list
+.if (${KERBEROS} == "yes")
+CRUNCHCONF= ${COMMONDIR}/${CBIN}-krb.conf
+.else
+CRUNCHCONF= ${COMMONDIR}/${CBIN}.conf
+.endif
+MTREE= ${COMMONDIR}/mtree.conf
+
+all: ${CBIN}
+.ifndef FLOPPY3
+ dd if=/dev/zero of=${REALIMAGE} bs=10k count=120
+ vnconfig -v -c ${VND} ${REALIMAGE}
+ disklabel -w -B -b /usr/mdec/fdboot -s /usr/mdec/bootfd ${VND} floppy5
+ newfs -O -m 0 -o space -i 3000 -c 80 ${VND_RDEV} floppy5
+.else
+ dd if=/dev/zero of=${REALIMAGE} bs=10k count=144
+ vnconfig -v -c ${VND} ${REALIMAGE}
+ disklabel -w -B -b /usr/mdec/fdboot -s /usr/mdec/bootfd ${VND} floppy3
+ newfs -O -m 0 -o space -i 3000 -c 80 ${VND_RDEV} floppy3
+.endif
+ mount ${VND_DEV} ${MOUNT_POINT}
+ mtree -def ${MTREE} -p ${MOUNT_POINT}/ -u
+ TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
+ TARGDIR=${MOUNT_POINT} sh ${TOP}/runlist.sh ${LISTS}
+ @echo ""
+ @df -i ${MOUNT_POINT}
+ @echo ""
+ umount ${MOUNT_POINT}
+ vnconfig -u ${VND}
+ cat /*bin/* > /dev/null
+ cp ${REALIMAGE} ${IMAGE}
+ rm ${REALIMAGE}
+
+unconfig:
+ -umount -f ${MOUNT_POINT}
+ -vnconfig -u ${VND}
+ -/bin/rm -f ${IMAGE}
+
+${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
+ crunchgen -D ${TOP}/../../.. -m ${CBIN}.mk -L ${DESTDIR}/usr/lib \
+ ${CRUNCHCONF}
+
+${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
+ make -f ${CBIN}.mk all
+.if (${KERBEROS} == "yes")
+ mv ${CBIN}-krb ${CBIN}
+.endif
+
+install:
+ cp ${IMAGE} ${DESTDIR}/snapshot/
+
+clean cleandir:
+ /bin/rm -f *.core ${IMAGE} ${CBIN} ${CBIN}.mk \
+ ${CBIN}.cache *.o *.lo *.c
+
+.include <bsd.obj.mk>
+.include <bsd.subdir.mk>
diff --git a/distrib/arc/common/dot.commonutils b/distrib/arc/common/dot.commonutils
new file mode 100644
index 00000000000..9105adbc3be
--- /dev/null
+++ b/distrib/arc/common/dot.commonutils
@@ -0,0 +1,131 @@
+# $OpenBSD: dot.commonutils,v 1.1 1997/05/14 21:13:31 pefo Exp $
+#
+# Copyright (c) 1994 Christopher G. Demetriou
+# 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 Christopher G. Demetriou.
+# 4. 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.
+
+# Installation utilites (functions), to get OpenBSD installed on
+# the hard disk. These are meant to be invoked from the shell prompt,
+# by people installing OpenBSD.
+
+# we know that /etc/fstab is only generated on the hard drive
+dest_dir=/
+if [ ! -f /etc/fstab ]; then
+ dest_dir=/mnt/
+fi
+
+# counter for possible shared library confusion
+TAR=/bin/tar
+GUNZIP="/usr/bin/gzip -d"
+
+Set_tmp_dir()
+{
+ def_tmp_dir=`pwd`
+ if [ "$def_tmp_dir" = "/" -o "$def_tmp_dir" = "/mnt" ]; then
+ def_tmp_dir="$dest_dir"usr/distrib
+ fi
+
+ echo -n "What directory should be used to find and/or store "
+ echo "installtion"
+ echo -n "files? [$def_tmp_dir] "
+ read tmp_dir
+ if [ "$tmp_dir" = "" ]; then
+ tmp_dir=$def_tmp_dir
+ fi
+ if [ ! -d "$tmp_dir" ]; then
+ /bin/rm -rf $tmp_dir
+ mkdir -p $tmp_dir
+ fi
+}
+
+Tmp_dir()
+{
+ if [ "$tmp_dir" = "" ]; then
+ Set_tmp_dir
+ fi
+ cd $tmp_dir
+}
+
+Load_fd()
+{
+ Tmp_dir
+ which=
+ echo "Don't forget that you can't load from the drive you booted from."
+ echo ""
+
+ while [ "$which" != "0" -a "$which" != "1" ]; do
+ echo -n "Read from which floppy drive ('0' or '1')? [1] "
+ read which
+ if [ "X$which" = "X" ]; then
+ which=1
+ fi
+ done
+ echo ""
+ echo "WARNING: during the floppy loading process, you should only"
+ echo "use Control-C at the prompt."
+ echo ""
+ while echo -n \
+ "Insert floppy (hit Control-C to terminate, enter to load): "
+ do
+ read foo
+ mount -r -t msdos /dev/fd${which}a /mnt2
+ cp -rp /mnt2/* .
+ umount /mnt2
+ done
+}
+
+Load_tape()
+{
+ Tmp_dir
+ echo -n "Which tape drive will you be using? [rst0] "
+ read which
+ if [ "X$which" = "X" ]; then
+ which=rst0
+ fi
+ echo -n "Insert the tape into the tape drive and hit return to "
+ echo -n "continue..."
+ read foo
+ echo "Extracting files from the tape..."
+ $TAR -xvpf /dev/$which
+ echo "Done."
+}
+
+Extract()
+{
+ Tmp_dir
+ echo -n "Would you like to list the files as they're extracted? [n] "
+ read verbose
+ case $verbose in
+ y*|Y*)
+ tarverbose=v
+ ;;
+ *)
+ tarverbose=
+ ;;
+ esac
+ cat "$1"* | $GUNZIP | (cd $dest_dir ; $TAR -xp"$tarverbose"f - )
+}
diff --git a/distrib/arc/common/instbin-krb.conf b/distrib/arc/common/instbin-krb.conf
new file mode 100644
index 00000000000..b718e2a1b7a
--- /dev/null
+++ b/distrib/arc/common/instbin-krb.conf
@@ -0,0 +1,26 @@
+# $OpenBSD: instbin-krb.conf,v 1.1 1997/05/14 21:13:31 pefo Exp $
+#
+# instbin.conf - unified binary for the inst/upgr floppies
+#
+
+srcdirs bin sbin usr.bin/less usr.bin usr.sbin gnu/usr.bin usr.sbin/pppd
+
+progs awk bad144 cat chmod chown cp dd df disklabel ed expr fsck_ffs
+progs ftp fdisk
+progs ifconfig init less ln ls mkdir mknod mount mount_cd9660
+progs mount_ffs mount_msdos mount_nfs mount_kernfs
+progs mv newfs pax pdksh ping pppd pwd reboot rm route
+progs scsi sed shutdown slattach stty sync test tip umount
+progs rsh restore gzip
+
+ln chown chgrp
+ln fsck_ffs fsck
+ln less more
+ln pax tar
+ln pax cpio
+ln pdksh sh
+ln pdksh -sh # init invokes the shell this way
+ln test [
+ln reboot halt
+
+libs -ledit -lutil -ltermcap -lkrb -ldes -ll -lm
diff --git a/distrib/arc/common/instbin.conf b/distrib/arc/common/instbin.conf
new file mode 100644
index 00000000000..e6ecf418118
--- /dev/null
+++ b/distrib/arc/common/instbin.conf
@@ -0,0 +1,26 @@
+# $OpenBSD: instbin.conf,v 1.1 1997/05/14 21:13:31 pefo Exp $
+#
+# instbin.conf - unified binary for the inst/upgr floppies
+#
+
+srcdirs bin sbin usr.bin/less usr.bin usr.sbin gnu/usr.bin usr.sbin/pppd
+
+progs awk bad144 cat chat chmod chown cp dd df disklabel ed
+progs expr fsck_ffs ftp fdisk
+progs ifconfig init less ln ls mkdir mknod mount mount_cd9660
+progs mount_ffs mount_msdos mount_nfs mount_kernfs
+progs mv newfs pax pdksh ping pppd pwd reboot rm route
+progs scsi sed shutdown slattach stty sync test tip umount
+progs rsh restore gzip
+
+ln chown chgrp
+ln fsck_ffs fsck
+ln less more
+ln pax tar
+ln pax cpio
+ln pdksh sh
+ln pdksh -sh # init invokes the shell this way
+ln test [
+ln reboot halt
+
+libs -ledit -lutil -ltermcap -ll -lm
diff --git a/distrib/arc/common/list b/distrib/arc/common/list
new file mode 100644
index 00000000000..2b32f36a688
--- /dev/null
+++ b/distrib/arc/common/list
@@ -0,0 +1,93 @@
+# $OpenBSD: list,v 1.1 1997/05/14 21:13:32 pefo Exp $
+
+# copy the crunched binary, link to it, and kill it
+COPY ${OBJDIR}/instbin instbin
+LINK instbin bin/cat
+LINK instbin bin/chmod
+LINK instbin bin/cp
+LINK instbin bin/cpio
+LINK instbin bin/dd
+LINK instbin bin/df
+LINK instbin bin/ed
+LINK instbin bin/expr
+LINK instbin bin/hostname
+LINK instbin bin/ln
+LINK instbin bin/ls
+LINK instbin bin/mkdir
+LINK instbin bin/mv
+LINK instbin bin/pwd
+LINK instbin bin/rm
+LINK instbin bin/sh
+LINK instbin bin/sleep
+LINK instbin bin/stty
+LINK instbin bin/sync
+LINK instbin bin/tar
+LINK instbin bin/test
+LINK instbin bin/[
+LINK instbin sbin/disklabel
+LINK instbin sbin/fdisk
+LINK instbin sbin/fsck
+LINK instbin sbin/fsck_ffs
+LINK instbin sbin/halt
+LINK instbin sbin/ifconfig
+LINK instbin sbin/init
+LINK instbin sbin/mknod
+LINK instbin sbin/mount
+LINK instbin sbin/mount_cd9660
+LINK instbin sbin/mount_ffs
+LINK instbin sbin/mount_msdos
+LINK instbin sbin/mount_nfs
+LINK instbin sbin/mount_kernfs
+LINK instbin sbin/mount_ext2fs
+LINK instbin sbin/newfs
+LINK instbin sbin/ping
+LINK instbin sbin/restore
+LINK instbin sbin/reboot
+LINK instbin sbin/route
+LINK instbin sbin/shutdown
+LINK instbin sbin/slattach
+LINK instbin sbin/umount
+SYMLINK /bin/cat usr/bin/awk
+SYMLINK /bin/cat usr/bin/cut
+SYMLINK /bin/cat usr/bin/chgrp
+SYMLINK /bin/cat usr/bin/egrep
+SYMLINK /bin/cat usr/bin/fgrep
+SYMLINK /bin/cat usr/bin/ftp
+SYMLINK /bin/cat usr/bin/grep
+SYMLINK /bin/cat usr/bin/gzip
+SYMLINK /bin/cat usr/bin/gunzip
+SYMLINK /bin/cat usr/bin/less
+SYMLINK /bin/cat usr/bin/more
+SYMLINK /bin/cat usr/bin/rsh
+SYMLINK /bin/cat usr/bin/sed
+SYMLINK /bin/cat usr/bin/sort
+SYMLINK /bin/cat usr/bin/tip
+SYMLINK /bin/cat usr/bin/vi
+SYMLINK /bin/cat usr/sbin/bad144
+SYMLINK /bin/cat usr/sbin/chat
+SYMLINK /bin/cat usr/sbin/chown
+SYMLINK /bin/cat usr/sbin/pppd
+SPECIAL /bin/rm instbin
+
+# copy the MAKEDEV script and make some devices
+COPY ${DESTDIR}/dev/MAKEDEV dev/MAKEDEV
+SPECIAL cd dev; sh MAKEDEV ramdisk
+SPECIAL /bin/rm dev/MAKEDEV
+
+# we need the contents of /usr/mdec
+COPY ${DESTDIR}/usr/mdec/bootsd usr/mdec/bootsd
+SPECIAL cd usr/mdec; ln bootsd bootwd
+COPY ${DESTDIR}/usr/mdec/bootsd usr/mdec/sdboot
+SPECIAL cd usr/mdec; ln sdboot wdboot
+
+# various files that we need in /etc for the install
+COPY ${DESTDIR}/etc/group etc/group
+COPY ${DESTDIR}/etc/protocols etc/protocols
+COPY ${DESTDIR}/etc/services etc/services
+COPY ${DESTDIR}/etc/spwd.db etc/spwd.db
+
+COPYDIR ${DESTDIR}/etc/ppp etc/ppp
+
+# and the common installation tools
+COPY ${TOPDIR}/common/termcap.pc3 usr/share/misc/termcap
+COPY ${DESTDIR}/usr/share/misc/scsi_modes usr/share/misc/scsi_modes
diff --git a/distrib/arc/common/mtree.conf b/distrib/arc/common/mtree.conf
new file mode 100644
index 00000000000..bb39f6183b4
--- /dev/null
+++ b/distrib/arc/common/mtree.conf
@@ -0,0 +1,83 @@
+# $OpenBSD: mtree.conf,v 1.1 1997/05/14 21:13:32 pefo Exp $
+
+/set type=dir uname=root gname=wheel mode=0755
+# .
+.
+
+# ./bin
+bin
+# ./bin
+..
+
+# ./dev
+dev
+# ./dev
+..
+
+# ./etc
+etc
+
+# ./etc/ppp
+ppp
+# ./etc/ppp
+..
+
+# ./etc
+..
+
+# ./mnt
+mnt
+# ./mnt
+..
+
+# ./mnt2
+mnt2
+# ./mnt2
+..
+
+# ./kern
+kern
+# ./kern
+..
+
+# ./sbin
+sbin
+# ./sbin
+..
+
+# ./tmp
+tmp mode=01777
+# ./tmp
+..
+
+# ./usr
+usr
+
+# ./usr/bin
+bin
+# ./usr/bin
+..
+
+# ./usr/mdec
+mdec
+# ./usr/mdec
+..
+
+# ./usr/sbin
+sbin
+# ./usr/sbin
+..
+
+# ./usr/share
+share
+
+# ./usr/share/misc
+misc
+# ./usr/share/misc
+..
+
+# ./usr/share
+..
+
+# ./usr
+..
diff --git a/distrib/arc/common/rdsetroot.c b/distrib/arc/common/rdsetroot.c
new file mode 100644
index 00000000000..35ba7aa3401
--- /dev/null
+++ b/distrib/arc/common/rdsetroot.c
@@ -0,0 +1,216 @@
+/* $OpenBSD: rdsetroot.c,v 1.1 1997/05/14 21:13:32 pefo Exp $ */
+/* $NetBSD: rdsetroot.c,v 1.2 1995/10/13 16:38:39 gwr Exp $ */
+
+/*
+ * Copyright (c) 1994 Gordon W. Ross
+ * All rights reserved.
+ *
+ * ELF modifications Copyright (c) Per Fogelstrom.
+ *
+ * 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. 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.
+ */
+
+/*
+ * Copy a ramdisk image into the space reserved for it.
+ * Kernel variables: rd_root_size, rd_root_image
+ */
+
+#include <sys/types.h>
+#include <sys/file.h>
+#include <sys/mman.h>
+
+#include <stdio.h>
+#include <nlist.h>
+#include <sys/exec_elf.h>
+
+extern off_t lseek();
+
+char *file;
+
+/* Virtual addresses of the symbols we frob. */
+long rd_root_image_va, rd_root_size_va;
+
+/* Offsets relative to start of data segment. */
+long rd_root_image_off, rd_root_size_off;
+
+/* value in the location at rd_root_size_off */
+int rd_root_size_val;
+
+/* pointers to pieces of mapped file */
+char *dataseg;
+
+/* parameters to mmap digged out from program header */
+int mmap_offs;
+int mmap_size;
+
+main(argc,argv)
+ char **argv;
+{
+ int fd, n;
+ int found;
+ int *ip;
+ char *cp;
+ Elf32_Ehdr eh;
+ Elf32_Phdr *ph;
+ int phsize;
+
+ if (argc < 2) {
+ printf("%s: missing file name\n", argv[0]);
+ exit(1);
+ }
+ file = argv[1];
+
+ fd = open(file, O_RDWR);
+ if (fd < 0) {
+ perror(file);
+ exit(1);
+ }
+
+ n = read(fd, &eh, sizeof(eh));
+ if (n < sizeof(eh)) {
+ printf("%s: reading header\n", file);
+ exit(1);
+ }
+
+ if (!IS_ELF(eh)) {
+ printf("%s: not elf\n", file);
+ exit(1);
+ }
+
+ phsize = eh.e_phnum * sizeof(Elf32_Phdr);
+ ph = (Elf32_Phdr *)malloc(phsize);
+ lseek(fd, eh.e_phoff, 0);
+ if(read(fd, (char *)ph, phsize) != phsize) {
+ printf("%s: can't read phdr area\n", file);
+ exit(1);
+ }
+ found = 0;
+ for(n = 0; n < eh.e_phnum && !found; n++) {
+ if(ph[n].p_type == PT_LOAD) {
+ found = find_rd_root_image(file, &eh, &ph[n]);
+ }
+ }
+ if(!found) {
+ printf("%s: can't locate space for rd_root_image!", file);
+ exit(1);
+ }
+
+ /*
+ * Map in the whole data segment.
+ * The file offset needs to be page aligned.
+ */
+ dataseg = mmap(NULL, /* any address is ok */
+ mmap_size, /* length */
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED,
+ fd, mmap_offs);
+ if ((long)dataseg == -1) {
+ printf("%s: can not map data seg\n", file);
+ perror(file);
+ exit(1);
+ }
+
+ /*
+ * Find value in the location: rd_root_size
+ */
+ ip = (int*) (dataseg + rd_root_size_off);
+ rd_root_size_val = *ip;
+#ifdef DEBUG
+ printf("rd_root_size val: 0x%08X (%d blocks)\n",
+ rd_root_size_val, (rd_root_size_val >> 9));
+#endif
+
+ /*
+ * Copy the symbol table and string table.
+ */
+#ifdef DEBUG
+ printf("copying root image...\n");
+#endif
+ n = read(0, dataseg + rd_root_image_off,
+ rd_root_size_val);
+ if (n < 0) {
+ perror("read");
+ exit(1);
+ }
+
+#if 0
+ msync(dataseg, mmap_size);
+#endif
+
+#ifdef DEBUG
+ printf("...copied %d bytes\n", n);
+#endif
+ close(fd);
+ exit(0);
+}
+
+
+/*
+ * Find locations of the symbols to patch.
+ */
+struct nlist wantsyms[] = {
+ { "_rd_root_size", 0 },
+ { "_rd_root_image", 0 },
+ { NULL, 0 },
+};
+
+int
+find_rd_root_image(file, eh, ph)
+ char *file;
+ Elf32_Ehdr *eh;
+ Elf32_Phdr *ph;
+{
+ int data_va;
+ int std_entry;
+ int kernel_start;
+ int kernel_size;
+
+ if (nlist(file, wantsyms)) {
+ printf("%s: no rd_root_image symbols?\n", file);
+ exit(1);
+ }
+ kernel_start = ph->p_paddr;
+ kernel_size = ph->p_filesz;
+
+ rd_root_size_off = wantsyms[0].n_value - kernel_start;
+ rd_root_image_off = wantsyms[1].n_value - kernel_start;
+
+#ifdef DEBUG
+ printf("rd_root_size_off = 0x%x\n", rd_root_size_off);
+ printf("rd_root_image_off = 0x%x\n", rd_root_image_off);
+#endif
+
+ /*
+ * Sanity check locations of db_* symbols
+ */
+ if (rd_root_image_off < 0 || rd_root_image_off >= kernel_size) {
+ return(0);
+ }
+ if (rd_root_size_off < 0 || rd_root_size_off >= kernel_size) {
+ printf("%s: rd_root_size not in data segment?\n", file);
+ return(0);
+ }
+ mmap_offs = ph->p_offset;
+ mmap_size = kernel_size;
+ return(1);
+}
diff --git a/distrib/arc/common/termcap.pc3 b/distrib/arc/common/termcap.pc3
new file mode 100644
index 00000000000..ef4e646fe54
--- /dev/null
+++ b/distrib/arc/common/termcap.pc3
@@ -0,0 +1,44 @@
+# $OpenBSD: termcap.pc3,v 1.1 1997/05/14 21:13:33 pefo Exp $
+#
+# Copyright (c) 1980, 1985, 1989 The Regents of the University of California.
+# 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
+# California, Berkeley 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 REGENTS 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 REGENTS 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.
+#
+# @(#)termcap.src 5.109 (Berkeley) 3/8/93
+#
+pc3|ibmpc3|IBM PC 386BSD Console:\
+ :DO=\E[%dB:K1=\E[H:K2=\E[E:K3=\E[I:K4=\E[F:K5=\E[G:LE=\E[%dD:\
+ :RI=\E[%dC:UP=\E[%dA:am:bl=^G:bs:cb=\E[1K:cd=\E[J:ce=\E[K:cl=\E[H\E[J:\
+ :cm=\E[%i%d;%dH:co#80:cr=^M:do=^J:ho=\E[H:is=\E[m:k0=\E[V:k1=\E[M:\
+ :k2=\E[N:k3=\E[O:k4=\E[P:k5=\E[Q:k6=\E[R:k7=\E[S:k8=\E[T:k9=\E[U:\
+ :kD=\177:kH=\E[F:kN=\E[G:kP=\E[I:kb=\177:kd=\E[B:kh=\E[H:kl=\E[D:\
+ :kr=\E[C:ku=\E[A:le=^H:li#25:ms:nd=\E[C:rs=\E[m\E[x\E[14r:se=\E[m:\
+ :sf=\E[S:so=\E[7m:sr=\E[T:ta=^I:te=\E[m:ti=\E[m:up=\E[A:km:pt:\
+ :AL=\E[%dL:DL=\E[%dM:SF=\E[%dS:SR=\E[%dT:al=\E[L:dl=\E[M: