From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6558749580291211264 X-Received: by 2002:a50:8e14:: with SMTP id 20-v6mr3023742edw.3.1527152270755; Thu, 24 May 2018 01:57:50 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a50:c441:: with SMTP id w1-v6ls11958797edf.1.gmail; Thu, 24 May 2018 01:57:50 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqtMfh8XgYyH57ywKDDk1zZag2pEa6TPKrACLUjPE74PzLizY+1Ie3avJzjIpQrQyVksZxh X-Received: by 2002:a50:9985:: with SMTP id m5-v6mr3024137edb.2.1527152270339; Thu, 24 May 2018 01:57:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527152270; cv=none; d=google.com; s=arc-20160816; b=L2z0E9y7L1Z1wnH0cEoQ4P30/g2OlyCZigeHzYNdj/f6dUUq2YWi124AfQWeZzJMBh Vww5NZA6PFFEUd169LDmR42Jin7NCOfhk+hfjmEd+vvTSm7tXDXV0/iFapS3QncsuvWT YiXeqkYBe4mMsUv6HIikXJMmq1MxmbPcfeWbgPWCS2GP47jjhCOkrM1ZVCs+2+TcoewR +UIXaEKpZySm6Nfu/KnVjWoWWxEqGNR7nJLCgKnBUztwx9uYRjTRhPlu+SVT2hBTFIGo 1ahmWeZKOZxIWa0ErxuL/6TsQjbUAJSF7hmb0rLeDKWKzLBJqbYU0GCTyNHqxc0uJeHZ IbWA== 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:subject:cc:to:from:date:arc-authentication-results; bh=VJD+pCuBMEcyuXiLPw7xjdKNf5mKTMAWC/HBPxImdpI=; b=XG5MxUylO0lpiayTnZbmFyhdvFzoZBR+r844cEyE/dvTXrKTNq7mYPPXcWxyD6fkzo e8wqwHZ0xOGWpyTkurEUSjgeVNWdrDdXJMWyrRg4wSt2lBMUrMDkNenYV7wRpl0fgpkq LcVRKVpPOZSgs7eTyj+Z0eQVTRnHacBPo9utIIIZqx0rEeQRaXDRpWoaG63TvyUoaeND pc+5b7y6bTZf0C+zacW4WH0m7L8TExqf8dSavmUpbhxdWjWv7mvThahRH6R508YXU2M/ XI5Mke2ebr0JMFKAyrvR2NIwTIBJOpb8SpNEJ4s5wp0AXePofSJjqqRnrs6k19Xn30b8 +85g== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id d24-v6si781028eds.0.2018.05.24.01.57.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 01:57:50 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w4O8vntI022924 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 May 2018 10:57:49 +0200 Received: from md1pvb1c.ad001.siemens.net (md1pvb1c.ad001.siemens.net [139.25.68.40]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w4O8vnQD018522; Thu, 24 May 2018 10:57:49 +0200 Date: Thu, 24 May 2018 10:57:48 +0200 From: Henning Schild To: Claudius Heine Cc: , Claudius Heine Subject: Re: [PATCH v2 1/3] isar-bootstrap|configscript: implement one shot config option Message-ID: <20180524105748.0c4e1b57@md1pvb1c.ad001.siemens.net> In-Reply-To: <225f79fc-bf52-4b06-fd71-9e71ae07d6a7@siemens.com> References: <20180523131248.31907-1-claudius.heine.ext@siemens.com> <20180523131248.31907-2-claudius.heine.ext@siemens.com> <20180523160606.3a155731@md1pvb1c.ad001.siemens.net> <225f79fc-bf52-4b06-fd71-9e71ae07d6a7@siemens.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: ORWiO4xlzLS9 Am Thu, 24 May 2018 09:06:56 +0200 schrieb Claudius Heine : > Hi Henning, > > On 2018-05-23 16:06, Henning Schild wrote: > > Am Wed, 23 May 2018 15:12:46 +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..76e20f6 > >> 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" > > > > I guess if you take the "install" out you can reuse that a few more > > times. > > Where? I only see purge and autoremove that doesn't use it already. > Replaceing '-y' with '${APT_ARGS}' there does seem like an overkill, > does it not? The other options in it don't do much for purge and > autoremove AFAIK. I did not check whether the rest is usefull for purge etc. In that case i would suggest to stick with "--yes" instead of "-y" just for consistency. Henning > If you think of this as a general improvement to have the command > outside of the 'APT_ARGS' variable for readability reasons, then I > agree, but that would be a different patch. > > > > >> - 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 > >> + if [ -n "${IMAGE_CFG_PACKAGE}" ]; then > >> + sudo -E chroot "$ROOTFSDIR" \ > >> + /usr/bin/apt-get ${APT_ARGS} ${IMAGE_CFG_PACKAGE} > > > > Say we have multiple packages here, are we sure apt-get will get the > > order right? > > Would it make sense to use a loop to deal with potential lists and > > their order? > > > > Henning > > > >> + sudo -E chroot "$ROOTFSDIR" \ > >> + /usr/bin/apt-get purge -y ${IMAGE_CFG_PACKAGE} > >> + fi > >> + if [ "clean" = ${CLEAN} ]; then > >> + sudo -E chroot "$ROOTFSDIR" \ > >> + /usr/bin/apt-get autoremove --purge -y > >> + sudo -E chroot "$ROOTFSDIR" \ > >> + /usr/bin/apt-get clean > >> + fi > >> } > > >