public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Claudius Heine <claudius.heine.ext@siemens.com>
To: Henning Schild <henning.schild@siemens.com>
Cc: isar-users@googlegroups.com, Claudius Heine <ch@denx.de>
Subject: Re: [PATCH v2 2/3] meta/isar-cfg-localepurge: added locale purge recipe
Date: Wed, 23 May 2018 16:39:15 +0200	[thread overview]
Message-ID: <060d5b70-f1fd-0b45-9995-f366c5c8fcfc@siemens.com> (raw)
In-Reply-To: <20180523161608.710986c0@md1pvb1c.ad001.siemens.net>

Hi Henning,

On 2018-05-23 16:16, Henning Schild wrote:
> Am Wed, 23 May 2018 15:12:47 +0200
> schrieb "[ext] claudius.heine.ext@siemens.com"
> <claudius.heine.ext@siemens.com>:
> 
>> From: Claudius Heine <ch@denx.de>
>>
>> The package 'isar-cfg-localepurge' is used to set the locales of the
>> root file system and purge all not required locales.
>>
>> Signed-off-by: Claudius Heine <ch@denx.de>
>> ---
>>   .../isar-cfg-localepurge/files/locale.debconf | 12 ++++++++
>>   .../isar-cfg-localepurge/files/locale.gen     |  1 +
>>   .../isar-cfg-localepurge/files/postinst       | 30
>> +++++++++++++++++++ .../isar-cfg-localepurge.bb                   |
>> 19 ++++++++++++ 4 files changed, 62 insertions(+)
>>   create mode 100644
>> meta/recipes-support/isar-cfg-localepurge/files/locale.debconf create
>> mode 100644
>> meta/recipes-support/isar-cfg-localepurge/files/locale.gen create
>> mode 100644 meta/recipes-support/isar-cfg-localepurge/files/postinst
>> create mode 100644
>> meta/recipes-support/isar-cfg-localepurge/isar-cfg-localepurge.bb
>>
>> diff --git
>> a/meta/recipes-support/isar-cfg-localepurge/files/locale.debconf
>> b/meta/recipes-support/isar-cfg-localepurge/files/locale.debconf new
>> file mode 100644 index 0000000..169c071 --- /dev/null
>> +++ b/meta/recipes-support/isar-cfg-localepurge/files/locale.debconf
>> @@ -0,0 +1,12 @@
>> +locales	locales/locales_to_be_generated
>> multiselect	en_US.UTF-8 UTF-8 +locales
>> locales/default_environment_locale	select	en_US.UTF-8 +
>> +localepurge	localepurge/dontbothernew	boolean
>> true +localepurge	localepurge/nopurge
>> multiselect	en, en_US, en_US.UTF-8 +localepurge
>> localepurge/use-dpkg-feature	boolean	false
>> +localepurge	localepurge/verbose	boolean	false
>> +localepurge	localepurge/showfreedspace	boolean
>> false +localepurge	localepurge/none_selected
>> boolean	false +localepurge	localepurge/mandelete
>> boolean	true +localepurge
>> localepurge/quickndirtycalc	boolean	false
>> +localepurge	localepurge/remove_no	note diff --git
>> a/meta/recipes-support/isar-cfg-localepurge/files/locale.gen
>> b/meta/recipes-support/isar-cfg-localepurge/files/locale.gen new file
>> mode 100644 index 0000000..a66d814 --- /dev/null +++
>> b/meta/recipes-support/isar-cfg-localepurge/files/locale.gen @@ -0,0
>> +1 @@ +en_US.UTF-8 UTF-8
>> diff --git a/meta/recipes-support/isar-cfg-localepurge/files/postinst
>> b/meta/recipes-support/isar-cfg-localepurge/files/postinst new file
>> mode 100644 index 0000000..3ef93cd
>> --- /dev/null
>> +++ b/meta/recipes-support/isar-cfg-localepurge/files/postinst
>> @@ -0,0 +1,30 @@
>> +#!/bin/sh
>> +set -e
>> +
>> +cat /usr/local/etc/isar-cfg-localepurge/locale.gen \
>> +	>> /etc/locale.gen
> 
> All of this is pretty evil. This package is installed last, so if i had
> any package before it dealing with locales ... Would i need to remember
> to clear IMAGE_CFG_PACKAGE?
> I guess some checking should be done before proceeding here.
> 
> And thinking about it, do we not need to set the locales very early? I
> remember all the perl warning in buildchroot.

I would still like to set the base locale in isar-bootstrap like its 
done in Alexs patchset. This avoids perl warnings. But that should just 
be a 'default' locale. The final locale should be done in a package like 
this.

Maybe we can generate some these settings by bitbake variables. 
Otherwise you could just overwrite the postinst script in your own 
bbappend to this recipe.

All your other suggestions are good and I will prepare a v2 with them.

Thanks a lot!
Claudius

> 
>> +debconf-set-selections /usr/local/etc/isar-cfg-localepurge/locale.debconf
>> +
>> +# locale.nopurge needs to be removed before localepurge is
>> reconfigured. +# Otherwise it would set the debconf to the values
>> from the locale.nopurge +# file again.
>> +rm -rf /etc/locale.nopurge
>> +dpkg-reconfigure -f noninteractive locales localepurge
>> +
>> +# When /etc/locale.nopurge was removed before dpkg-reconfigure, it
>> writes +# the new configuration with the '.ucf-dist' postfix
>> +mv /etc/locale.nopurge.ucf-dist /etc/locale.nopurge
>> +
>> +# Now reconfigure it localpurge again, because otherwise it would
>> complain: +#     Some new locales have appeared on your system:
>> +#
>> +#     bal be@latin en@boldquot en@quot sr@latin
>> +#
>> +#     They will not be touched until you reconfigure localepurge
>> +#     with the following command:
>> +#
>> +#         dpkg-reconfigure localepurge
>> +dpkg-reconfigure -f noninteractive localepurge
>> +
>> +localepurge
>> diff --git
>> a/meta/recipes-support/isar-cfg-localepurge/isar-cfg-localepurge.bb
>> b/meta/recipes-support/isar-cfg-localepurge/isar-cfg-localepurge.bb
>> new file mode 100644 index 0000000..b68a6d0 --- /dev/null
>> +++
>> b/meta/recipes-support/isar-cfg-localepurge/isar-cfg-localepurge.bb
>> @@ -0,0 +1,19 @@ +# This software is a part of ISAR.
>> +
>> +DESCRIPTION = "Isar configuration package for locale and localepurge"
>> +MAINTAINER = "isar-users <isar-users@googlegroups.com>"
>> +DEBIAN_DEPENDS = "localepurge"
>> +
>> +SRC_URI = "file://locale.debconf \
>> +	   file://locale.gen \
>> +	   file://postinst"
>> +
>> +inherit dpkg-raw
>> +
>> +do_install() {
>> +	install -v -d ${D}/usr/local/etc/${PN}
>> +	install -v -m 644 ${WORKDIR}/locale.debconf \
>> +                          ${D}/usr/local/etc/${PN}/locale.debconf
> 
> /usr/local/ suggests that we are not under package manager regime here,
> i googled it for a similar need and came to the conclusion
> that /usr/lib/${PN} would be the right place for such files. Or pack
> them into postinst as self extracting tar to gain a "staging area". In
> your case the package gets removed so you do not have to worry about
> potential copies. Still the location should not be /usr/local/... >
> Henning
> 
>> +	install -v -m 644 ${WORKDIR}/locale.gen \
>> +                          ${D}/usr/local/etc/${PN}/locale.gen
>> +}
> 

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: ch@denx.de

  reply	other threads:[~2018-05-23 14:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-23 13:12 [PATCH v2 0/3] One-shot configuration packages claudius.heine.ext
2018-05-23 13:12 ` [PATCH v2 1/3] isar-bootstrap|configscript: implement one shot config option claudius.heine.ext
2018-05-23 14:06   ` Henning Schild
2018-05-24  7:06     ` Claudius Heine
2018-05-24  8:57       ` Henning Schild
2018-05-23 13:12 ` [PATCH v2 2/3] meta/isar-cfg-localepurge: added locale purge recipe claudius.heine.ext
2018-05-23 14:16   ` Henning Schild
2018-05-23 14:39     ` Claudius Heine [this message]
2018-05-23 13:12 ` [PATCH v2 3/3] meta-isar/isar-image-base: switch use isar-cfg-localepurge claudius.heine.ext
2018-05-23 14:03 ` [PATCH v2 0/3] One-shot configuration packages Henning Schild
2018-05-24  8:38   ` Claudius Heine

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=060d5b70-f1fd-0b45-9995-f366c5c8fcfc@siemens.com \
    --to=claudius.heine.ext@siemens.com \
    --cc=ch@denx.de \
    --cc=henning.schild@siemens.com \
    --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