mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 10:13:34 +08:00
kernel-install: unquote plugin paths in KERNEL_INSTALL_PLUGINS
To support the case that paths to plugins contain spaces. Prompted by #34459
This commit is contained in:
parent
0432e28394
commit
6e1816ef16
@ -404,15 +404,16 @@ static int context_set_path_strv(Context *c, char* const* strv, const char *sour
|
||||
|
||||
static int context_set_plugins(Context *c, const char *s, const char *source) {
|
||||
_cleanup_strv_free_ char **v = NULL;
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
|
||||
if (c->plugins || !s)
|
||||
return 0;
|
||||
|
||||
v = strv_split(s, NULL);
|
||||
if (!v)
|
||||
return log_oom();
|
||||
r = strv_split_full(&v, s, NULL, EXTRACT_UNQUOTE);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to parse plugin paths from %s: %m", source);
|
||||
|
||||
return context_set_path_strv(c, v, source, "plugins", &c->plugins);
|
||||
}
|
||||
|
@ -46,7 +46,13 @@ echo 'DTBDTBDTBDTB' >"$D/sources/subdir/whatever.dtb"
|
||||
|
||||
export KERNEL_INSTALL_CONF_ROOT="$D/sources"
|
||||
# We "install" multiple plugins, but control which ones will be active via install.conf.
|
||||
export KERNEL_INSTALL_PLUGINS="${ukify_install} ${loaderentry_install} ${uki_copy_install}"
|
||||
KERNEL_INSTALL_PLUGINS="'${loaderentry_install}' '${uki_copy_install}'"
|
||||
if [[ -n "$ukify_install" ]]; then
|
||||
# shellcheck disable=SC2089
|
||||
KERNEL_INSTALL_PLUGINS="'${ukify_install}' $KERNEL_INSTALL_PLUGINS"
|
||||
fi
|
||||
# shellcheck disable=SC2090
|
||||
export KERNEL_INSTALL_PLUGINS
|
||||
export BOOT_ROOT="$D/boot"
|
||||
export BOOT_MNT="$D/boot"
|
||||
export MACHINE_ID='3e0484f3634a418b8e6a39e8828b03e3'
|
||||
|
Loading…
Reference in New Issue
Block a user