From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6566568349648551936 X-Received: by 2002:a7b:c047:: with SMTP id u7-v6mr122572wmc.9.1528966107911; Thu, 14 Jun 2018 01:48:27 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:add5:: with SMTP id w79-v6ls2262996wrc.10.gmail; Thu, 14 Jun 2018 01:48:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKVwZuG9/gPgsQ2RmbHiOf9Ab5df2eKdFzIM4O0kgIMJ1hAkOiaAjV+rMyCXTbKP2vCVT03 X-Received: by 2002:a5d:49c9:: with SMTP id t9-v6mr116722wrs.13.1528966107504; Thu, 14 Jun 2018 01:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528966107; cv=none; d=google.com; s=arc-20160816; b=GnGRJaCLZClBhjeIWTMLh+3IKGutDhbUs9rqcpUa0Ij0ere2lHuGqzXLWKuGoF1WAR tXq7i0HQ8PEcYHRtzByBvk8z2fgpjwGvmOpnTepaJsDkS13cYWsN/kbNbxKRE04SVqIH dh0yYhBC3S+E8rhAO9EMdIYkSoqWAd3ac5bLk/AKLDliVyMpnDzAevT1DS/bMK5aLzhs Y6WwAOWKRuappjFOxVodgWhXKvInyGXEQgBGQ7c6+xCVUWbjZvRrJChVUQVjGWOK0xNJ bfUd6W3kPQFSXDedDN3XJhX+MvAVh1fZkkOk5b9KAc+f0pJ72B3d7ljqSPvPyDmsaFAP XVrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=IiEbcQVdfF1jtNJD+WqJDaq1Zlp6pUw2SaR6As5mY68=; b=KuSXVdu0XwG8aD0yWlsfI3H0xlYR8h8pCxnAdml8/dmL/z/+UjwO2ixeqfksrW9a9B hECYtbZTlvxsOn7usut5mvwH5AOulSPrk20dBDMF5gcE1PfTjpo+A8FtR9px/IFfFv6O ZJVwQwZK5Ux7fbe9ai39+WTRMiEKZ9xRExUWhuZrqNo/pK1WyVJA2vmqV8AL+1sC62cj ZVNbBXFjOk/GpiyPukYQwm1XhFCiHSyFV8Pu0TzViCerD1GU6dYZIiSWQdlZgGWqBRSM Py4NmT8QcuU4GKdH4opHK5g3zhxEnWVqhiGYdeofbwJdlks74ggdo1bAfRdrw5QklOiH nADw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id l14-v6si165330wmh.0.2018.06.14.01.48.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 01:48:27 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w5E8mQDS032370 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Jun 2018 10:48:27 +0200 Received: from md1pvb1c.ad001.siemens.net (md1pvb1c.ad001.siemens.net [139.25.68.40] (may be forged)) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id w5E8mQJu028971; Thu, 14 Jun 2018 10:48:26 +0200 Date: Thu, 14 Jun 2018 10:48:26 +0200 From: Henning Schild To: "Maxim Yu. Osipov" Cc: Subject: Re: [RFC PATCH 0/6] ISAR SDK root filesystem Message-ID: <20180614104826.0d954ed7@md1pvb1c.ad001.siemens.net> In-Reply-To: <20180613135829.3151-1-mosipov@ilbers.de> References: <20180613135829.3151-1-mosipov@ilbers.de> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: GriCeQvu1uXl Am Wed, 13 Jun 2018 15:58:23 +0200 schrieb "Maxim Yu. Osipov" : > 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). Are we ready for buster? Not many people care about the past, but let us make sure this will work in the future. > 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 Imagine this being copied over to a totally different Linux-distro or into a docker container. The "sudos" should not be in the script. So people can choose to not use sudo at all or call the script with sudo. Maybe adding a Dockerfile would be a good idea to understand more such implications. Henning > - 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 >