vp-build/templates/OpenRC/files/locale.rc
Juan RP 0161d3bfd9 OpenRC: some fixes for locale service and inittab.
- Fix the locale service when $LOCALE is not, default to "en_US".
- Use again ttyX in inittab now the devices are created by udev.

Bump revision.

--HG--
extra : convert_revision : e7503768b9fca65d90925962cfae13a555b94375
2009-10-04 19:30:06 +02:00

29 lines
666 B
Plaintext

#!/sbin/runscript
description="Sets a system locale"
depend()
{
need localmount termencoding
after bootmisc
keyword noopenvz noprefix nouml novserver noxenu
}
start()
{
: >/etc/profile.d/locale.sh
chmod 755 /etc/profile.d/locale.sh
[ -z "$LOCALE" ] && LOCALE="en_US"
# Check if requested locale was already created
if ! $(locale -a|grep -q $LOCALE.utf8); then
[ ! -d /usr/lib/locale ] && mkdir -p /usr/lib/locale
ebegin "Building locale [$LOCALE] [UTF-8]"
localedef -i $LOCALE -f UTF-8 $LOCALE
eend $?
fi
# Set user defined locale
einfo "Setting system locale [$LOCALE] [UTF-8]"
echo "export LANG=$LOCALE.UTF-8" >> /etc/profile.d/locale.sh
}