From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6540161972303822848 X-Received: by 10.223.209.2 with SMTP id a2mr456809wri.32.1522750121573; Tue, 03 Apr 2018 03:08:41 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.111.152 with SMTP id c24ls565255wmi.11.canary-gmail; Tue, 03 Apr 2018 03:08:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx485b8UnuTCl/A1QtYol13dHSMVGVhB4SVENIeWfhtKNEBSxaQEWhAEgd7nsIwxS3uWFYibs X-Received: by 10.28.63.75 with SMTP id m72mr346947wma.27.1522750120964; Tue, 03 Apr 2018 03:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522750120; cv=none; d=google.com; s=arc-20160816; b=pp+ZJbErGADLTgSwTowucnEytOdqwr5psxZgwgPJNRKl2VafAtLfp2KIoszLm1Vgyv 1w2ZhXUBnO/47YYJ9Y5VUEIM2Lc2ICe5zFNSfRic14fk/kKflm6Vsf+MrLS/lZYWG8mS Cj30Woad79HE5eXJ0BmnV8DGRtVG3ceeytbcwMKuo09nTF7Xzjyt/72n59QjRLj8nryi v/jDn/H6vJTCoVYRo0rnkp/o6LMOSIz7gKC3KUlN1ty7K81stL4Z61HXJwJzsoMjh3wQ Ar/i1idUpAOq4b1AeXpdF2q4mlA2Ap3bIM2M4b0RiRTnXGqVU66CFY4j5Akf5nfnc7r8 HECQ== 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=/je/nBEgIeiu+KPEBc3JLJaD3YfGsgoEorknmB4POKU=; b=XhLQnbCfq+ODTBYvHnDVZplrBVipDfeoGItw8W3fQQzRJTECCmo4zRoQ7rSYk1tm4q 8VSjlbFVB1A7kFRABNZdFV+gAFhQfw7g4uOiIeFeLX3JHCO2koxJ1R8Aq82RzIyzqHYQ Av2Rupg5fYT4/SltnZgZv5PdCwsOTaELXr0+kjtS2J6pXHbIw3eaN+rBY+TZp4V9myr4 KnHwgIdLrtvedy9r3j5u6MRfzaDtPM5w3EH6Ex7ltebp+o4sxV5eirBvPfqx1GvlsaAu EiwjcWfrOsOftQ8YLrspH3PiWZk61wXltxQjtuRjOo2YslyZ4wEJs1lpTwKkHiX2vcEc ATDQ== 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 s130si4771wms.0.2018.04.03.03.08.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Apr 2018 03:08:40 -0700 (PDT) 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 w33A8eLU022670 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 3 Apr 2018 12:08:40 +0200 Received: from ring.ppmd.siemens.net (linux-ses-ext02.ppmd.siemens.net [139.25.69.226]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id w33A8eeQ025465; Tue, 3 Apr 2018 12:08:40 +0200 From: claudius.heine.ext@siemens.com To: isar-users@googlegroups.com Cc: Claudius Heine Subject: [PATCH v5 2/5] meta/isar-bootstrap-helper.bbclass: handle rfs customization centrally Date: Tue, 3 Apr 2018 12:07:59 +0200 Message-Id: <20180403100802.30710-3-claudius.heine.ext@siemens.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180403100802.30710-1-claudius.heine.ext@siemens.com> References: <20180403100802.30710-1-claudius.heine.ext@siemens.com> X-TUID: rXQMqWu0Fdwc 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.3