From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6524973730788016128 X-Received: by 10.28.165.213 with SMTP id o204mr332440wme.17.1519305548048; Thu, 22 Feb 2018 05:19:08 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.223.139.138 with SMTP id o10ls1144378wra.1.gmail; Thu, 22 Feb 2018 05:19:07 -0800 (PST) X-Google-Smtp-Source: AH8x224xUM32+cfJIFBx87EMsXKWLejIr+aGofB2GmSI4opc2N6J7AG1Dj9nkBrQ5oHfR0xmHtKs X-Received: by 10.223.166.209 with SMTP id t75mr666288wrc.19.1519305547585; Thu, 22 Feb 2018 05:19:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519305547; cv=none; d=google.com; s=arc-20160816; b=YeG/oZ/7bMET4fhf2QPX5W4bcfulCw/HWVrtciuxi1IHmV1fZ6se5poJ2zDxAOqlE8 frtjClW9rMxnaoQnR/tD6UpP3Joes6q5PlmD3dXpGShPxPlctgf2rEsUpHp3wWHIzMks bgHaRzrkOsHpFj4w+HMUXBaHN2jlpCAOs6mI8+BDDKjl3aTPZNyqCQ02DNZ/65JJo8to 3lLBfurKzweWOua/B334UWrQOTKuMLIWhVnijQq5ae+bsuK3rgqLc5eoynTr6JpKGZaF akYot/KmuusogapFCEh/PGo6mpi7k3ZKQQSXJE0r1Paea4f8v8dwKWPuGpzWK41kUHBL teTw== 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=ZHKJpw8fWNa7fWu5WIdPtEpMm7KfKpRdTane40DdHISeJ5L4+GfaCvFt4YW13Ds+SA Zhe61YMxsApQUpJrQfKMmwTGpq7St1A3z18aGs5USklQwd4eGrligGFBtF+7SogJx4PC /Htnk7+8ZqMo5VJue3wW55JgOs7KtsqYbFKF2Ttwc15VJZTCVfqNk7rEA6R5RqXILoQU C0USL2hajtMX6kzol6y09nMCksqzk74G10Uz4T413xhgapnJmFAaPJgJCg8m8imyKy2E BDXn6E14gIw7TS0bOxwEHD37JD/Waet0g2U8N40y84EMfXmYHkRlVo+K2wteyZ8KaHOR YDQw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id g70si46105wmc.3.2018.02.22.05.19.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Feb 2018 05:19:07 -0800 (PST) Received-SPF: pass (google.com: domain of claudius.heine.ext@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 claudius.heine.ext@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id w1MDJ6Le017021 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Feb 2018 14:19:06 +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 w1MDJ6Tg022389; Thu, 22 Feb 2018 14:19:06 +0100 From: claudius.heine.ext@siemens.com To: isar-users@googlegroups.com Cc: Claudius Heine Subject: [PATCH v2 2/5] meta/isar-bootstrap-helper.bbclass: handle rfs customization centrally Date: Thu, 22 Feb 2018 14:18:58 +0100 Message-Id: <20180222131901.20915-3-claudius.heine.ext@siemens.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180222131901.20915-1-claudius.heine.ext@siemens.com> References: <20180222131901.20915-1-claudius.heine.ext@siemens.com> X-TUID: XY5ZBNQYOWpd 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