From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6569888326546882560 X-Received: by 2002:a1c:b4d4:: with SMTP id d203-v6mr164837wmf.14.1529671327711; Fri, 22 Jun 2018 05:42:07 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:e68b:: with SMTP id r11-v6ls3154373wrm.0.gmail; Fri, 22 Jun 2018 05:42:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdVGqe9eYCS0f2ilTVJ+L7UdjOepsMcxlp9znxFgJHSqpsReo2diedz4zbeGwHv5i+zW2my X-Received: by 2002:adf:f011:: with SMTP id j17-v6mr153354wro.31.1529671327280; Fri, 22 Jun 2018 05:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529671327; cv=none; d=google.com; s=arc-20160816; b=0OBGQyzHZGJYrPOm7mS7QBao39xTFDdpu58Nyrj27Ys7viRW9bChoGZZ73V/fyEduA /8q11vglW8v9PQ+3nSGF1Wwnl81Sxx1FJzTXc0xD+s0iuvcUWgedNZhHMZpAJCEYGdcc 6TOYyzb9setEEWDLAy/ip0TY79P2CYfsunYkMce6Hv5QKYHv/gZOXuLL80oUvjrm+HXJ eOKb/e/Sf3YSkqIYQymlod5CltcwD7W9EcXjXIvopP5/P3NAapk15WXROZPtLlfrzHN/ jLEOgxFO/s2sJE/89+ulflLEbzmvShOQAXj/RC+qgswzkZGhAx5AdwfkSBv7h8Iq5+Tm 9akw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:arc-authentication-results; bh=QUTigPvrnKXVGxdh2H9YzZf0iBCOvT8B+Jt6KmGOTBs=; b=q22Id2aKfQusNRZjrZ2dq27D343Nshq+f9wK9PTWOObdHwo0qjiFU42jFb9Qx5hAcO UpHLhp59JeBN+/I0mQailN9TnnC07FN51OlShGGkl9AH3kR5m7XKJTq5N004GN/PrQ+6 630GqjRDC0oU8rXDNABs/HtVDEmQpmTkjeyKJQd13Iimq2aLbfqe4/HIUu+uREo/dkS1 9F8aaZ6fNQg74BMX+P0efzLDNmGdkIdtGcpFMGRX8GxLZj/+TZPohKC6hQpMPkg8SMc2 jN5DmVS0UZdu5ICrpNbOZoHs+xDiwz2puw8Lkq4UvFpGkHLjYPM/UVK0fgo13QakdkC4 CzJg== 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 c18-v6si248913wrq.5.2018.06.22.05.42.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jun 2018 05:42:07 -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 w5MCeN8L030516 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 22 Jun 2018 14:42:06 +0200 From: "Maxim Yu. Osipov" To: isar-users@googlegroups.com Subject: [PATCH v2 0/7] Add ISAR SDK support Date: Fri, 22 Jun 2018 14:40:15 +0200 Message-Id: <20180622124022.30192-1-mosipov@ilbers.de> X-Mailer: git-send-email 2.11.0 X-TUID: MaVkOY6MeFtP 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 ). 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_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