From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6524973730788016128 X-Received: by 10.46.89.156 with SMTP id g28mr131989ljf.32.1519213834178; Wed, 21 Feb 2018 03:50:34 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.23.194 with SMTP id 63ls118799ljx.8.gmail; Wed, 21 Feb 2018 03:50:33 -0800 (PST) X-Google-Smtp-Source: AH8x227kgxrcz8SoMIQx1Ku60OFo1Yd8GlRo1UDOiUwaJCXewBhGMXZgdzgN22Wj2lQ+GNiFhG1V X-Received: by 10.46.53.4 with SMTP id z4mr29357ljz.22.1519213833696; Wed, 21 Feb 2018 03:50:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519213833; cv=none; d=google.com; s=arc-20160816; b=f9QwKHF1c4cQU7Ni9tlwWQKpOY0oR1cAmdgUh/XriG9+cwOd6PvrXSVCjN7/c7K6Hn rDdpc9/xQMNwVnIZjhvd+GueN98W7gXMQs6O5/pY116p9YrEye+Y8mMKivWOMnTfGUil w9lL2rE2fB9tlWlYcddNVIzMxZJuMr6ek/mC4dbQgwCa/5FCWFrVgFyjUagd5jkKn9A2 KJ8f8RWsZv+mQzTUjooovniSTgqwaqCqOU/2r9hPlFVISK/mPpStLqeyrSwdzLaDJa2K 6Fh030lF3box27gnDSHe1/0Lb2fw0rjaGKXEbCTiJBcHiRxFFgGoDvMhFOiTAqdZzxyT ZxAQ== 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=CxbS3FlhEhccsGXt45Td+1UzPIfhtgrHGr8XCuSl0yo=; b=W11+5Lgz1de5Vs4V9DZ0MYJwYyVzl1aPdWByt0sjfLCjYj1TZBmRM8s65NOeCfI3mR 4Fy0bpksCIv0bh/e8Z92ACotEbWHYEHzytgnxxXrv1wq92rina6OUplmQZiKhug/cV9c yuW9plbGq80cMy5HKvfQpAY1W20ylPfHKjsrNE5gtf9ZizzP6hARj4+sVUsqPD89zlTL N5Izq9qc8GLUcyLpjmpXyxXzfR8WN+48MGkaENzmkGmNDnf+6bzzDQxnBlVFWXM5BN5J j+QUIaFAa4hTeGAQfKDBgCdJrEh1sk4YxXbo8aQz1c2kvAxPHd41nRgu51fbpt5TR4pE 4FSA== 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 25si572611ljt.1.2018.02.21.03.50.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 03:50:33 -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 w1LBoWeB011462 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 21 Feb 2018 12:50:32 +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 w1LBoWNt020019; Wed, 21 Feb 2018 12:50:32 +0100 From: claudius.heine.ext@siemens.com To: isar-users@googlegroups.com Cc: Claudius Heine Subject: [PATCH 2/5] meta/isar-bootstrap-helper.bbclass: handle rfs customization centrally Date: Wed, 21 Feb 2018 12:50:00 +0100 Message-Id: <20180221115003.11163-3-claudius.heine.ext@siemens.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180221115003.11163-1-claudius.heine.ext@siemens.com> References: <20180221115003.11163-1-claudius.heine.ext@siemens.com> X-TUID: VhH6HBCT/RYb 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 | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 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..49c81c1 --- /dev/null +++ b/meta/classes/isar-bootstrap-helper.bbclass @@ -0,0 +1,36 @@ +# 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() { + RFSDIR="$1" + shift + PACKAGES="$@" + + sudo cp -Trpfx \ + "${DEPLOY_DIR_IMAGE}/isar-bootstrap-${DISTRO}-${DISTRO_ARCH}/" \ + "$RFSDIR" + + echo "deb file:///isar-apt ${DEBDISTRONAME} main" | \ + sudo tee "$RFSDIR/etc/apt/sources.list.d/isar-apt.list" >/dev/null + + sudo mount --bind ${DEPLOY_DIR_APT}/${DISTRO} $RFSDIR/isar-apt + sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs $RFSDIR/dev + sudo mount -t proc none $RFSDIR/proc + + # Install packages: + E="${@ bb.utils.export_proxies(d)}" + sudo -E chroot "$RFSDIR" /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 "$RFSDIR" \ + /usr/bin/apt-get install -y \ + --allow-unauthenticated \ + --no-install-recommends \ + -o Debug::pkgProblemResolver=yes \ + $PACKAGES +} -- 2.16.1