summaryrefslogtreecommitdiff
path: root/src/sysext
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-11-18 22:00:31 +0100
committerLennart Poettering <lennart@poettering.net>2021-11-23 22:55:11 +0100
commit60c5f7002bfee928fb8799eb35e5cc95da982a48 (patch)
tree914764af8704c787ece225a0f97aa01afefa4c22 /src/sysext
parenta4e0d6171318b5f381a1cbdb6de895920d7f15d6 (diff)
downloadsystemd-60c5f7002bfee928fb8799eb35e5cc95da982a48.tar.gz
extension-release.d/: add a new field SYSEXT_SCOPE= for clarifying what a system extension is for
This should make things a bit more robust since it ensures system extension can only applied to the right environments. Right now three different "scopes" are defined: 1. "system" (for regular OS systems, after the initrd transition) 2. "initrd" (for sysext images that apply to the initrd environment) 3. "portable" (for sysext images that apply to portable images) If not specified we imply a default of "system portable", i.e. any image where the field is not specified is implicitly OK for application to OS images and for portable services – but not for initrds.
Diffstat (limited to 'src/sysext')
-rw-r--r--src/sysext/sysext.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sysext/sysext.c b/src/sysext/sysext.c
index b9387e904a..5abf1bb418 100644
--- a/src/sysext/sysext.c
+++ b/src/sysext/sysext.c
@@ -432,12 +432,17 @@ static int validate_version(
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Extension image contains /usr/lib/os-release file, which is not allowed (it may carry /etc/os-release), refusing.");
- return extension_release_validate(
+ r = extension_release_validate(
img->name,
host_os_release_id,
host_os_release_version_id,
host_os_release_sysext_level,
+ in_initrd() ? "initrd" : "system",
img->extension_release);
+ if (r < 0)
+ return log_error_errno(r, "Failed to validate extension release information: %m");
+
+ return r;
}
static int merge_subprocess(Hashmap *images, const char *workspace) {