From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6864480010557718528 X-Received: by 2002:a1c:40c4:: with SMTP id n187mr11516591wma.180.1599295087940; Sat, 05 Sep 2020 01:38:07 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:dd0a:: with SMTP id a10ls3814377wrm.2.gmail; Sat, 05 Sep 2020 01:38:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9yG1Zi7jslkkpfs2idIcsX80CpM1pCUyrnl0PcKRAH04qKiCwEizGGL2CVurBzEnAiCOG X-Received: by 2002:adf:a1d6:: with SMTP id v22mr11755558wrv.185.1599295087345; Sat, 05 Sep 2020 01:38:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599295087; cv=none; d=google.com; s=arc-20160816; b=C0qTBrxBFSBfzK3p7GryI/GO9pqx8B+JIqt+lVhQIFSPBluZMa1yz9J1qIJkwRcTLB CFajwdm8+Vqiz/7Cmu5jiGFnwQK3yHcKTwusS0ugbtX4TqzM4GEhm2ABcN13omfS3ifB v+CLVJ2dH6oi3NtwNp/KzUkNZhsGN+g2s27x9vdj/AMoztNmXesoVBfoEMkegAGjaBep 2xRnbnQVyCmuCdHhVSPMwatc9pRlCY0gAj8VdSkYiMLLYWdO8m/62T+oIzdB1YcAwp/B pnnV5TZNTltjDbIAom2WjaDzcJDsWejjFiL92qqSZntqk6vpIyqq2hou6KtcT6xw/N9x cMlw== 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:subject:cc:to:from:date; bh=oF/eRa/GzyVbJakn61HFBZr94w1DAaEpjVUwUgEph1k=; b=VQeBa7MV1Oi1dB2UloCkGu1KWHY+QW2L96ij7MzanpVjNb0VDd9CVzjF/R7fU5usZI oSShffsQ/0YAphOWTVLc/FM6GTmk4YtvitXUzy7RY6AS+QpVnFdLL6j480byDR6c1NNt lOhnIX5tDfmRQWPPVij1Lh2iKOCATOu1KDNueIyWDsR6/S4R3/OwCxcvFb/7s1H7sPp9 Cl3+SzKQH1ECh+Q1g8SWpU7DJTr1RY1fXyvBbdFgtl8LsnscLbSWzC+lq/6hHEDDK6ML P74pT/HK9IiNA2O2PwP7V/thTr1tx/TzeUWW9SC+x7J+tYj5dp65Jxk88z529xU/i1HP 43pQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id z17si288266wrm.2.2020.09.05.01.38.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Sep 2020 01:38:07 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id 0858c7Ni003000 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 5 Sep 2020 10:38:07 +0200 Received: from md1za8fc.ad001.siemens.net ([167.87.13.147]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 0858c6nJ004890; Sat, 5 Sep 2020 10:38:06 +0200 Date: Sat, 5 Sep 2020 10:38:06 +0200 From: Henning Schild To: Vijai Kumar K Cc: Subject: Re: [PATCH v2 06/10] wic_fakeroot: Handle standalone pseudo invocations Message-ID: <20200905103806.37dc1ba9@md1za8fc.ad001.siemens.net> In-Reply-To: <20200902185624.15044-7-Vijaikumar_Kanagarajan@mentor.com> References: <20200902185624.15044-1-Vijaikumar_Kanagarajan@mentor.com> <20200902185624.15044-7-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: fwbWdD4nE8sY On Thu, 3 Sep 2020 00:26:20 +0530 Vijai Kumar K 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 > --- > 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. > > # 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. 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.'):