From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6566568349648551936 X-Received: by 2002:aa7:d486:: with SMTP id b6-v6mr1334579edr.7.1528898338155; Wed, 13 Jun 2018 06:58:58 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aa7:c247:: with SMTP id y7-v6ls1961440edo.2.gmail; Wed, 13 Jun 2018 06:58:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJkfToe5XAGAPDIu2KxSNSZLh7zH6wAhBT25McNy/XeczhC2FiYGzYiH1JZS2agwltlcCtw X-Received: by 2002:a50:e613:: with SMTP id y19-v6mr1350126edm.2.1528898337725; Wed, 13 Jun 2018 06:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528898337; cv=none; d=google.com; s=arc-20160816; b=A9GSjHAK6kWggvJJfvsw5K+RPraMlVQAlrmBJ9LcchMPAhdeCdl+R4TBYDy4cnWnS3 40OTOW64wlW9FAkoAHKD/rGNj8EEboRHz8vAdz9Dxby8ISEBun/QivFvoTGxB/a1bf0g V3jzi6mYDMxUWjrXuG3GaxGD7lKj8RnDO47JvruHZUjoTJ+Cjq1xb7kOVLHTw8ZauNCh ErPrRp96DhDgolyIz3JsHatVOztmE2p2afNUpWVej2NFvNnckUS8QX56WT7Lp7dsBpxa S5G9OWGkZ6i9ePa/l3th86Dfh+WQASo+5Rw2v24gWurkx3J559K4Y4xzqfRNolfMPFyJ +1AQ== 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:to:from :arc-authentication-results; bh=nuvmYeXqoyMuPi8XJ+r9Kbp4bshOvMkd0nEVh5EUp4w=; b=WXgH/RlbKuEpL7+uInEaTFyMy6cHkbkgAaK3UvgqpAs5BvdO14R955FoP4sjDp6NMt S53L0r3VEHTBkKvA3DC1Ej/mYNJr+1G+EUZab5KJARFm41vdYIHUgCpMuPD/QXA5YNTS j8O214qPvY0HnXa0fsJy3JvBUUELdyV0HnpiIGItLBU0ukZgZT2Q+OIo2ISaQ4EBgt34 iR6Kf7tbdVizHuIq9XpTSZ0i66NuEkdZSEelFC1xO0WZCcTYaWN1pw3swoDcmHRtQox6 JvccJ+pQ1ryaPpw7qbS/IZJWv7K+G81GmFXZwEFYuJaG2q3XpFc8l6aPY5OeU6+gszso 2uyA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=mosipov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id o16-v6si93647edr.2.2018.06.13.06.58.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 06:58:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=mosipov@ilbers.de Received: from azat.i.ilbers.de (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id w5DDwUeX030155 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Wed, 13 Jun 2018 15:58:56 +0200 From: "Maxim Yu. Osipov" To: isar-users@googlegroups.com Subject: [RFC PATCH 6/6] doc: Add description of ISAR SDK root filesystem creation Date: Wed, 13 Jun 2018 15:58:29 +0200 Message-Id: <20180613135829.3151-7-mosipov@ilbers.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180613135829.3151-1-mosipov@ilbers.de> References: <20180613135829.3151-1-mosipov@ilbers.de> X-TUID: JAFoo+4awYPS Signed-off-by: Maxim Yu. Osipov --- doc/user_manual.md | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/doc/user_manual.md b/doc/user_manual.md index 9921f3a..746708d 100644 --- a/doc/user_manual.md +++ b/doc/user_manual.md @@ -17,6 +17,7 @@ Copyright (C) 2016-2017, ilbers GmbH - [Add a New Image](https://github.com/ilbers/isar/blob/master/doc/user_manual.md#add-a-new-image) - [Add a New Image Type](https://github.com/ilbers/isar/blob/master/doc/user_manual.md#add-a-new-image-type) - [Add a Custom Application](https://github.com/ilbers/isar/blob/master/doc/user_manual.md#add-a-custom-application) + - [Create an ISAR SDK root filesystem](https://github.com/ilbers/isar/blob/master/doc/user_manual.md#create-an-isar-sdk-root-filesystem) ## Introduction @@ -320,6 +321,8 @@ Some other variables include: - `BB_NUMBER_THREADS` - The number of `bitbake` jobs that can be run in parallel. Please set this option according your host CPU cores number. - `LOCALE_GEN` - A `\n` seperated list of `/etc/locale.gen` entries desired on the target. - `LOCALE_DEFAULT` - The default locale used for the `LANG` and `LANGUAGE` variable in `/etc/locale`. + - `DISTRO_HOST` - The distro to use for SDK root filesystem (so far limited only to `debian-stretch`). This variable is optional. + - `DISTRO_HOST_ARCH` - The Debian architecture of SDK root filesystem (e.g., `amd64`). By default set to current Debian host architecture. This variable is optional. --- @@ -574,3 +577,90 @@ For the variables please have a look at the previous example, the following new - `DEBIAN_DEPENDS` - Debian packages that the package depends on Have a look at the `example-raw` recipe to get an idea how the `dpkg-raw` class can be used to customize your image. + +## Create an ISAR SDK root filesystem + +### 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_isar_sdk` for target image, f.e. +`bitbake -c do_isar_sdk multiconfig:${MACHINE}-${DISTRO}:isar-image-base`. + +The resulting SDK rootfs is located under `tmp/work/${DITSRO}-${DISTRO_ARCH}/sdkchroot/rootfs`. +SDK rootfs directory `/isar-apt` contains the copy of isar-apt repo with locally prebuilt target debian packages. +One may chroot to SDK and install required target packages with the help of `apt-get install :` 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_isar_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 mount_chroot.sh +#!/bin/bash +sudo mount /tmp $1/tmp -o bind +sudo mount proc $1/proc -t proc -o nosuid,noexec,nodev +sudo mount sysfs $1/sys -t sysfs -o nosuid,noexec,nodev +sudo mount devtmpfs $1/dev -t devtmpfs -o mode=0755,nosuid +sudo mount devpts $1/dev/pts -t devpts -o gid=5,mode=620 +sudo mount tmpfs $1/dev/shm -t tmpfs -o rw,seclabel,nosuid,nodev + +$ ./mount_chroot.sh ./build/tmp/work/debian-stretch-armhf/sdkchroot/rootfs +``` + + - chroot to isar SDK rootfs: + +``` +$ sudo chroot ./build/tmp/work/debian-stretch-armhf/sdkchroot/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 +~# +``` -- 2.11.0