mirror of
https://github.com/systemd/systemd
synced 2024-10-15 12:34:37 +00:00
kernel-install: allow overriding the plugin list too
The use of IFS=<newline> is dropped. Let's just iterate over the list, using any whitespace as separator.
This commit is contained in:
parent
2bbf6c3590
commit
6755285ccb
|
@ -255,6 +255,11 @@
|
||||||
<filename>install.conf</filename>, <filename>entry-token</filename>, and other files will be
|
<filename>install.conf</filename>, <filename>entry-token</filename>, and other files will be
|
||||||
read from this directory.</para>
|
read from this directory.</para>
|
||||||
|
|
||||||
|
<para><varname>$KERNEL_INSTALL_PLUGINS</varname> can be set to override the list of plugins executed by
|
||||||
|
<command>kernel-install</command>. The argument is a whitespace-separated list of paths.
|
||||||
|
<literal>KERNEL_INSTALL_PLUGINS=:</literal> may be used to prevent any plugins from running.
|
||||||
|
</para>
|
||||||
|
|
||||||
<para><varname>$MACHINE_ID</varname> can be set for <command>kernel-install</command> to override
|
<para><varname>$MACHINE_ID</varname> can be set for <command>kernel-install</command> to override
|
||||||
<varname>$KERNEL_INSTALL_MACHINE_ID</varname>, the machine ID.</para>
|
<varname>$KERNEL_INSTALL_MACHINE_ID</varname>, the machine ID.</para>
|
||||||
|
|
||||||
|
|
|
@ -312,15 +312,20 @@ MAKE_ENTRY_DIR_ABS=$?
|
||||||
|
|
||||||
ret=0
|
ret=0
|
||||||
|
|
||||||
PLUGINS="$(
|
if [ -z "$KERNEL_INSTALL_PLUGINS" ]; then
|
||||||
dropindirs_sort ".install" \
|
KERNEL_INSTALL_PLUGINS="$(
|
||||||
"/etc/kernel/install.d" \
|
dropindirs_sort ".install" \
|
||||||
"/usr/lib/kernel/install.d"
|
"/etc/kernel/install.d" \
|
||||||
)"
|
"/usr/lib/kernel/install.d"
|
||||||
IFS="
|
)"
|
||||||
"
|
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
|
case "$COMMAND" in
|
||||||
add)
|
add)
|
||||||
|
@ -346,7 +351,7 @@ case "$COMMAND" in
|
||||||
fi
|
fi
|
||||||
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" "$@"
|
[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "+$f add $KERNEL_VERSION $ENTRY_DIR_ABS" "$@"
|
||||||
"$f" add "$KERNEL_VERSION" "$ENTRY_DIR_ABS" "$@"
|
"$f" add "$KERNEL_VERSION" "$ENTRY_DIR_ABS" "$@"
|
||||||
|
|
||||||
|
@ -357,7 +362,7 @@ case "$COMMAND" in
|
||||||
;;
|
;;
|
||||||
|
|
||||||
remove)
|
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"
|
[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "+$f remove $KERNEL_VERSION $ENTRY_DIR_ABS"
|
||||||
"$f" remove "$KERNEL_VERSION" "$ENTRY_DIR_ABS"
|
"$f" remove "$KERNEL_VERSION" "$ENTRY_DIR_ABS"
|
||||||
err=$?
|
err=$?
|
||||||
|
|
Loading…
Reference in a new issue