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
|
From f35e84199529c0dc320d8d4280a79b8060dbaf21 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] 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 0cb074f..47256b6 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 ad4b967..d45ca9c 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 251c884..24403e3 100644
--- a/src/manifest.c
+++ b/src/manifest.c
@@ -825,7 +825,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
|