From: Andreas Reichel <andreas.reichel.ext@siemens.com>
To: "[ext] Claudius Heine" <claudius.heine.ext@siemens.com>
Cc: "[ext] Henning Schild" <henning.schild@siemens.com>,
isar-users@googlegroups.com
Subject: Re: [PATCH v2 11/17] images: New class wic-img for wic intregration
Date: Mon, 16 Apr 2018 12:31:24 +0200 [thread overview]
Message-ID: <20180416103123.GA8866@iiotirae> (raw)
In-Reply-To: <1f89f1a6-9472-ba91-d1f3-fa93722dc2d4@siemens.com>
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
next prev parent reply other threads:[~2018-04-16 10:35 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-13 14:18 [PATCH v2 00/16] wic integration Henning Schild
2018-04-13 14:18 ` [PATCH v2 01/17] Revert "wic: Make the bootimg-efi plugin generate usable images" Henning Schild
2018-04-13 14:18 ` [PATCH v2 02/17] Revert "wic: Introduce the `WicExecError` exception class" Henning Schild
2018-04-13 14:18 ` [PATCH v2 03/17] Revert "wic: Work around mcopy error" Henning Schild
2018-04-13 14:18 ` [PATCH v2 04/17] Revert "wic: Use sudo instead of pseudo" Henning Schild
2018-04-16 10:44 ` Andreas Reichel
2018-04-16 10:53 ` Andreas Reichel
2018-04-16 10:57 ` Henning Schild
2018-04-13 14:18 ` [PATCH v2 05/17] Revert "wic: Remove sysroot support" Henning Schild
2018-04-13 14:18 ` [PATCH v2 06/17] wic: now truly go for the wic version we claim to have Henning Schild
2018-04-13 14:18 ` [PATCH v2 07/17] Revert "isar-init-build-env: Add /sbin to PATH" Henning Schild
2018-04-13 14:18 ` [PATCH v2 08/17] classes: image: introduce size measuring function, for before do_*_image Henning Schild
2018-04-13 14:18 ` [PATCH v2 09/17] meta/image: Fix broken variables KERNEL_IMAGE and INITRD_IMAGE Henning Schild
2018-04-16 10:45 ` Andreas Reichel
2018-04-13 14:18 ` [PATCH v2 10/17] isar-init-build-env: make ISARROOT available in bitbake Henning Schild
2018-04-13 14:19 ` [PATCH v2 11/17] images: New class wic-img for wic intregration Henning Schild
2018-04-13 14:44 ` Henning Schild
2018-04-16 10:17 ` Claudius Heine
2018-04-16 10:25 ` Henning Schild
2018-04-16 10:31 ` Andreas Reichel [this message]
2018-04-13 14:19 ` [PATCH v2 12/17] wic: Add pcibios boot plugins and wks files Henning Schild
2018-04-16 10:52 ` Andreas Reichel
2018-04-16 11:48 ` Henning Schild
2018-04-13 14:19 ` [PATCH v2 13/17] scripts/start_vm: Enable booting of full disk images Henning Schild
2018-04-16 10:33 ` Andreas Reichel
2018-04-16 11:46 ` Henning Schild
2018-04-16 13:24 ` Andreas Reichel
2018-04-13 14:19 ` [PATCH v2 14/17] multiconfig: Switch qemuamd64-stretch to using wic by default Henning Schild
2018-04-16 10:25 ` Claudius Heine
2018-04-16 10:32 ` Henning Schild
2018-04-13 14:19 ` [PATCH v2 15/17] multiconfig: Switch qemui386-stretch " Henning Schild
2018-04-16 10:35 ` Andreas Reichel
2018-04-16 10:43 ` Henning Schild
2018-04-16 10:51 ` Henning Schild
2018-04-16 10:56 ` Claudius Heine
2018-04-13 14:19 ` [PATCH v2 16/17] docs: Change according to recent patches Henning Schild
2018-04-13 14:19 ` [PATCH v2 17/17] scripts/vm_smoke_test: double the timeout we wait for qemus Henning Schild
2018-04-16 10:47 ` Andreas Reichel
2018-04-16 11:45 ` Henning Schild
2018-04-25 15:53 ` [PATCH v2 00/16] wic integration Alexander Smirnov
2018-04-26 11:26 ` Henning Schild
2018-05-01 19:23 ` Alexander Smirnov
2018-05-03 16:32 ` Henning Schild
2018-05-03 16:39 ` Alexander Smirnov
2018-05-04 8:16 ` Henning Schild
2018-05-04 8:32 ` Alexander Smirnov
2018-05-04 9:30 ` Henning Schild
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180416103123.GA8866@iiotirae \
--to=andreas.reichel.ext@siemens.com \
--cc=claudius.heine.ext@siemens.com \
--cc=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox