From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6558749580291211264 X-Received: by 2002:aa7:c516:: with SMTP id o22-v6mr1157564edq.6.1527268676899; Fri, 25 May 2018 10:17:56 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aa7:d68a:: with SMTP id d10-v6ls869069edr.8.gmail; Fri, 25 May 2018 10:17:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqEtE2ASHGO6Bvwrbd8sjceb6uSJHGTI0TgD/Y3p2WYmJBCEalioTkJn7pIhSRACjR9YQFz X-Received: by 2002:a50:ee8d:: with SMTP id f13-v6mr1157970edr.7.1527268676472; Fri, 25 May 2018 10:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527268676; cv=none; d=google.com; s=arc-20160816; b=bgI4Jx1SaLohKhrwPewrEj9T+8p32Wd/D83w2JbClygfkr9GMl3AhkBhCpeZt4M9CT uN6lftaFS4stx99UgDN3OsU5GUmAbDJFHFXBSZjaa+5gOkw0CeeyBuDiV8J4Obwv4Hnl ErH72J+Ioza+I8RP7MNjJCrB/XgELn4sAzCBr6hn0F81fHGI3rlxbzUMpFDgRJLW4Mhd 1BRLT4DMu3wXKEII00q1OYT/H3x1eBUbzFslCZqA99ju2p+YLZ4mWngVhn2efBFzPpzb 5pmqBlZ+lgOrqHO2Nvuw74wzkH+FD6Mn5Hh0nBdkilZp1Hjl9KINh5QEioMdMuomg8dv 7wwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:date:cc:to:from:subject :message-id:arc-authentication-results; bh=v6Oi4pzDZC3u7ruYj+9U3r6SDDHBrk0d93GtGL++gr4=; b=ek5lLknvqzd/YyQeev2IZ47FdWyiKFQBtRmKtC3SWO2sw2q6czKdaH6BRaFTSAZWHf nl9QEnmuUcPKBAKFIk2ltBJftZNIJ4b9NXfN7XYUAm4r1EDpoCGdoQYc7/1TbSHt1rXw hgR9czhSqP+M7p/dJR+WGtenAAZnf0OQMMZ+YSU9irLDpGs7n7vVD2oaiC6LIjrFbnaI PgTW/Dac29FdlKWtvRjn1k2OAivgLI9/HryVm1i/AGqiHBDC0lcmtix9NIRGpGxr2Fb9 ERyo7V0DqePS/+s1bHAyApPhvMlXAc3Rz1SjJTy/XhXvdowCiBrqogTNdBJup9yJ02LM JfTA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of ch@denx.de) smtp.mailfrom=ch@denx.de Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id u9-v6si1128815edp.3.2018.05.25.10.17.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 10:17:56 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of ch@denx.de) client-ip=212.18.0.9; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of ch@denx.de) smtp.mailfrom=ch@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 40stHS1QWBz1qvVR; Fri, 25 May 2018 19:17:56 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 40stHS103Fz1qqyB; Fri, 25 May 2018 19:17:56 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id YsWtOidTPhZc; Fri, 25 May 2018 19:17:55 +0200 (CEST) X-Auth-Info: zHj119hKsf9ja4WtshdAsrocMpFhPmBeEgXBy5cWn1Y= Received: from Orrorin (dslb-088-067-187-241.088.067.pools.vodafone-ip.de [88.67.187.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 25 May 2018 19:17:55 +0200 (CEST) Message-ID: <33ff8f1c9b7cd3c4e258c344269ab75b8b5539d5.camel@denx.de> Subject: Re: [PATCH v3 1/3] isar-bootstrap|configscript: implement one shot config option From: Claudius Heine To: "Maxim Yu. Osipov" , Henning Schild , "[ext] claudius.heine.ext@siemens.com" Cc: isar-users@googlegroups.com Date: Fri, 25 May 2018 19:17:50 +0200 In-Reply-To: References: <20180524142635.5814-1-claudius.heine.ext@siemens.com> <20180524142635.5814-2-claudius.heine.ext@siemens.com> <20180524174529.7571e20e@md1pvb1c.ad001.siemens.net> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-Do7OyjPqw5l7gW6I8UHL" X-Mailer: Evolution 3.28.2 Mime-Version: 1.0 X-TUID: 7NjLF5/sYRIH --=-Do7OyjPqw5l7gW6I8UHL Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Maxim, On Fri, 2018-05-25 at 14:25 +0200, Maxim Yu. Osipov wrote: > Hi Claudius, >=20 > I've a short question and suggestion before I can start procedure of=20 > testing/applying this patch set to the tree. >=20 > Are you going to correct looping order when purging (as Henning > pointed=20 > out see his email below) in the next version of series or provide > this=20 > later as a separate patch? Yes I planned to do that next week. >=20 > In any case it would be better to rename IMAGE_CFG_PACKAGE to=20 > IMAGE_CFG_PACKAGES and add short description (like purpose of this=20 > variable) to definition of IMAGE_CFG_PACKAGE(S) in=20 > isar-bootstrap-helper.bbclass. Let's improve code readability for > other=20 > people. Yes I can do that as well. Thanks for the suggestion! Claudius P.S.: Also, please avoid top posting in mailing lists and prefer interleaved style. >=20 > Kind regards, > Maxim. >=20 > On 05/24/2018 05:45 PM, Henning Schild wrote: > > Am Thu, 24 May 2018 16:26:33 +0200 > > schrieb "[ext] claudius.heine.ext@siemens.com" > > : > >=20 > > > From: Claudius Heine > > >=20 > > > Some configuration tasks on the image require certain other > > > packages, > > > but those packages might not be required on the final image. > > >=20 > > > One way to solve this is use a special package that is installed > > > to > > > the image and then removed again. When installing it makes > > > certain > > > that all required packages are installed to the image as well. > > > Then > > > the image can be configured in the postinst hook. When this > > > package > > > is removed and all unused dependencies are removed as well, no > > > not > > > required packages used by this package should remain on the > > > image. > > >=20 > > > Signed-off-by: Claudius Heine > > > --- > > > .../images/files/debian-configscript.sh | 1 - > > > .../images/files/raspbian-configscript.sh | 1 - > > > meta/classes/isar-bootstrap-helper.bbclass | 23 > > > +++++++++++++++---- 3 files changed, 19 insertions(+), 6 > > > deletions(-) > > >=20 > > > diff --git > > > a/meta-isar/recipes-core/images/files/debian-configscript.sh > > > b/meta-isar/recipes-core/images/files/debian-configscript.sh > > > index > > > 7ca0562..9b3ff30 100755 --- > > > a/meta-isar/recipes-core/images/files/debian-configscript.sh +++ > > > b/meta-isar/recipes-core/images/files/debian-configscript.sh @@ > > > -40,4 > > > +40,3 @@ fi # Purge unused locale and installed packages' .deb > > > files > > > localepurge > > > -apt-get clean > > > diff --git > > > a/meta-isar/recipes-core/images/files/raspbian-configscript.sh > > > b/meta-isar/recipes-core/images/files/raspbian-configscript.sh > > > index > > > b240de9..448dea5 100644 --- > > > a/meta-isar/recipes-core/images/files/raspbian-configscript.sh > > > +++ > > > b/meta-isar/recipes-core/images/files/raspbian-configscript.sh @@ > > > -40,4 +40,3 @@ kernel=3D$KERNEL_IMAGE EOF > > > localepurge > > > -apt-get clean > > > diff --git a/meta/classes/isar-bootstrap-helper.bbclass > > > b/meta/classes/isar-bootstrap-helper.bbclass index > > > 4284d02..1d21831 > > > 100644 --- a/meta/classes/isar-bootstrap-helper.bbclass > > > +++ b/meta/classes/isar-bootstrap-helper.bbclass > > > @@ -5,15 +5,17 @@ > > > # > > > # SPDX-License-Identifier: MIT > > > =20 > > > +IMAGE_CFG_PACKAGE ??=3D "" > > > + > > > setup_root_file_system() { > > > ROOTFSDIR=3D"$1" > > > - CLEANHOSTLEAK=3D"$2" > > > + CLEAN=3D"$2" > > > shift > > > shift > > > PACKAGES=3D"$@" > > > APT_ARGS=3D"install --yes --allow-unauthenticated \ > > > -o Debug::pkgProblemResolver=3Dyes" > > > - CLEANHOSTLEAK_FILES=3D"${ROOTFSDIR}/etc/hostname > > > ${ROOTFSDIR}/etc/resolv.conf" > > > + CLEAN_FILES=3D"${ROOTFSDIR}/etc/hostname > > > ${ROOTFSDIR}/etc/resolv.conf" > > > sudo cp -Trpfx \ > > > "${DEPLOY_DIR_IMAGE}/isar-bootstrap-${DISTRO}- > > > ${DISTRO_ARCH}/" > > > \ @@ -41,8 +43,21 @@ setup_root_file_system() { > > > -o Dir::Etc::sourceparts=3D"-" \ > > > -o APT::Get::List-Cleanup=3D"0" > > > sudo -E chroot "$ROOTFSDIR" \ > > > - /usr/bin/apt-get ${APT_ARGS} --download-only $PACKAGES > > > - [ "clean" =3D ${CLEANHOSTLEAK} ] && sudo rm -f > > > ${CLEANHOSTLEAK_FILES} > > > + /usr/bin/apt-get ${APT_ARGS} --download-only $PACKAGES \ > > > + ${IMAGE_CFG_PACKAGE} > > > + [ "clean" =3D ${CLEAN} ] && sudo rm -f ${CLEAN_FILES} > > > sudo -E chroot "$ROOTFSDIR" \ > > > /usr/bin/apt-get ${APT_ARGS} $PACKAGES > > > + for pkg in ${IMAGE_CFG_PACKAGE}; do > > > + sudo -E chroot "$ROOTFSDIR" \ > > > + /usr/bin/apt-get ${APT_ARGS} $pkg > > > + sudo -E chroot "$ROOTFSDIR" \ > > > + /usr/bin/apt-get purge --yes $pkg > > > + done > >=20 > > Sorry for not pointing that out the first time. But if we loop we > > should probably do that twice, on the purge in reverse order. > >=20 > > Henning > >=20 > > > + if [ "clean" =3D ${CLEAN} ]; then > > > + sudo -E chroot "$ROOTFSDIR" \ > > > + /usr/bin/apt-get autoremove --purge --yes > > > + sudo -E chroot "$ROOTFSDIR" \ > > > + /usr/bin/apt-get clean > > > + fi > > > } >=20 >=20 --=20 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 PGP key: 6FF2 E59F 00C6 BC28 31D8 64C1 1173 CB19 9808 B153 Keyserver: hkp://pool.sks-keyservers.net --=-Do7OyjPqw5l7gW6I8UHL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEb/LlnwDGvCgx2GTBEXPLGZgIsVMFAlsIRT4ACgkQEXPLGZgI sVM7NA/+Ph6ohM7oMkcl7ondkgOGacEWvKQz2nx50pVSe3EB1x3GIhKAhaQtax78 qgA4i+oowt2QYbsJbm0UdtIX63aakhSFrda6Jp52qQcbekknJhtrOs40EG5l4V2h qzQHHmVx35duB2m8X7hl2od76Ja0zkiWBM1a05s6zNBexk81627Z+ZMn1tsGWDYi yMZXMOMHm8pnSbRMohl/rLC7GdT6B67vu2LCnRlS+mUTj8uN5MCBnPtFjkG/fxZe 8VxKHqsZ8XlfuT0KJlrGnt/meCFJiwtJlFWI8+fIvaQUEe7gFjS0FRXNnYDmG/HW Z1QU9CHB/fB3TpPUo0MfbkUyibFSFr0LWUFXmZp1txKza5hEhtZKV6fNoZOKtb6R IsTEHu0SeBkbmlzPrjtD50FFxsm9BXVRWyW03T1F70zJRK5SSzJCgqtqJDYT6rnc JV3TGdTkBWviC5dqeDrXg5A6aomPC7StIYmeiXubGDK0Ri/q1Z5Bho+3IIOJHpVu Me1b1yz86KX/6K7xpHHvGbc3Sw+nNhBaL4poCqjixMtr+H4E5kMptswW02bZU3up FNk5Cca4W8HusiN60/5n8/OHQQ0hADoemxV1/s4PlTUL3NSq7byL6PW3Hweqw7+W K3jeM+IIzSE092dQTQk5wdj7C4OfdJjLQ9N6iq4qYJyBNf77z10= =iZEt -----END PGP SIGNATURE----- --=-Do7OyjPqw5l7gW6I8UHL--