From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6566568349648551936 X-Received: by 2002:a2e:380a:: with SMTP id f10-v6mr284676lja.3.1528898335348; Wed, 13 Jun 2018 06:58:55 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:c987:: with SMTP id z129-v6ls458732lff.14.gmail; Wed, 13 Jun 2018 06:58:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLk22pcradgnURo0mdKdT/OlF6lRFABHR+/Dl0ARfvO5szeiugd3Sy3hFnLbWXpvjpYNxw4 X-Received: by 2002:a19:1f09:: with SMTP id f9-v6mr247168lff.43.1528898334831; Wed, 13 Jun 2018 06:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528898334; cv=none; d=google.com; s=arc-20160816; b=090tU/BGEjsjhyJ69xLb3pT/+WgLe51ihhz+EjZFR/K+1F9kP0lyZDiBw7Zn4FvhRN 3zRg3bnIL3Rfd+RkRNlpq0JIw7aU5itVboct5kLU0xt8jiInCULjuN4tCtOpWzmlr8wR eWgc8FEDEMdDWihMPqq0NBDNmsRfr/WMfYr6rpSDZ3EcpYYywsweU0Zf/THnsYwdJgR/ 7OoTmoVpyj6MXKmb7Ho9NTMGlDoBEkRChctfLQFWKZ7Eg9OIUAEe5i/KG/aVgBm0gYBX MlZzvTcY1OQpmYlVzGuyj5VLqxgRofS/g7fXKhakJ9EOznXxHZ6c0ZY11Lzlrv3RY48V v3YA== 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=7tol53Cyljhrrau0LxPB7QlpA6TuFkKsFPXpa2Z/xc4=; b=NmSiqNeFkXHDnXA8wgiXwoE0Y9nwIlErRGuPw8SE7cYTXgBt94hXycfEmI4KPmusxj CYozILqWTsrfDPSGaC0VkekMcF/ns0fGQ18/L/6z0kX3KiK6P2VYZGhldI+CGvaj/1rX Hk75yl4ZBBS5HxKwvYBT33necuR0AEKCVsNYWYwoQwv+lg8+LiOAwondgHijolFTCY08 y0E4tQUWpt6GSFIRovwYJdTFoGQRfS2hxhVPW4L7ofXXjy7xrkZFNBiaqliZCyTN+eYe T1mtK54tBFWnwTD5r7uxKa4GBJRBiphhv94Gli1Q80DSnypzTm8GfcYwwRFj/sdHUGBa ULqw== 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 l24-v6si108552lja.1.2018.06.13.06.58.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 06:58:54 -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 w5DDwUeR030155 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Wed, 13 Jun 2018 15:58:53 +0200 From: "Maxim Yu. Osipov" To: isar-users@googlegroups.com Subject: [RFC PATCH 0/6] ISAR SDK root filesystem Date: Wed, 13 Jun 2018 15:58:23 +0200 Message-Id: <20180613135829.3151-1-mosipov@ilbers.de> X-Mailer: git-send-email 2.11.0 X-TUID: vZQZDMG/Xbeh Hello everybody, This series provides preliminary support of ISAR SDK root file system. 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 ~# Note: This code was not sync'ed with patchset 'Initial cross-compilation support' sent today by Alex. Your comments/suggestions are welcome, Kind regards, Maxim. Alexander Smirnov (1): isar-debootstrap: split into host and target recipes Maxim Yu. Osipov (5): isar-bootstrap-helper: Add option --copyrepo to setup_root_file_system() sdkchroot: Added recipe-devel to create SDK root filesystem meta/class/image: Add do_isar 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 | 90 ++++++++++++++++++++++ meta-isar/recipes-core/images/isar-image-base.bb | 2 +- meta/classes/image.bbclass | 10 ++- meta/classes/isar-bootstrap-helper.bbclass | 24 +++++- .../isar-bootstrap/isar-bootstrap-host.bb | 31 ++++++++ .../isar-bootstrap/isar-bootstrap-target.bb | 32 ++++++++ .../{isar-bootstrap.bb => isar-bootstrap.inc} | 24 ------ meta/recipes-devtools/buildchroot/buildchroot.bb | 4 +- .../sdkchroot/files/configscript.sh | 14 ++++ meta/recipes-devtools/sdkchroot/sdkchroot.bb | 59 ++++++++++++++ scripts/mount_chroot.sh | 7 ++ scripts/umount_chroot.sh | 7 ++ 12 files changed, 273 insertions(+), 31 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} (89%) 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