NetBSD Problem Report #6879

Received: (qmail 16031 invoked from network); 26 Jan 1999 05:43:40 -0000
Message-Id: <199901260543.XAA17892@marvin.ece.utexas.edu>
Date: Mon, 25 Jan 1999 23:43:39 -0600 (CST)
From: bgrayson@ece.utexas.edu
Reply-To: bgrayson@ece.utexas.edu
To: gnats-bugs@gnats.netbsd.org
Subject: /root/.termcap file
X-Send-Pr-Version: 3.95

>Number:         6879
>Category:       misc
>Synopsis:       /root/.termcap file
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 25 21:50:00 +0000 1999
>Closed-Date:    Thu Feb 04 21:07:24 +0000 2010
>Last-Modified:  Thu Feb 04 21:07:24 +0000 2010
>Originator:     Brian Grayson
>Release:        Jan 25, 1999
>Organization:
	Parallel and Distributed Systems
	Electrical and Computer Engineering
	The University of Texas at Austin
>Environment:

>Description:
	On systems where /usr/share is NFS-mounted, running
	single-user means that /usr/share/misc/termcap is not
	available, and thus vi and emacs won't work.  We can put
	a small termcap in root's home directory to hopefully
	allow the use of vi etc.

>How-To-Repeat:
>Fix:
	Here's a bit of the needed work.  Someone familiar with
	the distribution/release build process can probably
	improve on this.  Also, I do not know what the console
	term types are for many of the archs, so the 'for' list
	needs to be expanded.

1.  Create a script /usr/src/etc/root/gentermcap that generates
the mini-termcap to stdout, using "tset".
------------------------------------------------
#!/bin/sh
#  Generate a miniature termcap, for use as root's .termcap
#  file.  This should have all of the basic console entries for the
#  various architectures.
#  We want to force tgetent() to look in a particular file.  According
#  to the man page, this should do it:
export TERM=totally_bogus
export TERMCAP=bogus_termcap_entry
export TERMPATH=../../share/termcap/termcap.src

version=`grep "^#.*Version" $TERMPATH`

echo "#  The purpose of this file is to provide essential termcap"
echo "#  entries, to be used e.g. when running single-user and the"
echo "#  full termcap database in /usr/share/misc/termcap isn't accessible."
echo "#  "
echo "#  This file was generated on "`date`", using termcap version:"
echo $version

for terms in vt100 vt220 pc3 pcvt25 \
	; do
	#  Ignore first line, and first word of second line.
	#  Note that simply printing $2 won't work, as some
	#  termcap aliases have spaces in their names.
	#  Also, strip leading space from result.
	tset - -S $terms \
		| awk '{ if (NR==2) {$1=""; print $0;}}' \
		| sed -e 's/^ //'
done

echo "#  Add any local essential terminal entries here, for when "
echo "#  /usr/share/misc/termcap isn't accessible."
------------------------------------------------

2.  Change the Makefile in /usr/src/etc to invoke the script.
--- Makefile.dist	Mon Jan 25 22:49:19 1999
+++ Makefile	Mon Jan 25 23:28:04 1999
@@ -83,7 +83,9 @@
 		    ${DESTDIR}/root/.profile; \
 		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
 		ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
-		ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
+		ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile; \
+		./gentermcap > ${DESTDIR}/root/.termcap)
+		)
 	(cd mtree; ${MAKE} install)
 	(cd namedb; \
 		${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${NAMEDB} \

3.  Add appropriate essential term names for the various ports.

4.  Add /root/.termcap to file lists for distributions.

5.  I'm sure there's more that I am missing...  :)
>Release-Note:
>Audit-Trail:

From: Todd Vierling <tv@pobox.com>
To: bgrayson@ece.utexas.edu
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: misc/6879: /root/.termcap file
Date: Tue, 26 Jan 1999 11:03:34 -0500 (EST)

 On Mon, 25 Jan 1999 bgrayson@ece.utexas.edu wrote:

 : for terms in vt100 vt220 pc3 pcvt25 \

 To whomever actually decides to do this (this sent to make note in the
 PR database):

 this probably should add "sun", "vt52", "ansi-mini" (which is not vt100),
 "hpgeneric", "adm31" (includes Wyse 1xx), "wy30", and when I finally add it
 to the termcap.src, "ofcons" (for Shark support).

 -- 
 -- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)


From: "Erik E. Fair" <fair@clock.org>
To: gnats-bugs@netbsd.org
Cc:  Subject: Re: misc/6879
Date: Mon, 31 Jan 2000 12:53:11 -0800

 This script should not have a set list of terminal types; it should
 key from the terminal type found on the console in /etc/ttys. The
 console is the only terminal which is most commonly in use in single
 user mode, but the kind of console one might have could be most
 anything in /etc/termcap, which makes it unwise to assume that vt100
 (or anything else) is the common case.

 Ideally, what you want is for the .login or .profile or .cshrc to
 make the /root/.termcap into a termcap cache...

          Erik <fair@clock.org>
From: Roy Marples <roy@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/6879 CVS commit: src/etc
Date: Thu, 4 Feb 2010 21:01:16 +0000

 Module Name:	src
 Committed By:	roy
 Date:		Thu Feb  4 21:01:16 UTC 2010

 Modified Files:
 	src/etc: Makefile
 	src/etc/root: Makefile
 Added Files:
 	src/etc/root: dot.terminfo mkterminfo

 Log Message:
 Install a minimal .terminfo and .terminfo.db in /root.
 This allows terminfo to be used when /usr is not available.
 Fixes PR misc/6879.


 To generate a diff of this commit:
 cvs rdiff -u -r1.378 -r1.379 src/etc/Makefile
 cvs rdiff -u -r1.1 -r1.2 src/etc/root/Makefile
 cvs rdiff -u -r0 -r1.1 src/etc/root/dot.terminfo src/etc/root/mkterminfo

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: roy@NetBSD.org
State-Changed-When: Thu, 04 Feb 2010 21:07:24 +0000
State-Changed-Why:
Reported problem fixed in commit.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.