From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6691586504498610176 X-Received: by 2002:a2e:9594:: with SMTP id w20mr2679939ljh.17.1558623325632; Thu, 23 May 2019 07:55:25 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:2d4e:: with SMTP id t14ls596959lft.7.gmail; Thu, 23 May 2019 07:55:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2lnp96tcle19IhOBjzYs5SEJ71yYRaAHqlZagCtmPcNygAQxPVmn/4TDthp8dizWI8OXK X-Received: by 2002:a19:97d3:: with SMTP id z202mr15788551lfd.145.1558623325123; Thu, 23 May 2019 07:55:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558623325; cv=none; d=google.com; s=arc-20160816; b=Na732Dn8atMdohtFLLvn3B4i2ti2YJ/n0r8yEQveUh4bpi3Cr7hqnPxmo0kiWawcS4 IOPK5n9M1mq2StUodViJJb0MFq13ebfZXnD0fO59LZ+wO9+5JYHcsKW6pjw35CLApx+6 23Pk+iztxj0WsYkKFpztIvHuSoQkcdgqnOT7pgYFRVf/BrV7kMWLI5XCejYfHSCwZzl+ AhBrWmFr94zl4hCk8ZUHXzmM23UZ2zA201+jN/Y0wnR38N5Z2E7ik9MjnTRrBz8nYuCm l6HL7mMIqv+zrtw9PGBDADyBez5kp109vp2BFgdi4keYKuegrMOFLBV1YJkJ0r2IXciJ AjPw== 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=PuKXO6PvZRW4PQSwfcEO7PiI75fer7cBBH1VuMvDTu4=; b=bB9XmPPddFVEGIQ0PLVS5KcF9tKUbl1eU0fJUitL5GAYZU+88Ez1W7CmHsWA3U2/gm 9sFf0RBjm6Bk1vRyRRZez4qz5rHXGUKxnsNBO0yPnossS3V+kQVIJdCQbGTbcC52ba2O JORw/DN/Jg965GyqcMufaL7EksQtHUAOgxFjP7h1zLvBoF8DROY00nPnrN7qi0aMoJHe 0NFqgsRxf++UKJYfLoa9/zVZUFRHcp3pvtZaayP9xCp6+QoJyaReqDmKXYV8lSSkhUWC VGSqCJpXtxIk8XlvnajFNntQ5MPmnNkea8wQTLBqbUrwvakmBeDXqE+ut/NEBt+UA4Sm mAfA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id s187si2124074lfe.4.2019.05.23.07.55.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 May 2019 07:55:24 -0700 (PDT) Received-SPF: pass (google.com: domain of claudius.heine.ext@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id x4NEtOiw002713 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 May 2019 16:55:24 +0200 Received: from ring.ppmd.siemens.net (linux-ses-ext02.ppmd.siemens.net [139.25.69.232]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id x4NEtNgA014892; Thu, 23 May 2019 16:55:24 +0200 From: claudius.heine.ext@siemens.com To: isar-users@googlegroups.com Cc: Claudius Heine Subject: [PATCH v4 1/8] meta: remove transient package support Date: Thu, 23 May 2019 16:55:14 +0200 Message-Id: <20190523145521.23050-2-claudius.heine.ext@siemens.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523145521.23050-1-claudius.heine.ext@siemens.com> References: <20190523145521.23050-1-claudius.heine.ext@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: BXI2HLo9QoSm From: Claudius Heine Transient packages where meant for configuring images via packages, which proved to not be fit for purpose. Packages are meant to be shared across images, configuring it this way would mean that every possible configuration permutation would need to result in a separate package just so that no image accidentally installs a configuration package meant for a different build/image. Instead images need to be configured while its specific root file system is created using the new root file system creation pipeline. Signed-off-by: Claudius Heine --- meta/classes/image.bbclass | 4 +- meta/classes/isar-bootstrap-helper.bbclass | 13 +--- .../isar-cfg-localepurge/files/postinst | 15 ---- .../isar-cfg-localepurge.bb | 70 ------------------- .../isar-cfg-rootpw/files/postinst.tmpl | 19 ----- .../isar-cfg-rootpw/isar-cfg-rootpw.bb | 19 ----- 6 files changed, 2 insertions(+), 138 deletions(-) delete mode 100644 meta/recipes-support/isar-cfg-localepurge/files/postinst delete mode 100644 meta/recipes-support/isar-cfg-localepurge/isar-cfg-localepurge.bb delete mode 100644 meta/recipes-support/isar-cfg-rootpw/files/postinst.tmpl delete mode 100644 meta/recipes-support/isar-cfg-rootpw/isar-cfg-rootpw.bb diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 3eb261f..d77626c 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -36,9 +36,7 @@ def cfg_script(d): FILESPATH =. "${LAYERDIR_core}/conf/distro:" SRC_URI += "${@ cfg_script(d) }" -DEPENDS += "${IMAGE_INSTALL} ${IMAGE_TRANSIENT_PACKAGES}" - -IMAGE_TRANSIENT_PACKAGES += "isar-cfg-localepurge isar-cfg-rootpw" +DEPENDS += "${IMAGE_INSTALL}" ISAR_RELEASE_CMD_DEFAULT = "git -C ${LAYERDIR_core} describe --tags --dirty --match 'v[0-9].[0-9]*'" ISAR_RELEASE_CMD ?= "${ISAR_RELEASE_CMD_DEFAULT}" diff --git a/meta/classes/isar-bootstrap-helper.bbclass b/meta/classes/isar-bootstrap-helper.bbclass index 8612be2..bbc6322 100644 --- a/meta/classes/isar-bootstrap-helper.bbclass +++ b/meta/classes/isar-bootstrap-helper.bbclass @@ -5,8 +5,6 @@ # # SPDX-License-Identifier: MIT -IMAGE_TRANSIENT_PACKAGES ??= "" - def reverse_bb_array(d, varname): array = d.getVar(varname, True) if array is None: @@ -113,19 +111,10 @@ setup_root_file_system() { sudo -E chroot "$ROOTFSDIR" /usr/bin/apt-get update fi sudo -E chroot "$ROOTFSDIR" \ - /usr/bin/apt-get ${APT_ARGS} --download-only $PACKAGES \ - ${IMAGE_TRANSIENT_PACKAGES} + /usr/bin/apt-get ${APT_ARGS} --download-only $PACKAGES [ ${CLEAN} ] && sudo rm -f ${CLEAN_FILES} sudo -E chroot "$ROOTFSDIR" \ /usr/bin/apt-get ${APT_ARGS} $PACKAGES - for pkg in ${IMAGE_TRANSIENT_PACKAGES}; do - sudo -E chroot "$ROOTFSDIR" \ - /usr/bin/apt-get ${APT_ARGS} $pkg - done - for pkg in ${@reverse_bb_array(d, "IMAGE_TRANSIENT_PACKAGES") or ""}; do - sudo -E chroot "$ROOTFSDIR" \ - /usr/bin/apt-get purge --yes $pkg - done if [ ${CLEAN} ]; then if [ ${KEEP_APT_CACHE} -eq 1 ]; then mkdir -p ${WORKDIR}/apt_cache diff --git a/meta/recipes-support/isar-cfg-localepurge/files/postinst b/meta/recipes-support/isar-cfg-localepurge/files/postinst deleted file mode 100644 index 9dfd6f9..0000000 --- a/meta/recipes-support/isar-cfg-localepurge/files/postinst +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -set -e - -cat /usr/lib/isar-cfg-localepurge/locale.gen \ - >> /etc/locale.gen -cat /usr/lib/isar-cfg-localepurge/locale.default \ - > /etc/default/locale -cat /usr/lib/isar-cfg-localepurge/locale.nopurge \ - > /etc/locale.nopurge - -debconf-set-selections /usr/lib/isar-cfg-localepurge/locale.debconf - -dpkg-reconfigure -f noninteractive locales - -localepurge diff --git a/meta/recipes-support/isar-cfg-localepurge/isar-cfg-localepurge.bb b/meta/recipes-support/isar-cfg-localepurge/isar-cfg-localepurge.bb deleted file mode 100644 index 62b4b2d..0000000 --- a/meta/recipes-support/isar-cfg-localepurge/isar-cfg-localepurge.bb +++ /dev/null @@ -1,70 +0,0 @@ -# This software is a part of ISAR. - -DESCRIPTION = "Isar configuration package for locale and localepurge" -MAINTAINER = "isar-users " -DEBIAN_DEPENDS = "localepurge" - -SRC_URI = "file://postinst" - -inherit dpkg-raw - -LOCALE_GEN ?= "en_US.UTF-8 UTF-8\n\ - en_US ISO-8859-1\n" -LOCALE_DEFAULT ?= "en_US.UTF-8" - -def get_locale_gen(d): - locale_gen = d.getVar("LOCALE_GEN", True) or "" - return '\n'.join(sorted(set(i.strip() - for i in locale_gen.split('\\n') - if i.strip()))) - -def get_dc_locale_gen(d): - locale_gen = d.getVar("LOCALE_GEN", True) or "" - return ', '.join(sorted(set(i.strip() - for i in locale_gen.split('\\n') - if i.strip()))) - -def get_nopurge(d): - locale_gen = d.getVar("LOCALE_GEN", True) or "" - return '\n'.join(sorted(set(i.strip() - for j in locale_gen.split('\\n') - if j.strip() - for i in (j.split()[0].split("_")[0], - j.split()[0].split(".")[0], - j.split()[0])))) - -do_gen_config[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" -do_gen_config() { - cat<<-__EOF__ > ${WORKDIR}/locale.gen - ${@get_locale_gen(d)} - __EOF__ - cat<<-__EOF__ > ${WORKDIR}/locale.debconf - locales locales/locales_to_be_generated multiselect ${@get_dc_locale_gen(d)} - locales locales/default_environment_locale select ${LOCALE_DEFAULT} - __EOF__ - cat<<-__EOF__ > ${WORKDIR}/locale.default - LANG=${LOCALE_DEFAULT} - __EOF__ - cat<<-__EOF__ > ${WORKDIR}/locale.nopurge - #USE_DPKG - MANDELETE - DONTBOTHERNEWLOCALE - #SHOWFREEDSPACE - #QUICKNDIRTYCALC - #VERBOSE - ${@get_nopurge(d)} - __EOF__ -} -addtask gen_config after do_unpack before do_install - -do_install() { - install -v -d ${D}/usr/lib/${PN} - install -v -m 644 ${WORKDIR}/locale.debconf \ - ${D}/usr/lib/${PN}/locale.debconf - install -v -m 644 ${WORKDIR}/locale.gen \ - ${D}/usr/lib/${PN}/locale.gen - install -v -m 644 ${WORKDIR}/locale.default \ - ${D}/usr/lib/${PN}/locale.default - install -v -m 644 ${WORKDIR}/locale.nopurge \ - ${D}/usr/lib/${PN}/locale.nopurge -} diff --git a/meta/recipes-support/isar-cfg-rootpw/files/postinst.tmpl b/meta/recipes-support/isar-cfg-rootpw/files/postinst.tmpl deleted file mode 100644 index ca08a41..0000000 --- a/meta/recipes-support/isar-cfg-rootpw/files/postinst.tmpl +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -set -e - -if ! grep -q 'root:\*:' /etc/shadow; then - echo "ERROR:isar-cfg-rootpw: root password was set by a different package" >&2 - exit -1 -fi - -if [ -n '${CFG_ROOT_PW}' ]; then - echo 'root:${CFG_ROOT_PW}' | chpasswd -e -else - passwd -d root -fi - -if [ '${CFG_ROOT_LOCKED}' = "1" ]; then - # Lock the account after setting the password, since unlocking it at some - # point later would set it to the back to the previous one. - passwd -l root -fi diff --git a/meta/recipes-support/isar-cfg-rootpw/isar-cfg-rootpw.bb b/meta/recipes-support/isar-cfg-rootpw/isar-cfg-rootpw.bb deleted file mode 100644 index adee3b5..0000000 --- a/meta/recipes-support/isar-cfg-rootpw/isar-cfg-rootpw.bb +++ /dev/null @@ -1,19 +0,0 @@ -# This software is a part of ISAR. - -DESCRIPTION = "Isar configuration package for root password" -MAINTAINER = "isar-users " -DEBIAN_DEPENDS = "passwd" - -SRC_URI = "file://postinst.tmpl" - -TEMPLATE_FILES = "postinst.tmpl" -TEMPLATE_VARS = "CFG_ROOT_PW CFG_ROOT_LOCKED" - -CFG_ROOT_PW ??= "" -CFG_ROOT_LOCKED ??= "0" - -inherit dpkg-raw - -do_install() { - echo "intentionally left blank" -} -- 2.20.1