This is the first varlink method added to sysupdate. The D-Bus interface
(via sysupdated) will remain for now; the varlink interface will exist
in parallel.
This method can be called via:
```
varlinkctl call ./path/to/systemd-sysupdate \
io.systemd.SysUpdate.CheckNew \
'{"target":{"class":"host"}}'
SYSTEMD_SYSUPDATE_NO_VERIFY=1 \
varlinkctl call ./path/to/systemd-sysupdate \
io.systemd.SysUpdate.CheckNew \
'{"target":{"class":"component","name":"some-component"}}'
```
This includes some changes to run the integration tests again using the
varlink interface rather than running `systemd-sysupdate` directly, to
test the new interface.
51 lines
1.2 KiB
C
51 lines
1.2 KiB
C
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
#pragma once
|
|
|
|
#include "specifier.h"
|
|
#include "sysupdate-forward.h"
|
|
#include "sysupdate-target.h"
|
|
|
|
typedef struct Context {
|
|
/* Parameters/Command line arguments: */
|
|
char *definitions;
|
|
bool sync;
|
|
uint64_t instances_max;
|
|
char *root;
|
|
char *image;
|
|
bool reboot;
|
|
int cleanup;
|
|
char *component;
|
|
bool component_all;
|
|
int verify;
|
|
ImagePolicy *image_policy;
|
|
bool offline;
|
|
char *transfer_source;
|
|
|
|
/* Loaded state: */
|
|
LoopDevice *loop_device;
|
|
char *mounted_dir;
|
|
|
|
Transfer **transfers;
|
|
size_t n_transfers;
|
|
|
|
Transfer **disabled_transfers;
|
|
size_t n_disabled_transfers;
|
|
|
|
Hashmap *features; /* Defined features, keyed by ID */
|
|
|
|
UpdateSet **update_sets;
|
|
size_t n_update_sets;
|
|
|
|
UpdateSet *newest_installed, *candidate;
|
|
|
|
Hashmap *web_cache; /* Cache for downloaded resources, keyed by URL */
|
|
|
|
int installdb_fd;
|
|
|
|
TargetIdentifier target_identifier;
|
|
} Context;
|
|
|
|
void context_done(Context *c);
|
|
|
|
extern const Specifier specifier_table[];
|