public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Maxim Yu. Osipov" <mosipov@ilbers.de>
To: isar-users@googlegroups.com
Subject: [PATCH v2 0/7] Add ISAR SDK support
Date: Fri, 22 Jun 2018 14:40:15 +0200	[thread overview]
Message-ID: <20180622124022.30192-1-mosipov@ilbers.de> (raw)

Hello everybody,

Changes in v2:
 - Patches corrected after review
 - Improved isar-bootstrap separation into host and target parts. 
 - Renamed 'do_isar_task' to 'do_populate_sdk' to harmonize with Deby

Motivation

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.

Approach

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.

Solution

User manually triggers creation of SDK root filesystem for his target platform by launching the task `do_populate_sdk` for target image, f.e.
`bitbake -c do_populate_sdk multiconfig:${MACHINE}-${DISTRO}:isar-image-base`.

The resulting SDK rootfs is located under `tmp/work/${DISTRO}-${DISTRO_ARCH}/sdkchroot-${HOST_DISTRO}-${HOST_ARCH}/rootfs`.
SDK rootfs directory `/isar-apt` contains the copy of isar-apt repo with locally prebuilt target debian packages (for <HOST_DISTRO>).
One may chroot to SDK and install required target packages with the help of `apt-get install <package_name>:<DISTRO_ARCH>` command.

Limitation

Only Debian Stretch for SDK root filesystem is supported as only Stretch provides crossbuild environment by default.
(Debian Jessie requires some additional preconfiguration steps see https://wiki.debian.org/CrossToolchains#Installation for details).

Example

 - Trigger creation of SDK root filesystem

bitbake -c do_populate_sdk multiconfig:qemuarm-stretch:isar-image-base

 - Mount the following directories in chroot by passing resulting rootfs as an argument to the script `mount_chroot.sh`:

cat scripts/mount_chroot.sh
#!/bin/sh

set -e

mount /tmp     $1/tmp                 -o bind
mount proc     $1/proc    -t proc     -o nosuid,noexec,nodev
mount sysfs    $1/sys     -t sysfs    -o nosuid,noexec,nodev
mount devtmpfs $1/dev     -t devtmpfs -o mode=0755,nosuid
mount devpts   $1/dev/pts -t devpts   -o gid=5,mode=620
mount tmpfs    $1/dev/shm -t tmpfs    -o rw,seclabel,nosuid,nodev

$ sudo scripts/mount_chroot.sh ../build/tmp/work/debian-stretch-armhf/sdkchroot-debian-stretch-amd64/rootfs

 - chroot to isar SDK rootfs:

$ sudo chroot ../build/tmp/work/debian-stretch-armhf/sdkchroot-debian-stretch-amd64/rootfs

 - Check that cross toolchains are installed


:~# dpkg -l | grep crossbuild-essential-armhf
ii  crossbuild-essential-armhf           12.3                   all          Informational list of cross-build-essential packages


 - Install needed prebuilt target packages.


:~# apt-get install libhello-dev:armhf


 - Check the contents of the installed target package

:~# dpkg -L libhello-dev
/.
/usr
/usr/include
/usr/include/hello.h
/usr/lib
/usr/lib/arm-linux-gnueabihf
/usr/lib/arm-linux-gnueabihf/libhello.a
/usr/lib/arm-linux-gnueabihf/libhello.la
/usr/share
/usr/share/doc
/usr/share/doc/libhello-dev
/usr/share/doc/libhello-dev/changelog.gz
/usr/share/doc/libhello-dev/copyright
~#

Kind regards,
Maxim.



Alexander Smirnov (2):
  isar-bootstrap: Move common part to include.
  isar-bootstrap: Add host architecture support

Maxim Yu. Osipov (5):
  isar-bootstrap-helper: Add option --copyisarapt to
    setup_root_file_system()
  sdkchroot: Added recipe-devel to create SDK root filesystem
  meta/class/image: Add populate_sdk task to trigger SDK rootfs creation
  scripts: Add helper scripts to mount/umount chroot directory
  doc: Add description of ISAR SDK root filesystem creation

 doc/user_manual.md                                 | 95 ++++++++++++++++++++++
 meta/classes/image.bbclass                         | 17 +++-
 meta/classes/isar-bootstrap-helper.bbclass         | 27 +++++-
 .../isar-bootstrap/isar-bootstrap-host.bb          | 75 +++++++++++++++++
 .../isar-bootstrap/isar-bootstrap-target.bb        | 74 +++++++++++++++++
 .../{isar-bootstrap.bb => isar-bootstrap.inc}      | 83 +++----------------
 meta/recipes-devtools/buildchroot/buildchroot.bb   |  2 +-
 meta/recipes-devtools/isar-apt/isar-apt-host.bb    | 31 +++++++
 .../sdkchroot/files/configscript.sh                | 14 ++++
 meta/recipes-devtools/sdkchroot/sdkchroot.bb       | 47 +++++++++++
 scripts/mount_chroot.sh                            | 10 +++
 scripts/umount_chroot.sh                           |  8 ++
 12 files changed, 408 insertions(+), 75 deletions(-)
 create mode 100644 meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb
 create mode 100644 meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb
 rename meta/recipes-core/isar-bootstrap/{isar-bootstrap.bb => isar-bootstrap.inc} (68%)
 create mode 100644 meta/recipes-devtools/isar-apt/isar-apt-host.bb
 create mode 100644 meta/recipes-devtools/sdkchroot/files/configscript.sh
 create mode 100644 meta/recipes-devtools/sdkchroot/sdkchroot.bb
 create mode 100755 scripts/mount_chroot.sh
 create mode 100755 scripts/umount_chroot.sh

-- 
2.11.0


             reply	other threads:[~2018-06-22 12:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-22 12:40 Maxim Yu. Osipov [this message]
2018-06-22 12:40 ` [PATCH v2 1/7] isar-bootstrap: Move common part to include Maxim Yu. Osipov
2018-06-22 12:40 ` [PATCH v2 2/7] isar-bootstrap: Add host architecture support Maxim Yu. Osipov
2018-06-22 12:40 ` [PATCH v2 3/7] isar-bootstrap-helper: Add option --copyisarapt to setup_root_file_system() Maxim Yu. Osipov
2018-06-22 12:40 ` [PATCH v2 4/7] sdkchroot: Added recipe-devel to create SDK root filesystem Maxim Yu. Osipov
2018-06-22 12:40 ` [PATCH v2 5/7] meta/class/image: Add populate_sdk task to trigger SDK rootfs creation Maxim Yu. Osipov
2018-06-22 12:40 ` [PATCH v2 6/7] scripts: Add helper scripts to mount/umount chroot directory Maxim Yu. Osipov
2018-06-22 12:40 ` [PATCH v2 7/7] doc: Add description of ISAR SDK root filesystem creation Maxim Yu. Osipov
2018-06-29 12:57 ` [PATCH v2 0/7] Add ISAR SDK support 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=20180622124022.30192-1-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