From e92927cff9dbbe7e9c3f3fa1e86d3c5ac01421b3 Mon Sep 17 00:00:00 2001 From: Kris Adler Date: Sat, 3 Oct 2020 17:38:20 -0500 Subject: [PATCH] [preservefiles] Fix global storage JSON dump fixes calamares/calamares#1521 --- src/libcalamares/GlobalStorage.h | 2 +- src/modules/preservefiles/PreserveFiles.cpp | 4 ++-- src/modules/preservefiles/preservefiles.conf | 9 ++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/libcalamares/GlobalStorage.h b/src/libcalamares/GlobalStorage.h index 9d8e3849b..a0a1940f2 100644 --- a/src/libcalamares/GlobalStorage.h +++ b/src/libcalamares/GlobalStorage.h @@ -22,7 +22,7 @@ namespace Calamares /** @brief Storage for data that passes between Calamares modules. * - * The Global Storage is global to the Calamars JobQueue and + * The Global Storage is global to the Calamares JobQueue and * everything that depends on that: all of its modules use the * same instance of the JobQueue, and so of the Global Storage. * diff --git a/src/modules/preservefiles/PreserveFiles.cpp b/src/modules/preservefiles/PreserveFiles.cpp index 8194b3221..64770adce 100644 --- a/src/modules/preservefiles/PreserveFiles.cpp +++ b/src/modules/preservefiles/PreserveFiles.cpp @@ -137,9 +137,9 @@ PreserveFiles::exec() } if ( it.type == ItemType::Config ) { - if ( Calamares::JobQueue::instance()->globalStorage()->saveJson( dest ) ) + if ( !Calamares::JobQueue::instance()->globalStorage()->saveJson( dest ) ) { - cWarning() << "Could not write config for" << dest; + cWarning() << "Could not write a JSON dump of global storage to" << dest; } else { diff --git a/src/modules/preservefiles/preservefiles.conf b/src/modules/preservefiles/preservefiles.conf index 962ca756a..6af0872d7 100644 --- a/src/modules/preservefiles/preservefiles.conf +++ b/src/modules/preservefiles/preservefiles.conf @@ -31,10 +31,9 @@ # page (may be empty, for instance if no user page is enabled) # # Special values for the key *from* are: -# - *log*, for the complete log file (up to the moment the preservefiles -# module is run), -# - *config*, for the Calamares configuration file -# - *globals*, for a JSON dump of the contents of global storage +# - *log*, for the complete log file (up to the moment the preservefiles +# module is run), +# - *config*, for a JSON dump of the contents of global storage --- files: - /etc/oem-information @@ -42,7 +41,7 @@ files: dest: /root/install.log perm: root:wheel:644 - from: config - dest: /root/install.cfg + dest: /root/install.json perm: root:wheel:400 # The *perm* key contains a default value to apply to all files listed