From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6524973730788016128 X-Received: by 10.28.8.21 with SMTP id 21mr1967815wmi.0.1520439402676; Wed, 07 Mar 2018 08:16:42 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.193.69 with SMTP id r66ls505872wmf.10.gmail; Wed, 07 Mar 2018 08:16:42 -0800 (PST) X-Google-Smtp-Source: AG47ELsHasPin+wDYuoV9sgWV3q5PuxAL4h9oVWa5YCyZ82corSfkOgKwxGziXGKLst+MHUSIk6r X-Received: by 10.28.227.5 with SMTP id a5mr1813407wmh.7.1520439402209; Wed, 07 Mar 2018 08:16:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520439402; cv=none; d=google.com; s=arc-20160816; b=rhbbunQAVHXDdZxBFg1beW5ekiOMdAA2f7lATeTbznItHkQ14fWwC19RNQGVThcGSC e8vYbrkaN+XFrpNLVtMa8a+3qADFAXW/+U67wuwnHaTHSWilHttu5C80Rt4N6MZfGojy bGDNhKC4FQY+RbV+sHdHQTcv/nLoWPFWnL27UVyXTKYGw1+OiscG5mrBdIT004iaFKDP DODQARM0jC6m4/H+KG1AhhZFeK3eX5a6Ofc4dqXyGmVU+ukUuyjZ/TmkWZyCvdZgQZJt uOA3z+/GtsGn0CJCLPBiUStkhNy0NFydljTtB5O5sEAjB5RlcWiUXiyJj6ql/Ko+UgpL vm3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ngYoJJwv6vXo388T/b2svQQn8tkVbjjRLGknmMSfxgk=; b=h0ZcggiAiuW0ehXFz0ZZeMZxqDnLw9VYe2I/PitfJdJb1T8Ux1OqjnLODmAE99QUyv h9RtO2rWrqGz2snyqyArJ9mMs50EtxUDnJOQqsUF/4GV9S5M2qYnbGR05caO1EVtcQ/y 9ir3VeYkQtwucxnE6wDwtv99Y4bJ8JmWlUjJikV4/vpOGOFvLJUJepjCfp4OAoT+9CkL os2zR4XGBBZRrZfq6KxUtHV7r4qZ5B+Z1VIuz5MGVJGyvwwMaKIvkXcIq0/QRCtE0ySu 5QQ6BrZZzXEb/r3q0zUvC16Q7iRmDFhLnYqmU8d0g0XTnpXQ6IANP1VqTWun1XqhkYAT iVIA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Return-Path: Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id a139si394993wma.4.2018.03.07.08.16.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Mar 2018 08:16:42 -0800 (PST) Received-SPF: pass (google.com: domain of claudius.heine.ext@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id w27GGfmV025855 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Mar 2018 17:16:41 +0100 Received: from ring.ppmd.siemens.net (linux-ses-ext02.ppmd.siemens.net [139.25.68.223]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id w27GGfLT003137; Wed, 7 Mar 2018 17:16:41 +0100 From: claudius.heine.ext@siemens.com To: isar-users@googlegroups.com Cc: Claudius Heine Subject: [PATCH v3 2/5] meta/isar-bootstrap-helper.bbclass: handle rfs customization centrally Date: Wed, 7 Mar 2018 17:16:32 +0100 Message-Id: <20180307161635.30952-3-claudius.heine.ext@siemens.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180307161635.30952-1-claudius.heine.ext@siemens.com> References: <20180307161635.30952-1-claudius.heine.ext@siemens.com> X-TUID: 96HVHDdbomlX From: Claudius Heine This patch introduces the 'isar-bootstrap-helper' bitbake class to support recipes that use the basic root file system created by isar-bootstrap. In this patch the function 'setup_root_file_system' is defined that allows to copy the root file system to the directory specified in the first parameter and installs additional packages specified by the next parameters. It also adds the local 'isar-apt' repo to the apt configuration and fetches its index. Signed-off-by: Claudius Heine --- meta/classes/isar-bootstrap-helper.bbclass | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 meta/classes/isar-bootstrap-helper.bbclass diff --git a/meta/classes/isar-bootstrap-helper.bbclass b/meta/classes/isar-bootstrap-helper.bbclass new file mode 100644 index 0000000..a06116d --- /dev/null +++ b/meta/classes/isar-bootstrap-helper.bbclass @@ -0,0 +1,39 @@ +# Helper functions for using isar-bootstrap +# +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2018 +# +# SPDX-License-Identifier: MIT + +setup_root_file_system() { + ROOTFSDIR="$1" + shift + PACKAGES="$@" + + sudo cp -Trpfx \ + "${DEPLOY_DIR_IMAGE}/isar-bootstrap-${DISTRO}-${DISTRO_ARCH}/" \ + "$ROOTFSDIR" + + echo "deb file:///isar-apt ${DEBDISTRONAME} main" | \ + sudo tee "$ROOTFSDIR/etc/apt/sources.list.d/isar-apt.list" >/dev/null + + echo "Package: *\nPin: release n=${DEBDISTRONAME}\nPin-Priority: 1000" | \ + sudo tee "$ROOTFSDIR/etc/apt/preferences.d/isar" >/dev/null + + sudo mount --bind ${DEPLOY_DIR_APT}/${DISTRO} $ROOTFSDIR/isar-apt + sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs $ROOTFSDIR/dev + sudo mount -t proc none $ROOTFSDIR/proc + + # Install packages: + E="${@ bb.utils.export_proxies(d)}" + export DEBIAN_FRONTEND=noninteractive + sudo -E chroot "$ROOTFSDIR" /usr/bin/apt-get update \ + -o Dir::Etc::sourcelist="sources.list.d/isar-apt.list" \ + -o Dir::Etc::sourceparts="-" \ + -o APT::Get::List-Cleanup="0" + sudo -E chroot "$ROOTFSDIR" \ + /usr/bin/apt-get install -y \ + --allow-unauthenticated \ + -o Debug::pkgProblemResolver=yes \ + $PACKAGES +} -- 2.16.1