From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6880878174534631424 X-Received: by 2002:a5d:4c85:: with SMTP id z5mr2616848wrs.9.1602836289832; Fri, 16 Oct 2020 01:18:09 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:a544:: with SMTP id j4ls1743828wrb.3.gmail; Fri, 16 Oct 2020 01:18:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjaKho35OpbKjOomazCwnQ1dkdJH5GV1ix+/xZtgfZS08XN1TMh8VOiaOGUivqYNYMo01k X-Received: by 2002:adf:a51d:: with SMTP id i29mr2539870wrb.409.1602836288849; Fri, 16 Oct 2020 01:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602836288; cv=none; d=google.com; s=arc-20160816; b=gvW/JMFtvozSyFSzYH1fpMllMyYnhHekBBnh5cX8WI5ghPNZD9TJa73dr48/ybaTYF +vOfXSKd7OXM1TYpeFyuOcojMDAmLmNd49LyL103VDTCGoG1c+aiFlrGw7G4FWCuwSCu LDQeiEeGqCMWeQWR1kPoSLAUYVsZrvll2fBc5r5qgzeBANqWMW6tKKMuugklprLaV+6y 28qfwmizYegXCOUoINoJijPuN20EQSK2KNkjaYihYCLEE79evjViY27yNbtBhohRjqSn a2DdWwb4t1iakGpLkf6Ga1aSXMl8FCW48psAcju8f/Yt5BC0Ef6riXy1tML9zS+fxols 9ImA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:references:to:from:subject; bh=qQYZ3n1PKem3sk0rpNpo4FpnadoEzpYd/S0XbYMPiIs=; b=RcyPrNvNl/0K5KQ8Ppx2pV7+B6jX1vG6WwI6RNAKY4Gx83p9mTdtTuiNsVCJBninP8 3B2+kH3uSEdfVGoALrYEm9qqcvOGWJinOIwIJkl/xz+B49Uvr5/W4yIfPNETZVQ644Et VXT4KTjb6RRDSx+4B458SxUT0BRy83pMY+ZUo4k7TMp8H7RwZbOzdYRl3hdDUr41wWi+ +e9Nz+jKuNwzExmaWhHrEo5gtLvfpsvXHIg98VTh2EY/KEp98PIlmqyiKRymDdTGgw6d LU/8BYnYtXvLmZeg9lxH1z7o0X3Btmjl9PuqEnYBSUXDbqE79+ECeQbWn8JWCjHiF9al JmcA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id 14si46928wmf.4.2020.10.16.01.18.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Oct 2020 01:18:08 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@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 jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id 09G8I8CM004330 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 16 Oct 2020 10:18:08 +0200 Received: from [139.22.112.51] ([139.22.112.51]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 09G8I6ti032196 for ; Fri, 16 Oct 2020 10:18:07 +0200 Subject: [PATCH v5 06/13] sdk: Update README.sdk From: Jan Kiszka To: isar-users References: <6b3b4b469b32c896f029397f6e0d5b7d62fce65e.1602079290.git.jan.kiszka@siemens.com> Message-ID: Date: Fri, 16 Oct 2020 10:18:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <6b3b4b469b32c896f029397f6e0d5b7d62fce65e.1602079290.git.jan.kiszka@siemens.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: g365hx6K0MfK From: Jan Kiszka Document the out-of-chroot invocation and make it the preferred option. Remove irrelevant information about a toolchain check - it's always there. Append additional information in case the isar-apt is shipped and devel packages are not pre-installed. Signed-off-by: Jan Kiszka --- Partial update only due to the unclear "arm-linux-gnueabihf-gcc" issue, re-adding notes on dependency installations from isar-apt when applicable. .../sdkchroot/files/README.sdk | 71 ++++++++++--------- meta/recipes-devtools/sdkchroot/sdkchroot.bb | 27 +++++++ 2 files changed, 63 insertions(+), 35 deletions(-) diff --git a/meta/recipes-devtools/sdkchroot/files/README.sdk b/meta/recipes-devtools/sdkchroot/files/README.sdk index 9c1af6d3..3e06d8c5 100644 --- a/meta/recipes-devtools/sdkchroot/files/README.sdk +++ b/meta/recipes-devtools/sdkchroot/files/README.sdk @@ -1,42 +1,43 @@ -Building applications for targets in ISAR takes a lot of time as they are built under QEMU. -SDK helps to develop applications for target platform in crossbuild environment. +ISAR Target SDK +=============== -SDK contains cross-toolchain for target architecture and a copy of isar-apt repo with -locally prebuilt target debian packages. +This SDK helps to develop applications for an ISAR target platform in a +crossbuild environment. It contains a cross-toolchain and development packages +corresponding to the original target. - - First one have to mount the system directories for proper operation in chroot environement. -Just call supplied with sdk tarball in udo rootfs as an argument to the script `mount_chroot.sh`: +The SDK can be used in two ways, described in the following. -$ sudo mount_chroot.sh - - chroot to isar SDK rootfs: +Option 1 (recommended): Use cross-compiler in host environment +-------------------------------------------------------------- + +After unpacking the SDK at the desired location, it has to be relocated once: + +$ /relocate-sdk.sh + +Now you can add /usr/bin to the local path or adjust your project +to call the cross-compiler from the SDK. + + +Option 2 (fallback): Build inside chroot +---------------------------------------- + +First you have to mount the system directories for proper operation into the +chroot environment. Call the helper script supplied with SDK tarball: + +$ sudo /mount_chroot.sh + +Bind-mount the project into the rootfs: + +$ sudo mount -o bind /path/to/project /mnt + +If you have relocated the SDK previously for using option 1, you need to call +this next: + +$ /relocate-sdk.sh --restore-chroot + +Then chroot into the SDK rootfs: $ sudo chroot - - 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 update -:~# 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 -~# +Now you can build the project under /mnt. diff --git a/meta/recipes-devtools/sdkchroot/sdkchroot.bb b/meta/recipes-devtools/sdkchroot/sdkchroot.bb index c96cc772..3c299202 100644 --- a/meta/recipes-devtools/sdkchroot/sdkchroot.bb +++ b/meta/recipes-devtools/sdkchroot/sdkchroot.bb @@ -63,6 +63,33 @@ ROOTFS_POSTPROCESS_COMMAND =+ "sdkchroot_install_files" sdkchroot_install_files() { # Configure root filesystem sudo install -m 644 ${WORKDIR}/README.sdk ${S} + if [ "${SDK_INCLUDE_ISAR_APT}" = "1" ]; then + sudo sh -c "cat <>${S}/README.sdk + +In case build dependencies have not been pre-installed, you need to do that +first, e.g.: + +:~# apt-get update +:~# apt-get install libhello-dev:armhf + +Check the contents of the installed package like this: + +:~# 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 +EOF" + fi sudo install -m 755 ${WORKDIR}/relocate-sdk.sh ${S} sudo install -m 755 ${WORKDIR}/gcc-sysroot-wrapper.sh ${S}/usr/bin sudo install -m 755 ${WORKDIR}/configscript.sh ${S} -- 2.26.2