From: claudius.heine.ext@siemens.com
To: isar-users@googlegroups.com
Cc: Claudius Heine <ch@denx.de>
Subject: [PATCH v5 2/5] meta/isar-bootstrap-helper.bbclass: handle rfs customization centrally
Date: Tue, 3 Apr 2018 12:07:59 +0200 [thread overview]
Message-ID: <20180403100802.30710-3-claudius.heine.ext@siemens.com> (raw)
In-Reply-To: <20180403100802.30710-1-claudius.heine.ext@siemens.com>
From: Claudius Heine <ch@denx.de>
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 <ch@denx.de>
---
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
next prev parent reply other threads:[~2018-04-03 10:08 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-03 10:07 [PATCH v5 0/5] Debootstrap integration claudius.heine.ext
2018-04-03 10:07 ` [PATCH v5 1/5] implement isar-bootstrap using debootstrap claudius.heine.ext
2018-04-03 10:07 ` claudius.heine.ext [this message]
2018-04-03 10:08 ` [PATCH v5 3/5] meta/buildchroot: switch to using isar-bootstrap claudius.heine.ext
2018-04-03 10:08 ` [PATCH v5 4/5] meta-isar/isar-image-base: " claudius.heine.ext
2018-04-03 10:08 ` [PATCH v5 5/5] meta-isar/multiconfig: remove multistrap references claudius.heine.ext
2018-04-04 20:34 ` [PATCH v5 0/5] Debootstrap integration Baurzhan Ismagulov
2018-04-05 8:03 ` Claudius Heine
2018-04-05 9:16 ` Jan Kiszka
2018-04-11 6:28 ` Baurzhan Ismagulov
2018-04-11 6:58 ` Jan Kiszka
2018-04-11 7:04 ` Claudius Heine
2018-04-09 10:50 ` Jan Kiszka
2018-04-09 12:48 ` Baurzhan Ismagulov
2018-04-09 14:47 ` Jan Kiszka
2018-04-10 11:38 ` Claudius Heine
2018-04-10 20:49 ` Baurzhan Ismagulov
2018-04-11 5:59 ` Baurzhan Ismagulov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180403100802.30710-3-claudius.heine.ext@siemens.com \
--to=claudius.heine.ext@siemens.com \
--cc=ch@denx.de \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox