aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-core/swupd-server/swupd-server/0002-Add-configure-option-to-re-enable-config-files-in-ma.patch
blob: a5ab7afdeff7dc27afc26382eb5de51a75233f42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From e209255d8985eb4eb4c43f5e773ee1a0a16eb297 Mon Sep 17 00:00:00 2001
From: Joshua Lock <joshua.g.lock@intel.com>
Date: Fri, 12 Feb 2016 16:02:58 +0000
Subject: [PATCH 2/2] Add configure option to re-enable config files in
 manifests

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>

Upstream-Status: Accepted (v3.0+)

---
 configure.ac    | 6 ++++++
 include/swupd.h | 6 ++++++
 src/manifest.c  | 2 +-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 8bb6e3b..afffad5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,6 +28,12 @@ AC_ARG_ENABLE(
     AC_DEFINE(SWUPD_WITH_LZMA,1,[Use lzma compression])
 	[enable_lzma=check]
 )
+AC_ARG_ENABLE(
+    [stateless],
+    AS_HELP_STRING([--disable-stateless],[OS is not stateless, do not ignore configuration files (stateless by default)]),
+    AC_DEFINE(SWUPD_WITH_STATELESS,0,[OS is not stateless]),
+		AC_DEFINE(SWUPD_WITH_STATELESS,1,[OS is stateless])
+)
 
 AS_IF([test "$enable_lzma" = "check"],
 	[PKG_CHECK_MODULES([lzma],
diff --git a/include/swupd.h b/include/swupd.h
index 58307d9..7cce735 100644
--- a/include/swupd.h
+++ b/include/swupd.h
@@ -23,6 +23,12 @@
 #define TAR_PERM_ATTR_ARGS "--preserve-permissions --xattrs --xattrs-include='*'"
 #endif
 
+#if SWUPD_WITH_STATELESS
+#define OS_IS_STATELESS 1
+#else
+#define OS_IS_STATELESS 0
+#endif
+
 /* Build types */
 #define REGULAR_BUILD 0
 #define FIX_BUILD     1
diff --git a/src/manifest.c b/src/manifest.c
index 69a8fb9..58d0be1 100644
--- a/src/manifest.c
+++ b/src/manifest.c
@@ -830,7 +830,7 @@ int prune_manifest(struct manifest *manifest)
 		next = g_list_next(list);
 		file = list->data;
 
-		if ((!file->is_deleted) && (file->is_config)) {
+		if (OS_IS_STATELESS && (!file->is_deleted) && (file->is_config)) {
 			// toward being a stateless OS
 			LOG(file, "Skipping config file in manifest write", "component %s", manifest->component);
 			manifest->files = g_list_delete_link(manifest->files, list);
-- 
2.5.0