diff --git a/scripts/sign-modules b/scripts/sign-modules index 6b79fb847..c9cfdf46f 100755 --- a/scripts/sign-modules +++ b/scripts/sign-modules @@ -9,7 +9,12 @@ fi scst_dir=$(dirname "$(cd "$(dirname "$0")" && pwd)") -CONFIG_MODULE_SIG_HASH=$(sed -n 's/^CONFIG_MODULE_SIG_HASH="\([^"]*\)"$/\1/p' "${KDIR}/.config") +if [ ! -e "${KDIR}/scripts/sign-file" ]; then + echo "Not signing modules because no sign-file executable" + exit +fi + +CONFIG_MODULE_SIG_HASH=$(sed -n 's/^CONFIG_MODULE_SIG_HASH="\([^"]*\)"$/\1/p' "${KDIR}/.config" | { read -r line; [ -n "$line" ] && echo "$line" || echo sha256; }) sed 's,^kernel/,,' < modules.order | \ while read -r f; do diff --git a/scst/src/certs/Makefile b/scst/src/certs/Makefile index 90818f69d..2c9d76ff0 100644 --- a/scst/src/certs/Makefile +++ b/scst/src/certs/Makefile @@ -1,4 +1,4 @@ -CONFIG_MODULE_SIG_HASH := $(shell sed -n 's/^CONFIG_MODULE_SIG_HASH="\([^"]*\)"$$/\1/p' "$(KDIR)/.config") +CONFIG_MODULE_SIG_HASH := $(shell sed -n 's/^CONFIG_MODULE_SIG_HASH="\([^"]*\)"$$/\1/p' "$(KDIR)/.config" | { read -r line; [ -n "$$line" ] && echo "$$line" || echo sha256; }) all: $(shell grep -q '^CONFIG_MODULE_SIG=y$$' "$(KDIR)/.config" && \ echo module_signing_enabled)