From: "Maxim Yu. Osipov" <mosipov@ilbers.de>
To: isar-users@googlegroups.com
Subject: [RFC PATCH 3/6] sdkchroot: Added recipe-devel to create SDK root filesystem
Date: Wed, 13 Jun 2018 15:58:26 +0200 [thread overview]
Message-ID: <20180613135829.3151-4-mosipov@ilbers.de> (raw)
In-Reply-To: <20180613135829.3151-1-mosipov@ilbers.de>
Building applications for targets in ISAR takes a lot of time as
they are built under QEMU. SDK providing crossbuild environment
will help to solve this problem.
Create SDK root file system for host with installed cross-toolchain for
target architecture and ability to install already prebuilt target binary
artifacts. Developer chroots to sdk rootfs and develops applications
for target platform.
Signed-off-by: Maxim Yu. Osipov <mosipov@ilbers.de>
---
.../sdkchroot/files/configscript.sh | 14 +++++
meta/recipes-devtools/sdkchroot/sdkchroot.bb | 59 ++++++++++++++++++++++
2 files changed, 73 insertions(+)
create mode 100644 meta/recipes-devtools/sdkchroot/files/configscript.sh
create mode 100644 meta/recipes-devtools/sdkchroot/sdkchroot.bb
diff --git a/meta/recipes-devtools/sdkchroot/files/configscript.sh b/meta/recipes-devtools/sdkchroot/files/configscript.sh
new file mode 100644
index 0000000..62c1cf0
--- /dev/null
+++ b/meta/recipes-devtools/sdkchroot/files/configscript.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# This software is a part of ISAR.
+# Copyright (C) 2015-2018 ilbers GmbH
+
+set -e
+
+debconf-set-selections <<END
+locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8
+locales locales/default_environment_locale select en_US.UTF-8
+END
+
+dpkg --add-architecture $1
+apt-get update --yes -o Debug::pkgProblemResolver=yes
diff --git a/meta/recipes-devtools/sdkchroot/sdkchroot.bb b/meta/recipes-devtools/sdkchroot/sdkchroot.bb
new file mode 100644
index 0000000..d884d80
--- /dev/null
+++ b/meta/recipes-devtools/sdkchroot/sdkchroot.bb
@@ -0,0 +1,59 @@
+# SDK Root filesystem
+#
+# This software is a part of ISAR.
+# Copyright (C) 2015-2018 ilbers GmbH
+
+DESCRIPTION = "Isar SDK Root filesystem"
+
+LICENSE = "gpl-2.0"
+LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
+
+FILESPATH_prepend := "${THISDIR}/files:"
+SRC_URI := "file://configscript.sh"
+PV = "1.0"
+
+inherit isar-bootstrap-helper
+
+def get_deb_host_arch():
+ import subprocess
+ arch = subprocess.check_output(['dpkg-architecture', '-q', 'DEB_HOST_ARCH'], universal_newlines=True)
+ return str.splitlines(arch)[0]
+
+#SDK Debian Distribution
+DISTRO_HOST ?= "debian-stretch"
+#Determine SDK host architecture if not explicitly set
+DISTRO_HOST_ARCH ?= "${@get_deb_host_arch()}"
+
+
+SDKCHROOT_PREINSTALL := "crossbuild-essential-${DISTRO_ARCH} \
+ debhelper \
+ autotools-dev \
+ dpkg \
+ locales \
+ docbook-to-man \
+ apt \
+ automake \
+ devscripts \
+ equivs"
+
+WORKDIR := "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
+SDKCHROOT_DIR := "${WORKDIR}/rootfs"
+
+do_build[stamp-extra-info] = "${DISTRO_HOST}-${DISTRO_HOST_ARCH}"
+do_build[root_cleandirs] = "${SDKCHROOT_DIR} \
+ ${SDKCHROOT_DIR}/isar-apt"
+
+do_build[depends] = "isar-apt:do_cache_config isar-bootstrap-host:do_deploy"
+
+do_build() {
+
+ if [ ${DISTRO_HOST} != "debian-stretch" ]; then
+ bbfatal "SDK doesn't support ${DISTRO_HOST}"
+ fi
+
+ setup_host_root_file_system --copyrepo "${SDKCHROOT_DIR}" ${SDKCHROOT_PREINSTALL}
+
+ # Configure root filesystem
+ sudo install -m 755 ${WORKDIR}/configscript.sh ${SDKCHROOT_DIR}
+ sudo chroot ${SDKCHROOT_DIR} /configscript.sh ${DISTRO_ARCH}
+}
--
2.11.0
next prev parent reply other threads:[~2018-06-13 13:58 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-13 13:58 [RFC PATCH 0/6] ISAR " Maxim Yu. Osipov
2018-06-13 13:58 ` [RFC PATCH 1/6] isar-bootstrap-helper: Add option --copyrepo to setup_root_file_system() Maxim Yu. Osipov
2018-06-14 8:51 ` Henning Schild
2018-06-13 13:58 ` [RFC PATCH 2/6] isar-debootstrap: split into host and target recipes Maxim Yu. Osipov
2018-06-14 8:59 ` Henning Schild
2018-06-13 13:58 ` Maxim Yu. Osipov [this message]
2018-06-14 9:19 ` [RFC PATCH 3/6] sdkchroot: Added recipe-devel to create SDK root filesystem Henning Schild
2018-06-14 10:46 ` Maxim Yu. Osipov
2018-06-14 11:07 ` Henning Schild
2018-06-13 13:58 ` [RFC PATCH 4/6] meta/class/image: Add do_isar task to trigger SDK rootfs creation Maxim Yu. Osipov
2018-06-14 9:23 ` Henning Schild
2018-06-14 11:49 ` Maxim Yu. Osipov
2018-06-18 9:56 ` Baurzhan Ismagulov
2018-06-13 13:58 ` [RFC PATCH 5/6] scripts: Add helper scripts to mount/umount chroot directory Maxim Yu. Osipov
2018-06-14 9:28 ` Henning Schild
2018-06-13 13:58 ` [RFC PATCH 6/6] doc: Add description of ISAR SDK root filesystem creation Maxim Yu. Osipov
2018-06-14 8:48 ` [RFC PATCH 0/6] ISAR SDK root filesystem Henning Schild
2018-06-14 8:51 ` Jan Kiszka
2018-06-14 9:34 ` Henning Schild
2018-06-14 9:46 ` Maxim Yu. Osipov
2018-06-18 7:08 ` Henning Schild
2018-06-19 7:33 ` Maxim Yu. Osipov
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=20180613135829.3151-4-mosipov@ilbers.de \
--to=mosipov@ilbers.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