From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6543937367387930624 X-Received: by 10.46.146.7 with SMTP id k7mr201351ljg.42.1523874916943; Mon, 16 Apr 2018 03:35:16 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.60.12 with SMTP id j12ls1341690lja.8.gmail; Mon, 16 Apr 2018 03:35:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx49w/XRLI9lbXnJgr+o9o3tVjsRKA91sGw2bwoJu563skY1KnCjmcc7SKx2ZlH1sgZ9uN3S6 X-Received: by 10.46.137.2 with SMTP id d2mr414268lji.44.1523874916454; Mon, 16 Apr 2018 03:35:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523874916; cv=none; d=google.com; s=arc-20160816; b=DKq8Y+k4VAiO2pkBEzYIppChzA9QSyl9/yZmzjgUL/0cj+YNyFxj/oj2eaNO5+E6Rp L4FSCxcvuziG4ttxvMgn1UHguRTCUrb7xKTrLiOXOw02OS8oUftvXX915UXrdS6cmAGF 9rVTok8YyygSH0U1qJT7e13XW0nogf8FgaxqAHe/DQNUWd0DlOGwa40KuG8GaM+yftaq c68DSTEkpMvB2ecvW0q9XSJv3oc8hVTaXHluZoQj4iqpVfQh18Ybs4zhz6rMpVI/7HVv DWPQRAV+c2vfta69RsD0YncZVU/VRD9AOzZtjJtKD2Jy2iT370ZKFLswSnhqqmhP847v QD1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:content-description :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=LlTogo1J7T2iVBNCIy3IjHZ7UudvMDy0QZKY9e/oW2M=; b=KxLqRRMramMWpMv4RnpWTFtmePK/O/NhbkkTyMF+/ZTWk5TvP5872/Vrs7WziOgn9K 747TB3KRsvnYtr9MR7PxQjZwq0iWgNLEHfUUD0EYBNN6lYK2s9SQhofjfn+Sk96HAiER BxAbkZloa5BXGD6S2qG6QT3bEKcCtad32hoVDYtnZ+yPz88My+yYKm6zmr7xZQ0B9+An /qfmpc2qTLkpMxCvcTdAMiyyCqEX9axO4rB3Fqhc4arldBte9r700vO9zJkJe+meOIVV a1rqth5Exxz+cE8sAO+/nOx23GmJc+k26yB2LDigNe+l15NqbCj4J9rnSXZAO3ND2E8J pejQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of andreas.reichel.ext@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=andreas.reichel.ext@siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id e1si402545ljk.0.2018.04.16.03.35.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 03:35:16 -0700 (PDT) Received-SPF: pass (google.com: domain of andreas.reichel.ext@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of andreas.reichel.ext@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=andreas.reichel.ext@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id w3GAZFRV028058 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 16 Apr 2018 12:35:15 +0200 Received: from iiotirae (golem.ppmd.siemens.net [139.25.69.245]) by mail2.sbs.de (8.15.2/8.15.2) with SMTP id w3GAZFlX024248; Mon, 16 Apr 2018 12:35:15 +0200 Date: Mon, 16 Apr 2018 12:31:24 +0200 From: Andreas Reichel To: "[ext] Claudius Heine" Cc: "[ext] Henning Schild" , isar-users@googlegroups.com Subject: Re: [PATCH v2 11/17] images: New class wic-img for wic intregration Message-ID: <20180416103123.GA8866@iiotirae> References: <20180413164408.2697cf00@mmd1pvb1c.ad001.siemens.net> <1f89f1a6-9472-ba91-d1f3-fa93722dc2d4@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Description: message Content-Disposition: inline In-Reply-To: <1f89f1a6-9472-ba91-d1f3-fa93722dc2d4@siemens.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-TUID: bCVXfd+d0J2k On Mon, Apr 16, 2018 at 12:17:55PM +0200, [ext] Claudius Heine wrote: > > > + grub-efi-amd64-bin \ > > > + grub-efi-ia32-bin \ > > > + python3" > > > + > > > +python () { > > > + if d.getVar('IMAGE_TYPE', True) == 'wic-img': > > That limits how many images types one image recipe has. With OE you could > create multiple image types from one image recipe. Here you only have one. > That might be fine. But just as a note. I currently don't have a usecase to > support multiple image types for one image. > > OE supports different post-processes to the wic image. For instance 'wic.xz' > creates a compressed wic file and 'wic.bmap' creates a bmap-tool file in > addition to the wic image. > > I don't know if you currently have plans to implement such expansions, but > maybe think about how such could be implemented with your current design. > I agree. At least with swupdate we already had the necessity to also add 'ext4.gz'. So I would just test if 'wic-image' is contained in the IMAGE_TYPE. Nobody knows what image times are needed for special use cases and an exact match is not required here. > regards, > Claudius > > > > + d.appendVar('BUILDCHROOT_PREINSTALL', > > > + d.getVar('BUILDCHROOT_PREINSTALL_WIC', True)) > > > +} > > > > Now the wic tools become part of buildchroot if you chose that > > IMAGE_TYPE. > > > > > WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}" > > > do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" > > > diff --git a/scripts/wic_fakeroot b/scripts/wic_fakeroot > > > new file mode 100755 > > > index 0000000..9e01c38 > > > --- /dev/null > > > +++ b/scripts/wic_fakeroot > > > @@ -0,0 +1,37 @@ > > > +#!/usr/bin/env python3 > > > +# > > > +# wic needs a FAKEROOT cmd to run, the default is pseudo. In Isar we > > > do/can not +# use pseudo. And we call wic as root to begin with, so > > > this script could be a +# dummy doing nothing. It is almost a > > > dummy ... +# > > > +# If the fsck hack ever becomes obsolete, FAKEROOTCMD ?= "true;" can > > > be used +# > > > +# This software is a part of Isar. > > > +# Copyright (C) 2018 Siemens AG > > > +# > > > +import os > > > +import sys > > > +import shutil > > > +import subprocess > > > + > > > +args = sys.argv > > > +args.pop(0) > > > +cmd = args[0] > > > + > > > +# expect to be running as root > > > +# we could loosen that and execv(sudo, args) but even some early > > > +# "du"s fail, which do not use the fakeroot-wrapper > > > +# i.e. in wics partition.py the "du -ks" fails on > > > +# var/cache/apt/archives/partial > > > +# rootfs/root ... > > > +assert 'root' == os.environ["USER"] > > > + > > > +# e2fsck <= 1.43.5 returns 1 on non-errors (stretch and before > > > affected) +# treat 1 as safe ... the filesystem was successfully > > > repaired and is OK +if cmd.startswith('fsck.'): > > > + ret = subprocess.call(args) > > > + if ret == 0 or ret == 1: > > > + sys.exit(0) > > > + sys.exit(ret) > > > > This is another tool workaround, now outside of wic. > > I don't get this, sorry :) You have a general script to execute commands in a fake root environment. But then you always return 0 for all programs no matter if some programs fail with 1 or not. Also, where does the output of the failed command go? Can't we use 'popen' and write the output to stdout to get the error message? Just my two cents... > > > + > > > +os.execv(shutil.which(cmd), args) > > > > -- > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: ch@denx.de > > -- > You received this message because you are subscribed to the Google Groups "isar-users" group. > To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com. > To post to this group, send email to isar-users@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/1f89f1a6-9472-ba91-d1f3-fa93722dc2d4%40siemens.com. > For more options, visit https://groups.google.com/d/optout. -- Andreas Reichel Dipl.-Phys. (Univ.) Software Consultant Andreas.Reichel@tngtech.com, +49-174-3180074 TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterfoehring Geschaeftsfuehrer: Henrik Klagges, Dr. Robert Dahlke, Gerhard Mueller Sitz: Unterfoehring * Amtsgericht Muenchen * HRB 135082