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
|
From d648898c8f9823a8d511507f93390079954bc24a Mon Sep 17 00:00:00 2001
From: Joshua Lock <joshua.g.lock@intel.com>
Date: Mon, 18 Apr 2016 13:30:18 +0100
Subject: [PATCH] Add configure option to re-enable updating of config files
Upstream-Status: Pending
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
---
configure.ac | 7 +++++++
src/heuristics.c | 5 +++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index b1905f0..4a5c029 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,6 +63,13 @@ AS_IF([test "x$enable_bsdtar" = "xyes" ],
[AC_DEFINE(SWUPD_WITHOUT_BSDTAR, 1, [Use default tar])]
)
+AC_ARG_ENABLE(
+ [stateless],
+ AS_HELP_STRING([--disable-stateless],[OS is not stateless, do not ignore configuration files (stateless by default)]),
+ AC_DEFINE(OS_IS_STATELESS,0,[OS is not stateless]),
+ AC_DEFINE(OS_IS_STATELESS,1,[OS is stateless])
+)
+
AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
[path to systemd system service dir @<:@default=/usr/lib/systemd/system@:>@]), [unitpath=${withval}],
[unitpath="$($PKG_CONFIG --variable=systemdsystemunitdir systemd)"])
diff --git a/src/heuristics.c b/src/heuristics.c
index e7c0632..c488e17 100644
--- a/src/heuristics.c
+++ b/src/heuristics.c
@@ -27,6 +27,7 @@
#include <string.h>
#include <unistd.h>
+#include "config.h"
#include "swupd.h"
/* trailing slash is to indicate dir itself is expected to exist, but
@@ -121,8 +122,8 @@ void apply_heuristics(struct file *file)
*/
bool ignore(struct file *file)
{
- if ((file->is_config) ||
- is_config(file->filename) || // ideally we trust the manifest but short term reapply check here
+ if ((OS_IS_STATELESS && file->is_config) ||
+ (OS_IS_STATELESS && is_config(file->filename)) || // ideally we trust the manifest but short term reapply check here
(file->is_state) ||
is_state(file->filename) || // ideally we trust the manifest but short term reapply check here
(file->is_boot && file->is_deleted) ||
--
2.5.5
|