From a2a9d541087d32cc8fc95f80169e962ec785b87e Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 21 Apr 2022 14:47:23 +0200 Subject: [PATCH] kernel-install: Skip execution if $KERNEL_INSTALL_BYPASS=1 --- docs/ENVIRONMENT.md | 7 +++++++ src/kernel-install/kernel-install.in | 5 +++++ 2 files changed, 12 insertions(+) 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 -- 2.47.3