kernel-install: allow plugins to terminate the procedure (#4174)
Replaces #4103.
This commit is contained in:
parent
2541b135bf
commit
eb93312810
|
@ -72,9 +72,12 @@
|
||||||
in <filename>/usr/lib/kernel/install.d/</filename>. This can be used to override a system-supplied
|
in <filename>/usr/lib/kernel/install.d/</filename>. This can be used to override a system-supplied
|
||||||
executables with a local file if needed; a symbolic link in <filename>/etc/kernel/install.d/</filename>
|
executables with a local file if needed; a symbolic link in <filename>/etc/kernel/install.d/</filename>
|
||||||
with the same name as an executable in <filename>/usr/lib/kernel/install.d/</filename>,
|
with the same name as an executable in <filename>/usr/lib/kernel/install.d/</filename>,
|
||||||
pointing to /dev/null, disables the executable entirely. Executables must have the
|
pointing to <filename>/dev/null</filename>, disables the executable entirely. Executables must have the
|
||||||
extension <literal>.install</literal>; other extensions are ignored.</para>
|
extension <literal>.install</literal>; other extensions are ignored.</para>
|
||||||
|
|
||||||
|
<para>An executable should return <constant>0</constant> on success. It may also
|
||||||
|
return <constant>77</constant> to cause the whole operation to terminate
|
||||||
|
(executables later in lexical order will be skipped).</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
# You should have received a copy of the GNU Lesser General Public License
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
SKIP_REMAINING=77
|
||||||
|
|
||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
echo "Usage:"
|
echo "Usage:"
|
||||||
|
@ -123,7 +125,11 @@ case $COMMAND in
|
||||||
for f in "${PLUGINS[@]}"; do
|
for f in "${PLUGINS[@]}"; do
|
||||||
if [[ -x $f ]]; then
|
if [[ -x $f ]]; then
|
||||||
"$f" add "$KERNEL_VERSION" "$BOOT_DIR_ABS" "$KERNEL_IMAGE"
|
"$f" add "$KERNEL_VERSION" "$BOOT_DIR_ABS" "$KERNEL_IMAGE"
|
||||||
((ret+=$?))
|
x=$?
|
||||||
|
if [[ $x == $SKIP_REMAINING ]]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
((ret+=$x))
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
@ -132,7 +138,11 @@ case $COMMAND in
|
||||||
for f in "${PLUGINS[@]}"; do
|
for f in "${PLUGINS[@]}"; do
|
||||||
if [[ -x $f ]]; then
|
if [[ -x $f ]]; then
|
||||||
"$f" remove "$KERNEL_VERSION" "$BOOT_DIR_ABS"
|
"$f" remove "$KERNEL_VERSION" "$BOOT_DIR_ABS"
|
||||||
((ret+=$?))
|
x=$?
|
||||||
|
if [[ $x == $SKIP_REMAINING ]]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
((ret+=$x))
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue