From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6524973730788016128 X-Received: by 10.46.127.7 with SMTP id a7mr204440ljd.38.1519418675893; Fri, 23 Feb 2018 12:44:35 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.126.11 with SMTP id z11ls156160ljc.7.gmail; Fri, 23 Feb 2018 12:44:35 -0800 (PST) X-Google-Smtp-Source: AG47ELvUv3ey//MSgbZrW+gS3tN+mB4nIzJu9S9ckb4VFidg7eG6+3xzogIqw2Z5ybXqkNQxQ7Qi X-Received: by 10.46.124.23 with SMTP id x23mr199992ljc.21.1519418675106; Fri, 23 Feb 2018 12:44:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519418675; cv=none; d=google.com; s=arc-20160816; b=wkU0aphWGHsvR/A4/OV3L0t1I6DG4bzDoMC2BKVpIsdcPqvvqqd/6bkT9sZBRjSR9k LWWJwHLwdolYxaMV0FsA5MyUGh1cA5Eq1r+LrRmEE0try8DMDYnrUt8fThcNXHNabDSW fyRnKwYqrmmPyvrwkcdC89BdaB1ue35vx4N1g6i37cw4KbqWeN1DbTgMsG92JsMFZEIV LOzKSg2nbPZyjxXMwBKVEv2oGAjr8WSPm0rr+WBi6xVhouPc3PgyD58pI73Bvw3WDxZC yoAeDUHwM5lrb17ExynmcwhP2JyrNTpkFb8E6GLGYvCiKD/KGvOPm99Vqu9fS/B8ANUo m/7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :arc-authentication-results; bh=94u92fvREFz6HDxgOOMyHaIqKdJGp46DzBOyUP6k1RE=; b=flnKw1Zqt0BTOrYjnpmzxND7NdmMF81K8NGe0dQGoH6fHNEnxsuyUwEExents6lSb9 YVswocjFP9Zp3hfbcZ4vk/Nsr524jiWkETad1+5lW3moGQVna4AmlKSfHe+SA3B+90lG UzYZc2aGMUGEzHi22FZaY4xf5ZdS94ZHI53rPzly5kSP11V3hg0Sc9arXN/cBkRzgQ1y ZN7tfGc1EzoZdcAgu6aemGkciIm9q2OQMqcigPQ6RwfhqCVG3Jk5+LQFMgmcfCNd2EQY 8R/63EE0cEulam6O9/LDSFlLjCxLV6wSp+Sn71ObiCkMZk7apkD8ovLHEAFZJkJJIkBh rvRw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id 7si73401ljw.5.2018.02.23.12.44.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 12:44:33 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id w1NKiWfg007897 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 Feb 2018 21:44:32 +0100 Received: from [139.25.68.37] (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w1NKiVtf014988; Fri, 23 Feb 2018 21:44:31 +0100 Subject: Re: [PATCH v2 3/5] meta/buildchroot: switch to using isar-bootstrap To: "[ext] claudius.heine.ext@siemens.com" , isar-users@googlegroups.com Cc: Claudius Heine References: <20180222131901.20915-1-claudius.heine.ext@siemens.com> <20180222131901.20915-4-claudius.heine.ext@siemens.com> From: Jan Kiszka Message-ID: Date: Fri, 23 Feb 2018 21:44:30 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <20180222131901.20915-4-claudius.heine.ext@siemens.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: jqtpoLI1X3TE On 2018-02-22 14:18, [ext] claudius.heine.ext@siemens.com wrote: > From: Claudius Heine > > This patch removes the multistrap dependency of the buildchroot recipe > and changes it to use the 'isar-bootstrap' and 'isar-bootstrap-helper' > instead. > > Signed-off-by: Claudius Heine > --- > meta/recipes-devtools/buildchroot/buildchroot.bb | 54 ++++---------- > meta/recipes-devtools/buildchroot/files/build.sh | 2 +- > .../buildchroot/files/configscript.sh | 10 --- > .../buildchroot/files/multistrap.conf.in | 37 ---------- > meta/recipes-devtools/buildchroot/files/setup.sh | 82 ---------------------- > 5 files changed, 13 insertions(+), 172 deletions(-) > delete mode 100644 meta/recipes-devtools/buildchroot/files/multistrap.conf.in > delete mode 100755 meta/recipes-devtools/buildchroot/files/setup.sh > > diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb b/meta/recipes-devtools/buildchroot/buildchroot.bb > index 520daf9..809bc11 100644 > --- a/meta/recipes-devtools/buildchroot/buildchroot.bb > +++ b/meta/recipes-devtools/buildchroot/buildchroot.bb > @@ -8,13 +8,13 @@ DESCRIPTION = "Multistrap development filesystem" > LICENSE = "gpl-2.0" > LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe" > > -FILESPATH =. "${LAYERDIR_core}/recipes-devtools/buildchroot/files:" > -SRC_URI = "file://multistrap.conf.in \ > - file://configscript.sh \ > - file://setup.sh \ > +FILESPATH_prepend := "${THISDIR}/files:" > +SRC_URI = "file://configscript.sh \ > file://build.sh" > PV = "1.0" > > +inherit isar-bootstrap-helper > + > BUILDCHROOT_PREINSTALL ?= "gcc \ > make \ > build-essential \ > @@ -31,50 +31,20 @@ BUILDCHROOT_PREINSTALL ?= "gcc \ > WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}" > > do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" > -do_build[depends] = "isar-apt:do_cache_config" > +do_build[cleandirs] = "${BUILDCHROOT_DIR} \ > + ${BUILDCHROOT_DIR}/isar-apt \ > + ${BUILDCHROOT_DIR}/downloads \ > + ${BUILDCHROOT_DIR}/home/builder" We still have massive issues with cleaning root-owned build artifacts. So these cleandirs do not work on rebuilds. That's why there are all the mkdirs below, rather than a short statement like above. Either we fix this generically, somehow, or we need to stick with those explicit "sudo rm" / "sudo chown" at the task beginning. Jan > +do_build[depends] = "isar-apt:do_cache_config isar-bootstrap:do_deploy" > > do_build() { > - E="${@ bb.utils.export_proxies(d)}" > - > - # If buildchroot re-build is triggered, this ensure that we are always > - # re-building a clean image: > - sudo rm -rf ${BUILDCHROOT_DIR} > - mkdir -p ${BUILDCHROOT_DIR}/isar-apt > - mkdir -p ${BUILDCHROOT_DIR}/downloads > - mkdir -p ${BUILDCHROOT_DIR}/dev > - mkdir -p ${BUILDCHROOT_DIR}/proc > - mkdir -p ${BUILDCHROOT_DIR}/sys > - > - chmod +x "${WORKDIR}/setup.sh" > - chmod +x "${WORKDIR}/configscript.sh" > - > - # Multistrap accepts only relative path in configuration files, so get it: > - cd ${TOPDIR} > - WORKDIR_REL=${@ os.path.relpath(d.getVar("WORKDIR", True))} > - > - # Adjust multistrap config > - sed -e 's|##BUILDCHROOT_PREINSTALL##|${BUILDCHROOT_PREINSTALL}|g' \ > - -e 's|##DISTRO_MULTICONF_BOOTSTRAP##|${DISTRO_MULTICONF_BOOTSTRAP}|g' \ > - -e 's|##DISTRO_MULTICONF_APTSOURCES##|${DISTRO_MULTICONF_APTSOURCES}|g' \ > - -e 's|##DISTRO_APT_SOURCE##|${DISTRO_APT_SOURCE}|g' \ > - -e 's|##DISTRO_APT_SOURCE_SEC##|${DISTRO_APT_SOURCE_SEC}|g' \ > - -e 's|##DISTRO_SUITE##|${DISTRO_SUITE}|g' \ > - -e 's|##DISTRO_COMPONENTS##|${DISTRO_COMPONENTS}|g' \ > - -e 's|##CONFIG_SCRIPT##|./'"$WORKDIR_REL"'/configscript.sh|g' \ > - -e 's|##SETUP_SCRIPT##|./'"$WORKDIR_REL"'/setup.sh|g' \ > - -e 's|##DIR_HOOKS##|./'"$WORKDIR_REL"'/hooks_multistrap|g' \ > - "${WORKDIR}/multistrap.conf.in" > "${WORKDIR}/multistrap.conf" > - > - sudo mount --bind ${DEPLOY_DIR_APT}/${DISTRO} ${BUILDCHROOT_DIR}/isar-apt > - sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs ${BUILDCHROOT_DIR}/dev > - sudo mount -t proc none ${BUILDCHROOT_DIR}/proc > - > - # Create root filesystem > - sudo -E multistrap -a ${DISTRO_ARCH} -d "${BUILDCHROOT_DIR}" -f "${WORKDIR}/multistrap.conf" > + setup_root_file_system "${BUILDCHROOT_DIR}" ${BUILDCHROOT_PREINSTALL} > > # Install package builder script > + sudo chmod -R a+rw "${BUILDCHROOT_DIR}/home/builder" > sudo install -m 755 ${WORKDIR}/build.sh ${BUILDCHROOT_DIR} > > # Configure root filesystem > + sudo install -m 755 ${WORKDIR}/configscript.sh ${BUILDCHROOT_DIR} > sudo chroot ${BUILDCHROOT_DIR} /configscript.sh > } > diff --git a/meta/recipes-devtools/buildchroot/files/build.sh b/meta/recipes-devtools/buildchroot/files/build.sh > index 048f76f..06172f7 100644 > --- a/meta/recipes-devtools/buildchroot/files/build.sh > +++ b/meta/recipes-devtools/buildchroot/files/build.sh > @@ -29,7 +29,7 @@ install_cmd="${install_cmd} --allow-unauthenticated" > # APT::Get::List-Cleanup - do not erase obsolete packages list for > # upstream in '/var/lib/apt/lists' > apt-get update \ > - -o Dir::Etc::sourcelist="sources.list.d/multistrap-isar-apt.list" \ > + -o Dir::Etc::sourcelist="sources.list.d/isar-apt.list" \ > -o Dir::Etc::sourceparts="-" \ > -o APT::Get::List-Cleanup="0" > > diff --git a/meta/recipes-devtools/buildchroot/files/configscript.sh b/meta/recipes-devtools/buildchroot/files/configscript.sh > index a5942b5..c2a599a 100644 > --- a/meta/recipes-devtools/buildchroot/files/configscript.sh > +++ b/meta/recipes-devtools/buildchroot/files/configscript.sh > @@ -31,13 +31,3 @@ debconf-set-selections < locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8 > locales locales/default_environment_locale select en_US.UTF-8 > END > - > -#set up non-interactive configuration > -export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true > -export LC_ALL=C LANGUAGE=C LANG=C > - > -#run pre installation script > -/var/lib/dpkg/info/dash.preinst install > - > -#configuring packages > -dpkg --configure -a > diff --git a/meta/recipes-devtools/buildchroot/files/multistrap.conf.in b/meta/recipes-devtools/buildchroot/files/multistrap.conf.in > deleted file mode 100644 > index 480a4b8..0000000 > --- a/meta/recipes-devtools/buildchroot/files/multistrap.conf.in > +++ /dev/null > @@ -1,37 +0,0 @@ > -# This software is a part of ISAR. > -# Copyright (C) 2015-2017 ilbers GmbH > - > -[General] > -noauth=true > -unpack=true > -ignorenativearch=true > -bootstrap=##DISTRO_MULTICONF_BOOTSTRAP## > -aptsources=isar-apt ##DISTRO_MULTICONF_APTSOURCES## > -configscript=##CONFIG_SCRIPT## > -setupscript=##SETUP_SCRIPT## > -hookdir=##DIR_HOOKS## > - > -[base] > -source=##DISTRO_APT_SOURCE## > -suite=##DISTRO_SUITE## > -components=##DISTRO_COMPONENTS## > -packages=##BUILDCHROOT_PREINSTALL## > -omitdebsrc=true > - > -[updates] > -source=##DISTRO_APT_SOURCE## > -suite=##DISTRO_SUITE##-updates > -components=##DISTRO_COMPONENTS## > -omitdebsrc=true > - > -[security] > -source=##DISTRO_APT_SOURCE_SEC## > -suite=##DISTRO_SUITE##/updates > -components=##DISTRO_COMPONENTS## > -omitdebsrc=true > - > -[isar-apt] > -source=file:///isar-apt > -suite=isar > -components=main > -omitdebsrc=true > diff --git a/meta/recipes-devtools/buildchroot/files/setup.sh b/meta/recipes-devtools/buildchroot/files/setup.sh > deleted file mode 100755 > index 1257739..0000000 > --- a/meta/recipes-devtools/buildchroot/files/setup.sh > +++ /dev/null > @@ -1,82 +0,0 @@ > -#!/bin/sh > -# > -# This software is a part of ISAR. > -# Copyright (C) 2015-2016 ilbers GmbH > -# > -# Based on multistrap/examples/chroot.sh > - > -set -e > - > -# The script is called with the following arguments: > -# $1 = $DIR - the top directory of the bootstrapped system > -# $2 = $ARCH - the specified architecture, already checked with > -# dpkg-architecture. > -# setup.sh needs to be executable. > - > -TARGET=$1 > -ARCH=$2 > - > -# Prevent daemons from starting in buildchroot > -if [ -x "$TARGET/sbin/start-stop-daemon" ]; then > - echo "initctl: Trying to prevent daemons from starting in $TARGET" > - > - # Disable start-stop-daemon > - mv $TARGET/sbin/start-stop-daemon $TARGET/sbin/start-stop-daemon.REAL > - cat > $TARGET/sbin/start-stop-daemon << EOF > -#!/bin/sh > -echo > -echo Warning: Fake start-stop-daemon called, doing nothing > -EOF > - chmod 755 $TARGET/sbin/start-stop-daemon > -fi > - > -if [ -x "$TARGET/sbin/initctl" ]; then > - echo "start-stop-daemon: Trying to prevent daemons from starting in $TARGET" > - > - # Disable initctl > - mv "$TARGET/sbin/initctl" "$TARGET/sbin/initctl.REAL" > - cat > $TARGET/sbin/initctl << EOF > -#!/bin/sh > -echo > -echo "Warning: Fake initctl called, doing nothing" > -EOF > - chmod 755 $TARGET/sbin/initctl > -fi > - > -# Define sysvinit policy 101 to prevent daemons from starting in buildchroot > -if [ -x "$TARGET/sbin/init" -a ! -f "$TARGET/usr/sbin/policy-rc.d" ]; then > - echo "sysvinit: Using policy-rc.d to prevent daemons from starting in $TARGET" > - > - cat > $TARGET/usr/sbin/policy-rc.d << EOF > -#!/bin/sh > -echo "sysvinit: All runlevel operations denied by policy" >&2 > -exit 101 > -EOF > - chmod a+x $TARGET/usr/sbin/policy-rc.d > -fi > - > -case $ARCH in > - armel|armhf) > - qemu_arch=arm > - ;; > - arm64) > - qemu_arch=aarch64 > - ;; > -esac > - > -# Install QEMU emulator to execute foreign binaries > -if [ ! -x /usr/bin/qemu-${qemu_arch}-static ]; then > - echo "qemu-${qemu_arch}-static binary not present, unable to execute target binaries" > -else > - sudo cp /usr/bin/qemu-${qemu_arch}-static ${TARGET}/usr/bin > -fi > - > -# Set hostname > -echo "isar" > $TARGET/etc/hostname > - > -# Create packages build folder > -sudo install -d $TARGET/home/builder > -sudo chmod -R a+rw $TARGET/home/builder > - > -# Install host networking settings > -sudo cp /etc/resolv.conf $TARGET/etc > -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux