mirror of
git://github.com/lxc/lxc
synced 2025-09-01 00:10:04 +00:00
debian template: reconfigure locales
Signed-off-by: feng xiahou <xiahoufeng@yahoo.com>
This commit is contained in:
@@ -99,22 +99,6 @@ $hostname
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# reconfigure some services
|
# reconfigure some services
|
||||||
if [ -z "$LANG" ]; then
|
|
||||||
cat >> $rootfs/etc/locale.gen << EOF
|
|
||||||
en_US.UTF-8 UTF-8
|
|
||||||
EOF
|
|
||||||
chroot $rootfs locale-gen en_US.UTF-8 UTF-8
|
|
||||||
chroot $rootfs update-locale LANG=en_US.UTF-8
|
|
||||||
else
|
|
||||||
encoding=$(echo $LANG | cut -d. -f2)
|
|
||||||
chroot $rootfs sed -e "s/^# \(${LANG} ${encoding}\)/\1/" \
|
|
||||||
-i /etc/locale.gen 2> /dev/null
|
|
||||||
cat >> $rootfs/etc/locale.gen << EOF
|
|
||||||
$LANG $encoding
|
|
||||||
EOF
|
|
||||||
chroot $rootfs locale-gen $LANG $encoding
|
|
||||||
chroot $rootfs update-locale LANG=$LANG
|
|
||||||
fi
|
|
||||||
|
|
||||||
# remove pointless services in a container
|
# remove pointless services in a container
|
||||||
chroot $rootfs /usr/sbin/update-rc.d -f checkroot.sh disable
|
chroot $rootfs /usr/sbin/update-rc.d -f checkroot.sh disable
|
||||||
@@ -411,6 +395,25 @@ EOF
|
|||||||
|
|
||||||
# Re-enable service startup
|
# Re-enable service startup
|
||||||
rm ${rootfs}/usr/sbin/policy-rc.d
|
rm ${rootfs}/usr/sbin/policy-rc.d
|
||||||
|
|
||||||
|
# reconfigure locales
|
||||||
|
if [ -z "$LANG" ]; then
|
||||||
|
cat >> $rootfs/etc/locale.gen << EOF
|
||||||
|
en_US.UTF-8 UTF-8
|
||||||
|
EOF
|
||||||
|
chroot $rootfs locale-gen en_US.UTF-8 UTF-8
|
||||||
|
chroot $rootfs update-locale LANG=en_US.UTF-8
|
||||||
|
else
|
||||||
|
encoding=$(echo $LANG | cut -d. -f2)
|
||||||
|
chroot $rootfs sed -e "s/^# \(${LANG} ${encoding}\)/\1/" \
|
||||||
|
-i /etc/locale.gen 2> /dev/null
|
||||||
|
cat >> $rootfs/etc/locale.gen << EOF
|
||||||
|
$LANG $encoding
|
||||||
|
EOF
|
||||||
|
chroot $rootfs locale-gen $LANG $encoding
|
||||||
|
chroot $rootfs update-locale LANG=$LANG
|
||||||
|
fi
|
||||||
|
# end
|
||||||
}
|
}
|
||||||
|
|
||||||
clean()
|
clean()
|
||||||
|
Reference in New Issue
Block a user