From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6651523578180141056 X-Received: by 2002:a1c:8bcd:: with SMTP id n196mr1387763wmd.4.1548679011210; Mon, 28 Jan 2019 04:36:51 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:eac3:: with SMTP id o3ls3534811wrn.8.gmail; Mon, 28 Jan 2019 04:36:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN6anJB4d60buCvm9mQNGNJO2Lh9XB2aUyi2PVwPZ9c3xRGku0iIHy+A0hWF7PWdIlyivHR+ X-Received: by 2002:adf:f40b:: with SMTP id g11mr1481149wro.20.1548679010687; Mon, 28 Jan 2019 04:36:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548679010; cv=none; d=google.com; s=arc-20160816; b=lPf96iE7/rjjS6y9Nntr7s+OAJBQn6BmWYRRcvrf06jOitw4Pnw5g+F099bJorYz1D mKFSTqASbbRXhTv4KNyFWP79TsCTgH6IIaZXFyxyt8pJs0yi1Yq4tQ08/9wrWp9TfmGd HGG/0v7jJkglytn71eNAkkNbNge5rO+kejAN+ymuxYrVSRlG2ixq8pZQXEjOGPTS/SqS 4iAzYHGlaPRlrgbAWFcGXtonmR6sbn4PIu3tgl6cAA+iRNS/+jw0LAqvoixAlMzE3ch+ NhVt7Cgy0fgpl7MAILypwDJ/Lon03sCumzFSkxBtdaXMcT91nyX1+yl76qGggSMSLqy9 NQ1Q== 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:from:references:cc:to:subject; bh=8KLNjTlagd/xW9t9rXFhFqiHapEY+fXj+Ih3reBfWLM=; b=F9LxwyamHiBaUZJAIXk6sYxRAiHsaQANbVHg5VrPT+JSzpOP/8wQ6NXuzbt/4FKd7D KLGf+eVHtuwgZK+B8sHHsG/9QN7VQTndfd+QXTj3QFA21oWyxNMYRpE+LBB2N01AcWGv MyCuiFy9t44smLW4CcC7DgmkuujoiQ2xOilIQNI50O3ifMOUlzeWjoZNN4RaD/DnIKru fgfMvKaFgSduliUOHNnfLxGKAYnB5C4ojmbazPnwFolYkiI72vqKVmBnq/LQH9WlIrYP YTLm4S63I6OfdcZNLDtgP7oZUsxYatl+jKwKBxfLXn0VN1qG+iQ2uOV5/Td2g/1iPx1L 28qg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id x188si2347872wmb.3.2019.01.28.04.36.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 04:36:50 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@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 jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id x0SCanXD006864 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Jan 2019 13:36:50 +0100 Received: from [167.87.1.218] ([167.87.1.218]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id x0SCal0Y031704; Mon, 28 Jan 2019 13:36:48 +0100 Subject: Re: [PATCH 2/2] integrate ubifs image type To: "[ext] claudius.heine.ext@siemens.com" , isar-users@googlegroups.com Cc: Claudius Heine References: <20190128122821.10002-1-claudius.heine.ext@siemens.com> <20190128122821.10002-3-claudius.heine.ext@siemens.com> From: Jan Kiszka Message-ID: <80d2d5f3-13ef-ec61-d1b1-cea587e25b34@siemens.com> Date: Mon, 28 Jan 2019 13:36:47 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <20190128122821.10002-3-claudius.heine.ext@siemens.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: z3sbhcFKvfiA On 28.01.19 13:28, [ext] claudius.heine.ext@siemens.com wrote: > From: Claudius Heine > > Signed-off-by: Claudius Heine > --- > doc/user_manual.md | 1 + > meta-isar/conf/local.conf.sample | 1 + > .../multiconfig/qemuamd64-buster-ubifs.conf | 16 +++++++ > meta/classes/ubifs-img.bbclass | 42 +++++++++++++++++++ > scripts/ci_build.sh | 1 + > 5 files changed, 61 insertions(+) > create mode 100644 meta-isar/conf/multiconfig/qemuamd64-buster-ubifs.conf > create mode 100644 meta/classes/ubifs-img.bbclass > > diff --git a/doc/user_manual.md b/doc/user_manual.md > index c4fe42a..c9924ad 100644 > --- a/doc/user_manual.md > +++ b/doc/user_manual.md > @@ -476,6 +476,7 @@ Isar contains additional image type classes that can be used as reference: > - `ext4-img` > - `rpi-sdimg` > - `targz-img` > + - `ubifs-img` > - `wic-img` > > --- > diff --git a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample > index a671b20..9ea366c 100644 > --- a/meta-isar/conf/local.conf.sample > +++ b/meta-isar/conf/local.conf.sample > @@ -53,6 +53,7 @@ BBMULTICONFIG = " \ > hikey-stretch \ > qemuamd64-buster \ > qemuamd64-buster-tgz \ > + qemuamd64-buster-ubifs \ > rpi-jessie \ > " > > diff --git a/meta-isar/conf/multiconfig/qemuamd64-buster-ubifs.conf b/meta-isar/conf/multiconfig/qemuamd64-buster-ubifs.conf > new file mode 100644 > index 0000000..7c638b9 > --- /dev/null > +++ b/meta-isar/conf/multiconfig/qemuamd64-buster-ubifs.conf > @@ -0,0 +1,16 @@ > +# This software is a part of ISAR. > +# Copyright (c) Siemens AG, 2018 > +# > +# SPDX-License-Identifier: MIT > + > +MACHINE ?= "qemuamd64" > + > +DISTRO ?= "debian-buster" > +DISTRO_ARCH ?= "amd64" > + > +KERNEL_NAME ?= "amd64" > + > +MKUBIFS_ARGS ?= "-m 0x1000 -e 0x3e000 -c 1500" > +IMAGE_TYPE ?= "ubifs-img" > + > +IMAGE_INSTALL += "sshd-regen-keys" > diff --git a/meta/classes/ubifs-img.bbclass b/meta/classes/ubifs-img.bbclass > new file mode 100644 > index 0000000..f5e17d3 > --- /dev/null > +++ b/meta/classes/ubifs-img.bbclass > @@ -0,0 +1,42 @@ > +# This software is a part of ISAR. > +# Copyright (c) Siemens AG, 2018 > + > +python() { > + if not d.getVar("MKUBIFS_ARGS"): > + bb.fatal("MKUBIFS_ARGS must be set") > +} > + > +inherit image > + > +UBIFS_IMAGE_FILE ?= "${IMAGE_FULLNAME}.ubifs.img" > + > +IMAGER_INSTALL += "mtd-utils" > + > +PP = "/home/builder/${PN}" > +PP_DEPLOY = "${PP}/deploy" > +PP_ROOTFS = "${PP}/rootfs" > + > +BUILDROOT = "${BUILDCHROOT_DIR}${PP}" > +BUILDROOT_DEPLOY = "${BUILDCHROOT_DIR}${PP_DEPLOY}" > +BUILDROOT_ROOTFS = "${BUILDCHROOT_DIR}${PP_ROOTFS}" > + > +do_ubifs_image[stamp-extra-info] = "${DISTRO}-${MACHINE}" > + > +# Generate ubifs filesystem image > +do_ubifs_image() { > + rm -f ${DEPLOY_DIR_IMAGE}/${UBIFS_IMAGE_FILE} > + > + buildchroot_do_mounts > + > + sudo flock ${MOUNT_LOCKFILE} -c ' \ > + mkdir -p ${BUILDROOT_DEPLOY} ${BUILDROOT_ROOTFS} > + mount --bind ${DEPLOY_DIR_IMAGE} ${BUILDROOT_DEPLOY} > + mount --bind ${IMAGE_ROOTFS} ${BUILDROOT_ROOTFS} > + ' > + > + # Create ubifs image using buildchroot tools > + sudo chroot ${BUILDCHROOT_DIR} /usr/sbin/mkfs.ubifs ${MKUBIFS_ARGS} \ > + -r "${PP_ROOTFS}" "${PP_DEPLOY}/${UBIFS_IMAGE_FILE}" > +} > + > +addtask ubifs_image before do_build after do_copy_boot_files do_install_imager_deps For me as UBIFS newbie: I assume that this image class is already usable, e.g. as input for an out-of-isar ubi image generation, right? So, for someone familiar with ubi, it would be obvious what to do with this output artifact, and it does not need any form of documentation hint? Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux