From patchwork Tue Jan 12 00:33:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silvano Cirujano Cuesta X-Patchwork-Id: 265 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:b386:0:0:0:0:0 with SMTP id p6csp3104656ooo; Tue, 12 Jan 2021 02:33:41 -0800 (PST) X-Received: by 2002:adf:e541:: with SMTP id z1mr3540982wrm.143.1610447621105; Tue, 12 Jan 2021 02:33:41 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1610447621; cv=pass; d=google.com; s=arc-20160816; b=FZvBAoqMSMIl0Uf135RpwwoJf2NDa+8fKAItDdQlRa8aX69/5NPbfq7AWuSr/HSVVh jG2CmrS2yb03uXa2ICa6rlz5nYRjTesC+o+MKVMFjLld8EM/Bv34xh1MGjnmgN+kLOUo 3BDgoaDy5G1vLOdiny9uYt+rD9FNFuwDTRP8p/zvuH1L7sw0BqOdEJyYQwjs4n0CBbPo ayEcuOgMnWhiboZOjDld+RDSL1ujBH3m7Pj529A9seUCNw8+8WLWNmrRKCgL9UQJQrAb 3mUQSRKG29rS9p5O29fX+O9QnUAxPQUyug1wqILqKv1qKkg0GVwGORtPvzSuCEQ5LV3/ 8qkg== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:dkim-signature; bh=/JN1RKl+XatOuIHmrDcgpqLF387nRFN8WrvfW+lhPgo=; b=tcgmM/OqnqNWUI7JTMMDRLZ7MAA3Od1ZwxtkhAseKUXSDf2HTOu4morr/IMSfPQ3O1 2wy1PxVFqfTVKk9WpqeY7rMUvpV3p6UjQbcmoZb7xjNYsG+HAFViqOAg1V+UJGaBfwgb qGOfFj+9Pqq197n40J2BWS87tyLNHuKbWMzX7ls+8PzWPNsf1OO5l2ct/z/iuQuX/bEx jh67JdJZHUBAwQg5XjKSCcTd/T5mbPrhjdxf65IUJ8bnWGTuHLtVauFVGGRb5IU8MPvL grPWY/ccDOvtiYCqyn1CGXVJbvkuWr0EdZT29o2roZE3m8xbxpJK0qOT8GaXKUKNMUAR ksLQ== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=MQMdsPAx; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbcd6jj6cqqfrbbhw6x7qkgqeamjzbui@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCD6JJ6CQQFRBBHW6X7QKGQEAMJZBUI@googlegroups.com; dmarc=fail (p=NONE sp=NONE dis=NONE arc=pass) header.from=siemens.com Received: from mail-sor-f55.google.com (mail-sor-f55.google.com. [209.85.220.55]) by mx.google.com with SMTPS id x4sor1264701wro.13.2021.01.12.02.33.40 (Google Transport Security); Tue, 12 Jan 2021 02:33:41 -0800 (PST) Received-SPF: pass (google.com: domain of isar-users+bncbcd6jj6cqqfrbbhw6x7qkgqeamjzbui@googlegroups.com designates 209.85.220.55 as permitted sender) client-ip=209.85.220.55; Authentication-Results: mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=MQMdsPAx; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbcd6jj6cqqfrbbhw6x7qkgqeamjzbui@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCD6JJ6CQQFRBBHW6X7QKGQEAMJZBUI@googlegroups.com; dmarc=fail (p=NONE sp=NONE dis=NONE arc=pass) header.from=siemens.com ARC-Seal: i=2; a=rsa-sha256; t=1610447620; cv=pass; d=google.com; s=arc-20160816; b=C6z8fsFnhnF1NNPTx+o0vibffBMNQC1S5IaKMNAelJaZjQfqVKhnfRpNkrnsv5vSKZ S3EMP22rKKwqC/nnzDKjYCvkLNo49Brm13kuTtocIDJsLnJv9cIt8jV4g0lwrdnxJ0wK SYLSvzItMRcNpgvae4FHv/MkUpi+7za4zKqzfUsF7iELZP3YLrxjz5uBmabZCwJep+9P hceYly9n6WtVTzu8uG9dv8PLaTkz3PpjU2qvI2QuAjm3HR3zZq/kKXiUVTWdO1m7iD7L ol2x75Dxg6xHXAg0NA3qblb7GjgYqS4cX06akzoD+E7cFL+yZUva6FeO4+jufl9yxA6N nOJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:dkim-signature; bh=/JN1RKl+XatOuIHmrDcgpqLF387nRFN8WrvfW+lhPgo=; b=F15IRBBA3Z1v7dpTziIwhcDPqGm5nvuAcW0bPF4pMMxxt3HaDqmwEii4JL3mEXdh98 jFfY+AjUJVpUeIK31n09wdu1MVQ0KjwEDnhdma4+tG1ObotjYJp+07msYE5jBuLnJNO4 wpJmLs/6jIUPBTlRLmLZ7oFteofnDOPiFzJqerWpyo49lqH8B9PYOrPbmQ9n4R0BQ8gx y4vrw59SlUBaENjExhSe9tV184moz4pCrl6AKQh0uXy3J6XqlySUppd9Phx+ECpC2DbA WWRvd89v1qTxHT44rwv5fKs8k+zbX57jvkKhRlwIojRhyX8BAvxuEeeMka45QHTHXbRM pR0g== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of silvano.cirujano-cuesta@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=silvano.cirujano-cuesta@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=/JN1RKl+XatOuIHmrDcgpqLF387nRFN8WrvfW+lhPgo=; b=MQMdsPAx7X3p9dDF9xi8rja3uWqFCRUMFDzgxhQSIxkA+vf4vyuihPtlEda74cncTH GLcqT4TxNNJcoXPwL3sQSiQ7GstiHSdD6mo0rK5LtoED51GcXgk0U/KU94A5d6SuirnM 1hlL4Vgfej+UPRciVFNKwD0GumvRwncrg9DuQ/wWclYynNyd6pWhB1141h6/agSmIVNE cQKqi9JwZFKb+68Aii6WRj47fo6nWlKsUq6liKoF+wDnR/N24Ls2+pni3T0/e9sjUpUi dL1SokqCRQe/pmXP5Svjy++Xdkq9IVeWX7BrtvD/8hnYRSdWOcsIB+gVd3xxUJSUuIlW yBFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=/JN1RKl+XatOuIHmrDcgpqLF387nRFN8WrvfW+lhPgo=; b=QMUvbgnXLgWavbGfCM0Ky6tH6DqKA8Xb1ZlUmx7LEqL2BipG8g7ruTlANy+K0cIG9K B0VQOjc16fvjQETSDc5sbxgAVaWgNCJouB2Gb2gNAdLTe907yBdtQXUumNC/7IOQAWCF cVS2wUGHghNTq8cR6Lm6NSC8AH+0iFI3khJOEDSqnYZWGHaHmn7N76uD0E6gWLS978Ej NfnQAFT6ffIlTH+6Spzb7OtyViAson7KDmCXYT3jW0UM1txqGqoBz2Vlf98H8r3xEh9Z zBG6koe4QCLhS06Bcy7+Nf7aOWtdbHxnvKPn2RujwmlJiyBPTr97n7DQltKixYCCOag4 SRHA== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM530NT+GYOXccrF5KlyDLh5rt3g1ZTWTjiHwJNgsxd2pQw7agXHgf djUZPrAn9u/bR5zkAL+N3XM= X-Google-Smtp-Source: ABdhPJzjj6uJGbOVsh4iSf5YGUAYI+270fUT2ZiW0uLh32kt1ould4fg9bMWnDTSlRGIF+PjQbGOzw== X-Received: by 2002:a5d:4e92:: with SMTP id e18mr3738153wru.66.1610447620211; Tue, 12 Jan 2021 02:33:40 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:1f8e:: with SMTP id f136ls1024599wmf.0.canary-gmail; Tue, 12 Jan 2021 02:33:39 -0800 (PST) X-Received: by 2002:a1c:acc9:: with SMTP id v192mr2389614wme.174.1610447619359; Tue, 12 Jan 2021 02:33:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610447619; cv=none; d=google.com; s=arc-20160816; b=dsApV5zb2LSjcgnEnF4T9BfFNGC+RadPEqrKzIqEC0kDDC3W39nOFiq/egcdsaHkfN HBCs28nBv3tp3lbPHbzLmTjHnTyJJ26raM0S9yVfT/UpOGImkFYYAIQloY9LlUr0ZqQY LmkNCik/AhNsRXFIRQhlD/dhuDwNS+CBQJ/Yf/UeM2Ac72KDAkSDl0YakjiJh4ytQExA mpgF2kwrlUb1/8OP8e+f0W9qgm4ZG13fNkyDuYdSYDaTr1zH5wsM5DRwBBAbym2N4o3H Wg/UiKQjk2LQ9lrKHMeIinGWWBN+MSJUtX0YZ83oRcmMXDG/Vl55xod5rbQlKaMjKdY8 O+nw== 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:date:subject:to:from; bh=oSqyxOWUEovsY1r1r9wwCc6tZ6qnbiV2ieQUt5tB3qg=; b=hCLMfzB+tZvYiXJLfhMQXTPjqr19CYwAQ6ZdTdor2Pa1uceFWvDJVPGgUCXaH0E5Px NTCeBuRUVIgNANkfzamYXOFNrASllfUsbu2ZOnGStJJwOtX7ygPTsfe7KoCUCZAwy1MX nVqCl1Rz2vK0oOl/BovyZfvuafwBQg4Z6gYozr8TuvO+78897QXEv03yYTl42gU+ilEN pG3HXMPwH9hhtAMJxKJm36vmg/GTdobm9pDZe+m2hPxo5RWQ/XXrcou/GZabfbkSNplL g2ouRE+KU/sT75yHK9ayq1nKSL0NGYAPQtlrsjd1CDtSRnyhhItcExF9+4cPkRJjvNhD K9RQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of silvano.cirujano-cuesta@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=silvano.cirujano-cuesta@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id 10si145978wml.0.2021.01.12.02.33.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jan 2021 02:33:39 -0800 (PST) Received-SPF: pass (google.com: domain of silvano.cirujano-cuesta@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id 10CAXdJh013661 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 12 Jan 2021 11:33:39 +0100 Received: from md1sf36c.ad001.siemens.net ([139.22.36.115]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 10CAXc3A010059 for ; Tue, 12 Jan 2021 11:33:38 +0100 From: Silvano Cirujano Cuesta To: isar-users@googlegroups.com Subject: [RFC PATCH 2/2] docs: document usage of sdk container images Date: Tue, 12 Jan 2021 11:33:38 +0100 Message-Id: <20210112103338.14712-3-silvano.cirujano-cuesta@siemens.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210112103338.14712-1-silvano.cirujano-cuesta@siemens.com> References: <20210112103338.14712-1-silvano.cirujano-cuesta@siemens.com> MIME-Version: 1.0 X-Original-Sender: silvano.cirujano-cuesta@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of silvano.cirujano-cuesta@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=silvano.cirujano-cuesta@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1688676724575595780?= X-GMAIL-MSGID: =?utf-8?q?1688676724575595780?= Signed-off-by: Silvano Cirujano Cuesta --- doc/user_manual.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/doc/user_manual.md b/doc/user_manual.md index a4f3d1d..ff779b1 100644 --- a/doc/user_manual.md +++ b/doc/user_manual.md @@ -834,6 +834,76 @@ ii crossbuild-essential-armhf 12.3 all Inf ~# ``` +## Create a "containerized" ISAR SDK root filesystem + +### Motivation + +Distributing and using the SDK root filesystem created following the instructions in "[Create an ISAR SDK root filesystem](#create-an-isar-sdk-root-filesystem)" becomes easier using container images (at least for those using containers anyway) +A "containerized" SDK adds to those advantages of a normal SDK root filesystem the comfort of container images. + +### Approach + +Create container image with SDK root filesystem with installed cross-toolchain for target architecture and ability to install already prebuilt target binary artifacts. +Developer: + - runs a container based on the resulting container image mounting the source code to be built, + - develops applications for target platform on the container and + - leaves the container getting the results on the mounted directory. + +### Solution + +User specifies the variable `SDK_FORMAT` providing a space-separated list of SDK formats to generate. +Supported formats are: + - `tar`: is the default, is the non-containerized format that results from following the instructions in "[Create an ISAR SDK root filesystem](#create-an-isar-sdk-root-filesystem)" + - `docker-archive`: an archive containing a Docker image that can be imported with [`docker import`](https://docs.docker.com/engine/reference/commandline/import/) + - `docker-daemon`: (not supported from inside of a container) resulting container image is made available on the local Docker Daemon + - `containers-storage`: (not supported from inside of a container) resulting container image is made available to tools using containers/storage back-end (e.g. Podman, CRIO, buildah,...) + - `oci-archive`: an archive containing an OCI image, mostly for archiving as seed for any of the above formats + +User manually triggers creation of SDK formats for his target platform by launching the task `do_populate_sdk` for target image, f.e. +`bitbake -c do_populate_sdk mc:${MACHINE}-${DISTRO}:isar-image-base`. +Packages that should be additionally installed into the SDK can be appended to `SDK_PREINSTALL` (external repositories) and `SDK_INSTALL` (self-built). + +The resulting SDK formats are archived into `tmp/deploy/images/${MACHINE}/sdk-${DISTRO}-${DISTRO_ARCH}-${sdk_format}.tar.xz` (being `sdk_format` each one of the formats specified in `SDK_FORMATS`). +The SDK container directory `/isar-apt` contains a copy of isar-apt repo with locally prebuilt target debian packages (for ). +One may get into an SDK container and install required target packages with the help of `apt-get install :` command. +The directory with the source code to develop on should be mounted on the container (with `--volume :`) to be able to edit files in the host with an IDE and build in the container. + +### Example + + - Make the SDK formats to generate available to the task + +For one-shot builds (use `local.conf` otherwise): + +``` +export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE SDK_FORMATS" +export SDK_FORMATS="docker-archive" +``` + + - Trigger creation of SDK root filesystem + +``` +bitbake -c do_populate_sdk mc:qemuarm-buster:isar-image-base +``` + + - Load the SDK container image into the Docker Daemon + +``` +xzcat build/tmp/deploy/images/qemuarm/sdk-debian-buster-armhf-docker-archive.tar.xz | docker load +``` + + - Run a container using the SDK container image (following commands starting with `#~:` are to be run in the container) + +``` +docker run --rm -ti --volume "$(pwd):/build" isar-sdk-buster-armhf:latest +``` + + - 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 +``` + ## Creation of local apt repo caching upstream Debian packages ### Motivation