[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Need a copy of /sbin/termwrap



In <20010205130528.C4914@murphy.nl>, on 05/Feb/2001 
   at 01:05 PM,(+0100 GMT)
Paul Slootman <paul@murphy.nl> said:

>On Sat 03 Feb 2001, Bob Ogden wrote:

>> So I thought that just droping a copy of termwrap in should resolve it.
>> Anyone willing to send me a copy?

>$ locate termwrap
>$ grep termwrap ../../Contents-alpha.gz 
>$

>I have no idea what you're talking about, unfortunately...


>Paul Slootman

Henry House very kindly forwarded me a copy of the script. I wouldn't be
surprised if its only used during the install and is deleted after it's
used.

Anyway, for those searching the debian list archives here is a copy of
termwrap that solved my problems during second stage install due to non
findable /sbin/termwrap. Just boot to the point where the error starts to
occur then alt F2 and login as root. Mount a floppy with termwrap on it
and cp to /sbin/ not forgetting to chmod as executable then reboot and
away :).

Here's the script.


#!/bin/sh
######################################################################
##	Ignore some signals.
######################################################################
trap fail SIGTERM SIGINT

######################################################################
##	Set some environment variables.
###################################################################### #
reads /etc/environment.
. /etc/environment

# Set all locale related environment variables.
LC_ALL=$LANG
export LANG LC_ALL

######################################################################
##	Display usage if no argument.
###################################################################### if
[ -z "$1" ]; then
	echo "usage: $0 [-nnt] <command> [...]"
	echo "-nnt: don't run another terminal"
	exit 0
fi

######################################################################
##	Recognize terminal type.
######################################################################
case `/usr/bin/tty` in
/dev/tty|/dev/console|/dev/tty[1-9]*)
	TERMINAL=console
	;;
/dev/tty[p-za-e]*)
	TERMINAL=pseudo
	if [ ! -z "$DISPLAY" ]; then
		TERMINAL=x
	else
		case $TERM in
		rxvt|xterm*|kterm)	TERMINAL=x;;
		esac
	fi
	;;
/dev/tty[A-Z]*|/dev/cu*)
	TERMINAL=serial
	;;
esac

case $TERM in
dumb)	TERMINAL=dumb
esac

export TERMINAL

# Why don't we use dpkg-architecture? 
# Because it isn't in the base archive.

case $HOSTTYPE in 
i386)	/bin/grep -q 9800 /proc/version && SUBARCH=pc9800 ;;
esac

######################################################################
##	Select suitable terminal as wrapper.
######################################################################
WRAPPER=""

case $LANG in
ja*)	
	case $TERMINAL in
	x)
		#WRAPPER="/usr/X11R6/bin/kterm -e"
		WRAPPER="/usr/X11R6/bin/krxvt -e"
		;;
	console)
		if [ "$SUBARCH" != pc9800 -a "$TERMINAL" = console ]; then
			# Any plathome except PC9800 require jfbterm
			# to display japanese fonts on console.
			WRAPPER="/usr/bin/jfbterm -e"
		fi
		;;
	# On pseudo and serial, we couldn't know
	# that terminal can display japanese fonts...
	esac
	;;
esac

if [ "$1" = "-nnt" ]; then
	WRAPPER=""
	shift
fi

######################################################################
##	Execute Wrapper.
###################################################################### if
[ ! -z "$WRAPPER" -a -x "$WRAPPER" ]; then
	$WRAPPER /bin/true && exec $WRAPPER $@
fi

exec $@


-- 
/-- Bob Ogden  bob@contact.omen.com.au --------------/
/  -... --- -...   --- --. -.. . -.       Finger  for PGP key -----/
Only 31553804598 seconds till the _next_ millennium! 

Only 31553751991 seconds till the _next_ millennium! 





Reply to: