From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6566555412143800320 X-Received: by 2002:a1c:f20f:: with SMTP id s15-v6mr97529wmc.10.1529060183897; Fri, 15 Jun 2018 03:56:23 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:864a:: with SMTP id i71-v6ls368473wmd.11.gmail; Fri, 15 Jun 2018 03:56:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJEhM7+sxwOayjLmU6Ra32qRLxixXhShUgMrmghzyS7NyqDSdzOlkk75aDClnU9s1tY498H X-Received: by 2002:a1c:9993:: with SMTP id b141-v6mr94872wme.20.1529060183513; Fri, 15 Jun 2018 03:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529060183; cv=none; d=google.com; s=arc-20160816; b=jigRh/Fch4DW4fIREctafijz1eUCzkEqIOfBoRxnZ9suc/fOsjHFXHF+UmQmupsPiO yIJEf3r/leQ/aCljoA6D355cGD3tdE3b2nqJkaPcjUrCXpL4Eg2IM4FTad0t31Gk6isc 1RpMHKSRVtFbilRIBTYpQmvcf249b0SxwPXVchuNLZEODOx2qrsLc6Va7NUGXkfr0YlE hgyUs12cvmlZ4oG1bZh59IcrD3BFuGasqvKAHijEGTsR9Ko5HGOfgAW7rzJDkz7Roe9n NUXK/aOauzPxi0BjFPvXfdUtAAh/adC5jOmAoIFBESPKu07xMkHQE97x3CIye3EF+QCz 8mtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:arc-authentication-results; bh=f2vzHMSAUUW1bSC7r3TfIILneFJZ0Bx1fJNk5BYPBxo=; b=o/AFlMBA+6UgZrMGgXcfWPdJ69sZXnE0TxL3byRury2Lm+UYDsJQtsR9+ZKCm34W6N T5TJ9Gu6otNKsBxBHwmYRvmdF0mMw41O1L9ZRtt0YZZEa6bE4gXnIPssRjFYxTVhCFNN Ddx+8SS16iV0GIvF2x7/Ofi1B1DiEYaDDuaSSjuR1DCYD5bYwrQLl71s07g7StyEGbwC NIZlht22VCRAyC7qTMrQVTNksd8VGn8jVMNQRPG3BG48eeaH2QFLYA+lHdam5HAjeXLJ niTY+gqHCkz4D5ps9WIVNbX5vamsr+6tbBMkR2nQxbwOf8eRULfj9WBQR2uoCSnt1cVm oH7Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id r7-v6si168988wmc.0.2018.06.15.03.56.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jun 2018 03:56:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of asmirnov@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 asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from azat.radix50.net (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 w5FAuKUt005040 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 15 Jun 2018 12:56:22 +0200 Date: Fri, 15 Jun 2018 12:56:20 +0200 From: Alexander Smirnov To: Jan Kiszka Cc: isar-users@googlegroups.com Subject: Re: [PATCH 5/9] buildchroot-cross: Initial implementation Message-ID: <20180615105619.GC24273@azat.radix50.net> References: <20180613130807.2461-1-asmirnov@ilbers.de> <20180613130807.2461-6-asmirnov@ilbers.de> <0789d066-e475-e68c-41aa-e68d0e2ecbb4@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0789d066-e475-e68c-41aa-e68d0e2ecbb4@siemens.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-TUID: JrMv3Je3mDux On Thu, Jun 14, 2018 at 05:55:48PM +0200, Jan Kiszka wrote: > On 2018-06-13 15:08, Alexander Smirnov wrote: > > Add initial generation of buildchroot for cross-compilation. > > > > Signed-off-by: Alexander Smirnov > > --- > > meta/conf/isar-bitbake.conf | 1 + > > .../buildchroot/buildchroot-cross.bb | 53 ++++++++++++++++++++++ > > .../buildchroot/files/build-cross.sh | 29 ++++++++++++ > > 3 files changed, 83 insertions(+) > > create mode 100644 meta/recipes-devtools/buildchroot/buildchroot-cross.bb > > create mode 100644 meta/recipes-devtools/buildchroot/files/build-cross.sh > > > > diff --git a/meta/conf/isar-bitbake.conf b/meta/conf/isar-bitbake.conf > > index ead7798..1412508 100644 > > --- a/meta/conf/isar-bitbake.conf > > +++ b/meta/conf/isar-bitbake.conf > > @@ -22,6 +22,7 @@ WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PF}" > > DL_DIR = "${TOPDIR}/downloads" > > SSTATE_DIR ?= "${TMPDIR}/sstate-cache" > > BUILDCHROOT_DIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/buildchroot/rootfs" > > +BUILDCHROOT_CROSS_DIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/buildchroot-cross/rootfs" > > CACHE = "${TMPDIR}/cache" > > > > OVERRIDES_append = ":${DISTRO}:${DISTRO_ARCH}" > > diff --git a/meta/recipes-devtools/buildchroot/buildchroot-cross.bb b/meta/recipes-devtools/buildchroot/buildchroot-cross.bb > > new file mode 100644 > > index 0000000..935a626 > > --- /dev/null > > +++ b/meta/recipes-devtools/buildchroot/buildchroot-cross.bb > > @@ -0,0 +1,53 @@ > > +# Root filesystem for packages cross-building > > +# > > +# This software is a part of ISAR. > > +# Copyright (C) 2015-2016 ilbers GmbH > > + > > +DESCRIPTION = "Isar development cross-filesystem" > > + > > +LICENSE = "gpl-2.0" > > +LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe" > > + > > +FILESPATH_prepend := "${THISDIR}/files:" > > +SRC_URI = "file://configscript.sh \ > > + file://build-cross.sh" > > +PV = "1.0" > > + > > +inherit isar-bootstrap-helper > > + > > +BUILDCHROOT_CROSS_PREINSTALL ?= "gcc-multilib \ > > + make \ > > + build-essential \ > > + debhelper \ > > + autotools-dev \ > > + dpkg \ > > + locales \ > > + docbook-to-man \ > > + apt \ > > + automake \ > > + devscripts \ > > + equivs" > > + > > +# TODO: make this inclusion depending on the target arch > > +BUILDCHROOT_CROSS_PREINSTALL += "binutils" > > + > > +WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}" > > + > > +do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" > > +do_build[root_cleandirs] = "${BUILDCHROOT_CROSS_DIR} \ > > + ${BUILDCHROOT_CROSS_DIR}/isar-apt \ > > + ${BUILDCHROOT_CROSS_DIR}/downloads \ > > + ${BUILDCHROOT_CROSS_DIR}/home/builder" > > +do_build[depends] = "isar-apt:do_cache_config isar-bootstrap-host:do_deploy" > > + > > +do_build() { > > + setup_root_file_system --host-arch "${BUILDCHROOT_CROSS_DIR}" ${BUILDCHROOT_CROSS_PREINSTALL} > > + > > + # Install package builder script > > + sudo chmod -R a+rw "${BUILDCHROOT_CROSS_DIR}/home/builder" > > + sudo install -m 755 ${WORKDIR}/build-cross.sh ${BUILDCHROOT_CROSS_DIR}/build.sh > > + > > + # Configure root filesystem > > + sudo install -m 755 ${WORKDIR}/configscript.sh ${BUILDCHROOT_CROSS_DIR} > > + sudo chroot ${BUILDCHROOT_CROSS_DIR} /configscript.sh > > +} > > diff --git a/meta/recipes-devtools/buildchroot/files/build-cross.sh b/meta/recipes-devtools/buildchroot/files/build-cross.sh > > new file mode 100644 > > index 0000000..8c3ddaf > > --- /dev/null > > +++ b/meta/recipes-devtools/buildchroot/files/build-cross.sh > > @@ -0,0 +1,29 @@ > > +#!/bin/bash > > +# > > +# This software is a part of ISAR. > > +# Copyright (C) 2015-2017 ilbers GmbH > > +# Copyright (c) 2018 Siemens AG > > + > > +set -e > > + > > +# Go to build directory > > +cd $1 > > + > > +# Add target architecture > > +dpkg --add-architecture $2 > > + > > +# To avoid Perl locale warnings: > > +export LC_ALL=C > > +export LANG=C > > +export LANGUAGE=C > > + > > +# If autotools files have been created, update their timestamp to > > +# prevent them from being regenerated > > +for i in configure aclocal.m4 Makefile.am Makefile.in; do > > + if [ -f "${i}" ]; then > > + touch "${i}" > > + fi > > +done > > + > > +# Build the package > > +dpkg-buildpackage -a$2 > > > > This build-cross.sh doesn't install any of the build dependencies the > target package lists. How do they come in? Or is this a limitation of > this version? For the kernel cross-build, I'm currently trying to > translate the what is needed for a corresponding build-kernel-cross.sh. > That's exactly the limitation of this series about which I mentioned in the cover letter. Attempt to install them in similar way like for 'build.sh' failed, due to it tries to replace native packages like: build-essentials, binutils by foreign ones :-(. Henning already proposed to try to play with mk-build-deps params, so I'm going to do this. > Those packages would go into the cross-buildchroot, or are we also using > the native buildchroot here? buildchroot and buildchroot-cross has nothing common except isar-apt repository. Alex > > Jan > > -- > Siemens AG, Corporate Technology, CT RDA IOT SES-DE > Corporate Competence Center Embedded Linux