From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: linux-kbuild@vger.kernel.org
Cc: Ingo Molnar <mingo@redhat.com>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Bernd Edlinger <bernd.edlinger@hotmail.de>,
Borislav Petkov <bp@suse.de>, Sam Ravnborg <sam@ravnborg.org>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Michal Marek <michal.lkml@markovi.net>,
linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] kbuild: check the presence of lzo and lz4 tools when necessary
Date: Tue, 16 Oct 2018 18:10:53 +0900 [thread overview]
Message-ID: <1539681053-24388-4-git-send-email-yamada.masahiro@socionext.com> (raw)
In-Reply-To: <1539681053-24388-1-git-send-email-yamada.masahiro@socionext.com>
If CONFIG_KERNEL_LZ4 is enabled without lz4 tool installed on the
system, the build fails at the very last stage (reported by
Borislav Petkov [1]).
LZO arch/x86/boot/compressed/vmlinux.bin.lzo
/bin/sh: 1: lzop: not found
arch/x86/boot/compressed/Makefile:141: recipe for target 'arch/x86/boot/compressed/vmlinux.bin.lzo' failed
make[2]: *** [arch/x86/boot/compressed/vmlinux.bin.lzo] Error 1
arch/x86/boot/Makefile:112: recipe for target 'arch/x86/boot/compressed/vmlinux' failed
make[1]: *** [arch/x86/boot/compressed/vmlinux] Error 2
arch/x86/Makefile:284: recipe for target 'bzImage' failed
make: *** [bzImage] Error 2
Check the tools in scripts/Makefile.toolcheck to fail the build
earlier with a more readable message.
[1] https://patchwork.kernel.org/patch/10635381/
Suggested-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
scripts/Makefile.toolcheck | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/scripts/Makefile.toolcheck b/scripts/Makefile.toolcheck
index bc26fc0..5e336e4 100644
--- a/scripts/Makefile.toolcheck
+++ b/scripts/Makefile.toolcheck
@@ -17,6 +17,14 @@ msg_stack_validation = "libelf is necessary for building the objtool." \
"Please install libelf-dev, libelf-devel or elfutils-libelf-devel."
toolcheck-$(CONFIG_STACK_VALIDATION) += stack_validation
+chk_lzo = command -v lzop
+msg_lzo = "lzo tool not found. Please install it."
+toolcheck-$(CONFIG_KERNEL_LZO) += lzo
+
+chk_lz4 = command -v lz4c
+msg_lz4 = "lz4 tool not found. Please install it."
+toolcheck-$(CONFIG_KERNEL_LZ4) += lz4
+
PHONY += $(toolcheck-y)
__toolcheck: $(toolcheck-y)
--
2.7.4
next prev parent reply other threads:[~2018-10-16 9:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-16 9:10 [PATCH 0/3] kbuild: add scripts/Makefile.toolcheck to check necessary host tools Masahiro Yamada
2018-10-16 9:10 ` [PATCH 1/3] kbuild: provide a new place " Masahiro Yamada
2018-10-16 15:47 ` Sam Ravnborg
2018-10-16 9:10 ` [PATCH 2/3] objtool: move libelf check out of top Makefile Masahiro Yamada
2018-10-16 14:25 ` Josh Poimboeuf
2018-10-16 15:51 ` Masahiro Yamada
2018-10-16 16:15 ` Josh Poimboeuf
2018-10-19 6:04 ` Masahiro Yamada
2018-10-19 19:28 ` Josh Poimboeuf
2018-10-16 9:10 ` Masahiro Yamada [this message]
2018-10-16 19:54 ` [PATCH 3/3] kbuild: check the presence of lzo and lz4 tools when necessary Borislav Petkov
2018-10-17 8:59 ` Masahiro Yamada
2018-10-17 9:10 ` Borislav Petkov
2018-10-17 9:25 ` Masahiro Yamada
2018-10-17 9:47 ` Borislav Petkov
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=1539681053-24388-4-git-send-email-yamada.masahiro@socionext.com \
--to=yamada.masahiro@socionext.com \
--cc=bernd.edlinger@hotmail.de \
--cc=bp@suse.de \
--cc=jpoimboe@redhat.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=mingo@redhat.com \
--cc=sam@ravnborg.org \
/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;
as well as URLs for NNTP newsgroup(s).