From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6652197203295076352 X-Received: by 2002:a17:906:228b:: with SMTP id p11mr706983eja.1.1549876165160; Mon, 11 Feb 2019 01:09:25 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aa7:c396:: with SMTP id k22ls2245689edq.6.gmail; Mon, 11 Feb 2019 01:09:23 -0800 (PST) X-Google-Smtp-Source: AHgI3IYIZBq4Ayfqipdizt1wdDdlgQwonL82CBKAEtMb8AMZpajyt9X6dDoDTTUU+0vQiR3bnMiy X-Received: by 2002:a50:8881:: with SMTP id d1mr1077483edd.0.1549876163931; Mon, 11 Feb 2019 01:09:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549876163; cv=none; d=google.com; s=arc-20160816; b=Rrp64NCEUNNzSkJClEEaa+z//wawFkDuC9P1F/Jsn8sp9qrbvEGigcJQfEVcJ7t2Ei Z/ntfRYYBk4vWh5DZuN6y1XlxZ9slZ2nK+g+7Pmzq7tdMFZ76WQ2zoEjxQpOgsUIk47F KLM4ngYOdgXzHrdbivLRUw9mwxPdDDUhm2krqQEp6n+nXIFcv3Q1m93gfMsam/rMBTSx sxoNqYQH8yXWUTLwm6zx8okhKS8ObYeV8+hku1MB/j8p0soxP528ZxvGIAaDY8R65FUc PWrMHDevRjddRXZMzD329i4KctVWLaRRYghsNM44bIqnan140C+UUdeh2tdp/S+2YqcN Q18A== 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:cc:to:from; bh=+PTHN1cgEgn+GwJjQl/FJhZuaRy0MpJcFVYoVvImZf4=; b=FF0hTLQmRDbWqMmtuRxiDJ9ZADWG+HIQHLStcaNO0D2SnkWhC2SVA4KK9zaRLKyixp NHD5rkAkDbP3IDPNKiqcMqjPBRTrBvlPpgydXVkzm09QGI4w6jP2IQtmhLMaK1oF8fLh t0DHCJGRu2UYIhJiG73fpOjTtuTuvoRp242ObkzdmbJjfeZlWQ+pV0sFZhyulTgPtF01 k+yUS+GfHx457iOgUIQE1sdLmQVeTXZFo16FJfvzXif0Cpc+E26lILh3c/+eIlYUo3CG 0ApHJQuNU8tht9ew/XcflY4jBvP8hQvzlBGQAhiAdvnWuAlp9MHpXR4ouyPTAEuGMopk 9A5A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id a3si475834eda.0.2019.02.11.01.09.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Feb 2019 01:09:23 -0800 (PST) Received-SPF: pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id x1B99Mg0031836 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Feb 2019 10:09:23 +0100 Received: from ring.ppmd.siemens.net (linux-ses-ext02.ppmd.siemens.net [139.25.69.181]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id x1B99Mwx017002; Mon, 11 Feb 2019 10:09:22 +0100 From: claudius.heine.ext@siemens.com To: isar-users@googlegroups.com Cc: Claudius Heine Subject: [PATCH v5 3/5] meta/classes: added ubi-img class Date: Mon, 11 Feb 2019 10:09:19 +0100 Message-Id: <20190211090921.9294-4-claudius.heine.ext@siemens.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211090921.9294-1-claudius.heine.ext@siemens.com> References: <20190211090921.9294-1-claudius.heine.ext@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: yikN08cGliU9 From: Claudius Heine This class implements a new image type for UBI formatted nand flashes. Signed-off-by: Claudius Heine --- doc/user_manual.md | 2 ++ meta/classes/ubi-img.bbclass | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 meta/classes/ubi-img.bbclass diff --git a/doc/user_manual.md b/doc/user_manual.md index ebaf54c..8081784 100644 --- a/doc/user_manual.md +++ b/doc/user_manual.md @@ -350,6 +350,7 @@ Isar can generate various images types for specific machine. The type of the ima - `ext4` - Raw ext4 filesystem image (default option for `qemuarm` machine). - `rpi-sdimg` - A complete, partitioned Raspberry Pi SD card image (default option for the `rpi` machine). - `wic-img` - A full disk image with user-specified partitions created and populated using the wic tool. + - `ubi-img` - A image for use on mtd nand partitions employing UBI --- @@ -477,6 +478,7 @@ Isar contains additional image type classes that can be used as reference: - `rpi-sdimg` - `targz-img` - `ubifs-img` + - `ubi-img` - `wic-img` --- diff --git a/meta/classes/ubi-img.bbclass b/meta/classes/ubi-img.bbclass new file mode 100644 index 0000000..f61a940 --- /dev/null +++ b/meta/classes/ubi-img.bbclass @@ -0,0 +1,35 @@ +# This software is a part of ISAR. +# Copyright (C) Siemens AG, 2019 +# +# SPDX-License-Identifier: MIT + +python() { + if not d.getVar("UBINIZE_ARGS"): + bb.fatal("UBINIZE_ARGS must be set") +} + +UBINIZE_CFG ??= "ubinize.cfg" + +inherit image + +UBI_IMAGE_FILE ?= "${IMAGE_FULLNAME}.ubi.img" + +IMAGER_INSTALL += "mtd-utils" + +do_ubi_image[stamp-extra-info] = "${DISTRO}-${MACHINE}" + +# Generate ubi filesystem image +do_ubi_image() { + if [ ! -e "${WORKDIR}/${UBINIZE_CFG}" ]; then + die "UBINIZE_CFG does not contain ubinize config file." + fi + + rm -f '${DEPLOY_DIR_IMAGE}/${UBI_IMAGE_FILE}' + + image_do_mounts + + # Create ubi image using buildchroot tools + sudo chroot ${BUILDCHROOT_DIR} /usr/sbin/ubinize ${UBINIZE_ARGS} \ + -o '${PP_DEPLOY}/${UBI_IMAGE_FILE}' '${PP_WORK}/${UBINIZE_CFG}' +} +addtask ubi_image before do_build after do_copy_boot_files do_install_imager_deps do_unpack do_transform_template -- 2.20.1