Hi Richard

On Sun, Apr 5, 2020 at 1:04 PM Richard Purdie
<richard.pur...@linuxfoundation.org> wrote:
>
> On Sun, 2020-04-05 at 11:56 +0200, Ricardo Ribalda Delgado wrote:
> > Hi Richard
> >
> > I have tried with master  (0c91fcba446418ad1f71d3df9aa3b186bbd353c7)
> > +
> > my two patches.
> > Then I have used crops/poky:fedora-30
> >
> > and: oe-selftest  --run-tests wic.Wic.test_exclude_path oe-selftest
> > --run-tests wic.Wic.test_include_path wic.Wic.test_exclude_path
> >
> > With an OK result :(
>
> I worried this may be the case. There definitely is something wrong and
> I could replicate it a third time too.
>
> My guess is that there are perhaps files in /tmp/ which are logged in
> the pseudo database but don't exist when the second rootfs is created.
> Since the files no longer exist, the database integrity check fails.

That is definitely a good hypothesis. Since you can replicate the bug,
can you try to add also the attached patch to your tree and re-run the
test.

What it does, is to remove a file from the database if it has
vanished, during the bitbake move.

If it works I can add it to the beginning of my series, or even trying
to upstream it to pseudo.

Best regards

>
> Why that only occurs on Fedora case on the autobuilder, I don't know,
> I'm just hypothesising right now...
>
> Cheers,
>
> Richard
>


-- 
Ricardo Ribalda
From bbddec527d9056e1feda0d21edd8ddb9d64623b2 Mon Sep 17 00:00:00 2001
From: Ricardo Ribalda Delgado <rica...@ribalda.com>
Date: Sun, 5 Apr 2020 13:47:12 +0200
Subject: [PATCH] pseudo: During DB fix, remove files that do not exist

If a file does not exist, either because it has been removed outside
bitbake, or because only some of the files have been moved to a
different location, delete it from the pseudo-db is the user decides to
fix the database.

Signed-off-by: Ricardo Ribalda Delgado <rica...@ribalda.com>
---
 ...ixup-remove-files-that-do-not-exist-.patch | 48 +++++++++++++++++++
 meta/recipes-devtools/pseudo/pseudo_git.bb    |  1 +
 2 files changed, 49 insertions(+)
 create mode 100644 meta/recipes-devtools/pseudo/files/0001-pseudo-On-a-DB-fixup-remove-files-that-do-not-exist-.patch

diff --git a/meta/recipes-devtools/pseudo/files/0001-pseudo-On-a-DB-fixup-remove-files-that-do-not-exist-.patch b/meta/recipes-devtools/pseudo/files/0001-pseudo-On-a-DB-fixup-remove-files-that-do-not-exist-.patch
new file mode 100644
index 0000000000..8aec1c9551
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/0001-pseudo-On-a-DB-fixup-remove-files-that-do-not-exist-.patch
@@ -0,0 +1,48 @@
+From b0902e36108b49e6bc88d6b251cc2f8cffcd5a13 Mon Sep 17 00:00:00 2001
+From: Ricardo Ribalda <rica...@ribalda.com>
+Date: Sun, 5 Apr 2020 11:40:30 +0000
+Subject: [PATCH] pseudo: On a DB fixup remove files that do not exist anymore
+
+If the user decides to fix a database, remove the files that do not
+exist anymore.
+If only DB test is selected do not change the behaviour (return error).
+
+Signed-off-by: Ricardo Ribalda <rica...@ribalda.com>
+---
+ pseudo.c | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/pseudo.c b/pseudo.c
+index 0f5850e..98e5b0c 100644
+--- a/pseudo.c
++++ b/pseudo.c
+@@ -1087,9 +1087,15 @@ pseudo_db_check(int fix) {
+ 			int fixup_needed = 0;
+ 			pseudo_debug(PDBGF_DB, "Checking <%s>\n", m->path);
+ 			if (lstat(m->path, &buf)) {
+-				errors = EXIT_FAILURE;
+-				pseudo_diag("can't stat <%s>\n", m->path);
+-				continue;
++				if (!fix) {
++					pseudo_diag("can't stat <%s>\n", m->path);
++					errors = EXIT_FAILURE;
++					continue;
++				} else {
++					pseudo_debug("can't stat <%s>\n", m->path);
++					fixup_needed = 2;
++					goto do_fixup;
++				}
+ 			}
+ 			/* can't check for device type mismatches, uid/gid, or
+ 			 * permissions, because those are the very things we
+@@ -1125,6 +1131,7 @@ pseudo_db_check(int fix) {
+ 					S_ISDIR(m->mode));
+ 				fixup_needed = 2;
+ 			}
++			do_fixup:
+ 			if (fixup_needed) {
+ 				/* in fixup mode, either delete (mismatches) or
+ 				 * correct (dev/ino).
+-- 
+2.21.1
+
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
index 89e43c5996..a3049c5e6c 100644
--- a/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -11,6 +11,7 @@ SRC_URI = "git://git.yoctoproject.org/pseudo \
            file://0001-realpath.c-Remove-trailing-slashes.patch \
            file://0006-xattr-adjust-for-attr-2.4.48-release.patch \
            file://seccomp.patch \
+           file://0001-pseudo-On-a-DB-fixup-remove-files-that-do-not-exist-.patch \
            "
 
 SRCREV = "060058bb29f70b244e685b3c704eb0641b736f73"
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#137032): 
https://lists.openembedded.org/g/openembedded-core/message/137032
Mute This Topic: https://lists.openembedded.org/mt/72395318/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to