public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "vijaikumar....@gmail.com" <vijaikumar.kanagarajan@gmail.com>
To: isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH v2 06/10] wic_fakeroot: Handle standalone pseudo invocations
Date: Sat, 5 Sep 2020 08:19:05 -0700 (PDT)	[thread overview]
Message-ID: <4bd30048-e7bf-486a-b500-d188086b8c9cn@googlegroups.com> (raw)
In-Reply-To: <20200905103806.37dc1ba9@md1za8fc.ad001.siemens.net>


[-- Attachment #1.1: Type: text/plain, Size: 3384 bytes --]



On Saturday, September 5, 2020 at 2:08:07 PM UTC+5:30 Henning Schild wrote:

> On Thu, 3 Sep 2020 00:26:20 +0530 
> Vijai Kumar K <Vijaikumar_...@mentor.com> wrote: 
>
> > When using --exclude-path option wic copies the rootfs to a new 
> > location and invokes pseudo as a standalone command to rebuild the 
> > database in the new rootfs. 
> > 
> > This is not applicable when using wic_fakeroot. Return 0 for such 
> > standalone invocations in wic_fakeroot. 
> > 
> > It also looks for files.db inside the pseudo directory and throws an 
> > exception if it is not found. Handle that too. 
> > 
> > Signed-off-by: Vijai Kumar K <Vijaikumar_...@mentor.com> 
> > --- 
> > meta/classes/wic-img.bbclass | 1 + 
> > scripts/wic_fakeroot | 5 +++++ 
> > 2 files changed, 6 insertions(+) 
> > 
> > diff --git a/meta/classes/wic-img.bbclass 
> > b/meta/classes/wic-img.bbclass index a2c9627..b1a7259 100644 
> > --- a/meta/classes/wic-img.bbclass 
> > +++ b/meta/classes/wic-img.bbclass 
> > @@ -144,6 +144,7 @@ EOSUDO 
> > export BUILDDIR=${BUILDDIR} 
> > export MTOOLS_SKIP_CHECK=1 
> > mkdir -p ${IMAGE_ROOTFS}/../pseudo 
> > + touch ${IMAGE_ROOTFS}/../pseudo/files.db 
>
> Where is this coming from? It is not mentioned in the commit message 
> and not used in the code. 
>

This is to handle [2].

These kind of workarounds come because we use fakeroot. And our fakeroot 
was just
to handle the fsck issue in stretch. That issue is still there in stretch 
package. The other approach
is to drop the wic_fakeroot and these subsequent quirks handling and carry 
one patch on top of wic
just for the fsck support in stretch. Anyway I proceeded with wic_fakeroot 
assuming that it might be
useful when facing such package compatibility issues. But I see that has 
become an overhead. If only
we can carry one patch on top of wic this all touch pseudo/files.db, 
startswith(-) quirks are not needed. 

[2]https://github.com/openembedded/openembedded-core/blob/404292b570a78895a1c7900eeb319e36e31dec20/scripts/lib/wic/plugins/source/rootfs.py#L130 


> > 
> > # create the temp dir in the buildchroot to ensure uniqueness 
> > WICTMP=$(cd ${BUILDCHROOT_DIR}; mktemp -d -p tmp) 
> > diff --git a/scripts/wic_fakeroot b/scripts/wic_fakeroot 
> > index 88a03fa..16b011e 100755 
> > --- a/scripts/wic_fakeroot 
> > +++ b/scripts/wic_fakeroot 
> > @@ -25,6 +25,11 @@ cmd = args[0] 
> > # rootfs/root ... 
> > assert os.geteuid() == 0, "wic_fakeroot must be run as root!" 
> > 
> > +# Check if we are calling the pseudo command itself. Return 1 
> > +# for standalone pseudo operations. 
> > +if cmd.startswith('-'): 
> > + sys.exit(0) 
>
> I find it hard to match the comment to the code i see. "-" means its 
> not a cmd but an arg to wic_fakeroot? And what about the 0 vs 1. 
>

Yes. There is an instance[1] where FAKEROOT, in case of oe the pseudo, is 
called
as a standalone command with options. We are checking whether the first
option is an argument starting with '-' returning 0 on such calls.

Good catch. I will fix the comment.

[1] 
https://github.com/openembedded/openembedded-core/blob/404292b570a78895a1c7900eeb319e36e31dec20/scripts/lib/wic/plugins/source/rootfs.py#L133


> Henning 
>
> > # 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.'): 
>
>

[-- Attachment #1.2: Type: text/html, Size: 4547 bytes --]

  reply	other threads:[~2020-09-05 15:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02 18:56 [PATCH v2 00/10] WIC update Vijai Kumar K
2020-09-02 18:56 ` [PATCH v2 01/10] wic: Update to the latest wic from openembedded core Vijai Kumar K
2020-09-05  9:00   ` Henning Schild
2020-09-05  9:21     ` vijai kumar
2020-09-02 18:56 ` [PATCH v2 02/10] wic/plugins: Fix wic plugins to work with the latest wic Vijai Kumar K
2020-09-02 18:56 ` [PATCH v2 03/10] wic-img: Satisfy the quirks of " Vijai Kumar K
2020-09-05  8:30   ` Henning Schild
2020-09-05 16:24     ` vijaikumar....@gmail.com
2020-09-09 14:52       ` Henning Schild
2020-09-02 18:56 ` [PATCH v2 04/10] oe.path: Add copyhardlink() helper function Vijai Kumar K
2020-09-02 18:56 ` [PATCH v2 05/10] lib/oe/path: try hardlinking instead of guessing when it might fail Vijai Kumar K
2020-09-02 18:56 ` [PATCH v2 06/10] wic_fakeroot: Handle standalone pseudo invocations Vijai Kumar K
2020-09-05  8:38   ` Henning Schild
2020-09-05 15:19     ` vijaikumar....@gmail.com [this message]
2020-09-05  9:19   ` Henning Schild
2020-09-05 15:22     ` vijaikumar....@gmail.com
2020-09-02 18:56 ` [PATCH v2 07/10] meta-isar/conf: Add provision to debug WIC Vijai Kumar K
2020-09-02 18:56 ` [PATCH v2 08/10] debian-common: Add tar as a dependency for wic Vijai Kumar K
2020-09-02 19:02   ` [PATCH v2 09/10] wic: misc: Add /bin to the list of searchpaths Vijai Kumar K
2020-09-02 19:02     ` [PATCH v2 10/10] meta-isar/canned-wks: Remove /boot mountpoint Vijai Kumar K
2020-09-05  8:58       ` Henning Schild
2020-09-05 16:06         ` vijaikumar....@gmail.com
2020-09-09 15:09           ` Henning Schild
2020-09-14  5:32             ` vijaikumar....@gmail.com
2020-09-05  8:45     ` [PATCH v2 09/10] wic: misc: Add /bin to the list of searchpaths Henning Schild
2020-09-05  9:33       ` vijai kumar
2020-09-03  5:46 ` [PATCH v2 00/10] WIC update vijaikumar....@gmail.com
2020-09-05  9:04   ` Henning Schild
2020-09-05  9:25     ` vijai kumar

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=4bd30048-e7bf-486a-b500-d188086b8c9cn@googlegroups.com \
    --to=vijaikumar.kanagarajan@gmail.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