From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6864480010557718528 Date: Sat, 5 Sep 2020 08:22:42 -0700 (PDT) From: "vijaikumar....@gmail.com" To: isar-users Message-Id: <4bab934c-d608-4693-8c7a-ca3695f514e9n@googlegroups.com> In-Reply-To: <20200905111923.1fb5065c@md1za8fc.ad001.siemens.net> References: <20200902185624.15044-1-Vijaikumar_Kanagarajan@mentor.com> <20200902185624.15044-7-Vijaikumar_Kanagarajan@mentor.com> <20200905111923.1fb5065c@md1za8fc.ad001.siemens.net> Subject: Re: [PATCH v2 06/10] wic_fakeroot: Handle standalone pseudo invocations MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1094_1541477835.1599319362510" X-TUID: qxXFcMKGlnW2 ------=_Part_1094_1541477835.1599319362510 Content-Type: multipart/alternative; boundary="----=_Part_1095_2017919167.1599319362510" ------=_Part_1095_2017919167.1599319362510 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Saturday, September 5, 2020 at 2:49:26 PM UTC+5:30 Henning Schild wrote: > wic_fakeroot says that it can eventually be replaced with "true", which > would make this patch obsolete. And probably the python symlinking from > the previous patch. > > The stretch debian package has gotten a few updates since, and jessie > is not support by isar anymore. So maybe worth checking if the fsck > hack is still needed, and therefore the whole script. Also what wic > calls might have changed, or it might itself "ignore" the problem that > my code seems to work around there. > When I tested, this was not the case, stretch would still need this fsck hack to work. > > Same goes for "export MTOOLS_SKIP_CHECK=1", that might not be required > anymore. and should be double-checked. > Not either. We would still need this at least for stretch I think. I will check again though just to verify my observation back then. > > Henning > > > 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 > > > > # 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) > > + > > # 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.'): > > ------=_Part_1095_2017919167.1599319362510 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

On Saturday, September 5, 2020 at 2:49:26 PM UTC+5:30 Henning Schild wrote:
wic_fakeroot says that it can eventually be replaced with "true", which
would make this patch obsolete. And probably the python symlinking from
the previous patch.

The stretch debian package has gotten a few updates since, and jessie
is not support by isar anymore. So maybe worth checking if the fsck
hack is still needed, and therefore the whole script. Also what wic
calls might have changed, or it might itself "ignore" the problem that
my code seems to work around there.

When I tested, this was not the case, stretch would still need this fsck hack to
work.
 

Same goes for "export MTOOLS_SKIP_CHECK=1", that might not be required
anymore. and should be double-checked.

Not either. We would still need this at least for stretch I think. I will check again though
just to verify my observation back then.
 

Henning


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

------=_Part_1095_2017919167.1599319362510-- ------=_Part_1094_1541477835.1599319362510--