return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"The --instances-max argument must be >= 2 while updating");
- 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.");
-
if (arg_reboot) {
/* If automatic reboot on completion is requested, let's first determine the currently booted image */
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_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.");
+
if (arg_definitions && arg_component)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "The --definitions= and --component= switches may not be combined.");
# version against the booted OS version (IMAGE_VERSION= from os-release), which is
# unrelated to component versions. Selecting a component must therefore be refused
# rather than silently performing a bogus comparison.
-(! "$SYSUPDATE" --component=some-component pending)
-(! "$SYSUPDATE" --component=some-component reboot)
-(! "$SYSUPDATE" --component=some-component update --reboot)
+(! "$SYSUPDATE" --component=some-component pending) |& grep -F 'may not be combined' >/dev/null
+(! "$SYSUPDATE" --component=some-component reboot) |& grep -F 'may not be combined' >/dev/null
+(! "$SYSUPDATE" --component=some-component update --reboot) |& grep -F 'may not be combined' >/dev/null
# Clean up regression test
rmdir /run/sysupdate.d