[PATCH] dracut: add support for custom locale definitions

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

 



Compile and install locale definitions using localedef from GNU libc. The
resulting locale definitions archive contains at most two different locale
definitions, therefore its size is relatively small.

Signed-off-by: Guido Trentalancia <guido@xxxxxxxxxxxxxxxx>
---
 modules.d/10i18n/module-setup.sh |   10 ++++++++++
 1 file changed, 10 insertions(+)

--- dracut-044/modules.d/10i18n/module-setup.sh	2016-04-15 23:34:44.011398268 +0200
+++ dracut-044-10i18n-add-support-for-custom-locale-definitions/modules.d/10i18n/module-setup.sh	2016-04-15 23:32:05.292860621 +0200
@@ -219,6 +219,16 @@ install() {
             print_vars LC_ALL LANG >> ${initdir}${I18N_CONF}
         fi
 
+        [[ $LC_ALL || $LANG ]] && inst_dir /usr/lib/locale
+
+        # Generate locale definitions for LC_ALL
+        [ $LC_ALL ] && LC_ALL_LOCALE=`echo $LC_ALL | awk -F. '{ print $1 }'` && LC_ALL_CHARMAP=`echo $LC_ALL | awk -F. '{ print $2 }'`
+        [[ $LC_ALL && $LC_ALL_LOCALE && $LC_ALL_CHARMAP ]] && localedef --prefix="${initdir}" -i $LC_ALL_LOCALE -f $LC_ALL_CHARMAP $LC_ALL
+
+        # Generate locale definitions for LANG
+        [ $LANG ] && LANG_LOCALE=`echo $LANG | awk -F. '{ print $1 }'` && LANG_CHARMAP=`echo $LANG | awk -F. '{ print $2 }'`
+        [[ $LANG && $LANG_LOCALE && $LANG_CHARMAP ]] && localedef --prefix="${initdir}" -i $LANG_LOCALE -f $LANG_CHARMAP $LANG
+
         if dracut_module_included "systemd" && [[ -f ${VCONFIG_CONF} ]]; then
             inst_simple ${VCONFIG_CONF}
         else
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux