From 91430a3cdbde1b010e8699cdf770a60793e85098 Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Fri, 8 Feb 2019 18:11:06 +0100 Subject: [PATCH] [rawfs] Add rawfs source to the `partitions` entry in global storage When using the `rawfs` module for copying data, it may be useful to save the source device used for later checks or actions. This commit therefore adds a `source` field to each corresponding partition entry in global storage, so that this information can be retrieved later during the installation process. Another small improvement is that global storage is now modified only once (it was previously modified as many times as there were entries processed by the `rawfs` module). Signed-off-by: Arnaud Ferraris --- src/modules/rawfs/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/rawfs/main.py b/src/modules/rawfs/main.py index 2ccb03b69..acf901a0c 100644 --- a/src/modules/rawfs/main.py +++ b/src/modules/rawfs/main.py @@ -156,8 +156,10 @@ def update_global_storage(item, gs): libcalamares.utils.debug("Setting {} UUID to {}".format(item.destination, ret.stdout.rstrip())) gs[gs.index(partition)]["uuid"] = ret.stdout.rstrip() - libcalamares.globalstorage.remove("partitions") - libcalamares.globalstorage.insert("partitions", gs) + gs[gs.index(partition)]["source"] = item.source + + libcalamares.globalstorage.remove("partitions") + libcalamares.globalstorage.insert("partitions", gs) def run(): """Raw filesystem copy module"""