bootctl: return recognizable Varlink error when we cannot determine the boot entry token
When running "bootctl install" on an empty --root= dir, we don't know which token to use, and the operation will fail. Make sure to return an explicit error about this. This introduces a recognizable low-level error for this (EUNATCH), and then turns this into a recognizable Varlink error. (I made sure that the old low-level error EINVAL wasn't load-bearing, and it is safe to change this.)
This commit is contained in:
@@ -2087,6 +2087,8 @@ int vl_method_install(
|
||||
return r;
|
||||
|
||||
r = run_install(&p.context);
|
||||
if (r == -EUNATCH) /* no boot entry token is set */
|
||||
return sd_varlink_error(link, "io.systemd.BootControl.BootEntryTokenUnavailable", NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user