From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7085021667395633152 X-Received: by 2002:a63:d10d:0:b0:39c:d17a:7b08 with SMTP id k13-20020a63d10d000000b0039cd17a7b08mr13533116pgg.180.1649610155900; Sun, 10 Apr 2022 10:02:35 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6a00:23c2:b0:4fa:698b:ecd with SMTP id g2-20020a056a0023c200b004fa698b0ecdls4586621pfc.8.gmail; Sun, 10 Apr 2022 10:02:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGJM3pUjh53y9dH8ZLsjTHKzQYCxthPViy+yc4jULEZENYYqbsUWqwiTmNriv/hl01BDei X-Received: by 2002:a63:3586:0:b0:39c:c5e9:a657 with SMTP id c128-20020a633586000000b0039cc5e9a657mr15200000pga.3.1649610154797; Sun, 10 Apr 2022 10:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649610154; cv=none; d=google.com; s=arc-20160816; b=hUNt89C8Jv7q8z2lIk21qIdnkAObdEfNinLhtmb0jlwc0uMf9iGI1A+IGLnVyWA9vg kmz9YEk5PRZOtr5VXuzq7+TlnZZLadinC4z4TVQEua9eWsZAMrYbNHhqyTpTQYjke+j8 Pi7Ke5u44cmoRKW7MBqV2TciqDl3fAcwqch5JjOc54VQPzTeFPBoBRx0BrFnQGuxFVtq +RMTkyke8epXXq5ms0UCXBhO/Fio6T1ARmHxDJ/O/bhPr4JPOEpphU9NHDufOJme0y// iMwSbRvKU/jxkd+Zf2Kk6RS6Xb3HBx3VEVHX2H+IdZIByGRR271a4cHsMH6QZk3zjmLW xIXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=zqNM+eLOELRLwO8g1nNOAVHCiXmoiNRNWbk30pRVco0=; b=xJZKNaVztMW0hwtBlrIgdMS/V5/XOs5v/1vh6loby511JCBXBoerlKI6yrtWAbKyqE Xnm1UkRtYXeLRkg74+OJNcXGfLMbGHP9e3U5vXGAombusdOhPeMpPkrvaNHbv3w6kqzD 1SZWnlQYtWNjF2l0BTzhgUtGDH48TFsj6XPm8hEcUBxtJNq/pmXfKMDcKCW5FKL+53wx ip3Spsb+jwrnaCk/KBI0V/qIyu01va8xyO+WPnzSI+wRqJS76fbhBnnllpnPJpEqz+4e 3+4FlZtZsGlSE95tCPsO+eXRB78BCGJxZG5+awJMLv4Wey7NXwSm4DyQZGSnK/q3IrO+ i9Zw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of venkata.pyla@toshiba-tsip.com designates 210.130.202.156 as permitted sender) smtp.mailfrom=venkata.pyla@toshiba-tsip.com Return-Path: Received: from mo-csw.securemx.jp (mo-csw1114.securemx.jp. [210.130.202.156]) by gmr-mx.google.com with ESMTPS id b18-20020a056a000a9200b004f6fe5417cesi894846pfl.2.2022.04.10.10.02.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Apr 2022 10:02:34 -0700 (PDT) Received-SPF: pass (google.com: domain of venkata.pyla@toshiba-tsip.com designates 210.130.202.156 as permitted sender) client-ip=210.130.202.156; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of venkata.pyla@toshiba-tsip.com designates 210.130.202.156 as permitted sender) smtp.mailfrom=venkata.pyla@toshiba-tsip.com Received: by mo-csw.securemx.jp (mx-mo-csw1114) id 23AH2Wjj028417; Mon, 11 Apr 2022 02:02:32 +0900 X-Iguazu-Qid: 2wHHJRDF5pSQUOua80 X-Iguazu-QSIG: v=2; s=0; t=1649610152; q=2wHHJRDF5pSQUOua80; m=RGweG4ttransOkjw7S5p3MheKHhjXLcwaaFHxgdwab8= Received: from imx12-a.toshiba.co.jp (imx12-a.toshiba.co.jp [61.202.160.135]) by relay.securemx.jp (mx-mr1113) id 23AH2VUh003729 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 11 Apr 2022 02:02:32 +0900 From: venkata.pyla@toshiba-tsip.com To: isar-users@googlegroups.com Cc: venkata pyla , henning.schild@siemens.com, jan.kiszka@siemens.com, dinesh.kumar@toshiba-tsip.com, kazuhiro3.hayashi@toshiba.co.jp Subject: [isar 1/1] image-locales-extension: Do localepurge configuration after installation Date: Sun, 10 Apr 2022 22:32:29 +0530 X-TSB-HOP2: ON Message-Id: <20220410170229.6369-2-venkata.pyla@toshiba-tsip.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220410170229.6369-1-venkata.pyla@toshiba-tsip.com> References: <20220410170229.6369-1-venkata.pyla@toshiba-tsip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 10 Apr 2022 17:02:29.0927 (UTC) FILETIME=[C3497370:01D84CFC] X-TUID: AoWwzCDOgyPI From: venkata pyla The current seqence of copying the localepurge configuration first and then installing localepurge package is causing the debconf cache entry, that is because the package postinstall script assume the configuration is already present and checks for configuration change and updates the debconf cache entry. With the above sequence of steps it is causing unnecessary debconf cache entry and which is causing non-reproducible system image creation. To avoid this, the sequence is altered to install the package first and then configure necessary locales to remove. Signed-off-by: venkata pyla --- meta/classes/image-locales-extension.bbclass | 33 ++++++++++---------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/meta/classes/image-locales-extension.bbclass b/meta/classes/image-locales-extension.bbclass index 25af540..2db6d4a 100644 --- a/meta/classes/image-locales-extension.bbclass +++ b/meta/classes/image-locales-extension.bbclass @@ -60,6 +60,16 @@ __EOF__ # Install configuration into image: sudo -E -s <<'EOSUDO' set -e + localepurge_state='i' + if chroot '${ROOTFSDIR}' dpkg -s localepurge 2>/dev/null >&2 + then + echo 'localepurge was installed (leaving it installed later)' + else + localepurge_state='p' + echo 'localepurge was not installed (removing it later)' + chroot '${ROOTFSDIR}' apt-get ${ROOTFS_APT_ARGS} localepurge + fi + cat '${WORKDIR}/locale.gen' >> '${ROOTFSDIR}/etc/locale.gen' cat '${WORKDIR}/locale.default' > '${ROOTFSDIR}/etc/default/locale' cat '${WORKDIR}/locale.nopurge' > '${ROOTFSDIR}/etc/locale.nopurge' @@ -67,15 +77,6 @@ __EOF__ # Enter image and trigger locales config and localepurge: chroot '${ROOTFSDIR}' /bin/sh <<'EOSH' - localepurge_state='i' - if dpkg -s localepurge 2>/dev/null >&2 - then - echo 'localepurge was installed (leaving it installed later)' - else - localepurge_state='p' - echo 'localepurge was not installed (removing it later)' - apt-get ${ROOTFS_APT_ARGS} localepurge - fi echo 'running locale debconf-set-selections' debconf-set-selections /tmp/locale.debconf @@ -86,13 +87,13 @@ __EOF__ echo 'running localepurge' localepurge - - if [ "$localepurge_state" = 'p' ] - then - echo removing localepurge... - apt-get purge --yes localepurge - apt-get autoremove --purge --yes - fi EOSH + + if [ "$localepurge_state" = 'p' ] + then + echo removing localepurge... + chroot '${ROOTFSDIR}' apt-get purge --yes localepurge + chroot '${ROOTFSDIR}' apt-get autoremove --purge --yes + fi EOSUDO } -- 2.20.1