diff --git a/man/kernel-install.xml b/man/kernel-install.xml
index d7e27de7581..4a8a46cef4d 100644
--- a/man/kernel-install.xml
+++ b/man/kernel-install.xml
@@ -72,9 +72,12 @@
in /usr/lib/kernel/install.d/. This can be used to override a system-supplied
executables with a local file if needed; a symbolic link in /etc/kernel/install.d/
with the same name as an executable in /usr/lib/kernel/install.d/,
- pointing to /dev/null, disables the executable entirely. Executables must have the
+ pointing to /dev/null, disables the executable entirely. Executables must have the
extension .install; other extensions are ignored.
+ An executable should return 0 on success. It may also
+ return 77 to cause the whole operation to terminate
+ (executables later in lexical order will be skipped).
diff --git a/src/kernel-install/kernel-install b/src/kernel-install/kernel-install
index c66bcfc092d..0c0ee718acc 100644
--- a/src/kernel-install/kernel-install
+++ b/src/kernel-install/kernel-install
@@ -19,6 +19,8 @@
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see .
+SKIP_REMAINING=77
+
usage()
{
echo "Usage:"
@@ -123,7 +125,11 @@ case $COMMAND in
for f in "${PLUGINS[@]}"; do
if [[ -x $f ]]; then
"$f" add "$KERNEL_VERSION" "$BOOT_DIR_ABS" "$KERNEL_IMAGE"
- ((ret+=$?))
+ x=$?
+ if [[ $x == $SKIP_REMAINING ]]; then
+ return 0
+ fi
+ ((ret+=$x))
fi
done
;;
@@ -132,7 +138,11 @@ case $COMMAND in
for f in "${PLUGINS[@]}"; do
if [[ -x $f ]]; then
"$f" remove "$KERNEL_VERSION" "$BOOT_DIR_ABS"
- ((ret+=$?))
+ x=$?
+ if [[ $x == $SKIP_REMAINING ]]; then
+ return 0
+ fi
+ ((ret+=$x))
fi
done