From: Daan De Meyer Date: Thu, 21 Apr 2022 12:47:23 +0000 (+0200) Subject: kernel-install: Skip execution if $KERNEL_INSTALL_BYPASS=1 X-Git-Tag: v251-rc2~79 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a2a9d541087d32cc8fc95f80169e962ec785b87e;p=thirdparty%2Fsystemd.git kernel-install: Skip execution if $KERNEL_INSTALL_BYPASS=1 --- diff --git a/docs/ENVIRONMENT.md b/docs/ENVIRONMENT.md index 5f02f888a5e..257874d95c0 100644 --- a/docs/ENVIRONMENT.md +++ b/docs/ENVIRONMENT.md @@ -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. diff --git a/src/kernel-install/kernel-install.in b/src/kernel-install/kernel-install.in index f6d262f5226..293ed044d16 100755 --- a/src/kernel-install/kernel-install.in +++ b/src/kernel-install/kernel-install.in @@ -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