From: Zach Wade <zachwade.k@gmail.com>
To: masahiroy@kernel.org
Cc: nathan@kernel.org, nicolas@fjasle.eu,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
Zach Wade <zachwade.k@gmail.com>
Subject: [PATCH] kbuild: Add vmlinux_install to facilitate debugging
Date: Tue, 8 Oct 2024 00:07:10 +0800 [thread overview]
Message-ID: <20241007160710.3937-1-zachwade.k@gmail.com> (raw)
When testing multiple versions of the kernel with the same source code,it
is often necessary to recompile the kernel, which is time-consuming for
small hosts. I need to cp vmlinux to the corresponding module directory.
I think adding this will make debugging the kernel a little more
convenient.
Signed-off-by: Zach Wade <zachwade.k@gmail.com>
---
Makefile | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/Makefile b/Makefile
index c5493c0c0ca1..1caab011599f 100644
--- a/Makefile
+++ b/Makefile
@@ -1579,6 +1579,7 @@ help:
@echo '* vmlinux - Build the bare kernel'
@echo '* modules - Build all modules'
@echo ' modules_install - Install all modules to INSTALL_MOD_PATH (default: /)'
+ @echo ' vmlinux_install - Install vmlinux to INSTALL_MOD_PATH (default: /)'
@echo ' vdso_install - Install unstripped vdso to INSTALL_MOD_PATH (default: /)'
@echo ' dir/ - Build all files in dir and below'
@echo ' dir/file.[ois] - Build specified target only'
@@ -1887,6 +1888,19 @@ modpost: $(if $(single-build),, $(if $(KBUILD_BUILTIN), vmlinux.o)) \
$(if $(KBUILD_MODULES), modules_check)
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
+# ---------------------------------------------------------------------------
+# vmlinux install
+
+PHONY += vmlinux_install
+
+vmlinux_install:
+ @if [ -f vmlinux ]; then \
+ echo "INSTALL ${MODLIB}/vmlinux"; \
+ cp -f vmlinux ${MODLIB}/ ; \
+ else \
+ echo "vmlinux file does not exist."; \
+ fi
+
# Single targets
# ---------------------------------------------------------------------------
# To build individual files in subdirectories, you can do like this:
--
2.46.0
next reply other threads:[~2024-10-07 16:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 16:07 Zach Wade [this message]
2024-10-07 16:13 ` [PATCH] kbuild: Add vmlinux_install to facilitate debugging Zach Wade
2024-10-08 17:39 ` Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241007160710.3937-1-zachwade.k@gmail.com \
--to=zachwade.k@gmail.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=nicolas@fjasle.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox