public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: "[ext] claudius.heine.ext@siemens.com" <claudius.heine.ext@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:16:08 +0200	[thread overview]
Message-ID: <20180523161608.710986c0@md1pvb1c.ad001.siemens.net> (raw)
In-Reply-To: <20180523131248.31907-3-claudius.heine.ext@siemens.com>

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.

> +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
> +}


  reply	other threads:[~2018-05-23 14:16 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 [this message]
2018-05-23 14:39     ` Claudius Heine
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=20180523161608.710986c0@md1pvb1c.ad001.siemens.net \
    --to=henning.schild@siemens.com \
    --cc=ch@denx.de \
    --cc=claudius.heine.ext@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