Hi Maxim, On Fri, 2018-05-25 at 14:25 +0200, Maxim Yu. Osipov wrote: > Hi Claudius, > > I've a short question and suggestion before I can start procedure of > testing/applying this patch set to the tree. > > Are you going to correct looping order when purging (as Henning > pointed > out see his email below) in the next version of series or provide > this > later as a separate patch? Yes I planned to do that next week. > > In any case it would be better to rename IMAGE_CFG_PACKAGE to > IMAGE_CFG_PACKAGES and add short description (like purpose of this > variable) to definition of IMAGE_CFG_PACKAGE(S) in > isar-bootstrap-helper.bbclass. Let's improve code readability for > other > 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. > > Kind regards, > Maxim. > > 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" > > : > > > > > From: Claudius Heine > > > > > > Some configuration tasks on the image require certain other > > > packages, > > > but those packages might not be required on the final image. > > > > > > 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. > > > > > > 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(-) > > > > > > 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=$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 > > > > > > +IMAGE_CFG_PACKAGE ??= "" > > > + > > > setup_root_file_system() { > > > ROOTFSDIR="$1" > > > - CLEANHOSTLEAK="$2" > > > + CLEAN="$2" > > > shift > > > shift > > > PACKAGES="$@" > > > APT_ARGS="install --yes --allow-unauthenticated \ > > > -o Debug::pkgProblemResolver=yes" > > > - CLEANHOSTLEAK_FILES="${ROOTFSDIR}/etc/hostname > > > ${ROOTFSDIR}/etc/resolv.conf" > > > + CLEAN_FILES="${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="-" \ > > > -o APT::Get::List-Cleanup="0" > > > sudo -E chroot "$ROOTFSDIR" \ > > > - /usr/bin/apt-get ${APT_ARGS} --download-only $PACKAGES > > > - [ "clean" = ${CLEANHOSTLEAK} ] && sudo rm -f > > > ${CLEANHOSTLEAK_FILES} > > > + /usr/bin/apt-get ${APT_ARGS} --download-only $PACKAGES \ > > > + ${IMAGE_CFG_PACKAGE} > > > + [ "clean" = ${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 > > > > 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. > > > > Henning > > > > > + if [ "clean" = ${CLEAN} ]; then > > > + sudo -E chroot "$ROOTFSDIR" \ > > > + /usr/bin/apt-get autoremove --purge --yes > > > + sudo -E chroot "$ROOTFSDIR" \ > > > + /usr/bin/apt-get clean > > > + fi > > > } > > -- 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