kernel-install: Skip execution if $KERNEL_INSTALL_BYPASS=1

This commit is contained in:
Daan De Meyer 2022-04-21 14:47:23 +02:00 committed by Yu Watanabe
parent 041456246c
commit a2a9d54108
2 changed files with 12 additions and 0 deletions

View file

@ -441,3 +441,10 @@ SYSTEMD_HOME_DEBUG_SUFFIX=foo \
use for LUKS home directories, overriding the built-in default mount
options. There's one variable for each of the supported file systems for the
LUKS home directory backend.
`kernel-install`:
* `$KERNEL_INSTALL_BYPASS` If set to "1", execution of kernel-install is skipped
when kernel-install is invoked. This can be useful if kernel-install is invoked
unconditionally as a child process by another tool, such as package managers
running kernel-install in a postinstall script.

View file

@ -67,6 +67,11 @@ for i; do
fi
done
if [ "$KERNEL_INSTALL_BYPASS" = "1" ]; then
echo "kernel-install: Skipping execution because KERNEL_INSTALL_BYPASS=1"
exit 0
fi
export KERNEL_INSTALL_VERBOSE=0
if [ "$1" = "--verbose" ] || [ "$1" = "-v" ]; then
shift