From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6555830666749018112 X-Received: by 2002:a2e:94c7:: with SMTP id r7-v6mr1265900ljh.11.1526976281827; Tue, 22 May 2018 01:04:41 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:7008:: with SMTP id h8-v6ls58843lfc.1.gmail; Tue, 22 May 2018 01:04:41 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq2Pcn0TZGNEIraYmMeuBi/NMuyiK0xB4KtmOoXAw+hulvTh+Gf043Vm1yFWNIrBPVM6nEp X-Received: by 2002:a19:c50a:: with SMTP id w10-v6mr1991329lfe.37.1526976281232; Tue, 22 May 2018 01:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526976281; cv=none; d=google.com; s=arc-20160816; b=XZVPWGsQGfa8vwm82UTaHIEKtTD+aOFL1VfKl2ros7U0MKPVHuhFCP/EuwHFGHj6xL inmA0fAfONP53W/TRcXyqZNn5lR0kJdXt2fzGD5eXN/qNLN111IXBQEJatyJvCojbfvD CdJFGurmogQ5jV+yXEs/W49EjaXE/PvBb5hPXFXvlnENxCsXvM3jEsDoNpat4w3tO/Ld NKIh3i81Iro2aNofKIKtdn8pbTgjR1bV/X1v1pt12As8Frt9fqF9swEi8xNjvkub2Lap miIm1YyfoIrkT04bw12rzu2uZP20HgpJsQo+GXPxEyNtHFdBXTsWc1J+lnrfVcZ0xjnh t2Rw== 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:to:subject :arc-authentication-results; bh=6J5ciOQRO0mmAx6mKvhEPVBwMNPltpEw3Z6Zlnuzo+E=; b=L038v8eMxAXWaONo/LKV1cCjGrF06qmNzKOge3LxeRZJ61YPuI2gpwQc4Q+k9KAsj8 RmY/0oABJP9uJIo0PiuV0O77D5vkPpm5uvLyFbJAVpjr1E7okU6wm3Fs+IISeTOemTxL WaJp41InkEL1/VoJzCFabVatZd/WGYyi9zCf52qzJznaMpxrPcXPhrd3TXjRJgqWUfw0 W6etr14nrpDnl/hpfUgAActybd/DJsVuwa/tgwVguKfV4j3tKyrcSMAxNvlrXsyQ0gQ7 Fccp47I/zul55YVgmU3ap/N8PuGMEI7sy+EjUeUs5HKgkSDr/D7kkoIareq1kyQYODCc rirQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id n24-v6si601275lfh.5.2018.05.22.01.04.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 01:04:41 -0700 (PDT) Received-SPF: pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id w4M84eCg015850 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 May 2018 10:04:40 +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 w4M84ei7030020; Tue, 22 May 2018 10:04:40 +0200 Subject: Re: [PATCH 1/2] isar-bootsrtap: Setup locale To: Alexander Smirnov , isar-users@googlegroups.com References: <20180515153052.4946-1-asmirnov@ilbers.de> <20180515153052.4946-2-asmirnov@ilbers.de> From: Claudius Heine Message-ID: <6795a2f7-77b3-1d35-be67-858995018164@siemens.com> Date: Tue, 22 May 2018 10:04:40 +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: <20180515153052.4946-2-asmirnov@ilbers.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: F8o60upM5Vvv Hi Alex, On 2018-05-15 17:30, Alexander Smirnov wrote: > Currently locale is set in config scripts for buildchroot and images. > This is absolutely the same routine which is duplicated in all these > scripts. This patch moves locale initialization to isar-bootstrap, so > now locale is set once and works for all the futher root filesystems. > > The task do_set_locale is added right after do_bootstrap to avoid warning > messages in isar-bootstrap logs after 'apt-get' calls. > > Signed-off-by: Alexander Smirnov > --- > .../images/files/debian-configscript.sh | 22 -------------------- > .../images/files/raspbian-configscript.sh | 22 -------------------- > meta/recipes-core/isar-bootstrap/files/locale | 4 ++++ > .../isar-bootstrap/files/locale.nopurge | 10 +++++++++ > meta/recipes-core/isar-bootstrap/isar-bootstrap.bb | 13 ++++++++++-- > .../buildchroot/files/configscript.sh | 24 +--------------------- > 6 files changed, 26 insertions(+), 69 deletions(-) > create mode 100644 meta/recipes-core/isar-bootstrap/files/locale > create mode 100644 meta/recipes-core/isar-bootstrap/files/locale.nopurge > > diff --git a/meta-isar/recipes-core/images/files/debian-configscript.sh b/meta-isar/recipes-core/images/files/debian-configscript.sh > index 042b530..7ca0562 100755 > --- a/meta-isar/recipes-core/images/files/debian-configscript.sh > +++ b/meta-isar/recipes-core/images/files/debian-configscript.sh > @@ -10,28 +10,6 @@ readonly BAUDRATE_TTY="$2" > readonly ROOTFS_DEV="$3" > readonly ROOTFS_TYPE="$4" > > -cat >> /etc/default/locale << EOF > -LANG=en_US.UTF-8 > -LANGUAGE=en_US.UTF-8 > -LC_ALL=C > -LC_CTYPE=C > -EOF > - > -## Configuration file for localepurge(8) > -cat > /etc/locale.nopurge << EOF > - > -# Remove localized man pages > -MANDELETE > - > -# Delete new locales which appear on the system without bothering you > -DONTBOTHERNEWLOCALE > - > -# Keep these locales after package installations via apt-get(8) > -en > -en_US > -en_US.UTF-8 > -EOF > - > debconf-set-selections < locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8 > locales locales/default_environment_locale select en_US.UTF-8 > diff --git a/meta-isar/recipes-core/images/files/raspbian-configscript.sh b/meta-isar/recipes-core/images/files/raspbian-configscript.sh > index ec05a6b..b240de9 100644 > --- a/meta-isar/recipes-core/images/files/raspbian-configscript.sh > +++ b/meta-isar/recipes-core/images/files/raspbian-configscript.sh > @@ -10,28 +10,6 @@ readonly BAUDRATE_TTY="$2" > readonly ROOTFS_DEV="$3" > readonly ROOTFS_TYPE="$4" > > -cat >> /etc/default/locale << EOF > -LANG=en_US.UTF-8 > -LANGUAGE=en_US.UTF-8 > -LC_ALL=C > -LC_CTYPE=C > -EOF > - > -## Configuration file for localepurge(8) > -cat > /etc/locale.nopurge << EOF > - > -# Remove localized man pages > -MANDELETE > - > -# Delete new locales which appear on the system without bothering you > -DONTBOTHERNEWLOCALE > - > -# Keep these locales after package installations via apt-get(8) > -en > -en_US > -en_US.UTF-8 > -EOF > - > debconf-set-selections < locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8 > locales locales/default_environment_locale select en_US.UTF-8 > diff --git a/meta/recipes-core/isar-bootstrap/files/locale b/meta/recipes-core/isar-bootstrap/files/locale > new file mode 100644 > index 0000000..5b3a663 > --- /dev/null > +++ b/meta/recipes-core/isar-bootstrap/files/locale > @@ -0,0 +1,4 @@ > +LANG=en_US.UTF-8 > +LANGUAGE=en_US.UTF-8 > +LC_ALL=C > +LC_CTYPE=C > diff --git a/meta/recipes-core/isar-bootstrap/files/locale.nopurge b/meta/recipes-core/isar-bootstrap/files/locale.nopurge > new file mode 100644 > index 0000000..510d40c > --- /dev/null > +++ b/meta/recipes-core/isar-bootstrap/files/locale.nopurge > @@ -0,0 +1,10 @@ > +# Remove localized man pages > +MANDELETE > + > +# Delete new locales which appear on the system without bothering you > +DONTBOTHERNEWLOCALE > + > +# Keep these locales after package installations via apt-get(8) > +en > +en_US > +en_US.UTF-8 I don't think that putting 'locale.nopurge' in every image is the right solution. That means that every image is configured for localepurge. I'm working on a solution to allow configuration packages, that are installed and then purged from the image: https://github.com/cmhe/isar/commit/624ee1278657689ad5ef493b345905308a340039 https://github.com/cmhe/isar/commit/765b6b09e32230cd6d1929fd9f54455cb4ff65fc This is useful for one-shot configuration stuff like localepurge and maybe even the complete locale configuration. But I do see the reason for setting *some* locale variables in the isar-bootstrap, that can be easily overwritten later on just to provide a baseline configuration that avoids those warnings. Claudius > diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb > index 35953b5..28ad395 100644 > --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb > +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb > @@ -12,7 +12,9 @@ LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260 > FILESPATH_prepend := "${THISDIR}/files:" > SRC_URI = " \ > file://isar-apt.conf \ > - file://isar-apt-fallback.conf" > + file://isar-apt-fallback.conf \ > + file://locale \ > + file://locale.nopurge" > PV = "1.0" > > WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}" > @@ -183,6 +185,7 @@ do_bootstrap() { > sudo -E "${DEBOOTSTRAP}" --verbose \ > --variant=minbase \ > --arch="${DISTRO_ARCH}" \ > + --include=locales \ > ${@get_distro_components_argument(d)} \ > ${DEBOOTSTRAP_KEYRING} \ > "${@get_distro_suite(d)}" \ > @@ -191,6 +194,12 @@ do_bootstrap() { > } > addtask bootstrap before do_build after do_generate_keyring > > +do_set_locale() { > + sudo install -v -m644 "${WORKDIR}/locale" "${ROOTFSDIR}/etc/locale" > + sudo install -v -m644 "${WORKDIR}/locale.nopurge" "${ROOTFSDIR}/etc/locale.nopurge" > +} > +addtask set_locale after do_bootstrap > + > def get_host_release(): > import platform > rel = platform.release() > @@ -227,7 +236,7 @@ do_apt_update() { > sudo -E chroot "${ROOTFSDIR}" /usr/bin/apt-get dist-upgrade -y \ > -o Debug::pkgProblemResolver=yes > } > -addtask apt_update before do_build after do_apt_config_install > +addtask apt_update before do_build after do_apt_config_install do_set_locale > > do_deploy[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" > do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}" > diff --git a/meta/recipes-devtools/buildchroot/files/configscript.sh b/meta/recipes-devtools/buildchroot/files/configscript.sh > index c2a599a..d591c2a 100644 > --- a/meta/recipes-devtools/buildchroot/files/configscript.sh > +++ b/meta/recipes-devtools/buildchroot/files/configscript.sh > @@ -1,32 +1,10 @@ > #!/bin/sh > # > # This software is a part of ISAR. > -# Copyright (C) 2015-2017 ilbers GmbH > +# Copyright (C) 2015-2018 ilbers GmbH > > set -e > > -cat >> /etc/default/locale << EOF > -LANG=en_US.UTF-8 > -LANGUAGE=en_US.UTF-8 > -LC_ALL=C > -LC_CTYPE=C > -EOF > - > -## Configuration file for localepurge(8) > -cat > /etc/locale.nopurge << EOF > - > -# Remove localized man pages > -MANDELETE > - > -# Delete new locales which appear on the system without bothering you > -DONTBOTHERNEWLOCALE > - > -# Keep these locales after package installations via apt-get(8) > -en > -en_US > -en_US.UTF-8 > -EOF > - > debconf-set-selections < locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8 > locales locales/default_environment_locale select en_US.UTF-8 > -- 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