The following commit has been merged into the objtool/core branch of tip:
Commit-ID: 0573bcc4ffca498a6c644b0e1ccbe1a6d9b96a5c
Gitweb: https://git.kernel.org/tip/0573bcc4ffca498a6c644b0e1ccbe1a6d9b96a5c
Author: Joe Lawrence <joe.lawrence@redhat.com>
AuthorDate: Tue, 10 Mar 2026 16:37:45 -04:00
Committer: Josh Poimboeuf <jpoimboe@kernel.org>
CommitterDate: Mon, 16 Mar 2026 12:46:48 -07:00
livepatch/klp-build: add Makefile with check target
Add a standalone Makefile with a 'check' target that runs static code
analysis (shellcheck) on the klp-build script(s). This is intended
strictly as a development aid.
Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Link: https://patch.msgid.link/20260310203751.1479229-7-joe.lawrence@redhat.com
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
scripts/livepatch/Makefile | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 scripts/livepatch/Makefile
diff --git a/scripts/livepatch/Makefile b/scripts/livepatch/Makefile
new file mode 100644
index 0000000..17b5902
--- /dev/null
+++ b/scripts/livepatch/Makefile
@@ -0,0 +1,20 @@
+# SPDX-License-Identifier: GPL-2.0
+# Standalone Makefile for developer tooling (not part of kbuild).
+
+SHELLCHECK := $(shell which shellcheck 2> /dev/null)
+
+SRCS := \
+ klp-build
+
+.DEFAULT_GOAL := help
+.PHONY: help
+help:
+ @echo " check - Run shellcheck on $(SRCS)"
+ @echo " help - Show this help message"
+
+.PHONY: check
+check:
+ifndef SHELLCHECK
+ $(error shellcheck is not installed. Please install it to run checks)
+endif
+ @$(SHELLCHECK) $(SHELLCHECK_OPTIONS) $(SRCS)