Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
heuristics: set /usr/src/kernel as not state dir
Browse files Browse the repository at this point in the history
The kernel sources will be shipped in /usr/src/kernel but /usr/src/* is
state.

This commit enables /usr/src/kernel and its contents as a no state
directory.

Fixes #108

Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
  • Loading branch information
miguelinux authored and matthewrsj committed Dec 14, 2017
1 parent 9d3a813 commit e814a73
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/heuristics.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ static void runtime_state_heuristics(struct file *file)
/* these are shipped directories that are not themselves state,
* rather only their contents are state */
if ((strcmp(file->filename, "/usr/src/debug") == 0) ||
(strcmp(file->filename, "/usr/src/kernel") == 0) ||
(strcmp(file->filename, "/dev") == 0) ||
(strcmp(file->filename, "/home") == 0) ||
(strcmp(file->filename, "/proc") == 0) ||
Expand All @@ -56,6 +57,12 @@ static void runtime_state_heuristics(struct file *file)
return;
}

/* the contents of these directory are not state,
* but it belongs to a state directory */
if ((strncmp(file->filename, "/usr/src/kernel/", 16) == 0)) {
return;
}

/* the contents of these directory are state, ideally this never
* triggers if our package builds are clean */
if ((strncmp(file->filename, "/dev/", 5) == 0) ||
Expand All @@ -72,7 +79,7 @@ static void runtime_state_heuristics(struct file *file)
return;
}

/* these are commonly added directories for user customizatio,
/* these are commonly added directories for user customization,
* ideally this never triggers if our package builds are clean */
if ((strncmp(file->filename, "/acct", 5) == 0) ||
(strncmp(file->filename, "/cache", 6) == 0) ||
Expand Down

0 comments on commit e814a73

Please sign in to comment.