/usr/share/initramfs-tools/hooks/root_locale is in lupin-support 0.57build1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #! /bin/sh
set -e
# Adds support for the system default locale to the initramfs
# and stores the locale name in the initramfs /conf/conf.d/root_locale
# so that the premount script can pick it up through $ROOT_LOCALE
PREREQ=""
prereqs () {
echo "$PREREQ"
}
case $1 in
prereqs)
prereqs
exit 0
;;
esac
. /usr/share/initramfs-tools/hook-functions
CONF="$DESTDIR/conf/conf.d/root_locale"
# Accept overrides but will rewrite the initramfs conf file anyway
[ -r $CONF ] && . $CONF
rm -f $CONF
# Base the locale on the system default LANG and mangle it as
# needed to match the /usr/lib/locale naming.
[ -r /etc/default/locale ] && . /etc/default/locale
[ -z "$ROOT_LOCALE" ] && ROOT_LOCALE=`echo $LANG | sed -e 's/UTF/utf/' -e 's/utf-8/utf8/'`
if [ -n "$ROOT_LOCALE" ] && [ -d /usr/lib/locale/$ROOT_LOCALE ]; then
[ "${verbose}" = "y" ] && echo "Adding locale: $ROOT_LOCALE"
mkdir -p "$DESTDIR/usr/lib/locale"
cp -r /usr/lib/locale/$ROOT_LOCALE "$DESTDIR/usr/lib/locale"
echo "ROOT_LOCALE=$ROOT_LOCALE" > $CONF
echo "export ROOT_LOCALE" >> $CONF
echo "export FSTYPE" >> $CONF
else
echo "Warning: No support for locale: $ROOT_LOCALE" >&2
fi
exit 0
|