diff mbox series

[kvm-unit-tests,1/2] s390x: Only run genprotimg if necessary

Message ID 20240602130656.120866-2-npiggin@gmail.com (mailing list archive)
State New, archived
Headers show
Series s390x: Fix build error messages | expand

Commit Message

Nicholas Piggin June 2, 2024, 1:06 p.m. UTC
genprotimg is not required if the --host-key-document= configure option
is not specified, so avoid running it in that case. This prevents the
build message:

  bash: line 1: genprotimg: command not found

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 s390x/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Janosch Frank June 3, 2024, 11:54 a.m. UTC | #1
On 6/2/24 15:06, Nicholas Piggin wrote:
> genprotimg is not required if the --host-key-document= configure option
> is not specified, so avoid running it in that case. This prevents the
> build message:
> 
>    bash: line 1: genprotimg: command not found
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

This solves the immediate problem but I think we're really missing a lot 
more checks in the makefile and configure to sanitize the SE option space.

Anyway:
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Nicholas Piggin June 4, 2024, 5:18 a.m. UTC | #2
On Mon Jun 3, 2024 at 9:54 PM AEST, Janosch Frank wrote:
> On 6/2/24 15:06, Nicholas Piggin wrote:
> > genprotimg is not required if the --host-key-document= configure option
> > is not specified, so avoid running it in that case. This prevents the
> > build message:
> > 
> >    bash: line 1: genprotimg: command not found
> > 
> > Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>
> This solves the immediate problem but I think we're really missing a lot 
> more checks in the makefile and configure to sanitize the SE option space.

Agree, it would be ideal to find genprotimg at configure time
and warn or fail if other options were specified. That looked
like a bigger job and I don't have a PV environment to test with
at the moment.

> Anyway:
> Reviewed-by: Janosch Frank <frankja@linux.ibm.com>

Thanks,
Nick
diff mbox series

Patch

diff --git a/s390x/Makefile b/s390x/Makefile
index 19c41a2ec..c6518bbd1 100644
--- a/s390x/Makefile
+++ b/s390x/Makefile
@@ -213,12 +213,16 @@  $(comm-key):
 
 # The genprotimg arguments for the cck changed over time so we need to
 # figure out which argument to use in order to set the cck
+ifneq ($(HOST_KEY_DOCUMENT),)
 GENPROTIMG_HAS_COMM_KEY = $(shell $(GENPROTIMG) --help | grep -q -- --comm-key && echo yes)
 ifeq ($(GENPROTIMG_HAS_COMM_KEY),yes)
 	GENPROTIMG_COMM_OPTION := --comm-key
 else
 	GENPROTIMG_COMM_OPTION := --x-comm-key
 endif
+else
+GENPROTIMG_HAS_COMM_KEY =
+endif
 
 ifeq ($(CONFIG_DUMP),yes)
 	# allow dumping + PCKMO