]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sysupdate: explicitly refuse --root=/--image= in conjunction with --definitions=
authorLennart Poettering <lennart@amutable.com>
Fri, 10 Jul 2026 08:53:12 +0000 (10:53 +0200)
committerLennart Poettering <lennart@amutable.com>
Fri, 10 Jul 2026 12:27:11 +0000 (14:27 +0200)
This is currently effectively not supported (as we sometimes prefix the
definitions path with root and sometimes not), let's make this official
for now and refuse it. We could in theory support the combination but I
don't see the big benefit of it for now, hence let's just refuse it.

src/sysupdate/sysupdate.c

index fe39d31f6a90c3495e64cd7932705874ff3e5bf6..c31e7117956f0dd6843fa245baa98ab055510ee8 100644 (file)
@@ -2636,8 +2636,13 @@ static int parse_argv(int argc, char *argv[], char ***remaining_args) {
         if (arg_image && arg_root)
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Please specify either --root= or --image=, the combination of both is not supported.");
 
-        if ((arg_image || arg_root) && arg_reboot)
-                return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "The --reboot switch may not be combined with --root= or --image=.");
+        if (arg_image || arg_root) {
+                if (arg_reboot)
+                        return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "The --reboot switch may not be combined with --root= or --image=.");
+
+                if (arg_definitions)
+                        return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "The --definitions= switch may not be combined with --root= or --image=.");
+        }
 
         if (arg_reboot && arg_component)
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "The --reboot switch may not be combined with --component=, as automatic reboots only apply to the booted OS version.");