From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6566555412143800320 X-Received: by 2002:a19:7117:: with SMTP id m23-v6mr257805lfc.12.1528895328552; Wed, 13 Jun 2018 06:08:48 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:780f:: with SMTP id t15-v6ls504594ljc.2.gmail; Wed, 13 Jun 2018 06:08:48 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIj3XPHBL7Y1WoUw7+sLoq9Yb/kIRaF1Z+kEeDVstYdZI+4qTST+HvNbIc/VZ/gT+TRw6wf X-Received: by 2002:a2e:3502:: with SMTP id z2-v6mr280197ljz.25.1528895328128; Wed, 13 Jun 2018 06:08:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528895328; cv=none; d=google.com; s=arc-20160816; b=PjP1AyPGv6frdrnnZ5gCy8HG4gObogJZwcAIv/5gVaYGfX551nYnn1oOPWXYVOxI12 9kKmALo9+K4U/UeaxaHtIyEISXy8lHBLPx9yRv1uvZWKlyny0spuIm3SrlAVpOT+So85 RTRvd+XpmfWsbdTe2uOuktAKG7r3uJa1jfWS3GDIfELnTkDmy+gEa8aMvk1Yg18qj2kT tBbAoBLsL5WZuMHVEqQRwY7YqTBSTedqy06mr8D02sDtQwaErdbuRbnszcv0wPHbmVnr IeWz9VaS8V5HhzeLl1n3SGgSZUetIr1ipIdrgIHZp81+BHoSf6rwHXhoD/1PY6EQ4m+L 3Qqw== 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:cc:to:from :arc-authentication-results; bh=vRszcRyZQ9/lR+I20KSe6lIGV0xtFegW9g2uKylY1Z0=; b=AnzWh2RvdpMLlK5TsCU3lD4gPViMf2NKVAoWCgNEYaHLWu7wjgTivyinYn8+iXhf2u FZjTiFEASETp+JmnqiIzNuG4fiUldaSP3M4S9kgWkdWtBsU1jWKJ+hIVbmpdpSSnaAHF CuA9CiPz1FRC+GKfpIddmLYhkTo5I90/Wluy0Kc91niE9dT51PPJrzkWHlA5CG5oBcgv KemA7YsV65QifOp9WdX+eDb5ukS+erNTdsne6BIJL2p3fyl+qETZqbsNXed4nsD74czo WVNdP/IifFEaodD7iSMHNByU4BzmD6bPrgwUhwuJBbb4Q/G73WVvj6u+wCa74vXcGe3k 43Jg== 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 v11-v6si72164ljg.4.2018.06.13.06.08.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 06:08:48 -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.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 w5DD8P04030010 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT); Wed, 13 Jun 2018 15:08:36 +0200 From: Alexander Smirnov To: isar-users@googlegroups.com Cc: Alexander Smirnov Subject: [PATCH 5/9] buildchroot-cross: Initial implementation Date: Wed, 13 Jun 2018 15:08:03 +0200 Message-Id: <20180613130807.2461-6-asmirnov@ilbers.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180613130807.2461-1-asmirnov@ilbers.de> References: <20180613130807.2461-1-asmirnov@ilbers.de> X-TUID: OMi3yU00j+oT 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 -- 2.1.4