From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6558749580291211264 X-Received: by 2002:a1c:ca04:: with SMTP id a4-v6mr591751wmg.21.1527086357095; Wed, 23 May 2018 07:39:17 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:98f6:: with SMTP id w109-v6ls6372548wrb.2.gmail; Wed, 23 May 2018 07:39:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZptJyYcDyARV0usHqBeDIelpgW8BaQ4rCcJnEM7ixPfWzrHs/JuewtBwCO0Q1TAFFklfTFk X-Received: by 2002:adf:87f6:: with SMTP id c51-v6mr330989wrc.10.1527086356723; Wed, 23 May 2018 07:39:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527086356; cv=none; d=google.com; s=arc-20160816; b=x3UNwEijvmqN2Yu221xA7HFta1+0tzGqy+XkcvDBGvRixmvJ0yAvS2SoEljeDaWAeJ A6iVv0D0lK8VT8VlX6kxWOZMklG3+mM6W3pWCSOMUf61DJDfRj3ZkYa25D7ubCxwQGgJ Q8Tdsta6VbtYsWslBnt0R1ET02pM7Al1S3FTMyvaXgVt0n37vnYKafHlpZbj0tRCErpC HzZhDfJ4dbf29rEcEZNJDi47XtV05nDyMqmP+Uknm4KBgWjr9qmeu6yAG4zZ//ErSbL1 pMm2s0FvWUyuwuzext66DOe+xEIK0mOpzpHsSuHYlOxauAwxJnJmhnI7bgqk4u/sAak/ 0IQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :arc-authentication-results; bh=eTA+qd3owqsCVwdSeAtXEV7CXtj5ruqD7KVd9G7jazg=; b=DJZ+M/sxRawrjFEYg4KMfeQ4WzGrpK3SOIQqXFkuBuI1tr0mEWEKbLd6/N1kMiOS6f DhzXFrgV3gVF0NlTHS7gKmrK+95/A9z2lsEQn3OtPTrzhfw5VGQ7cyDwoDaEJLRgpJiR QY+ubGkBYyv/RMfTN09tDHe6LeMi89IDtGQ/OCvc/t+Kf4rFZh1hANfDi41x26aQU9Lo XPysgUcFs+H3VKy/Qu0NXvDN2oILBQ9Yl+GzItsyFP2qGi7BoF22LpUGAVVbwj2aT8Ez DgThi0hAOcF28Sn5XOQws1iThDLn5j+j6AHW63S9SsNCa6fTm1H3vbubKjnEJt1n0HLx H32w== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id i10-v6si69134wrn.5.2018.05.23.07.39.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 May 2018 07:39:16 -0700 (PDT) Received-SPF: pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w4NEdFSZ021819 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 May 2018 16:39:16 +0200 Received: from [139.25.69.69] (linux-ses-ext02.ppmd.siemens.net [139.25.69.69]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id w4NEdFhf020177; Wed, 23 May 2018 16:39:15 +0200 Subject: Re: [PATCH v2 2/3] meta/isar-cfg-localepurge: added locale purge recipe To: Henning Schild Cc: isar-users@googlegroups.com, Claudius Heine References: <20180523131248.31907-1-claudius.heine.ext@siemens.com> <20180523131248.31907-3-claudius.heine.ext@siemens.com> <20180523161608.710986c0@md1pvb1c.ad001.siemens.net> From: Claudius Heine Message-ID: <060d5b70-f1fd-0b45-9995-f366c5c8fcfc@siemens.com> Date: Wed, 23 May 2018 16:39:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180523161608.710986c0@md1pvb1c.ad001.siemens.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: XgZs3cIfzgQg 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" > : > >> From: Claudius Heine >> >> 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 >> --- >> .../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 " >> +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