From 07ddb0584cac31be89fd111709519991fbd13de4 Mon Sep 17 00:00:00 2001 From: "Baeuerle, Florian" Date: Wed, 19 Dec 2018 14:02:04 +0000 Subject: envfs: Sort files when generating on build machine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The resulting environment was dependend of the build machines' filesystem, i.e. the order in which readdir returns dirents depends on the filesystem implementation. Sort file entries in scripts/bareboxenv.c for generating a reproducible built-in environment. Signed-off-by: Florian Bäuerle Signed-off-by: Sascha Hauer --- common/environment.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/environment.c b/common/environment.c index 56a030eda0..aba6dcde48 100644 --- a/common/environment.c +++ b/common/environment.c @@ -277,9 +277,9 @@ int envfs_save(const char *filename, const char *dirname, unsigned flags) size = 0; /* force no content */ } else { /* first pass: calculate size */ - recursive_action(dirname, ACTION_RECURSE, file_action, + recursive_action(dirname, ACTION_RECURSE | ACTION_SORT, file_action, NULL, &data, 0); - recursive_action("/.defaultenv", ACTION_RECURSE, + recursive_action("/.defaultenv", ACTION_RECURSE | ACTION_SORT, file_remove_action, NULL, &data, 0); size = 0; -- cgit v1.2.3