bin/80256: /rescue/vi doesn't work without terminal database in /usr

Brian Candler B.Candler at
Fri Apr 22 09:50:10 PDT 2005

>Number:         80256
>Category:       bin
>Synopsis:       /rescue/vi doesn't work without terminal database in /usr
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 22 16:50:08 GMT 2005
>Originator:     Brian Candler
>Release:        FreeBSD 5.4-STABLE i386

5.4-STABLE as of about 2005-04-18


The usefulness of /rescue/vi is severely curtailed by the fact that it needs
to have /usr mounted before it functions. In that case, you might as well
just use /usr/bin/vi.


Boot into single-user mode; just the root partition is mounted initially.

# /rescue/vi
vi: No terminal database found
# echo $TERM
# mount /usr
# /rescue/vi
ex/vi: Error: Unable to create temporary file: Read-only file system
# mount /
# /rescue/vi
Error: /var/tmp/vi.recover: No such file or directory
[but it does continue into vi]
# mount /var
# /rescue/vi


Since the vast majority of single-user activity is at the console, I'd
suggest that vi have a hardcoded fallback termcap/terminfo entry in the
event that /usr is not mounted.

It might be possible to do this through an environment variable (TERMCAP?) -
however there is already a cons25 entry in /etc/termcap, and that isn't
being used, which makes me think that vi probably only uses terminfo.

Perhaps should set TERMINFO_DIRS and include a few choice terminals in the
root filesystem. e.g. vt100 could be included for the benefit of serial
console users.

More information about the freebsd-bugs mailing list