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

Re: not i18ned part in b-f 2.2.15



Hi. Thank you Adam and Erik :)

On Wed, 5 Jul 2000 19:35:14 -0600, Erik Andersen wrote:

> On Wed Jul 05, 2000 at 06:51:40PM -0400, Adam Di Carlo wrote:
> > 
> > > If our bf-utf8 will be completed, we may need to change this
> > > in order to invoke the bterm and run the dpkg-reconfigure on that.
> > 
> > Now with this issue added on top, I almost wonder if we shouldn't have
> > init invoke a wrapper which sets the lang stuff, takes care of the
> > bterm or whatever other console stuff, and then runs dpkg-reconfigure
> > ?
> 
> I think this is the right approach.  Then it is a matter
> of changing just one script...


Akira sent me his initial draft for the wrapper script. Here it is:

 %%%%%%  %%%%%%  %%%%%%  %%%%%%  %%%%%%  %%%%%%  %%%%%%  %%%%%% 
#!/bin/sh
#trap fail SIGTERM SIGINT

# Are these required?
# bash reads /etc/environment in booting.
#. /etc/environment

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

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

case `/usr/bin/tty` in
/dev/tty|/dev/console|/dev/tty[1-9]*)
	TERMINAL=console
	;;
/dev/tty[p-za-e]*)
	TERMINAL=pseudo
	if [ "$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 pc9800 /proc/version && SUBARCH=pc9800 ;;
esac

# initialize 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

# testing $WRAPPER
if test ! -z "$WRAPPER" && $WRAPPER /bin/true; then
	echo	exec $WRAPPER $@
else
	echo	exec $@
fi

 %%%%%%  %%%%%%  %%%%%%  %%%%%%  %%%%%%  %%%%%%  %%%%%%  %%%%%% 

Maybe Chinese and Korean people can use the scheme by adding 
their setup in "case $LANG in".

If this can be used, then I propose to put this into CVS
as scripts/rootdisk/prototype/sbin/termwrap, and to add lines at 
the end of extract_base() in utilities/dbootstrap/extract_base.c
in the way:

   if (NAME_ISREG("/target/etc/inittab",&statbuf)) {
     rename("/target/etc/inittab","/target/etc/inittab.real");
   }
   sprintf(prtbuf,"cp %s %s","/etc/inittab.install","/target/etc/inittab"); 
   execlog(prtbuf, LOG_INFO);
+
+  sprintf(prtbuf,"cp %s %s","/sbin/termrap","/target/sbin/termwrap"); 
+  execlog(prtbuf, LOG_INFO);
+  sprintf(prtbuf,"chmod 755 %s","/target/sbin/termwrap"); 
+  execlog(prtbuf, LOG_INFO);

  sync();
  return 0;
}

How do you think this ?

-- 
  Taketoshi Sano: <sano@debian.org>,<sano@debian.or.jp>,<kgh12351@nifty.ne.jp>



Reply to: