kernel-install: allow plugins to terminate the procedure (#4174)

Replaces #4103.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2016-09-24 09:03:54 -04:00
committed by GitHub
parent 2541b135bf
commit eb93312810
2 changed files with 16 additions and 3 deletions
+12 -2
View File
@@ -19,6 +19,8 @@
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
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