From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6524973730788016128 X-Received: by 10.46.126.17 with SMTP id z17mr1576276ljc.33.1520441103910; Wed, 07 Mar 2018 08:45:03 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:ef12:: with SMTP id n18-v6ls255740lfh.7.gmail; Wed, 07 Mar 2018 08:45:03 -0800 (PST) X-Google-Smtp-Source: AG47ELsiS6zzYYqoWXTvWq29aR+fgbbPEeEQB0Zd5z169L2uqTTfJm/FoxuK3fOj9s//hHVbBlbl X-Received: by 10.25.18.157 with SMTP id 29mr1650548lfs.4.1520441103349; Wed, 07 Mar 2018 08:45:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520441103; cv=none; d=google.com; s=arc-20160816; b=S48hsQ63Q7tl1KLaZ3eHL9JrIIFUw72LUOkzWGYeyKk37LgbW8BtHuiQvvV49FvCkV 9aJhnseIAY+NLc2qj4rpa53Kg5qtv4gZ0flhlxfBmLDmEuV+XW2K3Hue/Yoam2Orbf/f ttJ5WET9SFQH7BQh/Bl05wdAVYWTHx//sFXsKUgWydp90yKW1SAJDikMCI+yuYM2OGUT 6JozQO0eu5hYpmxnnF3r7aLnQjBNGi4Rapns2fi1HlZeRSg47wR4OpX7i6mNiWCpXnkv MxVpuSNDK2J21cHHQ17yXGLFlkmQ7BR56q3BgyttZcVRKqxPYgYG3MBBuNCgqXEv6JoV dIhA== 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=Uah/08//6HENjbUjjJIT6RSoitlcYyI8QoR7FWvY9JC8KG8ZDwDWKGE7ZqXfFW2W2E PUPnzxWYUBjpFvr6rlDOzuGi9D65hF1eHrhWsljtcSpu8nbw7IZypy85EGeShrzJnf0r DasoZN8PeF4n+FXQrYjEtjpwCXRsZRjaA60LHIvo1NNuJE4xT6zL9r7I8VQRIJWqbtv5 lCEICg/uDYk/kny4/GRguKD8dQ9ciI73MdxU1Rd4FXv3LlwvphNUhSgs/T7SYsrgY8hR kFFKY6t+aTuD/g5dgnbuqdE8O0sPEvw/biFmhzMRM4WNsPirsb7MOxHPhr9W2Ocma6RT euJw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id v144si193552lfa.3.2018.03.07.08.45.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Mar 2018 08:45:03 -0800 (PST) Received-SPF: pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w27Gj2mT028052 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Mar 2018 17:45:02 +0100 Received: from ring.ppmd.siemens.net (linux-ses-ext02.ppmd.siemens.net [139.25.68.223]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id w27Gj1e9025573; Wed, 7 Mar 2018 17:45:01 +0100 From: claudius.heine.ext@siemens.com To: isar-users@googlegroups.com Cc: Claudius Heine Subject: [PATCH v4 2/5] meta/isar-bootstrap-helper.bbclass: handle rfs customization centrally Date: Wed, 7 Mar 2018 17:44:54 +0100 Message-Id: <20180307164457.31933-3-claudius.heine.ext@siemens.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180307164457.31933-1-claudius.heine.ext@siemens.com> References: <20180307164457.31933-1-claudius.heine.ext@siemens.com> X-TUID: jEVTcw+cSGOl 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