aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2016-11-08 21:15:27 +0100
committerPatrick Ohly <patrick.ohly@intel.com>2016-12-08 14:12:56 +0100
commit7c7b11c209f5d24c42c30767928142206840da36 (patch)
tree89cc0067f7097464280b84e877b73e4df032217f
parent32963d9cfed031b93294767a39bbc461ff9b579b (diff)
downloadmeta-swupd-7c7b11c209f5d24c42c30767928142206840da36.tar.gz
meta-swupd-7c7b11c209f5d24c42c30767928142206840da36.tar.bz2
meta-swupd-7c7b11c209f5d24c42c30767928142206840da36.zip
swupd-server: avoid pseudo xattr removal bug
Not removing the directories is okay: typically we don't build incrementally, and we can remove any remaining ones before invoking swupd. Not removing a tempory directory tree may also have performance benefits, but the even better solution will be to not write the tree in the first place by calling libarchive directly. Related-to: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10623 Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
-rw-r--r--classes/swupd-image.bbclass5
-rw-r--r--recipes-core/swupd-server/swupd-server/0002-pack.c-do-not-clean-packstage.patch38
-rw-r--r--recipes-core/swupd-server/swupd-server_git.bb1
3 files changed, 44 insertions, 0 deletions
diff --git a/classes/swupd-image.bbclass b/classes/swupd-image.bbclass
index e849f56..4e03c1a 100644
--- a/classes/swupd-image.bbclass
+++ b/classes/swupd-image.bbclass
@@ -380,6 +380,11 @@ END
fi
done
+ # Remove any remaining intermediate artifacts from a previous run.
+ # Necessary because the corresponding cleanup in swupd-server is
+ # disabled because of https://bugzilla.yoctoproject.org/show_bug.cgi?id=10623.
+ rm -rf ${DEPLOY_DIR_SWUPD}/packstage
+
invoke_swupd () {
echo $PSEUDO "$@"
time env $PSEUDO "$@"
diff --git a/recipes-core/swupd-server/swupd-server/0002-pack.c-do-not-clean-packstage.patch b/recipes-core/swupd-server/swupd-server/0002-pack.c-do-not-clean-packstage.patch
new file mode 100644
index 0000000..4cc3af4
--- /dev/null
+++ b/recipes-core/swupd-server/swupd-server/0002-pack.c-do-not-clean-packstage.patch
@@ -0,0 +1,38 @@
+From 7b9e1bc78b704a2fb9610dddc6f0925bb6412f55 Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly@intel.com>
+Date: Tue, 8 Nov 2016 18:34:44 +0100
+Subject: [PATCH 2/3] pack.c: do not clean packstage
+
+This works around a bug in pseudo
+(https://bugzilla.yoctoproject.org/show_bug.cgi?id=10623) where
+unlinking the linked entries in the staging area also removes the
+xattrs of the original files in the full directory tree.
+
+This works as long as the swupd_create_pack command does not get
+called again without cleaning the packstage.
+
+Upstream-Status: Inappropriate [workaround]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ src/pack.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/pack.c b/src/pack.c
+index 46c7c68..984c2d6 100644
+--- a/src/pack.c
++++ b/src/pack.c
+@@ -46,7 +46,9 @@ static void empty_pack_stage(int full, int from_version, int to_version, char *m
+ // clean any stale data (eg: re-run after a failure)
+ string_or_die(&param, "%s/%s/%i_to_%i/", packstage_dir, module, from_version, to_version);
+ char *const rmcmd[] = { "rm", "-fr", param, NULL };
+- if (system_argv(rmcmd) != 0) {
++ if (true) {
++ LOG(NULL, "Skipping removal of packstage", "%s/%s/%i_to_%i/", packstage_dir, module, from_version, to_version);
++ } else if (system_argv(rmcmd) != 0) {
+ fprintf(stderr, "Failed to clean %s/%s/%i_to_%i\n",
+ packstage_dir, module, from_version, to_version);
+ free(param);
+--
+2.1.4
+
diff --git a/recipes-core/swupd-server/swupd-server_git.bb b/recipes-core/swupd-server/swupd-server_git.bb
index 63932c4..2ee8642 100644
--- a/recipes-core/swupd-server/swupd-server_git.bb
+++ b/recipes-core/swupd-server/swupd-server_git.bb
@@ -17,6 +17,7 @@ SRC_URI = "git://github.com/clearlinux/swupd-server.git;protocol=https \
file://0002-add-logging-to-stdout.patch \
file://swupd_create_fullfiles-avoid-segfault-when-nothing-c.patch \
file://0001-delta.c-fix-xattr-test-after-patching.patch \
+ file://0002-pack.c-do-not-clean-packstage.patch \
"
SRCREV = "ddca171dad32229ceeff8b8527a179610b88ce55"