Browse Source

linuxkm/Makefile: fix module sign-file error handling.

Daniel Pouzzner 2 years ago
parent
commit
742492cb5e
1 changed files with 6 additions and 2 deletions
  1. 6 2
      linuxkm/Makefile

+ 6 - 2
linuxkm/Makefile

@@ -87,8 +87,12 @@ libwolfssl.ko.signed: libwolfssl.ko
 		./scripts/sign-file "$${CONFIG_MODULE_SIG_HASH}"				\
 				    "$${CONFIG_MODULE_SIG_KEY}"					\
 				    "$${CONFIG_MODULE_SIG_KEY/%.pem/.x509}"			\
-				    '$(MODULE_TOP)/$@' ||					\
-					$(RM) -f '$(MODULE_TOP)/$@' || exit $$?;		\
+				    '$(MODULE_TOP)/$@';						\
+		sign_file_exitval=$$?;								\
+		if [[ $$sign_file_exitval != 0 ]]; then						\
+			$(RM) -f '$(MODULE_TOP)/$@';						\
+			exit $$sign_file_exitval;						\
+		fi;										\
 		if [[ "$(quiet)" != "silent_" ]]; then						\
 			echo "  Module $@ signed by $${CONFIG_MODULE_SIG_KEY}.";		\
 		fi										\