From: Alexander Smirnov <asmirnov@ilbers.de>
To: isar-users@googlegroups.com
Subject: Re: [PATCH] build.sh: Fix perl complaints about locale
Date: Thu, 16 Nov 2017 16:17:32 +0300 [thread overview]
Message-ID: <5e5c4544-67ae-7870-10ca-bd91457efd96@ilbers.de> (raw)
In-Reply-To: <20171114084152.dc56j6m5witxtn7c@MD1KR9XC.ww002.siemens.net>
Hi,
On 11/14/2017 11:41 AM, Christian Storm wrote:
>>>>> [...]
>>>>>
>>>>> Not sure what "ignorenativearch" does, but "sed /etc/locale.gen &&
>>>>> locale-gen" is clearer and probably free of side-effects. Are we
>>>>> sure about all implications of ignorenativearch?
>>>>
>>>> To be honest, I don't exactly know what multistrap does in native
>>>> mode (to be investigated), but with "ignorenativearch=true" we can
>>>> guarantee that Isar has the same build flow for *all* the
>>>> architectures. Otherwise we will have 2 possible flows: for native
>>>> arch and for foreign archs, what could be the source of potential
>>>> bugs like we have now with locales.
>>>
>>> True, but without that knowledge and looking at the one issue, i would
>>> prefer that patch that i understand ;).
>>>
>>
>> Yeah, but on the other hand:
>> - There is dedicated code which should setup locales, seems it's
>> broken in master for native builds now.
>> - Instead of fixing it, yet another locale setup is proposed.
>
> Well, strictly speaking, it's not yet another locale setup. If you do
> the `sed` and `dpkg-reconfigure locale` it's merely an explicit setup,
> more of the same so to say. The `dpkg --configure -a` at the bottom of
> configscript.sh may not *re-*configure a (wrongly) configured locale
> package.
Sorry, don't understand why locales could be miss-configured and
reconfigure is needed:
1. Here we define the default locale:
https://github.com/ilbers/isar/blob/next/meta/recipes-devtools/buildchroot/files/configscript.sh#L8
2. Here is the first dpkg --configure is called:
https://github.com/ilbers/isar/blob/next/meta/recipes-devtools/buildchroot/files/configscript.sh#L46
In your case for native arch, there is a bug in Isar, that postinst
scripts are run by multistrap before 'configscript.sh'.
>
>> - This new locale setup affects already working builds.
>
> Yes, to the extent that after locale setup, a *re-*configure is
> explicitly triggered. Shouldn't be a problem but instead intended
> behavior as you may have changed the locale in configscript.sh above
> this line nonetheless.
>
>> - Old locale stays in the tree.
>
> With my commit
> ec997ad "isar-image-base: purge locales and installed packages' .deb",
> unused locale are purged. Or didn't I get the point here?
>
>> So, for me it would be better to spend a few hours to understand
>> 'ignorenativearch' option before taking any decision. I'd happy to this :-)
>
> Independently of the issue at hand, this is a very welcome proposal of
> yours! I'd like to hear the results...
>
> That said, from a quick multistrap manpage glimpse, I read
> "A native multistrap can be used directly with chroot, so "multistrap"
> runs "dpkg --configure -a" at the end of the multistrap process, unless
> the ignorenativearch option is set to true in the General section of the
> configuration file."
>
> So, on native multistrap, `dpkg --configure -a` is run if ignorenativearch=false.
> Otherwise, if ignorenativearch=true, it's not run.
> However, `dpkg --configure -a` is run unconditionally in configscript.sh...
>
After thinking about this problem I have the following summary:
1. 'ignorenativearch=true' should be used. It prevents multistrap from
early postinst scripts execution. That is needed to guarantee that all
the architectures are handled in the same way.
EFFECT: with this change we have correctly generated locales for en.UTF-8.
2. The initial patch from Christian is needed. AFAIK, chroot by default
inherits environment from host system (including LC_* variables). So if
user has different locale set on the host (for example de.*), then
annoying locale flood in buildchroot will appear again, because in
buildchroot only en.UTF-8 is generated.
EFFECT: this patch will guarantee, that en.UTF-8 will be used in
buildchroot despite on host settings.
3. We should consider the possibility to change locale in buildchroot
for users who don't speak English good enough to understand
compiler/other tools output. So I propose to define some variable in,
for example, local.conf, which will define the default locale for
buildchroot and target image:
DEFAULT_LOCALE ?= "en.UTF-8"
and then 'sed' configscripts.sh script accordingly.
Alex
next prev parent reply other threads:[~2017-11-16 13:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-13 12:21 Christian Storm
2017-11-13 12:49 ` Alexander Smirnov
2017-11-13 13:19 ` Christian Storm
2017-11-13 13:44 ` Alexander Smirnov
2017-11-13 14:07 ` Alexander Smirnov
2017-11-13 14:16 ` Christian Storm
2017-11-13 14:35 ` Alexander Smirnov
2017-11-13 15:24 ` Christian Storm
2017-11-13 16:10 ` Henning Schild
2017-11-13 16:50 ` Alexander Smirnov
2017-11-13 17:06 ` Henning Schild
2017-11-13 17:19 ` Alexander Smirnov
2017-11-14 8:41 ` Christian Storm
2017-11-16 13:17 ` Alexander Smirnov [this message]
2017-11-17 10:12 ` Christian Storm
2017-11-17 10:42 ` Alexander Smirnov
2017-11-21 8:42 ` Henning Schild
2017-11-21 8:56 ` Alexander Smirnov
2017-11-21 18:04 ` Henning Schild
2017-11-21 18:12 ` Alexander Smirnov
2017-11-21 18:32 ` Henning Schild
2017-11-21 18:40 ` Alexander Smirnov
2017-11-26 22:09 ` Alexander Smirnov
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=5e5c4544-67ae-7870-10ca-bd91457efd96@ilbers.de \
--to=asmirnov@ilbers.de \
--cc=isar-users@googlegroups.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox