All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Guido Trentalancia
	<guido-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>,
	initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2] dracut: 10i18n: add support for custom locale definitions
Date: Sat, 16 Apr 2016 20:52:09 +0300	[thread overview]
Message-ID: <57127BC9.70103@gmail.com> (raw)
In-Reply-To: <1460815966.4296.13.camel-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>

16.04.2016 17:12, Guido Trentalancia пишет:
> Hello Andrei.
> 
> Thanks very for much for reviewing the patch...
> 
> On Sat, 16/04/2016 at 09.00 +0300, Andrei Borzenkov wrote:
>> 16.04.2016 01:07, Guido Trentalancia пишет:
>>> 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.
>>>
>>
>> On many distributions sources for locale definitions are in separate
>> packages that are not installed by default. You need at least error
>> checks and some alternative way to gather the same information.
> 
> Good point, I have now included a check to make sure that the localedef
> executable is available on the system (please see the new patch version
> reported below)...
> 

It is not about localedef itself (which is likely to be present) but
about sources for locale definitions that you assume to be always available.

> I don't know exactly what you mean by "some alternative way to gather
> the same information", however if you mean copying the locale archive
> from the one installed on the system, I am against that, as it is
> usually very large, while the one we generate here is rather small and
> should be usually compatible with the initram filesystem size
> constraint.
> 

Locale archive is not used universally. Other systems use split
definitions in /usr/lib/locale/$LOCALE. Just copy them directly if present.

> /usr/lib/locale-archive (system-wide): 101,997,312 bytes
> average locale-archive generated ad-hoc by localedef for initramfs:
> 1,629,568
> 
> ... there is a size factor of about 63 !
> ---
> 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-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>
> ---
>  modules.d/10i18n/module-setup.sh |   10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> --- dracut-git/modules.d/10i18n/module-setup.sh	2016-04-12 15:59:43.174765608 +0200
> +++ dracut-044-10i18n-add-support-for-custom-locale-definitions/modules.d/10i18n/module-setup.sh	2016-04-16 15:59:51.254099707 +0200
> @@ -212,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 ]] && command -v localedef > /dev/null && 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 ]] && command -v localedef > /dev/null && localedef --prefix="${initdir}" -i $LANG_LOCALE -f $LANG_CHARMAP $LANG
> +
>          if dracut_module_included "systemd" && [[ -f ${VCONFIG_CONF} ]]; then
>              inst_simple ${VCONFIG_CONF}
>          else
> 
> 

  parent reply	other threads:[~2016-04-16 17:52 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15 22:07 [PATCH] dracut: add support for custom locale definitions Guido Trentalancia
     [not found] ` <1460758050.3211.2.camel-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>
2016-04-16  6:00   ` Andrei Borzenkov
     [not found]     ` <5711D4E7.9070705-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-16 14:12       ` [PATCH v2] dracut: 10i18n: " Guido Trentalancia
     [not found]         ` <1460815966.4296.13.camel-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>
2016-04-16 17:52           ` Andrei Borzenkov [this message]
     [not found]             ` <57127BC9.70103-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-16 19:32               ` [PATCH v3] " Guido Trentalancia
     [not found]                 ` <1460835143.3201.10.camel-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>
2016-04-16 20:13                   ` [PATCH v4] " Guido Trentalancia
     [not found]                     ` <1460837622.3201.14.camel-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>
2016-04-16 20:24                       ` [PATCH v5] " Guido Trentalancia
     [not found]                         ` <1460838269.3201.18.camel-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>
2016-04-19  0:36                           ` [PATCH v6] dracut: " Guido Trentalancia
     [not found]                             ` <1461026208.2262.1.camel-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>
2016-04-20 13:04                               ` [PATCH v7] " Guido Trentalancia
     [not found]                                 ` <1461157491.11229.3.camel-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>
2016-04-21 10:24                                   ` Harald Hoyer
     [not found]                                     ` <5718AA77.8090600-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-04-21 12:30                                       ` Guido Trentalancia
     [not found]                                         ` <1461241841.10934.12.camel-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>
2016-04-21 12:41                                           ` Andrei Borzenkov
     [not found]                                             ` <CAA91j0U0XaJBaWNzBmRE3hs0zV7UKMEvO-6nBx_jaxkwhEHckg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-21 12:57                                               ` Guido Trentalancia
2016-04-21 13:07                                           ` Harald Hoyer
     [not found]                                             ` <5718D074.70507-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-21 13:48                                               ` Guido Trentalancia
2016-04-21 15:03                                               ` Guido Trentalancia
2016-05-17 10:12                                           ` Thomas Renninger
2016-05-17 12:36                                             ` [PATCH v9] " Guido Trentalancia
2016-04-22 16:13                                       ` [PATCH v8] " Guido Trentalancia
     [not found]                                         ` <1461341618.21231.0.camel-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>
2016-04-23  7:50                                           ` Andrei Borzenkov
     [not found]                                             ` <571B2950.5060209-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-23 16:47                                               ` Guido Trentalancia
2016-04-23 16:50                                           ` [PATCH v9] " Guido Trentalancia
     [not found]                                             ` <1461430242.2604.15.camel-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org>
2016-05-06 15:01                                               ` Guido Trentalancia
2017-10-11 13:17                                               ` Harald Hoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57127BC9.70103@gmail.com \
    --to=arvidjaar-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=guido-D1bseh+SzQhuxeB9wqlrNw@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.