summaryrefslogtreecommitdiffstats
path: root/src/dissect
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-12-18 12:22:40 +0100
committerLennart Poettering <lennart@poettering.net>2019-12-23 14:43:59 +0100
commitd4dffb8533a038fd42da8aae00ed2b09495dedb0 (patch)
tree16d797db584eb3e67cc810848e12bdd42f44158f /src/dissect
parentbash-completion: move shell-completion for log-level or friends to systemctl (diff)
downloadsystemd-d4dffb8533a038fd42da8aae00ed2b09495dedb0.tar.xz
systemd-d4dffb8533a038fd42da8aae00ed2b09495dedb0.zip
dissect: introduce new recognizable partition types for /var and /var/tmp
This has been requested many times before. Let's add it finally. GPT auto-discovery for /var is a bit more complex than for other partition types: the other partitions can to some degree be shared between multiple OS installations on the same disk (think: swap, /home, /srv). However, /var is inherently something bound to an installation, i.e. specific to its identity, or actually *is* its identity, and hence something that cannot be shared. To deal with this this new code is particularly careful when it comes to /var: it will not mount things blindly, but insist that the UUID of the partition matches a hashed version of the machine-id of the installation, so that each installation has a very specific /var associated with it, and would never use any other. (We actually use HMAC-SHA256 on the GPT partition type for /var, keyed by the machine-id, since machine-id is something we want to keep somewhat private). Setting the right UUID for installations takes extra care. To make things a bit simpler to set up, we avoid this safety check for nspawn and RootImage= in unit files, under the assumption that such container and service images unlikely will have multiple installations on them. The check is hence only required when booting full machines, i.e. in in systemd-gpt-auto-generator. To help with putting together images for full machines, PR #14368 introduces a repartition tool that can automatically fill in correctly calculated UUIDs on first boot if images have the var partition UUID initialized to all zeroes. With that in place systems can be put together in a way that on first boot the machine ID is determined and the partition table automatically adjusted to have the /var partition with the right UUID.
Diffstat (limited to 'src/dissect')
-rw-r--r--src/dissect/dissect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c
index c1be6c034c..2fef95aa02 100644
--- a/src/dissect/dissect.c
+++ b/src/dissect/dissect.c
@@ -22,7 +22,7 @@ static enum {
} arg_action = ACTION_DISSECT;
static const char *arg_image = NULL;
static const char *arg_path = NULL;
-static DissectImageFlags arg_flags = DISSECT_IMAGE_REQUIRE_ROOT|DISSECT_IMAGE_DISCARD_ON_LOOP;
+static DissectImageFlags arg_flags = DISSECT_IMAGE_REQUIRE_ROOT|DISSECT_IMAGE_DISCARD_ON_LOOP|DISSECT_IMAGE_RELAX_VAR_CHECK;
static void *arg_root_hash = NULL;
static size_t arg_root_hash_size = 0;