From: Zbigniew Jędrzejewski-Szmek Date: Fri, 1 Jul 2022 10:55:32 +0000 (+0200) Subject: kernel-install: allow overriding the plugin list too X-Git-Tag: v252-rc1~671^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6755285ccb55fc1f790e0a2c5202987acb52c98a;p=thirdparty%2Fsystemd.git kernel-install: allow overriding the plugin list too The use of IFS= is dropped. Let's just iterate over the list, using any whitespace as separator. --- diff --git a/man/kernel-install.xml b/man/kernel-install.xml index bde30ab16ae..7ad7f86c6da 100644 --- a/man/kernel-install.xml +++ b/man/kernel-install.xml @@ -255,6 +255,11 @@ install.conf, entry-token, and other files will be read from this directory. + $KERNEL_INSTALL_PLUGINS can be set to override the list of plugins executed by + kernel-install. The argument is a whitespace-separated list of paths. + KERNEL_INSTALL_PLUGINS=: may be used to prevent any plugins from running. + + $MACHINE_ID can be set for kernel-install to override $KERNEL_INSTALL_MACHINE_ID, the machine ID. diff --git a/src/kernel-install/kernel-install.in b/src/kernel-install/kernel-install.in index 96595fa295e..30b28f4658b 100755 --- a/src/kernel-install/kernel-install.in +++ b/src/kernel-install/kernel-install.in @@ -312,15 +312,20 @@ MAKE_ENTRY_DIR_ABS=$? ret=0 -PLUGINS="$( - dropindirs_sort ".install" \ - "/etc/kernel/install.d" \ - "/usr/lib/kernel/install.d" -)" -IFS=" -" +if [ -z "$KERNEL_INSTALL_PLUGINS" ]; then + KERNEL_INSTALL_PLUGINS="$( + dropindirs_sort ".install" \ + "/etc/kernel/install.d" \ + "/usr/lib/kernel/install.d" + )" +fi -[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && printf '%s\n' "Plugin files:" "$PLUGINS" +if [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ]; then + printf '%s\n' "Plugin files:" + for f in $KERNEL_INSTALL_PLUGINS; do + printf '%s\n' "$f" + done +fi case "$COMMAND" in add) @@ -346,7 +351,7 @@ case "$COMMAND" in fi fi - for f in $PLUGINS; do + for f in $KERNEL_INSTALL_PLUGINS; do [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "+$f add $KERNEL_VERSION $ENTRY_DIR_ABS" "$@" "$f" add "$KERNEL_VERSION" "$ENTRY_DIR_ABS" "$@" @@ -357,7 +362,7 @@ case "$COMMAND" in ;; remove) - for f in $PLUGINS; do + for f in $KERNEL_INSTALL_PLUGINS; do [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "+$f remove $KERNEL_VERSION $ENTRY_DIR_ABS" "$f" remove "$KERNEL_VERSION" "$ENTRY_DIR_ABS" err=$?